Skip to content

Roshini - Fix Task Completed Data Not Populating Across - #5567

Open
roshini1212 wants to merge 3 commits into
developmentfrom
Roshini_Seelamsetty_Fix-Task-Completed-Data-Not-Populating-Across
Open

roshini1212 wants to merge 3 commits into
developmentfrom
Roshini_Seelamsetty_Fix-Task-Completed-Data-Not-Populating-Across

Conversation

@roshini1212

Copy link
Copy Markdown
Contributor

Description

Screenshot 2026-09-19 at 10 30 11 Screenshot 2026-09-19 at 10 30 48

Related PRS (if any):

This frontend PR is related to the (OneCommunityGlobal/HGNRest#2358) backend PR.

Main changes explained:

  • Updated task statistics aggregation to calculate Assigned and Completed task counts independently.
    -Added support for completed tasks identified by:
    completedDatetime
    terminal task statuses such as Completed, Closed, Complete, Done, and Finished
    resources.completedTask
  • Updated the weekly task trends endpoint to honor the selected start and end dates.
  • Added assigned and completed values to weekly chart responses.
  • Updated the task summary endpoint to use the same completion rules as the graph.
  • Normalized dashboard date ranges using the America/Los_Angeles timezone.
  • Preserved the existing YYYY-MM-DD date format for time-entry queries.
  • Added regression tests covering assigned/completed counts, date filtering, and comparison periods.

How to test:

  1. Checkout the backend branch
  2. Do npm install
    npm run build
    npm start
  3. Checkout the related frontend PR
  4. Clear browser site data/cache.
  5. Log in as a Manager, Admin, or Tester.
  6. Navigate to: Dashboard → Total Org Summary
  7. Verify that:
    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

@netlify

netlify Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit 8fbfd58
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/6acb0927f394f70008206701
😎 Deploy Preview https://deploy-preview-5567--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@iAbhi001
iAbhi001 self-requested a review September 27, 2026 03:37
@one-community one-community added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label Sep 27, 2026
@one-community one-community changed the title Fix Task Completed Data Not Populating Across Roshini - Fix Task Completed Data Not Populating Across Sep 27, 2026

@adit24dhaya adit24dhaya left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

report-contract-evidence

};

// --- Export CSV helper ---
const exportCSV = () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 vidiyala99 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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. On development the 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:

  1. Both bars render black (regression in this PR). chartData now sets color: index === 0 ? '#8e44ad' : '#3498db' (a string per bar), but TinyBarChart still reads entry.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. On development the 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 pass entry.color directly in TinyBarChart or keep the array.

  2. 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 no interval={0}, so recharts drops the first tick in this narrow card. Adding interval={0} (the Y axis already has it) should show both.

  3. 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.current is an object ({assigned, completed}), while the export still expects the old array.

  4. 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.

  5. 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.jsx is fine: with backend development the 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)

Image

Screenshot 2: same, dark mode

Image

Screenshot 3: Blue Square Stats with backend PR 2358

Image

Screenshot 4: Blue Square Stats with backend development

Image

@sonarqubecloud

Copy link
Copy Markdown

@iAbhi001 iAbhi001 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants