Skip to content

Sayali: resolve duplicate badge assignment and fix checkbox display for existing badges in dark mode#5223

Open
sayali-2308 wants to merge 1 commit into
developmentfrom
fix/badge-assign-duplicate
Open

Sayali: resolve duplicate badge assignment and fix checkbox display for existing badges in dark mode#5223
sayali-2308 wants to merge 1 commit into
developmentfrom
fix/badge-assign-duplicate

Conversation

@sayali-2308
Copy link
Copy Markdown
Contributor

@sayali-2308 sayali-2308 commented May 1, 2026

image

Description

Fixes #3237 (Priority Medium)

Main changes explained:

  • Fixed returnUpdatedBadgesCollectionSingleUser in badgeManagement.js to use immutable approach preventing duplicate entries on all existing badges when a new badge is assigned
  • Fixed broken e.target hyperlink in AssignTableRow.jsx
  • Fixed propExistBadges prop name mismatch in UserProfile/AssignBadgePopup.jsx
  • Fixed isSelected logic so existing badges show as checked when modal opens
  • Prevented existing badges from being re-assigned accidentally
  • Fixed dark mode dropdown date text color in BadgeReport.jsx

How to test:

  1. Check out branch
  2. npm install and npm run start:local
  3. Clear cache, log in as admin
  4. Navigate to any User Profile
  5. Click "Assign Badges" — verify existing badges show as checked
  6. Select a new badge and click Confirm
  7. Click "Select Featured" — verify existing badges did NOT get duplicated
  8. Verify newly assigned badge appears with count 1
  9. Verify dark mode works correctly including dates dropdown

Screenshots:

image image image image

Note:

This PR finishes the work started in PR #3237 from scratch with a cleaner fix.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 1, 2026

Deploy Preview for highestgoodnetwork-dev ready!

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

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 1, 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 Sayali,

I tested this PR lPR locally but was unable to assign badges as the page keeps showing repeated "It was not possible to retrieve the team codes" error toasts on load when clicked on the profile of a user. Please fix this.

Image

@sayali-2308
Copy link
Copy Markdown
Contributor Author

Hi @HemanthNidamanuru , I tested locally and the badge assignment is working correctly on my end with no team codes errors. The 'retrieve team codes' toast is unrelated to this PR it comes from fetchTeamCodeAllUsers calling the WEEKLY_SUMMARIES_TEAM_CODES backend endpoint. Please ensure your backend is running on port 4500 with npm run build then npm start and try again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants