Skip to content

Frontend/cosm public search restriction column#1571

Open
jsandoval81 wants to merge 5 commits into
csg-org:mainfrom
InspiringApps:frontend/cosm-public-search-status
Open

Frontend/cosm public search restriction column#1571
jsandoval81 wants to merge 5 commits into
csg-org:mainfrom
InspiringApps:frontend/cosm-public-search-status

Conversation

@jsandoval81
Copy link
Copy Markdown
Collaborator

@jsandoval81 jsandoval81 commented May 20, 2026

Requirements List

  • None

Description List

  • Update Licensee model to capture new eligibility prop from server
  • Add Restriction column to cosmetology public search list view
  • Fixed list-fetch-only props getting removed when navigating to detail page
  • Fixed copy at top of cosmetology public search list view

Testing List

  • yarn test:unit:all should run without errors or warnings
  • yarn serve should run without errors or warnings
  • yarn build should run without errors or warnings
  • Code review
  • Testing
    • Public search
      • Cosmetology list results should have a new "Restriction" column
      • Other compacts should not have any new columns or changes
    • Staff search
      • No compacts should have any new columns or changes

Closes #1479

Summary by CodeRabbit

  • New Features

    • Added license eligibility and restriction indicators to licensee lists and a dedicated license-eligibility column in cosmetology views for public search
    • Added localized labels for restriction states (English and Spanish)
  • Style

    • Added alert styling for restricted license entries
  • Tests

    • Expanded test coverage for eligibility and restriction behavior
  • Chores

    • Updated mock data and state handling to support eligibility fields

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

Warning

Rate limit exceeded

@jsandoval81 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 44 minutes and 53 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0cf1ed95-4006-42a7-b1f0-a4fcfe524db3

📥 Commits

Reviewing files that changed from the base of the PR and between 018b232 and cff2d66.

📒 Files selected for processing (5)
  • webroot/src/components/Licensee/LicenseeList/LicenseeList.ts
  • webroot/src/components/Licensee/LicenseeListLegacy/LicenseeListLegacy.ts
  • webroot/src/components/Licensee/LicenseeListLegacy/LicenseeListLegacy.vue
  • webroot/src/network/mocks/mock.data.ts
  • webroot/src/store/license/license.mutations.ts
📝 Walkthrough

Walkthrough

This PR adds licensee eligibility tracking and a restriction column to cosmetology public search lists: a new enum and model field, display and restricted-state helpers, serializer mapping and mocks, updated tests, conditional header/row rendering, translations, styling, and a mutation tweak to preserve fetch-only properties.

Changes

Licensee Eligibility Display

Layer / File(s) Summary
Eligibility enum and model contract
webroot/src/models/Licensee/Licensee.model.ts
New LicenseeEligibility enum and optional eligibility field added to InterfaceLicensee and Licensee class.
Eligibility methods, serializer, and mocks
webroot/src/models/Licensee/Licensee.model.ts, webroot/src/network/mocks/mock.data.ts
Adds eligibilityDisplay() and isRestricted(); LicenseeSerializer.fromServer maps json.licenseEligibility; mock data extended with licenseEligibility for sample records.
Model tests for eligibility
webroot/src/models/Licensee/Licensee.model.spec.ts
Imports updated and tests extended to assert default, specific, and deserialized eligibility display and restricted-state behavior.
List header and row rendering
webroot/src/components/Licensee/LicenseeList/LicenseeList.ts, webroot/src/components/Licensee/LicenseeListLegacy/LicenseeListLegacy.ts, webroot/src/components/Licensee/LicenseeRow/LicenseeRow.vue
Header records conditionally include public-search eligibility fields for cosmetology mode; row template renders a license-eligibility cell with eligibilityDisplay() and restricted-state styling; sortable header interactions wired.
Locales and list styling
webroot/src/locales/en.json, webroot/src/locales/es.json, webroot/src/styles.common/_lists.less
Adds licensing.restrictionOptions (eligible / ineligible) and licensing.compactRestriction keys in EN/ES; introduces .alert rule for bold red restricted text.
Store mutation
webroot/src/store/license/license.mutations.ts
STORE_UPDATE_LICENSEE merges fetch-only properties (licenseNumber, eligibility) from the existing stored record into incoming updates when appropriate.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • jlkravitz
  • rmolinares
  • isabeleliassen

Poem

🐰 A little rabbit hops through code today,

Adds eligibility, so restrictions show the way.
Red alert for the bound, translations snug and neat,
Public search now lists who can safely treat.
Hooray for tests and mocks—this feature's now complete!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR implements all core requirements from #1479: adds eligibility property to Licensee model, displays 'no restrictions' for eligible licensees, displays 'alert: restricted' for ineligible licensees with styling via alert class, and restricts changes to cosmetology public search only.
Out of Scope Changes check ✅ Passed All code changes directly support the stated objectives—eligibility model support, UI rendering in public search, and localization—with no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description includes well-structured requirements, description, and testing sections that align with the template and comprehensively explain the changes.
Title check ✅ Passed The title directly and clearly summarizes the main change: adding a public search restriction column for the cosmetology compact.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Copy link
Copy Markdown
Contributor

