Skip to content

WIP: discipline table#1549

Open
jsandoval81 wants to merge 2 commits intocsg-org:mainfrom
InspiringApps:frontend/cosm-discipline-table
Open

WIP: discipline table#1549
jsandoval81 wants to merge 2 commits intocsg-org:mainfrom
InspiringApps:frontend/cosm-discipline-table

Conversation

@jsandoval81
Copy link
Copy Markdown
Collaborator

@jsandoval81 jsandoval81 commented May 7, 2026

Requirements List

  • None

Description List

  • Update Licensee model to handle server adverseActions top-level property
  • Update AdverseAction model with npdb type display helper methods
  • Add an AlertCircle icon component
  • Update LicensingDetail page with a discipline table for Cosmetology
  • Updated mock data & tests
  • Update StaffUser model tests to improve coverage

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
    • Cosmetology
      • Login as staff
      • Search for licensee with adverse actions
      • Navigate to licensee detail page
      • Confirm new Discipline table at bottom of page matches designs
      • Search for licensee with NO adverse actions
      • Navigate to licensee detail page
      • Confirm new Discipline table at bottom of page correctly shows no discipline
    • JCC Compacts
      • Login as staff
      • Search for licensees
      • Navigate to licensee detail page
      • Confirm NO Discipline table at bottom of page

Closes #1477

Summary by CodeRabbit

  • New Features

    • Added a disciplinary information section to the licensing detail page (cosmetology mode) with collapsible interface and sortable adverse actions.
    • Added new alert icon component.
  • Style

    • Updated styling and layout for the licensing details page.
  • Tests

    • Expanded test coverage for adverse actions and permission displays.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Review Change Stack

Warning

Rate limit exceeded

@jsandoval81 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 47 minutes 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: 52f5060a-35e6-4de5-8217-73542222ecd6

📥 Commits

Reviewing files that changed from the base of the PR and between 31bbe21 and ba0e398.

📒 Files selected for processing (1)
  • webroot/src/pages/LicensingDetail/LicensingDetail.ts
📝 Walkthrough

Walkthrough

This PR adds a discipline section to the LicensingDetail page that displays licensee adverse actions. It introduces a new AlertCircle icon component, extends the Licensee and AdverseAction data models, adds localization strings, and implements responsive UI with collapsible discipline records including sorting by start date and state.

Changes

Discipline and Adverse Action UI and Data

