Skip to content

Purav fix PR promotion confirmation display box - #5499

Open
pixelpix13 wants to merge 2 commits into
developmentfrom
Purav_fix_pr_promotion_display_box
Open

Purav fix PR promotion confirmation display box#5499
pixelpix13 wants to merge 2 commits into
developmentfrom
Purav_fix_pr_promotion_display_box

Conversation

@pixelpix13

@pixelpix13 pixelpix13 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Description

Follow-up UI fixes for the PR promotion confirmation modal from PR 3727. Jae tested in Dev and found default checkboxes unselected, weekly PR counts not in VIBGYOR circles, and the column labeled Team Reviewer Name with quote placeholders instead of Team Leader Name.

This PR updates the confirmation box so every reviewer starts selected, weekly PR counts render in rainbow-colored circles, and the column is Team Leader Name with readable names. Confirm removes checked people from the pending list; Cancel closes with no change.

Fixes follow-up for PR 3727 (PRIORITY HIGH): add right title, color, and checkbox on the PR Review Team Analytics promotion display box.

Related PRS (if any):

Frontend follow-up to #3727
No paired backend PR.

Main changes explained:

  • src/components/PRPromotions/DisplayBox.jsx: Default-check all pending reviewers, rename column to Team Leader Name / Weekly PRs, render weekly counts in VIBGYOR circles, disable Confirm while confirming or when nothing is selected, toast success/error, remove confirmed rows from the pending list.
  • src/components/PRPromotions/DisplayBox.module.css: Clean VIBGYOR circle styles, visible checkboxes, dark mode contrast, and a responsive table layout.
  • src/components/PRPromotions/pendingPromotionReviewers.js: Sample pending-promotion reviewers. Confirmed sample ids are stored in browser localStorage so a refresh keeps them off the list.
  • src/components/PRPromotions/__tests__/DisplayBox.test.jsx: Coverage for default-checked boxes, titles, circles, Cancel, Confirm list updates, remount persistence, and empty remaining list.

How to test:

  1. Check out branch Purav_fix_pr_promotion_display_box on HighestGoodNetworkApp
  2. Run npm install if dependencies changed (they did not in this PR)
  3. Frontend: npm run start:localhttp://localhost:5173
  4. Clear site data/cache if the old modal still appears (this also clears localStorage and restores the full sample list)
  5. Log in as Admin — default dev admin: devadmin@hgn.net / DeveloperPassword100%!
  6. Go to http://localhost:5173/prPromotionsPage and click Promote ?
  7. Confirm the modal title is "Are you sure you want to promote these PR reviewers?"
  8. Confirm every row checkbox is selected by default, including Select All
  9. Confirm columns are PR Reviewer, Team Code, Team Leader Name, Weekly PRs (not Team Reviewer Name, not Weekly PR Counts)
  10. Confirm Team Leader Name shows names such as Chris Martinez / Sam Patel, not quotes
  11. Confirm weekly PR numbers sit inside filled VIBGYOR circles (violet, indigo, blue, green, yellow, orange, red)
  12. Uncheck one reviewer (for example Akshay - Jayaram) and click Confirm — that person stays; the checked people leave the table; a success toast appears
  13. Refresh the page and open Promote ? again — the people you confirmed should still be gone (localStorage). Unchecked people should still be there
  14. Click Cancel — modal closes with no further list change
  15. Uncheck Select All so no rows are selected — Confirm is disabled
  16. Also open the modal from the header Reports → PR Promotions item and repeat the default-checked + VIBGYOR checks
  17. Test roles: Volunteer (should not have this admin promotions path / should not be able to promote) and Admin (full modal)
  18. Verify dark mode: toggle dark mode, reopen the modal, confirm table text, checkboxes, circles, Cancel, and Confirm remain readable

Screenshots or videos of changes:

pr.5499_video.mp4
pr_5499_1 pr_5499_2 pr_5499_3

Note:

This is a frontend-only follow-up for Jae's three UI notes on PR 3727 (default checkboxes, VIBGYOR weekly PR circles, Team Leader Name).

Persistence / backend (important for reviewers):

  • The modal uses sample pending reviewers so the UI can be tested. It does not load the full /promotion-eligibility list.
  • Confirm does not save promotions on the backend for these sample rows. Sample ids such as pending-akshay are not real Mongo user ids, so POST /api/promote-members is not called (the API would 400).
  • After Confirm, the updated list is stored in browser localStorage (hgn.prPromotions.promotedReviewerIds). A refresh keeps confirmed people off the list on this browser only. Clearing site data restores the sample list.
  • To store promotions on the server later: put real reviewerIds from eligibility into the box, then Confirm can call POST /api/promote-members with { memberIds, requestor }, which sets role to Promoted Reviewer. Team code, team leader name, and live weekly PR history still need backend fields (/promotion-details/:id currently 404s for real user ids).

Jae merges; text Jae if this needs an urgent merge.

@netlify

netlify Bot commented Sep 3, 2026

Copy link
Copy Markdown

Deploy Preview for highestgoodnetwork-dev ready!

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

…torage and enhance dark mode styles for better visibility.
@sonarqubecloud

sonarqubecloud Bot commented Sep 3, 2026

Copy link
Copy Markdown

@iAbhi001
iAbhi001 self-requested a review September 6, 2026 02:23

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

All functional and visual test criteria have passed:
[x] Correct modal title displayed
[x] Default check on row checkboxes and master checkbox
[x] Columns labeled PR Reviewer, Team Code, Team Leader Name, and Weekly PRs
[x] Realistic leader names rendered without quotation marks
[x] VIBGYOR color spectrum applied to weekly PR badges
[x] Confirm removes selected users and shows success toast
[x] Unselected rows persist across page reload via localStorage
[x] Empty state reached after confirming all reviewers

Image image image

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