Skip to content

Feature/volunteer_management_lifecycle#62

Merged
qiuethan merged 13 commits intomainfrom
feat/vol
Mar 22, 2026
Merged

Feature/volunteer_management_lifecycle#62
qiuethan merged 13 commits intomainfrom
feat/vol

Conversation

@RaymondC-tech
Copy link
Contributor

@RaymondC-tech RaymondC-tech commented Mar 17, 2026

Description

Fixed the renew/extend button by implementing the application logic and connecting frontend + backend
Added expiry date support with a default of 30 days with the access_expiry timestamp is now correct.
Added 5 new backend tests for volunteer lifecycle management.

Additional Fixes

Changed Dockerfile name to the correct name so docker compose up runs properly.
Fixed bug in the items array in API call.
Fixed bug by removing extra /api in PATCH call for volunteers.
Edit styles of text in buttons to be black from white for readability

Test

Run tests with the following commands:

cd backend
source venv/bin/activate
pytest users/tests.py -v

@RaymondC-tech RaymondC-tech requested review from Edwz208, qiuethan and vivjd and removed request for Edwz208, qiuethan and vivjd March 17, 2026 15:06
@vivjd vivjd requested a review from Copilot March 19, 2026 15:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Implements volunteer access lifecycle management (approve with optional expiry, extend/renew access), wiring frontend UI flows to backend endpoints and adding supporting backend tests/config tweaks.

Changes:

  • Frontend: add approve/extend modals with expiry/no-expiry options; add “Renew Access” flow and hook for extending a volunteer’s access_expires_at.
  • Backend: enrich volunteer-application list responses with linked volunteer user data (user_id/expiry/days_remaining) and support setting access_expires_at when approving an application; add volunteer-stats warning_days.
  • Tooling/robustness: dev server host binding, docker-compose cleanup, API/items list guards, .env ignore, and updated frontend tests for new endpoints/hooks.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
frontend/vite.config.ts Expose dev server on 0.0.0.0 for Docker/host access
frontend/src/pages/public/VolunteerApplication.test.tsx Update expected volunteer-application URL (no extra /api)
frontend/src/pages/admin/ManageVolunteers.tsx Add expiry/extend/renew UI + wire to new/updated hooks
frontend/src/pages/admin/ManageVolunteers.test.tsx Mock new useExtendVolunteerAccess hook + pending states
frontend/src/pages/admin/ManageVolunteers.css Styling for renew list + modal checkbox field
frontend/src/lib/types.ts Add volunteer user_id; make expiry fields nullable
frontend/src/components/items/ItemList.tsx Guard against non-array items
frontend/src/api/items.api.ts Guard getAll to always return an array
frontend/src/actions/useVolunteers.ts Fix API paths (no double /api); add expiry support + extend hook
docker-compose.yml Remove obsolete top-level version
backend/users/views.py Add expiry parsing, user linkage enrichment, and warning_days in stats
backend/users/tests.py Add volunteer lifecycle tests (approve/expiry/list enrichment/stats)
.gitignore Ignore .env files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@qiuethan qiuethan merged commit 5282c76 into main Mar 22, 2026
2 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