@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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@webroot/src/components/Licensee/LicenseeListLegacy/LicenseeListLegacy.ts`:
- Line 151: Remove the debug console.log in LicenseeListLegacy by deleting the
line that logs `HEADER isPublicSearch: ${this.isPublicSearch}` inside the
LicenseeListLegacy class (where the property isPublicSearch is referenced); if
runtime visibility is required replace it with the existing app logging
mechanism (e.g., processLogger or a debug logger) or remove entirely so no
console.log remains in production code.
- Around line 160-166: The non-legacy headerRecord is missing isPublicSearch:
true causing the header row to hide the eligibility column in public search;
update the object built where headerRecord is created (the ternary that checks
this.isPublicSearch) to include isPublicSearch: true alongside
eligibilityDisplay and isRestricted so LicenseeRow.vue’s (isPublicSearch ||
item.isPublicSearch) check works the same as the legacy implementation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 667b2892-affd-4c2a-93e9-0035b0f44501

📥 Commits

Reviewing files that changed from the base of the PR and between ab5670f and 669a63a.

📒 Files selected for processing (9)
  • webroot/src/components/Licensee/LicenseeList/LicenseeList.ts
  • webroot/src/components/Licensee/LicenseeListLegacy/LicenseeListLegacy.ts
  • webroot/src/components/Licensee/LicenseeRow/LicenseeRow.vue
  • webroot/src/locales/en.json
  • webroot/src/locales/es.json
  • webroot/src/models/Licensee/Licensee.model.spec.ts
  • webroot/src/models/Licensee/Licensee.model.ts
  • webroot/src/network/mocks/mock.data.ts
  • webroot/src/styles.common/_lists.less

Comment thread webroot/src/components/Licensee/LicenseeListLegacy/LicenseeListLegacy.ts Outdated
Comment thread webroot/src/components/Licensee/LicenseeListLegacy/LicenseeListLegacy.ts Outdated
Copy link
Copy Markdown
Contributor

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@webroot/src/store/license/license.mutations.ts`:
- Around line 82-87: The merge logic in license.mutations.ts is using inverted
checks for preserving stored-only properties: instead of checking that the
stored record (currentLicenseeRecord) has listFetchOnlyProp and the incoming
licensee is missing it, the code currently checks the opposite; change the
condition to if (Object.hasOwn(currentLicenseeRecord, listFetchOnlyProp) &&
!Object.hasOwn(licensee, listFetchOnlyProp)) and then copy
currentLicenseeRecord[listFetchOnlyProp] onto licensee[listFetchOnlyProp] so
only missing incoming fields are filled from the stored record.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 71877109-de72-40f0-a1a6-108746300c01

📥 Commits

Reviewing files that changed from the base of the PR and between 669a63a and 018b232.

📒 Files selected for processing (8)
  • webroot/src/components/Licensee/LicenseeList/LicenseeList.ts
  • webroot/src/components/Licensee/LicenseeListLegacy/LicenseeListLegacy.ts
  • webroot/src/locales/en.json
  • webroot/src/locales/es.json
  • webroot/src/models/Licensee/Licensee.model.spec.ts
  • webroot/src/models/Licensee/Licensee.model.ts
  • webroot/src/network/mocks/mock.data.ts
  • webroot/src/store/license/license.mutations.ts
💤 Files with no reviewable changes (1)
  • webroot/src/components/Licensee/LicenseeListLegacy/LicenseeListLegacy.ts
✅ Files skipped from review due to trivial changes (1)
  • webroot/src/locales/es.json

Comment thread webroot/src/store/license/license.mutations.ts Outdated
@jsandoval81 jsandoval81 requested a review from rmolinares May 20, 2026 18:37
@jsandoval81 jsandoval81 changed the title WIP: cosm public search restriction column Frontend/cosm public search restriction column May 20, 2026
@jsandoval81 jsandoval81 requested a review from jlkravitz May 20, 2026 23:17
@jsandoval81
Copy link
Copy Markdown
Collaborator Author

@jlkravitz This is ready for your review.

Copy link
Copy Markdown
Collaborator

@jlkravitz jlkravitz left a comment

Choose a reason for hiding this comment

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

Couple small comments!

Comment thread webroot/src/components/Licensee/LicenseeList/LicenseeList.ts
Comment thread webroot/src/components/Licensee/LicenseeList/LicenseeList.ts Outdated
Comment thread webroot/src/components/Licensee/LicenseeListLegacy/LicenseeListLegacy.ts Outdated
@jsandoval81 jsandoval81 requested a review from jlkravitz May 22, 2026 17:37
@jsandoval81
Copy link
Copy Markdown
Collaborator Author

@jlkravitz This is ready for re-review.

Copy link
Copy Markdown
Collaborator

@jlkravitz jlkravitz left a comment

Choose a reason for hiding this comment

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

@isabeleliassen This is good to merge!

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.

in public search, licensees who are not eligible are marked "not eligible" in list view FE

3 participants