Repository navigation
Shubham Jakhete - Create way to see deactivated people's last week on the Weekly Summaries Reports page (frontend) - #5577
Conversation
Deactivated users should appear on the Weekly Summaries Report tab for the week they left, with a final week notice. Right now they appear on no tab, and active users with a scheduled end date are hidden too. - Move the visibility rule into weeklySummariesFinalWeek.js so both components use it - Always show active users, even if they have an end date - Show inactive users only on the tab matching the finalWeekIndex from the backend - Style the notice with the existing module classes instead of inline styles Adds unit and component tests for these cases. Needs the HGNRest branch shubham-deactivated-final-week, which returns the corrected finalWeekIndex.
The final week notice was hard to see in dark mode: near-white text on a background barely different from the card. - Add a red left border in both themes - Use a visible red tint and light-red text in dark mode, with about 5:1 contrast
✅ Deploy Preview for highestgoodnetwork-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
adit24dhaya
left a comment
There was a problem hiding this comment.
Reviewed 7276aa4 with the explicitly paired backend #2363 at f19b6618. The shared visibility rule now keeps active users with scheduled end dates on every tab, and shows inactive users only on their backend-provided final-week tab. The same rule is used for filtering, team counts and report rendering. I found no blocking issue in this pair.
Validation: 41/41 frontend tests passed in seven files on Node 20.19.4. The production build passed with 9,156 modules; changed-JS ESLint and git diff --check passed. The SCSS compiles in the build, but separate SCSS lint was not run because the configured parser is unavailable. Paired backend: 20/20 tests in two suites, Babel build 774 files, ESLint zero errors/nine warnings and diff check passed.
I also ran 20 isolated assertions across the real backend report helper and frontend visibility rules for all four tabs: zero-hour deactivated users, legacy missing inactiveReason, active scheduled separations, paused users and old inactive users. Aggregate persistence is mocked and its query predicates are interpreted by the fixture, not executed by MongoDB. Eight actual FormattedReport browser cases covered four tabs in both themes, with 24 visibility and four notice assertions; only the correct inactive tab shows the notice and dates. Five additional theme/contrast assertions used the real ThemeManager, app CSS and report route CSS. The dark notice measures 5.12:1 against its actual tinted background, meeting the description's claim and the normal-text contrast threshold. The existing CSS-module class names remain scoped.
No real accounts were deactivated or scheduled for separation; there were no database writes or external API calls. Full authenticated Admin/Owner navigation and a real MongoDB aggregation remain unverified.
Commit audit: both commits are focused, imperative, under 72 characters, without trailing periods, and include blank-separated what/why bodies. The dependency branch is named; adding #2363 or a relevant ticket in the commit body would improve traceability. Approved.
vidiyala99
left a comment
There was a problem hiding this comment.
Tested 7276aa4 with backend #2363 (f19b661) as Administrator and Volunteer, in light and dark mode, against the shared dev data. Both PRs only change how the report is read, so nothing was written; I used users who are already inactive on dev instead of deactivating anyone.
Before (backend development), calling GET /api/reports/weeklysummaries?week=N for each tab: every tab returned all 56 inactive users, and the one person who left last week ("DevAdmin100 Mahika DontEdit TOS Bravo") came back with finalWeekIndex: 0 on the Last Week request, so no tab matched.
After (this PR + #2363):
- API: only active users plus people who left in the requested week are returned. Mahika gets
finalWeekIndex: 1, Ashmita Pal (left 09-26) gets2, two users whose final day is this week get0, and active users with a scheduled end date getnull. - UI, checked by exact name on each tab: Mahika appears only on Last Week, Ashmita Pal only on Week Before Last, the two this-week users only on This Week, and Three Weeks Ago has no final-week notice. Active users with an end date (Summit Kaushal, Rajeshwari Mangers2) appear on all four tabs with no notice. Total Team Members goes 2699 / 2698 / 2698 / 2697 accordingly.
- Notice: "FINAL WEEK REPORTING: This team member is no longer active" shows the right dates (Last Week: Sep 27 - Oct 3, 2026) and is readable in both themes (screenshots 1 and 2). It uses the module classes, with no new generic class names.
- Volunteer:
/weeklysummariesreportredirects to the dashboard, as before. - Tests: frontend Weekly Summaries tests 41/41 and backend
finalWeekIndex+reporthelpertests 20/20 pass.
Three small notes, not blocking:
- These two need to merge together. With this frontend and the old backend, the frontend trusts a
finalWeekIndexthat the old backend computes relative to the requested tab, so departed users would land on the wrong tab. - #5597 (active team code suggestions, also high priority) calls
weekIndexFromEndDateinFormattedReport.jsx, which this PR removes, so whichever merges second will needshouldShowSummaryOnTabthere. reporthelper.weeklySummariesis also used by the weekly summaries email job (userHelper.emailWeeklySummariesForAllUsers). After #2363, that email will include only people who left during that week instead of every inactive user. That looks like an improvement, but it's worth a line in the backend description.
Approving.
1. Last Week tab, light mode: final-week notice on the user who left last week
2. Same view in dark mode
AaditTrivedi
left a comment
There was a problem hiding this comment.
Reviewed by Aadit Trivedi.
Frontend pair of HGNRest #2363, which I reviewed and approved. I reviewed the diff and ran the tests (weeklySummariesFinalWeek.test.js and the WeeklySummariesReport suite: [41/41] passing); I didn't test it end to end, since #2363 isn't merged.
Verified
- The final-week decision previously lived in two places with different logic:
FormattedReport.jsxrecomputed the tab fromendDatein the browser (weekIndexFromEndDate), whileWeeklySummariesReport.jsxcompared againstfinalWeekIndex(shouldIncludeSummaryForWeek). Both now use the sharedshouldShowSummaryOnTabandisFinalWeekOnTabfromweeklySummariesFinalWeek.js, which has its own tests. - The old
if (summary.endDate && !isFinalWeek) return nullhid any user with anendDateoutside their final week, including active users with a future scheduled separation. Basing the check on the backend'sfinalWeekIndex, which #2363 sets only for users who have left, removes that problem. - The commented-out final-week message is removed, and its inline colors moved to SCSS classes with a dark mode variant.
Pointer, not blocking
- The last commit is from Sep 23, 2026; please update the branch with development before merge, and merge it together with #2363, since it depends on
finalWeekIndexfrom that PR.
Approving.
…ighestGoodNetworkApp into shubham-deactivated-final-week
|
|
Thank you all, merging! |



Description
Bug list: "Create way to see deactivated people's last week on the Weekly Summaries Reports page" (priority high, Jae).
Deactivated people should still show up on the Weekly Summaries Report tab for the week they left, with a clear notice: "FINAL WEEK REPORTING: This team member is no longer active". Currently they show on no tab, and active people with a scheduled end date are hidden too.
The page decided who to show in two places, and both treated anyone with an
endDateas leaving.FormattedReportalso recalculated the final week itself, so it could disagree with the backend.Related PRS (if any):
This frontend PR is related to backend PR OneCommunityGlobal/HGNRest#2363.
To test this frontend PR you need to check out backend PR OneCommunityGlobal/HGNRest#2363.
Link: OneCommunityGlobal/HGNRest#2363
Main changes explained:
src/utils/weeklySummariesFinalWeek.jswith one shared rule: active users always show; inactive users show only on the tab matching the backend'sfinalWeekIndex.WeeklySummariesReport.jsxto use the shared rule and remove its old filter functions.FormattedReport.jsxto use the shared rule, remove its duplicate week calculation, and remove a commented-out copy of the notice..finalWeekNotice/.finalWeekNoticeDarkmodule classes instead of inline styles. Add a red left border, and make the dark-mode version readable (about 5:1 contrast). No new or generic class names.How to test:
npm install, thennpm run start:local.Screenshots or videos of changes:
Note: