Skip to content

sai teja loss tracking line graph#5016

Open
saitejakaasoju wants to merge 23 commits intodevelopmentfrom
SaiTeja_loss_tracking_line_graph
Open

sai teja loss tracking line graph#5016
saitejakaasoju wants to merge 23 commits intodevelopmentfrom
SaiTeja_loss_tracking_line_graph

Conversation

@saitejakaasoju
Copy link
Copy Markdown
Contributor

Description

Implements #3876 (WBS - Loss Tracking Line Graph for BM Dashboard Weekly Project Summary)

Implements a fully functional Loss Tracking
Line Chart with filters, dark mode, date range validation, and reset functionality.

Related PRS (if any):

This frontend PR is related to the #XXX backend PR.
To test this backend PR you need to checkout the #XXX frontend PR.

Main changes explained:

  • Create LossTrackingLineChart.jsx — Recharts line chart with 9 lines (Metal/Plastic/Glass × 2022/2023/2024), Material filter, Year filter, Start/End date range filter, Reset Filters button, date range validation error message, and full dark mode support via CSS custom properties
  • Create LossTrackingLineChart.module.css — CSS token system with :root light theme and .darkMode overrides
  • Update WeeklyProjectSummary.jsx — add LossTrackingLineChart to "Loss Tracking" accordion section; add useEffect to fix page scroll blocked by stale Vite CSS
  • Update WeeklyProjectSummary.module.css — fix .financial-big card overflow: hiddenvisible so chart is not clipped
  • Update App.module.css

How to test:

  1. check into current branch
  2. do npm install and ... to run this PR locally
  3. Clear site data/cache
  4. log as admin user
  5. Go to BM Dashboard → Total Construction Summary
  6. Scroll down and click "Loss Tracking ∨" to expand the section
  7. Verify the line chart renders with 9 colored lines (Metal/Plastic/Glass × 2022/2023/2024)
  8. Verify all filter features:
    • Change Material dropdown → only lines for that material appear
    • Change Year dropdown → only lines for that year appear
    • Set Start Date and End Date → chart updates to that month range
    • Set Start Date after End Date → red validation error appears below filters
    • Click Reset Filters → all filters return to "All" and button disables
  9. verify this new feature works in dark mode

Screenshots or videos of changes:

Screen.Recording.2026-03-18.at.3.38.31.PM.mov

Note:

Include the information the reviewers need to know.

karnati007 and others added 13 commits August 7, 2025 06:27
Resolved merge conflicts in:
- WeeklyProjectSummary.jsx: kept LossTrackingLineChart import + new imports from development (SupplierPerformanceGraph, DistributionLaborHours)
- package.json: adopted development's husky v9 and jest-environment-jsdom
- yarn.lock: accepted development version
- Fixed ESLint warnings for console.error and alert in PDF catch block

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fixes from PR #3876 review + code improvements:

1. Critical bug fix: mergedData key was `line.year` (number) but <Line
   dataKey> expected `${line.year}-${line.material}` — multiple materials
   of the same year were silently overwriting each other in the chart data.

2. Wrap mergedData/chartData computation in useMemo (deps: filteredLines,
   startDate, endDate) to avoid unnecessary recalculation on every render.

3. Expanded color palette to support 9 year-material combinations:
   Teal shades for 2022, Pink shades for 2023, Yellow/Orange for 2024.

4. Expanded mock rawData to include all 3 materials (Metal, Plastic, Glass)
   for each of the 3 years (2022-2024), giving 9 distinct lines.

5. Moved date-range validation error message out of the <label> element
   and added .dateRangeError CSS class (grid-column: 1 / -1 for full width).

6. Applied Prettier formatting (auto-fixed via eslint --fix).

All dark mode axis/tick colors already handled via dynamic textColor;
Reset Filters button visibility handled via CSS module variables.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- App.module.css: force overflow-y: auto on html/body (overrides stale
  Vite-cached 'overflow: hidden' rule from NotFoundPage styles); change
  #root from height:100%/overflow-y:hidden to min-height:100%/auto
- WeeklyProjectSummary.jsx: add useEffect that sets inline
  overflowY:'auto' on body/html on mount, restoring original on unmount;
  inline styles beat all stylesheets and guarantee scrollability
- WeeklyProjectSummary.module.css: change .financial-big card overflow
  from hidden to visible so the LossTrackingLineChart is not clipped

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Resolved missing peer packages (antd, libphonenumber-js, react-calendar,
react-tagcloud, @tanstack/react-query) that were in package.json but not
installed, causing Vite to error on startup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 18, 2026

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit 8de602c
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/69e9b191441cfa0008994a7d
😎 Deploy Preview https://deploy-preview-5016--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@saitejakaasoju saitejakaasoju changed the title Sai teja loss tracking line graph sai teja loss tracking line graph Mar 18, 2026
@saitejakaasoju saitejakaasoju added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label Mar 31, 2026
Copy link
Copy Markdown

@HemanthNidamanuru HemanthNidamanuru left a comment

Choose a reason for hiding this comment

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

Hi Sai Teja,

I have reviewed your PR locally. The line chart renders correctly with all 9 lines and all filter features are working as expected.

However, I noticed one issue:

  1. The calendar and calendar icon are not styled correctly in dark mode.
Image Image Image Image Image

@Nirali164
Copy link
Copy Markdown

Hello Sai Teja,

I have used the branch locally and tested it.
It seems to be working fine for me.

  1. Just one thing highlights the calendar icon in Dark mode
  2. Time(Months) is too close to the year and material.
Screenshot 2026-04-07 at 9 17 45 PM Screenshot 2026-04-07 at 9 14 50 PM Screenshot 2026-04-07 at 9 14 24 PM Screenshot 2026-04-07 at 9 13 49 PM Screenshot 2026-04-07 at 9 13 35 PM Screenshot 2026-04-07 at 9 12 37 PM Screenshot 2026-04-07 at 9 11 39 PM

Copy link
Copy Markdown

@Anusha-Gali Anusha-Gali left a comment

Choose a reason for hiding this comment

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

Hi Sai Teja,

I have reviewed your PR locally and all features work as per requirement. Please update the calendar icon as well as calendar to adapt to dark mode.
Issue
Image
Working Screenshots
Image
Image
Image
Image
Image
Image

@saitejakaasoju
Copy link
Copy Markdown
Contributor Author

Hi Sai Teja,

I have reviewed your PR locally. The line chart renders correctly with all 9 lines and all filter features are working as expected.

However, I noticed one issue:

  1. The calendar and calendar icon are not styled correctly in dark mode.

Image Image Image Image Image

@saitejakaasoju
Copy link
Copy Markdown
Contributor Author

Addressed the dark mode styling issue in the Loss Tracking chart’s Start Date / End Date month picker, including the calendar icon.

Copy link
Copy Markdown

@Anusha-Gali Anusha-Gali left a comment

Choose a reason for hiding this comment

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

Hi Teja,

I reviewed your PR again after pulling all the changes, however the issue of calendar icon and the calendar itself being in light mode in dark mode does not appear to be fixed and also some other reviewer's point - Time(months) is too close to the years also does not appear to be fixed.

Image Image

@saitejakaasoju
Copy link
Copy Markdown
Contributor Author

Updated based on the review comments.

Fixed the dark mode styling for the month picker and adjusted the chart layout so “Time (months)” no longer overlaps the legend. I retested the Loss Tracking Line Chart in dark mode and verified both issues are resolved.
Screenshot 2026-04-21 at 2 15 52 PM

@sonarqubecloud
Copy link
Copy Markdown

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