Skip to content

feat(scheduler): Clinical Scheduler audit trail + inline per-week history#236

Open
rlorenzo wants to merge 4 commits into
mainfrom
feature/clinical-scheduler-audit-log
Open

feat(scheduler): Clinical Scheduler audit trail + inline per-week history#236
rlorenzo wants to merge 4 commits into
mainfrom
feature/clinical-scheduler-audit-log

Conversation

@rlorenzo

@rlorenzo rlorenzo commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Surfaces the clinical schedule-change audit data VIPER already records, replacing the legacy ColdFusion "Schedule Changes Audit log". Everything is gated on SVMSecure.ClnSched.Manage, the same permission the legacy page used, so no new permission is introduced.

  • Audit Trail page: filterable read of the ScheduleAudit table (grad year, term, rotation, area, modified-by, person, date range) with colored action badges.
  • Inline per-week history: a clock icon on each week in Schedule-by-Rotation / Schedule-by-Clinician opens that week's change history (anchored popover on desktop, centered dialog on mobile).
  • Term column and grad-year-scoped Term filter; "Year" relabeled to "Grad Year"; every filter defaults to an explicit "All ...".
  • Responsive audit table: full table (desktop), stacked table (tablet/iPad), cards (phone), matching the Effort audit trail.
  • Effort audit parity: same "All ..." filter defaults, the free-text search moved on top of the table, and a shared AuditChangeDetail component (removes duplicated diff markup).

Activates previously-dead code (flagged by fallow)

This branch is mostly surfacing audit code that already existed but was dead, not new plumbing:

  • The ScheduleAudit table has been written on every add/remove/primary-evaluator change, but had no reader. At this branch's base the read methods (GetInstructorScheduleAuditHistoryAsync, GetRotationWeekAuditHistoryAsync) had zero callers, i.e. dead code.
  • The project's dead-code detection (the fallow tool) is exactly what flags unreferenced code like this. Rather than delete the audit read paths, this PR gives them real consumers (the audit page and inline per-week history), so the recorded data is finally exercised.

rlorenzo added 3 commits June 23, 2026 18:33
Replace the legacy ColdFusion "Schedule Changes Audit log" with a filterable audit trail (year, rotation, area, modified-by, person, date range) and colored action badges, matching the Effort audit trail UI. Reachable from a left-nav link and in-page tab gated on SVMSecure.ClnSched.Manage.

The ScheduleAudit table was already written on every add/remove/primary-evaluator change but had no reader; this surfaces that data, so the audit read paths are no longer dead code.
- Inline change-history popover per week (centered dialog on mobile),
  reusing the existing schedule-audit data; gated on the same
  SVMSecure.ClnSched.Manage permission as the audit trail page.
- Audit trail: add a Term column and a grad-year-scoped Term filter,
  relabel the "Year" filter to "Grad Year", and default every filter
  to an explicit "All ..." state.
- Make the audit table responsive: full table on desktop, a stacked
  table on tablet/iPad, and cards on phones, matching the Effort
  audit trail.

Claude-Session: https://claude.ai/code/session_01KG91i9MUZbBB7Mp73qwmA4
- Default every filter to an explicit "All ..." state and move the
  free-text search to a bar on top of the results table.
- Extract a shared AuditChangeDetail component, removing the duplicated
  old-to-new diff markup in the desktop and mobile views.

Claude-Session: https://claude.ai/code/session_01KG91i9MUZbBB7Mp73qwmA4
@codecov-commenter

