Skip to content

Taariq: Fix filterColor persistence issue on change and refresh for Individual as well as bulk Selected filterColors Backend.#1667

Merged
one-community merged 25 commits intodevelopmentfrom
taariq_fixing_angads_filter_branch_backend
Jan 23, 2026
Merged

Taariq: Fix filterColor persistence issue on change and refresh for Individual as well as bulk Selected filterColors Backend.#1667
one-community merged 25 commits intodevelopmentfrom
taariq_fixing_angads_filter_branch_backend

Conversation

@TaariqMansurie
Copy link
Copy Markdown
Contributor

Description

This PR addresses issues in the filterColor handling and bulk updates within user profiles. Previously, filterColor updates were not consistently applied across bulk operations, leading to mismatches between frontend UI state and backend data.

Related PRS (if any):

This backend PR is related to the frontend PR 3916. Please checkout both the PR's while testing it on your local.

Main changes explained:

  • src/controllers/userProfileController.js → Updated controller logic to correctly handle bulk filterColor updates and ensure validation of color arrays.
  • src/routes/userProfileRouter.js → Exposed new/updated route for bulk filterColor updates.
  • src/models/userProfile.js → Adjusted schema (and validation rules) for filterColor to ensure consistent persistence and prevent invalid color entries.
  • src/helpers/reportHelper.js → Improved helper functions to recalculate and reflect updated filterColor states when fetching reports.

How to test:

  1. Checkout into this backend branch.
  2. Run npm install and npm run dev to start the backend server.
  3. Clear DB cache/site data.
  4. On the frontend, log in as an admin user.
  5. Follow the steps to test given in the frontend PR.
  6. Check mongo db compass for the updations.
  7. Verify that updated filterColor values persist across refreshes and match frontend behavior.

Screenshots or videos of changes:

  • Video uploaded in the Frontend PR.

Note:

Only the above files were changed by me, rest other files were fetched from the origin as I was behind several commits from the development branch.

Copy link
Copy Markdown

@sourabhbagde sourabhbagde left a comment

Choose a reason for hiding this comment

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

Blocking to Test
Error: ReferenceError: dashboardMetrics is not defined. at runtime.
Root Cause: dashboardMetrics is referenced in src/startup/routes.js (passed into bmDashboardPrototypeRouter) even though the both src/models/bmdashboard/dashboardMetrics.js and src/routes/bmdashboard/bmDashboardPrototypeRouter.js were removed in this PR and are not defined.

Attaching screenshots - please refer and let me know if I am missing anything here.

PR 1667 (2) PR 1667 (1)

@TaariqMansurie TaariqMansurie added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label Sep 3, 2025
Copy link
Copy Markdown
Contributor

@akshith312 akshith312 left a comment

Choose a reason for hiding this comment

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

Provided Feedback in the corresponding FE PR 3916

Copy link
Copy Markdown
Contributor

@RitzzzZ2021 RitzzzZ2021 left a comment

Choose a reason for hiding this comment

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

The update in backend doesn't seem to work. See screenshots and more details in the corresponding frontend PR #3916

@sanjeev29
Copy link
Copy Markdown

sanjeev29 commented Oct 10, 2025

Tested the related frontend PR-3916 for this branch. The changes work as expected.

@apoorvajainrp21
Copy link
Copy Markdown
Contributor

Update does not seem to be functioning as expected. I have provided details in the corresponding #3916 comments.

@tomkkl
Copy link
Copy Markdown

tomkkl commented Oct 26, 2025

Tested the related frontend PR-3916 and its working as expected.

@ManeeshBuddha21
Copy link
Copy Markdown

Tested with frontend PR #3916 , backend changes work correctly for filter color updates and persistence.

@Vinay944924
Copy link
Copy Markdown

Hi Taariq,
I tested the PR locally and provided the feedback in the FrontEnd PR- 3916

Copy link
Copy Markdown

@Sriamshreddy000 Sriamshreddy000 left a comment

Choose a reason for hiding this comment

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

Tested this PR along with the related frontend PR #3916.
Verified via browser console that the filterColor updates are correctly sent to and persisted by the backend.
Everything is working as expected, left detailed notes and screenshots in the frontend PR.

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 Taariq,

I tested the PR locally and provided the feedback in the FrontEnd PR: OneCommunityGlobal/HighestGoodNetworkApp#3916 (review)

@one-community
Copy link
Copy Markdown
Member

Thank you all, merging!

@one-community one-community merged commit 3ef49b3 into development Jan 23, 2026
2 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.