Skip to content

feat: newsletter flows and admin-only e2e coverage (#1400, #1401, #1402, #1403) - #1430

Open
Fidelis900 wants to merge 4 commits into
solutions-plug:mainfrom
Fidelis900:feature/newsletter-and-admin-flows
Open

feat: newsletter flows and admin-only e2e coverage (#1400, #1401, #1402, #1403)#1430
Fidelis900 wants to merge 4 commits into
solutions-plug:mainfrom
Fidelis900:feature/newsletter-and-admin-flows

Conversation

@Fidelis900

Copy link
Copy Markdown
Contributor

Summary

This PR addresses and implements the requirements for issues #1400, #1401, #1402, and #1403 across the newsletter and admin dashboard areas.


Detailed Changes

1. #1400 [Admin Dashboard] Add e2e coverage for admin-only flows

  • File: frontend/e2e/admin.spec.ts
  • Changes:
    • Added Playwright end-to-end tests for API key rotation (POST /api/v1/admin/api-keys/rotate, GET /api/v1/admin/api-keys), verifying that rotated keys become active and functional.
    • Added audit log query & filtering tests (GET /api/v1/audit/logs, GET /api/v1/audit/statistics) covering pagination and action/resource-type filtering.
    • Added email queue inspection and dead-letter requeue tests (GET /api/v1/email/queue/stats, GET /api/v1/email/queue/dead-letter, POST /api/v1/email/queue/dead-letter/:job_id/requeue).
    • Added authorization guards asserting 401 Unauthorized for unauthenticated or invalid API key requests.
    • Ensured the suite fails loudly (does not silently skip) when ADMIN_API_KEY is not configured in the environment.

2. #1401 [Newsletter] Build newsletter signup form

  • File: frontend/src/components/NewsletterSignup.tsx
  • Changes:
    • Built the NewsletterSignup component handling double opt-in newsletter subscriptions.
    • Integrates with POST /api/v1/newsletter/subscribe.
    • Implements distinct UI states for pending confirmation ("check your inbox to confirm") versus already-subscribed states.
    • Accurately captures server-specific messages for duplicate/already-subscribed email submissions rather than surfacing a generic error or generic success.
    • Complies with WCAG 2.1 AA accessibility standards (ARIA live regions, semantic elements, focus indicators, error announcements).

3. #1402 [Newsletter] Build unsubscribe page

  • File: frontend/src/app/newsletter/unsubscribe/page.tsx
  • Changes:
    • Built the standalone unsubscribe page reached from external email links.
    • Automatically fires unsubscribe request on page mount when token or email parameters are present in URL search params, with fallback to manual confirmation.
    • Handles duplicate link clicks or already-unsubscribed addresses by rendering a distinct "Already Unsubscribed" state rather than an error banner.
    • Includes clear success feedback and navigation back to the home page.

4. #1403 [Newsletter] Build GDPR data-export request page

  • Files: frontend/src/app/account/privacy/export/page.tsx, frontend/src/lib/api/public-client.ts
  • Changes:
    • Implemented the 2-step GDPR data-export flow (Step 1: Request verification token via POST /api/v1/newsletter/gdpr/request-token; Step 2: Submit export request via POST /api/v1/newsletter/gdpr/export).
    • Added newsletterGdprRequestToken and updated newsletterGdprExport in public-client.ts to support passing token payloads in the request body.
    • Strictly transmits recipient email in POST JSON request bodies and component state, ensuring no email addresses leak into URLs, browser history, or server access logs.
    • Provides a data preview and JSON file download (predictiq-gdpr-data-export.json).

Linked Issues

Closes #1400
Closes #1401
Closes #1402
Closes #1403

@drips-wave

drips-wave Bot commented Aug 27, 2026

Copy link
Copy Markdown

@Fidelis900 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant