Skip to content

Super Admin switch for shop app early access - #332

Merged
rqms40 merged 2 commits into
devfrom
fm/gg-329-dash-switch
Nov 21, 2026
Merged

rqms40 merged 2 commits into
devfrom
fm/gg-329-dash-switch

Conversation

@rqms40

@rqms40 rqms40 commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

Refs #329

What

A Shop app early access card on Super Admin's Operational settings (/admin/settings) that turns shopEarlyAccessEnabled on or off (contract: "Activation and mixed-version rollout" in gridgo-api/docs/EARLY_ACCESS_API.md, API gridgoph/gridgo-api#418).

  • Plain state: "Shop app early access: open / closed", with one line on what it does and what the website shop form shows right now.
  • Flipping the switch writes nothing. A confirmation restates what changes on the website (the shop form opens / goes back to "opens soon"), says to open it only after the new service is live everywhere, and asks for the reason. Opening uses the page's one yellow action; closing is destructive-styled.
  • Saves on its own with expectedVersion and the reason (Shop app early access opened. <reason>). A 409 settings_version_conflict closes the dialog, says someone else saved, and reloads the settings in force. An API without the field shows "not available yet" and no switch.
  • Super Admin only: the card is mounted only from OperationalSettings, which only /admin/settings mounts (/ops/settings stays the "Super Admin only" screen). A test checks both import paths.

Tests run

  • npm run typecheck: clean. npm run lint: 0 errors (2 existing warnings in other files).
  • npm test: 401/403 files passed on the first run. The 2 failures were 5 s timeouts under host load in unrelated files (admin/broadcast, tracker/DecisionPanel). Both pass on a rerun (15/15).
  • New src/components/settings/__tests__/shop-early-access-settings.test.tsx (6 tests): closed state and copy, a flip writes nothing and Cancel keeps it closed, a reason is required, opening sends version + reason, closing has its own confirmation, the 409 path reloads, an older API, and the Super Admin-only mount.

Browser check

The shared dev API does not serve shopEarlyAccessEnabled yet, so I tested against a copy of gridgo-api dev on a spare port, backed by a throwaway seeded Postgres. Shared servers and the shared database were not touched. With next dev and the dev Super Admin, at 1280×900 and 390×844:

  • open → closed with real PATCH /settings writes (the audit log kept both reasons), and the empty-reason refusal. The flag was left off.
  • a 409 answered once by a browser route, to show the stale-version path.
  • the dev Operations login on /ops/settings shows no card at either size.
Before After (closed) After (open)
before closed open
Confirm open Reason required Confirm close
confirm reason close
Phone confirm Phone 409 Operations view
phone conflict ops

Rollout

Turn it on only after the new API is deployed and no old API process remains. Before any rollback to code from before the app choice, the switch must be off and there must be no shop rows (rollback preflight in the API doc).

Adds a Shop app early access card to Operational settings: open/closed
state, a confirmation that says the website shop form opens or closes,
an audited reason, the expectedVersion handshake and a reload on a stale
version. Mounted only on the Super Admin settings screen.

Refs #329
@rqms40
rqms40 merged commit 1ad272a into dev Nov 21, 2026
6 checks passed
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