TTAHUB-5344 and TTAHUB-5348 - Compliant Follow-up Reviews with TTA Support widget Table View#3681
Conversation
|
|
|
|
There was a problem hiding this comment.
Pull request overview
This PR adds a new “Compliant Follow-up Reviews with TTA Support” widget to the Regional Dashboard Monitoring page, including a frontend table view and a new backend widget endpoint to supply the data.
Changes:
- Added a new backend monitoring widget (
compliantFollowUpReviewsWithTtaSupport) that computes monthly counts for follow-up reviews with/without TTA support. - Added a new frontend widget component intended to render the widget in a horizontal table view (with a menu toggle for tabular vs. non-tabular display).
- Wired the widget into the Regional Dashboard Monitoring page and registered it in the widget index.
Impact assessment:
- Benefits: Medium — introduces the requested widget/table view on the monitoring dashboard.
- Risks: High — current backend SQL appears to ignore filters and contains counting/aliasing issues; frontend has a missing component reference that can break rendering/build depending on configuration.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| src/widgets/monitoring/compliantFollowUpReviewsWithTtaSupport.ts | Adds backend widget logic + SQL query to compute monthly with/without-TTA review counts. |
| src/widgets/index.js | Registers the new backend widget for routing/lookup. |
| frontend/src/widgets/CompliantFollowUpReviewsWithTtaSupport.js | Adds the frontend widget container and horizontal table rendering. |
| frontend/src/widgets/CompliantFollowUpReviewsWithTtaSupport.css | Adds widget stylesheet (currently empty). |
| frontend/src/pages/RegionalDashboard/components/MonitoringReportDashboard.js | Adds the widget to the Monitoring dashboard layout. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
illustrative change to how the widget scopes are implemented, plus tests
|
Bottom row stickiness seems a bit funky Screen.Recording.2026-06-18.at.10.44.15.AM.mov |
| ...scopes.deliveredReview, | ||
| { complete: true }, | ||
| { complete_date: { [Op.gte]: MIN_MONITORING_DATE } }, |
There was a problem hiding this comment.
@Andrew565 @hardwarehuman the design says the following: "Date filtering: The date range you select at the top of the dashboard filters the data based on the Follow-up review received date."
The scopes applied are to "DeliveredReview.review_delivery_date" but it looks like this sequelize function will only return the initial, now-completed review, which will make the date filter function in unexpected ways. Am I misunderstanding what this query is returning?
| // Apply the deliveredReview scope (e.g. review_type) and grant filter via the ORM, since | ||
| // WhereOptions can't be injected into raw SQL. The resulting ids are passed to the SQL where | ||
| // scoped_reviews re-fetches the necessary columns and drives the rest of the query. | ||
| const deliveredReviews = await DeliveredReview.findAll({ |
There was a problem hiding this comment.
Codex said: This still does not enforce the widgets own business definition of compliant follow-up reviews. DeliveredReview.findAll only applies scopes.deliveredReview, complete: true, and the date bound; it does not add outcome: Compliant or review_type: Follow-up. Unless every caller always injects those constraints, this widget can count complete reviews that are not compliant follow-ups. The fix is to hardcode those predicates here, the same way monitoringOverview.ts does.
There was a problem hiding this comment.
This is a misunderstanding of the schema: Adding the predicates "outcome: compliant" etc would be incorrect and exclude reviews that have been made compliant by all of their citations being addressed. The proper way to determine compliant follow up reviews is to find reviews that are complete.
There was a problem hiding this comment.
Reviews where DeliveredReviews.corrected is true, which incorporates both DeliveredReviews.corrected and that all findings were actually corrected in the end.
…corrected" instead of "complete"
| </Grid> | ||
| <Grid row> | ||
| <CompliantFollowUpReviewsWithTtaSupport filters={filtersToApply} /> | ||
| <FeatureFlag flag="compliant_follow_up_reviews_tta_support"> |
There was a problem hiding this comment.
'compliant_follow_up_reviews_tta_support' => 'monitoring-regional-dashboard'
There was a problem hiding this comment.
oh I see you added a flag. There is already one hanging around for monitoring regional dash, I should have mentioned
There was a problem hiding this comment.
Hmm, gotcha. Should I change to the existing one?
There was a problem hiding this comment.
I think so, that's why I left it in there (was assuming I would do this widget), that way we have less to cleanup in the future
There was a problem hiding this comment.
Further convo with Matt, he said it's not really a big deal, we just have to remember to remove this feature flag once it's ready.
@Andrew565 I'm still seeing the bottom row is not sticky, otherwise looks good |
| @@ -0,0 +1,351 @@ | |||
| import PropTypes from 'prop-types'; | |||
There was a problem hiding this comment.
This is a large file can anything be broken out into a helper file?
Description of change
Table view of the Compliant Follow-up Reviews with TTA Support widget for the Regional Dashboard Monitoring page.
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