Skip to content

Comments

Mani shashank; fix/BM Dashboard Financials Tracking, Cost-prediction#4193

Open
shashankm9 wants to merge 9 commits intodevelopmentfrom
fix/bm-expenditure-charts
Open

Mani shashank; fix/BM Dashboard Financials Tracking, Cost-prediction#4193
shashankm9 wants to merge 9 commits intodevelopmentfrom
fix/bm-expenditure-charts

Conversation

@shashankm9
Copy link
Contributor

@shashankm9 shashankm9 commented Oct 10, 2025

Description

This PR restores the missing Financials Tracking functionality in the BM Dashboard that was showing "Failed to load projects" error. The expenditure pie charts and cost prediction features are now fully functional with proper authentication and CSS modules implementation.
image

Related PRS (if any):

This frontend PR is related to the #1797 backend PR.

Main changes explained:

  • Restore FinancialsTrackingCard component: Fixed missing expenditure project loading with proper httpService authentication
  • Update ExpenditureChart component: Replaced direct axios calls with httpService for authenticated requests to /api/bm/expenditure/:projectId/pie
  • Convert CostPredictionPage.css to module.css: Migrated from global CSS to CSS modules following team standards, renamed classes to camelCase
  • Update WeeklyProjectSummary: Integrated FinancialsTrackingCard component in the Financials Tracking section

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. Navigate to BM Dashboard → Weekly Project Summary(http://localhost:5173/bmdashboard/totalconstructionsummary) → Financials Tracking section → Actual expenditure/Planned expenditure(Pie charts only)
  6. Verify that:
  • Project dropdown loads without "Failed to load projects" error
  • Actual Expenditure pie chart displays with Labor/Equipment/Materials breakdown
  • Planned Expenditure pie chart displays with proper percentages
  • Cost prediction charts render correctly
  1. Test the standalone cost prediction page at http://localhost:5173/bmdashboard/cost-prediction
  2. Verify functionality works in [dark mode]

Screenshots or videos of changes:

Recording.2025-10-09.215401.mp4

Note:

@netlify
Copy link

netlify bot commented Oct 10, 2025

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit 9d6eb93
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/699e9f78082431000889311b
😎 Deploy Preview https://deploy-preview-4193--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.

@shashankm9 shashankm9 changed the title Mani shashank; BM Dashboard: fix Financials Tracking, Cost-prediction Mani shashank; fix/BM Dashboard Financials Tracking, Cost-prediction Oct 10, 2025
@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 Nov 5, 2025
@Sriamshreddy000
Copy link
Contributor

Hi Mani Shashank,
Tested this PR along with the related backend PR. The app fails to load due to a duplicate import declaration in routes.jsx, showing the error “Identifier 'RentalChart' has already been declared.”

I’m attaching a screenshot below for reference.
Screenshot 2025-11-11 at 6 02 09 PM

Copy link

@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 Mani Shashank,

I have reviewed your PR locally and have identified many issues. I have mentioned them here as well as attached screenshots for each.

  1. Duplicate imports is causing the code to not run. Upon commenting them myself i was able to test the code but i suppose this should not be the case
  2. In the light mode and dark mode - In Labor and Time Tracking - In Distribution of Labor Hours pie chart, upon selection any item and clicking on submit, the page reloads and all steps are lost.
  3. In the light mode and dark mode - In Financial Tracking - The pie chart fail to load.
  4. The UI of the titles and subtitles is not visible in Dark Mode.

Issue 1. Duplicate imports is causing the code to not run. Upon commenting them myself i was able to test the code but i suppose this should not be the case
Screenshot 2025-11-14 at 12 11 46 AM

Screenshot 2025-11-14 at 12 11 51 AM Screenshot 2025-11-14 at 12 12 01 AM Screenshot 2025-11-14 at 12 12 06 AM Screenshot 2025-11-14 at 12 12 20 AM Screenshot 2025-11-14 at 12 12 57 AM

Issue 2: In the light mode and dark mode - In Labor and Time Tracking - In Distribution of Labor Hours pie chart, upon selection any item and clicking on submit, the page reloads and all steps are lost.

4194.mp4

Issue 3: In the light mode and dark mode - In Financial Tracking - The pie chart fail to load.
Screenshot 2025-11-13 at 11 59 04 PM

** Issue 2,3,4: The UI of the titles and subtitles is not visible in Dark Mode.**
Screenshot 2025-11-14 at 12 00 39 AM

Screenshot 2025-11-14 at 12 00 42 AM

Positive Scenario
Screenshot 2025-11-13 at 11 59 45 PM

Screenshot 2025-11-14 at 12 00 21 AM

Copy link
Contributor

@bhanuanishakkineni bhanuanishakkineni left a comment

Choose a reason for hiding this comment

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

Hello Shashank,
I have reviewed the PR and tested it. While running the frontend app, I encountered errors due to redundant import statements in router.jsx.
image

After I commented out those import statements in router.jsx and tried to re-run the app, it worked.
In the totalconstructionsummary page, the pie charts - Actual expenditure and Planned Expenditure were displayed and the projects drop down is working fine. Cost prediction charts rendered correctly.
First issue with this is the page is not responsive. In the smaller screens (mobile screen) only pie charts are visible and rest of the charts are going out of the screen and are not visible at all. Second issue is that some text is not visible or readable in dark mode. Change the text color so that it will be visible during dark mode.
In cost-prediction, the planned vs actual costs tracking plot is working fine and is responsive in both light and dark mode.

PR.4193+.1797.testing-1.mp4

@SwathiAngadi
Copy link
Contributor

Hi Mani Shashank ,

I reviewed your PR.
There were many duplication error in the route.js file after commenting the necessary lines UI loaded. But couldn't see Pie charts under Financial Tracking section. Got 'Failed to load projects' error. In Dark mode UI is breaking like couldn't see body and title were still black color.
Cost-prediction page is working fine. Able to see all the data in the graph upon selection. And UI is responsive too.

Screenshot 2025-12-10 190912 Screenshot 2025-12-10 190954

Copy link

@Shravan-neelamsetty Shravan-neelamsetty left a comment

Choose a reason for hiding this comment

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

Hi Mani Shashank, I tested this PR locally after fixing the duplicate imports in src/routes.jsx by commenting out lines 149-167. I navigated to /bmdashboard/totalconstructionsummary and tested both the "Labor and Time Tracking" and "Financials Tracking" sections. The Labor and Time Tracking section works properly in light mode with the Distribution of Labor Hours pie chart and Paid Labor Cost bar chart displaying correctly with all filters functioning. The Planned vs Actual Costs Tracking line chart in the Financials Tracking section also renders correctly with Labor Cost and Materials Cost filters working as expected. However, I noticed a dark mode visibility issue: the section titles "Distribution of Labor Hours" and "Paid Labor Cost" are not clearly visible in dark mode, making it difficult to read the headers. The pie charts in the left side of Financials Tracking still show "Failed to load projects" error.
Screenshot 2026-01-13 at 3 39 41 PM
Screenshot 2026-01-13 at 3 39 50 PM
Screenshot 2026-01-13 at 3 40 17 PM
Screenshot 2026-01-13 at 3 40 33 PM
Screenshot 2026-01-13 at 3 43 27 PM
Screenshot 2026-01-13 at 3 43 39 PM

Copy link

@Vikas-8055 Vikas-8055 left a comment

Choose a reason for hiding this comment

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

Hi Mani Shashank, Tested this PR locally. Labor and Time Tracking section works as expected. Planned vs Actual Costs chart renders correctly. Issues,Financials Tracking pie charts show "Failed to load projects" error.

Screenshot 2026-01-16 at 1 03 08 AM Screenshot 2026-01-16 at 1 02 18 AM

@abhinav-TB
Copy link
Member

Hi Mani, I have tested this PR locally and have got the following error
image

Copy link

@Ganesh112001 Ganesh112001 left a comment

Choose a reason for hiding this comment

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

I attempted to test PR #4193, which restores the Financials Tracking functionality in the BM Dashboard by fixing the "Failed to load projects" error and implementing expenditure pie charts. After checking out both the frontend branch (fix/bm-expenditure-charts) and backend branch (fix/bm-expenditure-api), I encountered build errors that prevented the frontend dev server from starting. The build fails with "Transform failed with 13 errors" due to duplicate identifier declarations in src/routes.jsx, where symbols RentalChart, CreateNewTeam, CPProtectedRoute, CPLogin, CPDashboard, and EventParticipation are imported or declared multiple times on lines 149, 150, 152, 155, 156, and 165. These duplicate declarations cause compilation errors that block the application from running. The code issues need to be resolved before testing can proceed.

Screenshot 2026-01-24 at 3 13 34 AM

@maithili20
Copy link

maithili20 commented Feb 6, 2026

Hi @shashankm9
Reviewed your PR and tested it in both light and dark modes.
There is an issue of duplicate imports. fixed that locally and reviewed.
Screenshot 2026-02-06 at 6 00 47 PM

Cost Prediction: Working correctly in both modes (video review attached).

Untitled.mp4

Total Construction Summary: Not working—shows “Failed to load projects” (screenshots attached).
Dark mode UI: Some headings/text are not visible due to contrast issues.
Screenshot 2026-02-06 at 6 11 35 PM
Screenshot 2026-02-06 at 6 10 46 PM

- Created FinancialsTrackingCard component with project dropdown
- Created ExpenditureChart component with Actual/Planned pie charts
- Added mock data from MongoDB expenditurePie collection
- Implemented dark mode support and responsive design
- Fixed legend overflow and dropdown visibility issues
- Fixed Cost Prediction chart line connectivity with connectNulls prop
@shashankm9 shashankm9 force-pushed the fix/bm-expenditure-charts branch from 4dcb691 to 9bca7ea Compare February 9, 2026 07:32
@OneCommunityGlobal OneCommunityGlobal deleted a comment from sonarqubecloud bot Feb 12, 2026
Anusha-Gali
Anusha-Gali previously approved these changes Feb 13, 2026
Copy link

@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 Mani Shashank,

I have re-reviewed your PR locally and it works as per requirement and both the charts load.

Image Image Image Image

@sonarqubecloud
Copy link

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.