Skip to content

Adithya Refactor main dashboard to display real data#4538

Merged
one-community merged 6 commits intodevelopmentfrom
adithya_dashboard_refactor_realtime_data
Mar 22, 2026
Merged

Adithya Refactor main dashboard to display real data#4538
one-community merged 6 commits intodevelopmentfrom
adithya_dashboard_refactor_realtime_data

Conversation

@adithya-6101
Copy link
Copy Markdown
Contributor

@adithya-6101 adithya-6101 commented Dec 10, 2025

Description

Implements # Phase 2: Refactor the main dashboard component to display real-time data instead of static placeholders.

This PR replaces the hardcoded "DummyData" in the Project Dashboard with live data fetched directly from the database. It integrates the bmProjectMembers and allTeams Redux states to provide a real-time view of members currently working on specific buildings, resolving the "No Team" display issue caused by inconsistent backend data population.

image

Related PRs (if any):

  • This PR is a standalone frontend refactor.
  • Related to my other PR: Adithya_Fix_Edit_Existing_Team_Button.

Main changes explained:

  • ProjectDetails.jsx: Implemented a lifecycle safety check in useEffect to re-fetch the project list if the Redux store is empty (e.g., on a hard refresh), preventing the "Project Not Found" crash.
  • ProjectLog.jsx:
    • Created a robust findTeamNameForUser helper function to handle inconsistent User ID formats.
    • Replaced the static DummyData array with dynamic mapping of the bmProjectMembers Redux state.
    • Integrated conditional rendering to handle "Loading..." and "No active members found" states.

How to test:

  1. Checkout this branch: adithya_dashboard_refactor_realtime_data.
  2. Run npm install and start the application locally.
  3. Log in as an Admin or Building Manager.
  4. Navigate to BM Dashboard $\rightarrow$ Projects. http://localhost:5173/bmdashboard
  5. Select a project (e.g., "Commercial Test - Project").
  6. Verify Data Integration: Ensure the "Members working on site today" table displays real names and IDs instead of dummy placeholders.
  7. Verify Team Mapping: Confirm that members are correctly mapped to their teams (e.g., Harshida's Test Team or Vishala_PR_Test_Team) rather than showing "No Team".
  8. Verify that the table renders correctly in Dark Mode.

Screenshots or videos of changes:

Previously:
image

My changes:
Realtime Data from Db

@adithya-6101 adithya-6101 added the do not review Do not review or look at code without full context label Dec 10, 2025
@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 10, 2025

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit 64f9c60
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/69c038f7824b340008d6e3df
😎 Deploy Preview https://deploy-preview-4538--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.

@adithya-6101 adithya-6101 changed the title feat: initial commit Adithya Refactor main dashboard to display real data Dec 10, 2025
@sonarqubecloud
Copy link
Copy Markdown

@adithya-6101 adithya-6101 removed the do not review Do not review or look at code without full context label Dec 25, 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 Mar 21, 2026
Copy link
Copy Markdown

@rohanrastogi311 rohanrastogi311 left a comment

Choose a reason for hiding this comment

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

Hi Adithya,

Well done with this implementation

Image

.

@sonarqubecloud
Copy link
Copy Markdown

@one-community one-community merged commit 72b6b47 into development Mar 22, 2026
10 checks passed
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.

3 participants