Repository navigation
Roshini - Fix Task Completed Data Not Populating Across - #5567
roshini1212 wants to merge 3 commits into
Conversation
✅ 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 this with the explicitly linked backend #2358 at heads fda8aa2 / 5fe7ffbc. The task bars can show the new counts, but CSV export still expects the old raw-data arrays. With the actual backend helper response (assigned 7, completed 8), Export CSV alerts 'No raw data available to export.' and produces no file. Keeping the counts identical and substituting the old array shape restores export. Please support the paired response contract and add an export regression test.
Validation: the four new PR suites have 5 passes and 1 failure: AnniversaryCelebrated.test.jsx expects 'No anniversaries found', while the changed component renders 'No anniversary data available for this period.' Please align that new assertion with the intended message. Six additional paired component checks have 4 passes and exactly 2 expected-export failures, one per theme. Chromium checks using the actual task and Blue Square chart components passed 24 assertions across current/control responses in light/dark; current export is blocked, and the old-shape control prepares CSV containing the expected counts. The paired backend also drops Blue Square categories; that separate source issue is reported on #2358.
Frontend production build passes (29.05s); changed JSX lint and whitespace checks pass. Backend mocked-model tests pass 5/5, including three PR tests and two contract/pipeline controls. No API requests or database writes were made by the browser fixtures, and actual downloads were suppressed. Backend pipeline control is a bounded JavaScript interpretation of captured stages, not MongoDB execution. Full authenticated dashboard, live database, mutation workflows and deployment were not tested.
Commit audit: the single 46-character subject is imperative and has no terminal period, but starts with a stray space and lacks a what/why body or issue reference. The non-task null-data guards broaden the stated task-data fix; please keep their regression tests green. These history/scope notes are secondary to the broken CSV contract.
| }; | ||
|
|
||
| // --- Export CSV helper --- | ||
| const exportCSV = () => { |
There was a problem hiding this comment.
[P2] Support the paired backend's raw object shape in CSV export. #2358 now returns raw.current = { assigned: 7, completed: 8 } and raw.comparison = { assigned: 2, completed: 4 }. Neither object has length, so the unchanged array guard immediately alerts 'No raw data available to export.' despite populated bars. Reproduced with the actual helper response in component tests and Chromium, both themes; substituting old raw arrays with identical counts prepares the CSV. Please adapt the export logic (including iteration) to the agreed response shape and cover this contract.
| </MemoryRouter>, | ||
| ); | ||
|
|
||
| expect(screen.getByText('No anniversaries found')).toBeInTheDocument(); |
There was a problem hiding this comment.
This newly added test fails on the current head: the missing-data branch renders 'No anniversary data available for this period.', not 'No anniversaries found'. Running all four new suites yields 5 passes / 1 failure. Please assert the intended empty-state message so the PR's regression tests pass.
vidiyala99
left a comment
There was a problem hiding this comment.
Tested fda8aa2 with backend OneCommunityGlobal/HGNRest#2358 (5fe7ffb) as Administrator, in light and dark mode, on /totalorgsummary against the dev data. Read-only. I compared every number with backend development, using the same date ranges.
What works:
- Date filtering: task counts now follow the selected range. For Jan 1 - Oct 5, 2026 the chart shows Assigned 40 / Completed 6 (from
tasksStats.raw.current = {assigned: 40, completed: 6}), and the Tasks Completed card shows 6. Ondevelopmentthe same range shows 1714 / 1275, which are all-time status counts that ignore the dates. - Range handling: Previous Week shows 0 / 0 for a week with no task activity, and the weekly trends endpoint now honors
start/end.
Issues:
-
Both bars render black (regression in this PR).
chartDatanow setscolor: index === 0 ? '#8e44ad' : '#3498db'(a string per bar), butTinyBarChartstill readsentry.color[index](<Cell fill={entry.color[index]} />). With a string, that picks single characters ('#'for Assigned,'8'for Completed), so neither is a valid color and both bars fall back to black. Ondevelopmentthe value was the array['#8e44ad', '#3498db'], which worked. In dark mode the black bars nearly disappear against the panel (screenshots 1 and 2). Please either passentry.colordirectly inTinyBarChartor keep the array. -
The Assigned bar has no label. The x-axis shows only "Completed"; the first bar is unlabeled in both themes, although the description says both labels show.
TinyBarChart's<XAxis dataKey="name" />has nointerval={0}, so recharts drops the first tick in this narrow card. Addinginterval={0}(the Y axis already has it) should show both. -
Export CSV is still broken. With the Jan 1 - Oct 5 range loaded, Export CSV alerts "No raw data available to export." and produces no file, as adit24dhaya reported on this head. The new
raw.currentis an object ({assigned, completed}), while the export still expects the old array. -
The percentages read oddly. Each bar's percentage is its share of assigned + completed (40 = 86.96%, 6 = 13.04%), which isn't a meaningful figure. A completion rate (completed / assigned = 15%) on the Completed bar, or no percentage, would be clearer.
-
Blue Square Stats goes empty with OneCommunityGlobal/HGNRest#2358. With the paired backend, the Blue Square card shows "No Blue Square data available for this period" (screenshot 3) because every category count comes back 0. Your frontend change to
BlueSquareStats.jsxis fine: with backenddevelopmentthe same page renders the donut with all categories (screenshot 4). Details are in my OneCommunityGlobal/HGNRest#2358 review.
Not tested: mobile layout.
Screenshot 1: Task Completed, black bars (light)
Screenshot 2: same, dark mode
Screenshot 3: Blue Square Stats with backend PR 2358
Screenshot 4: Blue Square Stats with backend development
|
iAbhi001
left a comment
There was a problem hiding this comment.
Tested locally with backend PR #2358 as Admin on /totalorgsummary across light and dark modes with dev data. Date filtering works as expected, updating task counts properly based on the selected range instead of falling back to all time numbers.
A few issues need fixing before this can land. Both chart bars render black because TinyBarChart indexes into a single color string with entry.color[index], breaking the fill; passing entry.color directly fixes it. The Assigned bar is missing its x axis label, which adding interval={0} to XAxis will resolve. Export CSV fails because it expects an array instead of the new raw.current object. The bar percentages calculate each bar against assigned plus completed, which reads confusingly compared to a standard completion rate. Lastly, the Blue Square card is empty due to zero counts returned by the paired backend, though the frontend logic works fine against development.
Requesting changes for the bar colors, x axis label, and CSV export.



Description
Related PRS (if any):
This frontend PR is related to the (OneCommunityGlobal/HGNRest#2358) backend PR.
Main changes explained:
-Added support for completed tasks identified by:
completedDatetime
terminal task statuses such as Completed, Closed, Complete, Done, and Finished
resources.completedTask
How to test:
npm run build
npm start
The Task Completed summary card displays the correct value.
The graph displays both Assigned and Completed labels.
Assigned and Completed values are separate.
The chart updates when the date-range filter changes.
The behavior works on desktop and mobile layouts.
Screenshots or videos of changes:
Screen.Recording.2026-09-18.at.11.37.59.mov