Skip to content

Conversation

@thewatermethod
Copy link
Collaborator

@thewatermethod thewatermethod commented Dec 30, 2025

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

  • Meets issue criteria
  • JIRA ticket status updated
  • Code is meaningfully tested
  • Meets accessibility standards (WCAG 2.1 Levels A, AA)
  • API Documentation updated
  • Boundary diagram updated
  • Logical Data Model updated
  • Architectural Decision Records written for major infrastructure decisions
  • UI review complete
  • QA review complete

Before merge to main

  • OHS demo complete
  • Ready to create production PR

Production Deploy

  • PR created as Draft
  • Staging smoke test completed
  • PR transitioned to Open
  • Reviewer added (after transitioning to Open to ensure Slack notifications trigger)
    • Sequence: Draft PR → Smoke test → Open PR → Add reviewer
    • Confirm that Slack notification was sent after reviewer was added

After merge/deploy

  • Update JIRA ticket status

@thewatermethod thewatermethod changed the base branch from main to mb/TTAHUB-4491/goal-category-filter December 30, 2025 15:33
Copy link
Collaborator

@hardwarehuman hardwarehuman left a 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',
Copy link
Collaborator

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?

Copy link
Collaborator Author

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

Copy link
Collaborator

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.

Base automatically changed from mb/TTAHUB-4491/goal-category-filter to main January 7, 2026 15:06
Copilot AI review requested due to automatic review settings February 3, 2026 22:57
Copy link
Contributor

Copilot AI left a 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 trReasonList widget with new trStandardGoalList widget that queries goal templates by standard and counts distinct training report events
  • Updated frontend to use TRStandardGoalsList component (which reuses the StandardGoalsListTable component) instead of TRReasonList
  • Removed unused generateReasonList helper 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),
Copy link

Copilot AI Feb 3, 2026

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.

Copilot uses AI. Check for mistakes.
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.

5 participants