Skip to content

Add volunteer profile modal and view page#21

Open
wmiq84 wants to merge 7 commits intomainfrom
feature/user-profiles
Open

Add volunteer profile modal and view page#21
wmiq84 wants to merge 7 commits intomainfrom
feature/user-profiles

Conversation

@wmiq84
Copy link
Contributor

@wmiq84 wmiq84 commented Feb 17, 2026

Overview

This PR adds a full volunteer profile modal (View + Edit) with backend persistence for profile fields, status/type/event tags, and notes. It also includes post-merge integration fixes so profile edits work with the new auth/tag architecture and do not regress table/profile behavior.

Changes

View tab

  • VolunteerProfileModal.tsx: Built the View tab UI
  • VolunteerProfileModal.module.css: Added View tab styling

Edit tab

Created edit tab, enabled data to be updated in the backend.

  • volunteerRoutes.ts: Added PUT /:id to update volunteer profiles from the edit modal.
  • volunteerValidator.ts: Added full update validation and relaxed phone validation to accept dashed formats.
  • volunteerController.ts: Implemented updateVolunteer to persist edits in MongoDB via findByIdAndUpdate (this is what makes the data store after changes).
  • VolunteerProfileModal.tsx: Built the full Edit tab UI (fields, tag add/remove, save button) and wired PUT /api/volunteer/:id so edits persist and then refresh the selected volunteer/table.
  • VolunteerProfileModal.module.css: Added styles for the edit/save experience (save button and error state).
  • page.tsx: Updated volunteer state in-place after successful edits to keep the table and selected volunteer synchronized.
  • VolunteerProfileModal.tsx: Built the full Edit tab UI (fields, tag add/remove, save button) and wired saves through the frontend proxy PUT /api/volunteer/:id (auth-aware) so edits persist and UI state stays in sync.

Post-merge fixes

  • Fixed regression where row click no longer opened profile modal (volunteers/page.tsx, VolunteerTable.tsx).
  • Added frontend API proxy route for profile updates: frontend/src/app/api/volunteer/[id]/route.ts (auth-aware, no hardcoded backend URL).
  • Prevented accidental tag wipe on profile save by only updating tags when explicitly provided (backend/src/controllers/volunteerController.ts).
  • Ensured update response includes populated tags so table/profile rendering stays consistent after save (backend/src/controllers/volunteerController.ts).
  • Updated seed script to match Tag ObjectId schema (backend/src/scripts/seedVolunteers.ts).

Testing

Desktop View
Screenshot 2026-03-09 at 11 42 07 PM

Desktop Edit

Screenshot 2026-03-09 at 11 41 52 PM Screenshot 2026-03-09 at 11 41 59 PM
Mobil View Mobil Edit Mobil Edit
Screenshot 2026-03-09 at 11 44 48 PM Screenshot 2026-03-09 at 11 44 56 PM Screenshot 2026-03-09 at 11 45 02 PM

Future Considerations

I spoke with the designers, and there might be a change for the Status to make them binary instead of tags, but this has not been decided nor designed yet. So currently, we are just following the original design.

@wmiq84 wmiq84 marked this pull request as ready for review February 23, 2026 02:55
@wmiq84 wmiq84 requested a review from navyaa31 as a code owner February 23, 2026 02:55
@wmiq84 wmiq84 marked this pull request as draft February 23, 2026 02:57
…ag disply in user profile. Some are temporary as they are based on other PRs and need to be updated later
@wmiq84 wmiq84 changed the base branch from volunteer-table-final to main March 3, 2026 05:34
@navyaa31 navyaa31 marked this pull request as ready for review March 10, 2026 17:44
@navyaa31 navyaa31 requested review from 22yuzu and YoChang410 March 10, 2026 17:45
Copy link
Contributor

Choose a reason for hiding this comment

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

Volunteer schema should be reverted

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, could you provide more context on what it should be reverted to and why?

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