Skip to content

Yu Yan - feat: add blue square manual assignment tracking#5062

Merged
yany960 merged 2 commits intodevelopmentfrom
yan_blue_square_manual_assignment_fe
Apr 13, 2026
Merged

Yu Yan - feat: add blue square manual assignment tracking#5062
yany960 merged 2 commits intodevelopmentfrom
yan_blue_square_manual_assignment_fe

Conversation

@yany960
Copy link
Copy Markdown
Contributor

@yany960 yany960 commented Mar 25, 2026

THIS IS A REDO OF PR #3424

Description

image image

This PR implements the frontend functionality for tracking blue square manual assignments.

Related PRs (if any):

Main changes explained:

  1. UserProfile.jsx:

    • Updated modifyBlueSquares function to pass manullyAssigned: true and manullyAssignedBy (current user ID) when adding a blue square
    • Updated edit logic to pass editedBy (current user ID) when updating a blue square
  2. UserProfileModal.jsx:

    • Added "Manual Assignment" section to display when a blue square was manually assigned
    • Shows the assigner's name (firstName + lastName)
    • Added "Edited By" section showing the last editor and edit date
    • Applied to both modBlueSquare and viewBlueSquare modal types

How to test:

  1. Check into this branch
  2. Run npm install to ensure all dependencies are installed
  3. Clear site data/cache
  4. Log in as admin/owner user
  5. Ensure backend from PR Yu Yan - feat: add reasons array to infringements in user profile (resolves #1686, #1817) HGNRest#2106 is running
  6. Navigate to "View Profile" of any user
  7. Click the "+" icon to manually assign a blue square
  8. After assigning, verify in MongoDB under userProfiles → infringements:
    • manullyAssigned should be true
    • manullyAssignedBy should contain your user _id
  9. Click the blue square to view it - should show "Manual Assignment" section with your name
  10. Edit the blue square and confirm:
    • Changes are reflected correctly in the frontend
    • editedBy is updated in the MongoDB document
    • "Edited By" section shows in the modal

Highly Recommended Test:

  • Use your Admin/Owner account to assign a blue square to a different user
  • Then log in with a different Admin/Owner account and edit the blue square
  • Verify that manullyAssignedBy and editedBy fields are properly tracked with correct user IDs

Screenshots:

The modal now displays:

  • Manual Assignment section showing who assigned the blue square
  • Edited By section showing the last editor and date

Note:

The field name manullyAssigned (single 'l') matches the backend schema spelling.

Checklist:

  • The PR has a clear description
  • The PR follows the style guidelines
  • I have performed a self-review of my own code
  • The changes generate no new warnings

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 25, 2026

Deploy Preview for highestgoodnetwork-dev ready!

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

@yany960 yany960 force-pushed the yan_blue_square_manual_assignment_fe branch 2 times, most recently from f84babc to a0ee1c9 Compare March 26, 2026 00:44
- Add manullyAssigned and manullyAssignedBy fields when adding blue squares
- Pass editedBy field when updating blue squares
- Display 'Manual Assignment' section in blue square modal
- Display 'Edited By' information with last editor and date
- Extract BlueSquareMetadata component to avoid code duplication
@yany960 yany960 force-pushed the yan_blue_square_manual_assignment_fe branch from a0ee1c9 to 595a121 Compare March 26, 2026 00:59
@sonarqubecloud
Copy link
Copy Markdown

@one-community one-community changed the title feat: add blue square manual assignment tracking Yu Yan - feat: add blue square manual assignment tracking Mar 28, 2026
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 Yuyan,

I have reviewed your PR locally, as you can see the API still does not work of backend and reasons is Other, however rest of the functionality works as per requirement of the frontend.

Image Image Image Image Image Image

@yany960 yany960 merged commit eee3a50 into development Apr 13, 2026
10 checks passed
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.

3 participants