Skip to content

feat(wave-admin): UI for managing waves; split current/upcoming display#1909

Open
efstajas wants to merge 1 commit into
mainfrom
admin/manage-waves-ui
Open

feat(wave-admin): UI for managing waves; split current/upcoming display#1909
efstajas wants to merge 1 commit into
mainfrom
admin/manage-waves-ui

Conversation

@efstajas
Copy link
Copy Markdown
Contributor

Summary

Front-end for the new wave-admin endpoints (see matching wave PR: drips-network/wave#624), plus a small fix to the public wave program page so a current wave and an upcoming wave can both show at the same time.

Admin

  • New "Waves" card on /wave/admin (gated on manageWaves).
  • /wave/admin/waves β€” lists wave programs with a "Manage Waves" link each.
  • /wave/admin/waves/[waveProgramId] β€” lists scheduled waves with status badges and per-row actions:
    • Schedule wave (header action) opens a modal with start/end dates and a budget input pre-filled from the program's preset.
    • Edit (upcoming) opens the edit modal with all fields editable.
    • Extend (active) reuses the edit modal but locks start date + budget; end-date picker is clamped via `min` to the current end and validates inline.
    • Delete (upcoming only) β€” destructive variant, behind a confirmation modal + standard error-modal wrapper.
    • Ended waves are read-only β€” no actions.
  • New API client helpers in `wavePrograms.ts`: `manualCreateWave`, `updateWave`, `deleteWave`.

Public wave program page

  • Previously: `upcomingWave ?? activeWave` collapsed both into one slot, so a program with both an active wave and an upcoming wave showed only the upcoming one.
  • Now: separate "Current Wave" and "Upcoming Waves" sections.
  • Upcoming section is hidden when there's a current wave but nothing scheduled (matches the user's preference β€” no noisy "nothing here" card alongside the live wave).
  • The existing newsletter/Discord empty state is preserved for the no-active + no-upcoming case.

Test plan

  • As a user with the `manageWaves` permission, open `/wave/admin` and confirm the new "Waves" card appears.
  • As a user without it, confirm the card does not appear and `/wave/admin/waves` redirects to `/wave/admin`.
  • Schedule a new wave β€” confirm 201 and that it appears in the list with status "upcoming".
  • Edit an upcoming wave β€” change start date, end date, budget independently.
  • Try to edit an active wave β€” confirm start + budget are disabled, end-date picker cannot select a date earlier than the current end.
  • Try to edit an ended wave β€” confirm no edit button shows.
  • Delete an upcoming wave β€” confirmation, success toast, list refresh.
  • Confirm no delete button on active / ended waves.
  • Public page: navigate to a wave program with an active wave but no upcoming β†’ only "Current Wave" shows.
  • Public page: with active and upcoming β†’ both sections show, current on top.
  • Public page: with no active or upcoming β†’ the newsletter/Discord empty state still renders.

…ve display

- Admin dashboard: new "Waves" card (gated on manageWaves) linking to
  /wave/admin/waves, listing all wave programs.
- Per-program admin page: list scheduled waves with status badges, schedule
  new waves, edit upcoming ones, extend active ones (start/budget locked),
  and delete upcoming waves (with confirmation). Ended waves are read-only.
- Wave program public page: split into separate "Current Wave" and
  "Upcoming Waves" sections so a current+upcoming combo renders both;
  upcoming section hides entirely when there's a current wave but nothing
  scheduled, and keeps the newsletter/Discord empty state when neither
  exists.
- API client: add manualCreateWave, updateWave, and deleteWave helpers.
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.

1 participant