Repository navigation
feat: unsubscribe page - #255
Alessandro100 wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
🟡 Changes recommended
The unsubscribe flow depends on client authentication despite the server-authentication contract, and locale preservation and schema nullability need correction.
3 open issues
What changed in this PR
Adds an email-linked unsubscribe page with notification-management navigation.
Changes:
- Adds single-type and all-notification unsubscribe controls with confirmation and error states.
- Adds English/French copy and unit tests for unsubscribe helpers.
- Updates subscription API contracts and validation-history schemas.
Applied vercel-react-best-practices guidance (custom).
| File | Description |
|---|---|
| src/app/services/user-service-api-types.ts | Updates generated subscription types. |
| src/app/services/notification-service.ts | Adds subscription lookup and unsubscribe calls. |
| src/app/constants/Navigation.ts | Adds notifications destination. |
| src/app/[locale]/notifications/unsubscribe/UnsubscribeContent.tsx | Implements unsubscribe controls and navigation. |
| src/app/[locale]/notifications/unsubscribe/page.tsx | Adds the localized route and metadata. |
| src/app/[locale]/notifications/unsubscribe/lib/unsubscribe.ts | Adds validation and view-state helpers. |
| src/app/[locale]/notifications/unsubscribe/lib/unsubscribe.spec.ts | Tests unsubscribe helpers. |
| messages/fr.json | Adds French unsubscribe messages. |
| messages/en.json | Adds English unsubscribe messages. |
| external_types/UserServiceAPI.yaml | Updates subscription operations and contracts. |
| external_types/DatabaseCatalogAPI.yaml | Adds validation-history API schemas. |
Review effort: Balanced
| const accessToken = await getUserAccessToken(); | ||
| const authMiddleware = generateAuthMiddlewareWithToken(accessToken); | ||
| userServiceClient.use(authMiddleware); |
|
*Lighthouse ran on https://mobilitydatabase-bvqgcpujo-mobility-data.vercel.app/ * (Desktop)
*Lighthouse ran on https://mobilitydatabase-bvqgcpujo-mobility-data.vercel.app/feeds * (Desktop)
*Lighthouse ran on https://mobilitydatabase-bvqgcpujo-mobility-data.vercel.app/feeds/gtfs/mdb-2126 * (Desktop)
*Lighthouse ran on https://mobilitydatabase-bvqgcpujo-mobility-data.vercel.app/feeds/gtfs_rt/mdb-2585 * (Desktop)
*Lighthouse ran on https://mobilitydatabase-bvqgcpujo-mobility-data.vercel.app/feeds/gbfs/gbfs-flamingo_porirua * (Desktop)
|
|
LGTM! |

closes #175
Summary:
Generate the unsubscribe page which is accessed from the notification email. On this page the user can
With the manage notifications option
Expected behavior:
When the user receives the notification email, they should be able to successfully navigate to the unsubscribe page and successfully unsubscribe or manage their notifications
Testing tips:
As it's difficult to trigger a real notification email, you can get your subscription id from the database and input it in the url
ex:
/notifications/unsubscribe?id=ef7efa4e-3b42-45cd-a808-de5142c0fb41You can use my subscription as a test (note if unsubscribed, the link will become invalid)
https://mobilitydatabase-web-git-feat-175-unsubscr-87d44f-mobility-data.vercel.app/notifications/unsubscribe?id=bd063dc2-ba94-4615-925f-03a7b89338b7
Please make sure these boxes are checked before submitting your pull request - thanks!
yarn testto make sure you didn't break anything