Skip to content

Frontend/discipline table#1549

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

Frontend/discipline table#1549
jsandoval81 wants to merge 2 commits into
csg-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

📝 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 | ✅ 5
✅ Passed checks (5 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.
Title check ✅ Passed The title 'Frontend/discipline table' accurately reflects the main changes in this PR—adding a discipline table feature to the LicensingDetail page with supporting components and model updates.

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

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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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
@jsandoval81 jsandoval81 requested a review from rmolinares May 12, 2026 20:08
@jsandoval81 jsandoval81 changed the title WIP: discipline table Frontend/discipline table May 12, 2026
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

2 participants