Skip to content

[FE-37] NPS survey: frontend prompt and admin display #1231

Description

@yusuftomilola

Overview

After a booking completes, surface the NPS survey in the dashboard so members can rate their experience without leaving the platform, and show aggregated NPS results in the admin analytics.

Context

  • Dashboard page: frontend/app/dashboard/page.tsx
  • Admin analytics page: frontend/app/admin/analytics/page.tsx
  • Depends on BE-43 being implemented first

Tasks

  • Add a useGetPendingNpsSurvey hook that checks if the current user has an unanswered NPS survey
  • If pending: show a dismissible banner or modal on /dashboardHow was your experience at [Workspace Name]? Rate us 0–10
  • NPS widget: 11 numbered buttons (0–10) with Not at all likely / Extremely likely labels; optional comment textarea below
  • Submit calls POST /nps/respond; on success dismiss the prompt and show thank-you toast
  • Dismiss for now hides the banner for 24 hours (store in localStorage)
  • Admin analytics page: add an NPS summary card showing: NPS score (large number), promoter/passive/detractor % breakdown as a donut chart, last 5 recent comments

Files to Modify / Create

  • frontend/app/dashboard/page.tsx
  • frontend/app/admin/analytics/page.tsx
  • New: frontend/components/nps/NpsBanner.tsx
  • New: frontend/lib/react-query/hooks/nps/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions