[TTAHUB-5402] Add TR in person count to overview widget on TTA History tab#3720
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Training Report (TR) “in-person session” counts into the Recipient Record TTA History overview widget by extending the TR per-recipient aggregate and combining it with the Activity Report (AR) overview metrics.
Changes:
- Extend
trSessionsForRecipientto return a newnumInPersonaggregate (count of COMPLETE sessions withdeliveryMethod === 'in-person'). - Update
ttaHistoryOverviewto combine AR + TRinPersoncounts, using a newparseFormattedNumberhelper to safely sum locale-formatted AR strings with numeric TR values. - Add/expand unit tests for the new helper and the new combined
inPersonbehavior.
Impact assessment:
- Benefits: Medium — completes the “In person activities” metric by including TR delivery channel.
- Risks: Low — changes are localized to widgets/helpers with good test coverage; output shape is only extended (not breaking).
Open issue(s):
- Low severity (documentation): One new/updated test comment references
parseInt, but the implementation now usesparseFormattedNumber/parseFloat(tracked in PR comment ID: 001).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/widgets/ttaHistoryOverview.ts | Combines AR + TR totals for duration, participants, and new in-person count using parseFormattedNumber. |
| src/widgets/ttaHistoryOverview.test.ts | Updates expectations and adds coverage for combined inPerson behavior and parsing. |
| src/widgets/trSessionsForRecipient.ts | Adds numInPerson aggregation for TR sessions scoped to recipient grants. |
| src/widgets/trSessionsForRecipient.test.ts | Adds assertions and new test cases validating numInPerson counting rules (exclude hybrid, exclude non-COMPLETE sessions). |
| src/widgets/helpers.js | Introduces parseFormattedNumber helper for locale-formatted numeric strings. |
| src/widgets/helpers.test.js | Adds unit tests for parseFormattedNumber. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
thewatermethod
approved these changes
Jun 23, 2026
thewatermethod
left a comment
Collaborator
There was a problem hiding this comment.
looks great!
would we want to update any of the api docs, etc?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of change
This adds the TR approved reports to the in-person overview count widget on the TTA History tab of the RTR.
How to test
Jira Issue(s)
Checklists
Every PR
Before merge to main
Production Deploy
ready_for_reviewtransition triggers the Slack/Jira automation)elainaparrishis the authorized approver under normal circumstances)After merge/deploy