Skip to content

[PROD] TTAHUB-5283 Fix for regional dashboard AR table#3717

Merged
elainaparrish merged 5 commits into
productionfrom
main
Jun 23, 2026
Merged

[PROD] TTAHUB-5283 Fix for regional dashboard AR table#3717
elainaparrish merged 5 commits into
productionfrom
main

Conversation

@AdamAdHocTeam

@AdamAdHocTeam AdamAdHocTeam commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Description of change

TTAHUB-5283: Fix for pagination reset when filters change on regional dashboard AR table.
TTAHUB-5378: Fix CLASS same grant matching and align widget/page counts on the QA dashboard.
TTAHUB-5443: Prevent users from removing all approvers after an activity report is submitted.
TTAHUB-5460: Update PR quality checks to use pull_request_target so advisory comments work for forked PRs.
TTAHUB-5470: Fix for disappearing objectives.

How to test

TTAHUB-5283: Make sure that the pagination resets back to the first page after filter change for AR table.
TTAHUB-5378: In the QA dashboard, verify a recipient only qualifies when at least one grant has both a CLASS goal and CLASS scores on the same grant, and that widget/detail counts stay aligned.
TTAHUB-5443: Try as a submitter, with activity report in needs action, and as an approver to find a way to remove all of a reports's approvers after that activity report has been submitted.
TTAHUB-5460: Open or reopen a PR targeting main and confirm the diff size and review count advisory jobs run successfully, including for fork PRs.
TTAHUB-5470: Edit an existing goal on the RTTAPA with objectives. Note that all objectives on the RTTAPA load on the edit form. Add an objective. Save. Note that all existing objectives appear on the RTTAPA (we aren't down to one).

Jira Issue(s)

Checklists

Every PR

  • Linked Jira issue
  • JIRA issue 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 (this ready_for_review transition triggers the Slack/Jira automation)
  • Reviewer added after the PR is Open (elainaparrish is the authorized approver under normal circumstances)
    • Sequence: Draft PR → Smoke test → Open PR (automation runs) → Add reviewer
    • Confirm that the Slack notification was sent after the PR was opened
    • Confirm that linked Jira ticket(s) transitioned as expected; if not, review the GitHub Actions workflow logs

After merge/deploy

  • Update JIRA ticket status

thewatermethod and others added 5 commits June 18, 2026 20:26
…3711)

* fix for mismatched display

* make more fix broader

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* use constant

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…nts (#3706)

* Bump fast-xml-builder from 1.1.5 to 1.2.0

Bumps [fast-xml-builder](https://github.com/NaturalIntelligence/fast-xml-builder) from 1.1.5 to 1.2.0.
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-builder/blob/main/CHANGELOG.md)
- [Commits](NaturalIntelligence/fast-xml-builder@v1.1.5...v1.2.0)

---
updated-dependencies:
- dependency-name: fast-xml-builder
  dependency-version: 1.2.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* TTAHUB-5378 Fix CLASS same grant matching and align widget/page counts

* Fix the cleanup helper

* align QA CLASS widget counts and detail rows by grant

* Remove unused http-proxy-middleware package

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: thewatermethod@gmail.com <thewatermethod@gmail.com>
* test: add failing TDD test for zero-approver submission on needs-action AR

Reproduces the STR: approver removes all approvers on a NEEDS_ACTION report,
clicks 'Update report', validation message appears but onSubmit was still called.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: prevent submission when all approvers removed from AR review page

NeedsAction.js: route 'Update report' through handleSubmit(submit) using a
<Form> wrapper so the ApproverSelect notEmpty validation rule actually blocks
execution (not just displays an error). Add explicit hasApprovers guard in
submit() as defense-in-depth.

Draft.js: include hasApprovers in canSubmitReport as defense-in-depth
alongside the existing RHF required rule on ApproverSelect.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: block side-nav navigation save when it would strip all approvers

In Navigator.onUpdatePage, short-circuit before onSaveDraft when the report
status is SUBMITTED or NEEDS_ACTION and the form approvers would resolve to
zero valid user IDs. Surfaces the error via the existing SideNav errorMessage
alert mechanism.

Also removes a pre-existing dead else-branch in navigatorPages map where the
else case reassigned stateOfPage to its already-computed value (no-op).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: add Joi middleware blocking zero-approver submit on activity reports

Add checkSubmitReportBody middleware (src/routes/activityReports/middleware.ts)
following the existing checkReviewReportBody pattern. Validates only that
approverUserIds is a non-empty array of positive integers; all other request
body fields remain permissive via .unknown(true).

Wire middleware into PUT /:activityReportId/submit in index.js.

Also removes unused auditLogger import and dead userId/user variables from
getGoals handler (identified during implementation).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs: fix stale Joi example and add RHF handleSubmit guidance

- Validation section: update Joi example to point to the route-level
  middleware pattern (middleware.ts) instead of a hooks file that doesn't
  use Joi; clarify that Joi belongs in route middleware, not model hooks.
- Frontend section: add RHF handleSubmit footgun warning — plain onClick
  bypasses field-level validation rules (errors show but execution is not
  blocked); always use handleSubmit(fn) or type=submit inside Form.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* refactor: move approver-nav guard from Navigator into ActivityReportNavigator preflight

Navigator is a generic shared component (used by ActivityReports,
CommunicationLogs, etc.) and must not contain domain-specific field names.

Move the zero-approver guard out of Navigator.onUpdatePage and into an
AR-specific preFlight() function defined in ActivityReportNavigator, passed
via the existing preFlightForNavigation prop — matching the same pattern
LogFormNavigator already uses.

Changes:
- Navigator/index.js: remove REPORT_STATUSES import and AR-specific
  approvers/calculatedStatus check from onUpdatePage; add comment
  documenting the preFlightForNavigation contract for future contributors
- ActivityReportNavigator.js: add preFlight() that blocks navigation on
  submitted/needs-action reports with zero valid approvers; pass it as
  preFlightForNavigation prop to Navigator
- Navigator test: replace AR-specific test with generic preflight-blocks-nav test
- ActivityReportNavigator test: add the AR-specific zero-approver case

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Revert "docs: fix stale Joi example and add RHF handleSubmit guidance"

This reverts commit 602ac89.

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* wrap draftSaver with preFlight to block all save paths when no approver

* Fix Preflight/draft save test

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
* Fix for disappearing goals on RTTAPA

* test(standard-goals): align test isolation with selective   objective delete

* Add migration to revert known invalid deletions

* Remove unnecessary lookup from SQL

* Linting; spelling

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Encompass AI review suggestion

* Address additional PR finding

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@thewatermethod thewatermethod marked this pull request as ready for review June 23, 2026 13:43
@elainaparrish elainaparrish merged commit b3791f8 into production Jun 23, 2026
35 checks passed
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.

4 participants