Layer / File(s) Summary
Icon Component
webroot/src/components/Icons/AlertCircle/*
New AlertCircle icon component with SVG template, Vue class, LESS styles, and unit test.
Data Model Enhancements
webroot/src/models/AdverseAction/AdverseAction.model.ts, webroot/src/models/Licensee/Licensee.model.ts
AdverseAction gains npdbTypeName() and npdbTypeNames() methods for NPDB type localization. Licensee adds optional adverseActions field and LicenseeSerializer deserializes adverse actions from server responses.
Localization Strings
webroot/src/locales/en.json, webroot/src/locales/es.json
Added disciplineTitle translation keys in English ("Disciplinary information") and Spanish ("Información disciplinaria").
Test Data and Specifications
webroot/src/models/AdverseAction/AdverseAction.model.spec.ts, webroot/src/models/Licensee/Licensee.model.spec.ts, webroot/src/models/StaffUser/StaffUser.model.spec.ts, webroot/src/network/mocks/mock.data.ts
Test suites updated to verify NPDB type helpers and Licensee adverseActions field. Mock data enhanced with adverse action fixtures including privilege/license action types and clinical privilege categories. StaffUser test expectations updated for SSN read permissions.
LicensingDetail Page UI and Logic
webroot/src/pages/LicensingDetail/LicensingDetail.ts, webroot/src/pages/LicensingDetail/LicensingDetail.vue, webroot/src/pages/LicensingDetail/LicensingDetail.less
Page component wires AlertTriangleIcon and AlertCircleIcon, adds isDisciplineCollapsed state with toggle, computes licenseeDiscipline sorted by start date and state, and implements responsive discipline section template with collapsible header and per-row cell formatting.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • csg-org/CompactConnect#1517: Both PRs modify the LicensingDetail component (its .ts and .vue files) — this PR adds discipline/adverse-action data, sorting and UI while the related PR adds cosmetology-mode SSN/registration conditionals.
  • csg-org/CompactConnect#939: Both PRs touch the Licensee model/serializer and mock data (including adverseActions), with overlapping code-level changes.
  • csg-org/CompactConnect#1115: Both PRs modify the frontend mock data for provider/license privilege history/adverse actions in webroot/src/network/mocks/mock.data.ts.

Suggested reviewers

  • rmolinares
  • jlkravitz

Poem

🐰 Hops with glee through discipline rows,
AlertCircles flag what each licensee knows,
Sorted by dates, collapsing with care,
Adverse actions now visible to share!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'WIP: discipline table' is partially related to the changeset. It mentions the discipline table feature but uses 'WIP' (work-in-progress) prefix and is vague without specifics. Replace 'WIP:' with a more descriptive title that clearly conveys the main changes, such as 'Add discipline table to LicensingDetail page for Cosmetology' or 'Implement adverse actions display in LicensingDetail page'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description includes Requirements List, Description List, and Testing List sections following the template structure. All critical sections are present with substantial content.
Linked Issues check ✅ Passed The PR implements the discipline table feature from #1477 with model updates, new icon component, LicensingDetail page changes, and comprehensive test coverage for the feature.
Out of Scope Changes check ✅ Passed All changes are scoped to the discipline table feature. Updates to AlertCircle icon, AdverseAction model, Licensee model, LicensingDetail page, and test updates are all directly related to implementing the linked issue requirements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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: 1

🧹 Nitpick comments (1)
webroot/src/pages/LicensingDetail/LicensingDetail.less (1)

299-378: 💤 Low value

.no-discipline element has no style rule defined.

The Vue template renders <div class="no-discipline"> when there are no discipline records, but no corresponding CSS rule exists for it. The text will display with no indentation, padding, or font styling — inconsistent with other "empty state" presentations on the page.

🎨 Suggested fix
         .discipline-list {
             ...
         }
+
+        .no-discipline {
+            padding: 1.6rem 0;
+            color: `@fontColorLight`;
+        }
     }
🤖 Prompt for 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.

In `@webroot/src/pages/LicensingDetail/LicensingDetail.less` around lines 299 -
378, Add a CSS rule for the .no-discipline element in LicensingDetail.less
(place it near .discipline-section/.discipline-list for discoverability) so the
empty-state matches other rows: give .no-discipline similar margin/padding and
top-border as .discipline-row (padding: 1.6rem 0; border-top when not-first or
explicit top border), set font-weight or muted color consistent with
.cell-title/.header, and ensure responsive behavior (tablet/desktop media
queries) so it aligns with other .discipline-cell layout; target the class name
".no-discipline" to implement these styles.
🤖 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/pages/LicensingDetail/LicensingDetail.ts`:
- Around line 348-360: The comparator sortByDisciplineStart currently compares
display-formatted dates from AdverseAction.startDateDisplay(), which are
M/D/YYYY strings and sort incorrectly; change it to compare the underlying ISO
date values (e.g., AdverseAction.startDate) or parse the ISO strings into Date
objects and compare numerically so ordering is correct; update
sortByDisciplineStart to read action1.startDate and action2.startDate (or
Date.parse(action1.startDate)/Date.parse(action2.startDate)) and return -1/0/1
based on those comparisons.

---

Nitpick comments:
In `@webroot/src/pages/LicensingDetail/LicensingDetail.less`:
- Around line 299-378: Add a CSS rule for the .no-discipline element in
LicensingDetail.less (place it near .discipline-section/.discipline-list for
discoverability) so the empty-state matches other rows: give .no-discipline
similar margin/padding and top-border as .discipline-row (padding: 1.6rem 0;
border-top when not-first or explicit top border), set font-weight or muted
color consistent with .cell-title/.header, and ensure responsive behavior
(tablet/desktop media queries) so it aligns with other .discipline-cell layout;
target the class name ".no-discipline" to implement these styles.
🪄 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: 6ac74b7b-4607-4a72-86d5-502d050c4be2

📥 Commits

Reviewing files that changed from the base of the PR and between f5065f5 and 31bbe21.

📒 Files selected for processing (15)
  • webroot/src/components/Icons/AlertCircle/AlertCircle.less
  • webroot/src/components/Icons/AlertCircle/AlertCircle.spec.ts
  • webroot/src/components/Icons/AlertCircle/AlertCircle.ts
  • webroot/src/components/Icons/AlertCircle/AlertCircle.vue
  • webroot/src/locales/en.json
  • webroot/src/locales/es.json
  • webroot/src/models/AdverseAction/AdverseAction.model.spec.ts
  • webroot/src/models/AdverseAction/AdverseAction.model.ts
  • webroot/src/models/Licensee/Licensee.model.spec.ts
  • webroot/src/models/Licensee/Licensee.model.ts
  • webroot/src/models/StaffUser/StaffUser.model.spec.ts
  • webroot/src/network/mocks/mock.data.ts
  • webroot/src/pages/LicensingDetail/LicensingDetail.less
  • webroot/src/pages/LicensingDetail/LicensingDetail.ts
  • webroot/src/pages/LicensingDetail/LicensingDetail.vue

Comment thread webroot/src/pages/LicensingDetail/LicensingDetail.ts
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.

FE discipline table

1 participant