codecov-commenter commented Jun 27, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 22.5kB (1.06%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
viper-frontend-esm 2.15MB 22.5kB (1.06%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: viper-frontend-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/GenericError-*.js 17 bytes 538.55kB 0.0%
assets/schedule-*.js 1.33kB 52.69kB 2.6%
assets/TermManagement-*.js -5 bytes 52.38kB -0.01%
assets/CourseDetail-*.js -1 bytes 40.35kB -0.0%
assets/PhotoGallery-*.js 2 bytes 36.08kB 0.01%
assets/InstructorEdit-*.js -2 bytes 29.66kB -0.01%
assets/InstructorList-*.js -2 bytes 25.92kB -0.01%
assets/effort-*.js -2 bytes 23.17kB -0.01%
assets/CrossListedCoursesSection-*.js 1 bytes 23.02kB 0.0%
assets/MultiYearReport-*.js 1 bytes 18.75kB 0.01%
assets/ClinicianScheduleView-*.js -281 bytes 18.59kB -1.49%
assets/AuditList-*.js 283 bytes 17.59kB 1.63%
assets/RotationScheduleView-*.js 221 bytes 17.19kB 1.3%
assets/AuditLogPage-*.js (New) 11.58kB 11.58kB 100.0% 🚀
assets/permission-*.js 193 bytes 10.81kB 1.82%
assets/schedule-*.css 1.76kB 8.6kB 25.82% ⚠️
assets/audit-*.js (New) 6.39kB 6.39kB 100.0% 🚀
assets/WebReports-*.js 5 bytes 6.37kB 0.08%
assets/UnitList-*.js 1 bytes 6.35kB 0.02%
assets/use-*.js 76 bytes 739 bytes 11.46% ⚠️
assets/use-*.js (New) 663 bytes 663 bytes 100.0% 🚀
assets/clinicalscheduler-*.js 141 bytes 1.71kB 8.99% ⚠️
assets/audit-*.css (New) 115 bytes 115 bytes 100.0% 🚀

Files in assets/schedule-*.js:

  • ./src/ClinicalScheduler/components/WeekHistoryContent.vue → Total Size: 261 bytes

  • ./src/ClinicalScheduler/components/WeekHistoryButton.vue → Total Size: 258 bytes

  • ./src/ClinicalScheduler/components/WeekCell.vue → Total Size: 231 bytes

  • ./src/ClinicalScheduler/components/ScheduleView.vue → Total Size: 243 bytes

Files in assets/ClinicianScheduleView-*.js:

  • ./src/ClinicalScheduler/pages/ClinicianScheduleView.vue → Total Size: 265 bytes

Files in assets/AuditList-*.js:

  • ./src/Effort/pages/AuditList.vue → Total Size: 218 bytes

  • ./src/Effort/components/AuditChangeDetail.vue → Total Size: 162 bytes

Files in assets/RotationScheduleView-*.js:

  • ./src/ClinicalScheduler/pages/RotationScheduleView.vue → Total Size: 262 bytes

Files in assets/AuditLogPage-*.js:

  • ./src/ClinicalScheduler/pages/AuditLogPage.vue → Total Size: 153 bytes

Files in assets/permission-*.js:

  • ./src/ClinicalScheduler/constants/permission-messages.ts → Total Size: 1.62kB

Files in assets/audit-*.js:

  • ./src/ClinicalScheduler/components/SchedulerNavigation.vue → Total Size: 264 bytes

  • ./src/ClinicalScheduler/utils/audit-actions.ts → Total Size: 332 bytes

  • ./src/ClinicalScheduler/services/audit-log-service.ts → Total Size: 2.6kB

Files in assets/clinicalscheduler-*.js:

  • ./src/ClinicalScheduler/router/routes.ts → Total Size: 1.59kB

@codecov-commenter

codecov-commenter commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 20.33195% with 384 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.20%. Comparing base (f6dbe72) to head (b6c60f4).
⚠️ Report is 17 commits behind head on main.

Files with missing lines Patch % Lines
...ClinicalScheduler/Services/ScheduleAuditService.cs 0.00% 179 Missing ⚠️
...ueApp/src/ClinicalScheduler/pages/AuditLogPage.vue 53.29% 70 Missing and 8 partials ⚠️
...alScheduler/Controllers/ScheduleAuditController.cs 0.00% 67 Missing ⚠️
...rc/ClinicalScheduler/services/audit-log-service.ts 19.04% 34 Missing ⚠️
...cheduler/Models/DTOs/Responses/AuditLogEntryDto.cs 0.00% 15 Missing ⚠️
...icalScheduler/Services/ClinicalSchedulerNavMenu.cs 0.00% 5 Missing ⚠️
...ueApp/src/ClinicalScheduler/utils/audit-actions.ts 33.33% 2 Missing ⚠️
...cheduler/Models/DTOs/Responses/AuditModifierDto.cs 0.00% 2 Missing ⚠️
...calScheduler/Models/DTOs/Responses/AuditTermDto.cs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #236      +/-   ##
==========================================
- Coverage   44.49%   44.20%   -0.30%     
==========================================
  Files         895      909      +14     
  Lines       51655    52424     +769     
  Branches     4812     4914     +102     
==========================================
+ Hits        22983    23173     +190     
- Misses      28108    28671     +563     
- Partials      564      580      +16     
Flag Coverage Δ
backend 44.41% <0.00%> (-0.24%) ⬇️
frontend 40.48% <46.22%> (-0.84%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Comment thread web/Areas/ClinicalScheduler/Services/ScheduleAuditService.cs Fixed
Comment thread web/Areas/ClinicalScheduler/Services/ScheduleAuditService.cs Fixed
Comment thread web/Areas/ClinicalScheduler/Services/ScheduleAuditService.cs Fixed
Comment thread web/Areas/ClinicalScheduler/Services/ScheduleAuditService.cs Fixed
Replace .HasValue/.Value with "is T x" pattern matching on the audit-log
filter params (rotation, term, from/to dates) so the code-quality
analyzer stops flagging the guarded .Value access as a possible null
dereference. No behavior change.

Claude-Session: https://claude.ai/code/session_01KG91i9MUZbBB7Mp73qwmA4
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.

2 participants