Skip to content

Conversation

@DmyMi
Copy link
Contributor

@DmyMi DmyMi commented Sep 12, 2025

Summary by CodeRabbit

  • New Features

    • Increased maximum title length from 60 to 120 characters across competition and workshop creation/edit forms for admins and providers.
    • Updated validation messages and character count hints to reflect the new 120-character limit.
  • Chores

    • Added a reusable validation constant for a 120-character input length to standardize limits across the app.

@coderabbitai
Copy link

coderabbitai bot commented Sep 12, 2025

Walkthrough

Adds new constant INPUT_LENGTH_120 to validation constants and updates title field max length from 60 to 120 across moderator draft and provider creation forms, including both validators in TypeScript and displayed maxCharacters hints in templates. No other logic, control flow, or public APIs are changed.

Changes

Cohort / File(s) Summary
Validation constants
src/app/shared/constants/validation.ts
Added static readonly INPUT_LENGTH_120 = 120 to ValidationConstants.
Admin tools — moderator draft forms
src/app/shell/admin-tools/data/admin-competition-list/moderator-draft-competition-form/moderator-draft-competition-form.component.ts, src/app/shell/admin-tools/data/admin-workshop-list/moderator-draft-edit-form/moderator-draft-edit-form.component.html, src/app/shell/admin-tools/data/admin-workshop-list/moderator-draft-edit-form/moderator-draft-edit-form.component.ts
Increased title maxLength validator and template hint from 60 to 120. Other validators unchanged.
Provider — create competition (required form)
src/app/shell/personal-cabinet/provider/create-competition/create-required-form/create-required-form.component.html, src/app/shell/personal-cabinet/provider/create-competition/create-required-form/create-required-form.component.ts
Updated title maxLength to 120 in FormControl and FormGroup; updated UI hint to 120. Other fields unchanged.
Provider — create workshop (about form)
src/app/shell/personal-cabinet/provider/create-workshop/create-about-form/create-about-form.component.html, src/app/shell/personal-cabinet/provider/create-workshop/create-about-form/create-about-form.component.ts
Increased title maxLength validator to 120 and adjusted template hint accordingly.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant FC as Form Component
    participant V as Angular Validators
    participant C as ValidationConstants

    U->>FC: Type title
    FC->>C: Read INPUT_LENGTH_120
    FC->>V: Validate title (required, minLength, pattern, maxLength=120)
    alt length <= 120
        V-->>FC: Valid
        FC-->>U: Enable submit / no error
    else length > 120
        V-->>FC: MaxLength error
        FC-->>U: Show "max 120 chars" hint
    end
    note over FC,C: Max length increased from 60 to 120
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks (3 passed)

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "update title length to 120" succinctly and accurately summarizes the primary change—raising the allowed title length to 120 characters across multiple forms (and adding the INPUT_LENGTH_120 constant)—so it is concise and directly related to the changeset.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Poem

I twitch my whiskers at lines anew,
From sixty hops to one-twenty, woo!
Titles stretch like fields in spring,
Validators nod, templates sing.
In burrows of code, I thump with glee—
More room for words, more room for me! 🐇✨

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dmin/update_title_length

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/app/shared/constants/validation.ts (1)

33-33: INPUT_LENGTH_120 added — titles use 120; shortTitle remains 60.

Sweep confirms title FormControls use ValidationConstants.INPUT_LENGTH_120; shortTitle and other short fields intentionally use ValidationConstants.INPUT_LENGTH_60. Remaining hardcoded maxlength="60": src/app/shell/personal-cabinet/provider/create-workshop/create-description-form/create-description-form.component.html:111 — replace with ValidationConstants.INPUT_LENGTH_60 for consistency.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 750ef86 and ba0a97b.

📒 Files selected for processing (8)
  • src/app/shared/constants/validation.ts (1 hunks)
  • src/app/shell/admin-tools/data/admin-competition-list/moderator-draft-competition-form/moderator-draft-competition-form.component.ts (1 hunks)
  • src/app/shell/admin-tools/data/admin-workshop-list/moderator-draft-edit-form/moderator-draft-edit-form.component.html (1 hunks)
  • src/app/shell/admin-tools/data/admin-workshop-list/moderator-draft-edit-form/moderator-draft-edit-form.component.ts (1 hunks)
  • src/app/shell/personal-cabinet/provider/create-competition/create-required-form/create-required-form.component.html (1 hunks)
  • src/app/shell/personal-cabinet/provider/create-competition/create-required-form/create-required-form.component.ts (1 hunks)
  • src/app/shell/personal-cabinet/provider/create-workshop/create-about-form/create-about-form.component.html (1 hunks)
  • src/app/shell/personal-cabinet/provider/create-workshop/create-about-form/create-about-form.component.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-02-17T21:20:13.347Z
Learnt from: humanmantis
PR: ita-social-projects/OoS-Frontend#2733
File: src/app/shared/components/validation-hint/validation-hint.component.html:4-4
Timestamp: 2025-02-17T21:20:13.347Z
Learning: Using [innerHTML] is acceptable for rendering validation messages in ValidationHintComponent as the messages are predefined constants from ValidationMessages and are not user-provided content.

