-
Notifications
You must be signed in to change notification settings - Fork 11
[TTAHUB-3997] TR regional dashboard standard goals list #3205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[TTAHUB-3997] TR regional dashboard standard goals list #3205
Conversation
hardwarehuman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a question about Monitoring and CLASS Monitoring exclusion, but it seems most likely that was already addressed by discussions w/design OHS and I'm just unaware.
| where: { | ||
| creationMethod: CREATION_METHOD.CURATED, | ||
| standard: { | ||
| [Op.not]: 'Monitoring', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have various reasons to exclude Monitoring goals from selection lists (e.g. on ARs) because we don't want people creating their own Monitoring Goals, but I'm less sure about this one. Like, Monitoring might not be something that TRs address, but then I wonder if CLASS Monitoring should also be excluded. Is there something in the design that specifically specifies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember seeing this as a spec but I looked it up again to find it, and I see nothing that references not including monitoring in this graph.
To be clear, both Monitoring and RAN are explicitly excluded as selections on the session reports so those counts will always be zero, but I don't see a specific reason to exclude them from this list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The existing session report exclusion of Monitoring seems like plenty reason for excluding it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR replaces the "Reasons in Training Reports" widget with a new "Goal categories in Training Report sessions" widget on the Training Report Regional Dashboard. The change shifts from displaying training report reasons to showing goal categories (standards) associated with training report sessions.
Changes:
- Replaced backend
trReasonListwidget with newtrStandardGoalListwidget that queries goal templates by standard and counts distinct training report events - Updated frontend to use
TRStandardGoalsListcomponent (which reuses theStandardGoalsListTablecomponent) instead ofTRReasonList - Removed unused
generateReasonListhelper function and all associated reason list code - Added comprehensive test coverage for edge cases in related widgets
Reviewed changes
Copilot reviewed 23 out of 24 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/widgets/trStandardGoalList.ts | New widget that queries curated goal template standards linked to completed training report sessions after 2025-09-01 |
| src/widgets/trStandardGoalList.test.js | Comprehensive test suite for the new standard goals list widget |
| src/widgets/index.js | Updated widget exports to replace trReasonList with trStandardGoalList |
| src/widgets/helpers.js | Removed unused generateReasonList function |
| src/widgets/helpers.test.js | Added tests for baseTRScopes and enhanced countBySingleKey tests |
| src/widgets/index.test.js | New test file verifying all widget exports |
| src/widgets/trOverview.test.js | Added edge case tests for null recipients and zero participants |
| src/widgets/trHoursOfTrainingByNationalCenter.test.js | Added tests for unmatched trainers and null objectiveTrainers |
| src/widgets/totalHrsAndRecipientGraph.test.js | Added tests for null startDate and missing date filters |
| frontend/src/widgets/TRStandardGoalsList.js | New component that wraps StandardGoalsListTable with trStandardGoalList data source |
| frontend/src/widgets/StandardGoalList.js | Made title prop configurable to support different widget contexts |
| frontend/src/pages/RegionalDashboard/components/TrainingReportDashboard.js | Updated to use TRStandardGoalsList with appropriate title |
| frontend/src/pages/RegionalDashboard/components/tests/TrainingReportDashboard.js | Updated test to verify new widget title and endpoint |
| frontend/src/pages/RegionalDashboard/tests/index.js | Removed mock references to deprecated reasonList widget |
| docs/openapi/paths/widgets/trStandardGoalsList.yaml | New API documentation for trStandardGoalList endpoint |
| docs/openapi/paths/index.yaml | Updated paths index to reference new widget endpoint |
| docs/logical_data_model.encoded | Updated encoded data model |
| data: { | ||
| status: TRAINING_REPORT_STATUSES.COMPLETE, | ||
| }, | ||
| eventId: events.map(({ id }) => id), |
Copilot
AI
Feb 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the events array is empty (no complete training reports match the criteria), the query on line 49 will use eventId: [] which could lead to inefficient database queries or unexpected behavior. Consider adding an early return when events array is empty to avoid unnecessary database queries.
Description of change
Add "Goal categories in Training Report sessions" widget to the Training Report Regional Dashboard page, replacing the reason list widget.
How to test
The widget can be viewed in the UI at /dashboards/regional-dashboard/training-reports
Confirm functionality and fidelity to the mockups
Issue(s)
Checklists
Every PR
Before merge to main
Production Deploy
After merge/deploy