Exit Attendance: Implement "Thank You" Screen
Merge Request
Overview
This MR streamlines the volunteer exit flow by introducing a dedicated "Thank You" screen once a volunteer's attendance has been marked with a logout flag. It also cleans up unused certificate-related logic and improves test stability for the core App component.
What does this MR do and why?
Previously, volunteers were left on the QR generation screen even after their exit attendance was marked. This MR implements a better UX by:
- Detecting the "exited" state from the backend.
- Replacing the QR scanner with a minimalist, appreciative "Thank You" message.
- Removing the "Download Certificate" functionality as it is no longer required in this flow.
- Increasing test timeouts to resolve intermittent CI/CD failures during the push process.
Changes Made
-
Modified
src/pages/volunteer/VolunteerCampFlow.tsx: Added conditional rendering to show the Appreciation screen whenis_exitedis true. Removed "Download Certificate" and "Refresh Status" buttons. -
Modified
src/pages/volunteer/QRGenerationPage.tsx: Updated the "Check Status" logic to recognize the exited state and trigger a success notification. -
Modified
src/types/api.ts: Addedis_exitedto theVolunteerCampSignupStatustype. -
Modified
src/locales/en/translations.json: Added new appreciation messages and cleaned up unused keys. -
Modified
src/App.tsx&tests/App.test.tsx: Removed obsolete routes and increased Vitest timeout for the App component. -
Added/Modified Tests: Updated
VolunteerCampFlow.test.tsx,QRGenerationPage.test.tsx, andTranslationValidation.test.tsxto cover the new flow.
Technical Details
-
State Management: The component now reacts to the
is_exitedboolean from thesignup-statusAPI. -
Cleanup: Removed the
CertificatePageentirely to reduce bundle size and technical debt. - UX: Uses smooth conditional rendering to transition from the "Exited" attendance check to the final "Thank You" screen.
Type of Change
-
🐛 Bug fix (non-breaking change that fixes an issue) -
✨ New feature (non-breaking change that adds functionality) -
💥 Breaking change (fix or feature that would cause existing functionality to change) -
📝 Documentation update -
🎨 UI/UX improvement -
♻ ️ Refactor (no functional changes) -
⚡ Performance improvement -
🧪 Test update -
🔧 Configuration change -
🚨 Security fix
Related Issues / References
closes #359
- Related to the backend update for
is_exitedstatus logic.
Screenshots or Screen Recordings
| Before | After |
|---|---|
| QR scanner remains active after logout | Clean "Thank You for Your Service" message |
How to Set Up and Validate Locally
- Pull this branch
-
Launch App:
bun dev -
Simulate Exit:
- As a volunteer, go to the active camp flow.
- On the QR generation page, trigger a status check where the backend returns
is_exited: true.
-
Expected Behavior:
- The app should show a success toast: "Your exit attendance has been marked successfully!"
- The screen should transition to the "Thank You" layout.
- All certificate-related UI elements should be absent.
Testing Done
-
Manual testing completed -
Unit tests added/updated
Test Cases Covered:
| Scenario | Expected Result | Status |
|---|---|---|
Volunteer state is is_exited: true
|
Renders "Thank You" screen | |
| Volunteer clicks "Refresh Status" after logout | Notifications show success and transitions screen | |
| i18n keys for thank you screen | Validated as non-empty strings | |
| App component load | Tests pass with increased 30s timeout |
Code Quality Checklist
Code Standards
-
Code follows project conventions (naming, structure, formatting) -
No console.log() or debugger statements left in code -
No unused imports, variables, or functions -
i18n check passed -
TypeScript types are properly defined -
ESLint and Prettier checks pass
React Best Practices
-
Components are properly split and single-responsibility -
Hooks follow rules -
State management is appropriate
Component Patterns
-
shadcn/ui components used correctly -
Tailwind classes follow utility-first approach -
Accessibility attributes included
API & Data Fetching
-
TanStack Query used for server state -
Loading and error states handled -
API types defined in src/types/api.ts
Error Handling
-
Errors are caught and handled gracefully -
User-friendly error messages displayed
Documentation
-
API documentation updated in types -
Code comments explain complex logic
Known Limitations / Technical Debt
None.
Additional Notes
Alternative approaches considered: Keeping the certificate but hiding the download until generation is ready. Decision: User requested removal for a simpler flow.
Edited by Vandana reddy Balannagari