Applied to files:

  • src/app/shell/admin-tools/data/admin-workshop-list/moderator-draft-edit-form/moderator-draft-edit-form.component.html
  • src/app/shell/personal-cabinet/provider/create-workshop/create-about-form/create-about-form.component.html
📚 Learning: 2025-02-12T23:13:35.247Z
Learnt from: MaxZhylka
PR: ita-social-projects/OoS-Frontend#2733
File: src/app/shared/components/validation-hint/validation-hint.component.ts:62-62
Timestamp: 2025-02-12T23:13:35.247Z
Learning: In ValidationHintComponent, a minimal debounce time (1ms) is required on statusChanges to prevent double error addition caused by formControl.markAsTouched(), while still maintaining near-instant validation feedback for dynamic ValidationParams updates.

Applied to files:

  • src/app/shell/admin-tools/data/admin-workshop-list/moderator-draft-edit-form/moderator-draft-edit-form.component.html
  • src/app/shell/personal-cabinet/provider/create-workshop/create-about-form/create-about-form.component.html
  • src/app/shell/personal-cabinet/provider/create-competition/create-required-form/create-required-form.component.html
📚 Learning: 2025-08-30T18:26:27.585Z
Learnt from: witolDark
PR: ita-social-projects/OoS-Frontend#3091
File: src/app/shell/personal-cabinet/provider/create-workshop/create-description-form/create-description-form.component.ts:84-90
Timestamp: 2025-08-30T18:26:27.585Z
Learning: In the CreateDescriptionFormComponent (src/app/shell/personal-cabinet/provider/create-workshop/create-description-form/create-description-form.component.ts), the fieldsToListen array should NOT include 'competitiveSelection' and 'tagIds' fields as they don't need to trigger moderation notices according to the maintainer.

Applied to files:

  • src/app/shell/admin-tools/data/admin-competition-list/moderator-draft-competition-form/moderator-draft-competition-form.component.ts
  • src/app/shell/personal-cabinet/provider/create-competition/create-required-form/create-required-form.component.html
  • src/app/shell/personal-cabinet/provider/create-competition/create-required-form/create-required-form.component.ts
  • src/app/shell/admin-tools/data/admin-workshop-list/moderator-draft-edit-form/moderator-draft-edit-form.component.ts
🧬 Code graph analysis (4)
src/app/shell/personal-cabinet/provider/create-workshop/create-about-form/create-about-form.component.ts (1)
src/app/shared/constants/validation.ts (1)
  • ValidationConstants (5-65)
src/app/shell/admin-tools/data/admin-competition-list/moderator-draft-competition-form/moderator-draft-competition-form.component.ts (1)
src/app/shared/constants/validation.ts (1)
  • ValidationConstants (5-65)
src/app/shell/personal-cabinet/provider/create-competition/create-required-form/create-required-form.component.ts (1)
src/app/shared/constants/validation.ts (1)
  • ValidationConstants (5-65)
src/app/shell/admin-tools/data/admin-workshop-list/moderator-draft-edit-form/moderator-draft-edit-form.component.ts (1)
src/app/shared/constants/validation.ts (1)
  • ValidationConstants (5-65)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: SonarCloud
  • GitHub Check: build_and_test
🔇 Additional comments (7)
src/app/shell/personal-cabinet/provider/create-competition/create-required-form/create-required-form.component.html (1)

21-21: Title hint maxCharacters → 120 — aligned with validators

Matches the updated TS validator; UI copy will reflect the new limit.

src/app/shell/admin-tools/data/admin-workshop-list/moderator-draft-edit-form/moderator-draft-edit-form.component.html (1)

38-38: Title hint maxCharacters → 120 — consistent

Template matches the new constant.

src/app/shell/admin-tools/data/admin-competition-list/moderator-draft-competition-form/moderator-draft-competition-form.component.ts (1)

237-237: Title maxLength validator → 120 — OK

Validator aligns with product change. Please ensure the backend accepts 120 chars for title to prevent 400s.

src/app/shell/personal-cabinet/provider/create-workshop/create-about-form/create-about-form.component.html (1)

26-26: Title hint maxCharacters → 120 — OK

In sync with the component validators.

src/app/shell/personal-cabinet/provider/create-workshop/create-about-form/create-about-form.component.ts (1)

196-196: Title maxLength validator → 120 — OK

No other validator logic changed; good.

src/app/shell/personal-cabinet/provider/create-competition/create-required-form/create-required-form.component.ts (1)

189-189: Title maxLength validator → 120 — OK

Short title remains at 60 as intended; confirm BE contracts match these limits.

src/app/shell/admin-tools/data/admin-workshop-list/moderator-draft-edit-form/moderator-draft-edit-form.component.ts (1)

235-235: Title maxLength validator → 120 — OK

Change is isolated and consistent with the new constant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants