Skip to content

Reina create line graph chart for cost breakdown by expenditure#3458

Closed
ReinaT5678 wants to merge 14 commits into
developmentfrom
reina-create-line-graph-chart-for-cost-breakdown-by-expenditure
Closed

Reina create line graph chart for cost breakdown by expenditure#3458
ReinaT5678 wants to merge 14 commits into
developmentfrom
reina-create-line-graph-chart-for-cost-breakdown-by-expenditure

Conversation

@ReinaT5678

@ReinaT5678 ReinaT5678 commented May 1, 2025

Copy link
Copy Markdown
Contributor

Description

A frontend line graph chart that shows time in months (x-axis) and cost (y-axis) of projects. The chart can be filtered by projects and by date range.

The new PR for this task is: #3906

Related PRS (if any):

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

Main changes explained:

  • Added a new route to the page for the Expenditure Line Graph
  • "Cost Breakdown by Type of Expenditure" page shows a line graph generated by Chart.js showing projects related to plumbing, electrical, mechanical, and structural.
  • Component jsx file added as a simplified mini graph to fit in the weekly construction summary page.

How to test:

  1. check into current branch
  2. do npm install and npm run start:local to run this PR locally
  3. Clear site data/cache
  4. log as admin user
  5. go to http://localhost:3000/bmdashboard/ExpenditureLineGraph
  6. Check if graph renders some lines (these lines were generated by fake data, you can play around with this in MongoDB)
  7. Check if the filter work
  8. check light/dark mode

Screenshots or videos of changes:

Screen.Recording.2025-05-01.at.10.13.13.AM.mov

Note:

Include the information the reviewers need to know.

@netlify

netlify Bot commented May 1, 2025

Copy link
Copy Markdown

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit 6ac2087
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/688a6b95dccff40008969a86
😎 Deploy Preview https://deploy-preview-3458--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.

@nikhilpittala16 nikhilpittala16 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.

I have tested the PR and everything works as expected.
image

@strallia strallia added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label Jun 2, 2025
@1709abhishek 1709abhishek self-requested a review June 13, 2025 23:41
Comment thread src/components/BMDashboard/ExpenditureGraph/ExpenditureLineGraph.jsx Outdated
Comment thread src/components/BMDashboard/ExpenditureGraph/ExpenditureLineGraph.jsx Outdated
@Venk-rgb Venk-rgb self-assigned this Jun 27, 2025

@Venk-rgb Venk-rgb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested the PR in UI. Everything looks good in light mode. In dark mode, the x-axis, y-axis labels and the type of expenditure is not visible. Adding screen recording of the same.

Screen.Recording.2025-06-27.at.9.46.48.AM.mov

@ReinaT5678 ReinaT5678 requested a review from 1709abhishek June 27, 2025 22:58

@boppanapraveen boppanapraveen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I tried to create frontend line graph chart that shows time in months (x-axis) and cost (y-axis) of projects. But getting error like page not found.
#3458

@marcusyi1 marcusyi1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In the Expenditure Line Graph, the graph was working fine and the filters were working. However, when I tried to do the total constructions summary, the site itself crashed.

image image

@Deekshith010905

Copy link
Copy Markdown
Contributor

image
image
I encountered an error while reviewing this PR

@shashank-madan shashank-madan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Works as expected in light mode.

filters light_mode

In dark mode axis and legend labels are not visible.
dark_mode

Total construction summary gives error.
total_construction_summary

@1709abhishek 1709abhishek removed their request for review July 2, 2025 20:38

.dark-mode .project-filter,
.dark-mode .filter-group {
background-color: var (--card-bg);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There should be no space between var and (--card-bg).

@jaydeep138 jaydeep138 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The functionality is working as expected in Light Mode. However, in Dark Mode, the text, as well as the X and Y axis labels for both the filters and the graph, are not visible — likely due to missing or incorrect styling for dark backgrounds.

Additionally, when navigating to http://localhost:3000/bmdashboard/totalconstructionsummary, the application crashes and throws errors during page load. Please check for potential issues causing the crash on that route.
Screenshot 2025-07-02 at 17 25 12
Screenshot 2025-07-02 at 17 25 22
Screenshot 2025-07-02 at 17 25 33

@Charitha2009

Copy link
Copy Markdown
Contributor

Checked into the current branch and ran the app locally. The Expenditure Line Graph page loads, but the graph does not render any data, and filters have no effect.

The Total Construction Summary page fails to load due to a TypeError in WeeklyProjectSummaryHeader.jsx and shows a 404 error when fetching data.

Both pages need fixes before the PR can be approved.
Screenshot 2025-07-04 at 1 35 38 PM
Screenshot 2025-07-04 at 1 32 59 PM

@pranavgovi pranavgovi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Both in light and dark mode, I am facing these errors for the mentioned 2 URLs
Screenshot 2025-07-04 184425
Screenshot 2025-07-04 184342

@Varshakaranam18

Copy link
Copy Markdown

When checking out the 2 mentioned URLs , am facing these errors both in light and dark mode.
Screenshot 2025-07-04 183554
Screenshot 2025-07-04 183655
Screenshot 2025-07-04 183909

@vamsidharpanithi vamsidharpanithi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I encountered a 404 error on the /ExpenditureLineGraph page, and a TypeError related to projectFilter on the /totalconstructionsummary page due to undefined Redux state. Please find the screenshots attached below.

Screenshot 2025-07-06 at 7 24 17 PM Screenshot 2025-07-06 at 7 24 54 PM

@suparshwa31

Copy link
Copy Markdown
Contributor

I'm currently unable to fetch the data, and the projects dropdown appears to be uneditable or disabled.
Screenshot 2025-07-08 at 16 27 18

@naiduajaykumar naiduajaykumar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi Reina,

In the first change you made I can see a graph with filters like by date and by project,
-> when I filter by project name I don't see project name instead I see their Id's for a user it will difficult to filter.
-> When I switched to dark mode the dark mode is not applied to filters section and graph section though the titles are changed to white text.

In the second change when run the url I got error that related to "projectFilter" because of this the website got crashed.

PR-3458+1357-1 PR-3458+1357-2 PR-3458+1357-3 PR-3458+1357-4 PR-3458+1357-5

adithya-6101
adithya-6101 previously approved these changes Jul 15, 2025

@adithya-6101 adithya-6101 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested the PR thoroughly and everything works well now. The graph renders correctly, filters are working as expected, and both Light and Dark Mode are displaying properly — including the X and Y axis labels. Also confirmed that the issue on the /bmdashboard/totalconstructionsummary route is resolved, and the page no longer crashes. Approving this PR.

Screenshot 2025-07-15 144813 Screenshot 2025-07-15 144751 Screenshot 2025-07-15 145220

@Neeraj-Kondaveeti Neeraj-Kondaveeti left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested the PR locally. The page at /bmdashboard/ExpenditureLineGraph loads, but the graph doesn't render. I'm getting a 404 error when it tries to fetch the data, which suggests the backend endpoint may be missing or misconfigured. Let me know once it's fixed—happy to retest.

Screenshot 2025-07-15 at 4 08 48 PM

uhakruthi1
uhakruthi1 previously approved these changes Jul 16, 2025

@uhakruthi1 uhakruthi1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thoroughly tested the PR and everything functions correctly. The graph renders as expected, filters operate properly, and both Light and Dark Modes display correctly, including X and Y axis labels. Approving the PR.
Screenshot 2025-07-16 at 4 03 01 PM
Screenshot 2025-07-16 at 4 03 13 PM
Screenshot 2025-07-16 at 4 05 34 PM

@ReinaT5678 ReinaT5678 dismissed stale reviews from uhakruthi1 and adithya-6101 via a584543 July 16, 2025 20:50
Babu-kota
Babu-kota previously approved these changes Jul 18, 2025

@Babu-kota Babu-kota 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.

I tested the "Cost Breakdown by Type of Expenditure" line graph and confirmed that it renders correctly using the sample data. The time-series cost data displays properly on the x-axis (months) and y-axis (cost), and the graph is responsive in both light and dark modes. Filters for project and date range are working as expected.

graphs.mp4

shashankm9

This comment was marked as resolved.

shashankm9
shashankm9 previously approved these changes Jul 20, 2025

@shashankm9 shashankm9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have tested this PR, Everything works as expected. Graph looks good with different colors and all the texts are clear and legible in dark mode as well. Good job.

PR.3458.mp4

@gurusaichittoji7

Copy link
Copy Markdown

I checked out the current branch, installed dependencies, and started the app locally. Cleared cache and logged in as an admin. Navigated to /bmdashboard/ExpenditureLineGraph and verified the graph renders with data (using dummy data from MongoDB). Confirmed filter functionality and verified the UI in both light and dark modes. Encountered a 404 Error: Error fetching data — needs backend/API check.
Screenshot 2025-07-22 131001
Screenshot 2025-07-22 131414
Screenshot 2025-07-22 131911

@ReinaT5678 ReinaT5678 dismissed stale reviews from shashankm9 and Babu-kota via 1bf8efb July 25, 2025 16:31

@harshavarma29 harshavarma29 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have tested the PR in the local environment using admin credentials. Working well for positive scenarios, such as selecting different date ranges and projects, as shown below:

Different date ranges and projects:

positive-scenarios.mp4

However, the following negative scenarios are not handled as expected:
1) Selecting the same date:
When selecting the same start and end date, the expenditure information is displayed as a dot instead of a line.

same-date-issue

2) Start date greater than end date / Date ranges with no data:
No error message is shown in the following cases. It would be great if you could add relevant error messages.

i) Start date is greater than end date:

start-date-gt-end-date

ii) Date ranges with no data:

no-data-error

@ShravyaKudlu ShravyaKudlu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested in dark and light mode and clicked on all buttons, everything seams to be working as expected
Screenshot from 2025-08-01 00-26-11

@kanishkagarwal6101 kanishkagarwal6101 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am seeing error in fetching the graph when i go to the page. Will re-review this later.
Screenshot 2025-08-04 at 1 10 57 PM

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 High Priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.