Skip to content

feat(mrf-cutover): default UseTemplateModal to MRF with storage-mode escape hatch (6/6)#9467

Merged
kevin9foong merged 3 commits into
feat/duplicate-form-modal-cutoverfrom
feat/use-template-modal-cutover
Jun 4, 2026
Merged

feat(mrf-cutover): default UseTemplateModal to MRF with storage-mode escape hatch (6/6)#9467
kevin9foong merged 3 commits into
feat/duplicate-form-modal-cutoverfrom
feat/use-template-modal-cutover

Conversation

@kevin9foong
Copy link
Copy Markdown
Contributor

@kevin9foong kevin9foong commented May 21, 2026

Stacked PR 6/6 for MRF cutover. Base: feat/duplicate-form-modal-cutover.

Problem

Per the PRD: when admins create a form from a template, the use-template flow currently inherits the template's response mode, locking admins into storage mode whenever they pick a legacy template. Closes #9455.

Solution

Under the mrf-cutover flag:

  • Default UseTemplateModal to Multirespondent, regardless of the template's responseMode.
  • Storage-mode templating remains reachable via the escape hatch (same pattern as PRs 4 and 5).
  • Default storage-mode emails to the admin's email (mirrors create + duplicate flows).
  • Storybook stories + UseTemplateWizardProvider.cutover.test.tsx pinning the MRF default + dispatch under cutover.

When the flag is off, the original use-template flow renders unchanged.

Breaking Changes

No - gated behind mrf-cutover feature flag.

Tests

TC1: storage-mode template → MRF default

  • Enable flag; use a storage-mode template
  • Confirm modal opens on MRF default screen
  • Submit → confirm new form is an MRF

TC2: escape hatch from use-template flow

  • In the use-template modal, click "old version of FormSG"
  • Confirm storage-mode screen renders with title input
  • Submit → confirm storage-mode form is created with admin's email as recipient

TC3: flag off

  • Disable flag; use any template
  • Confirm original use-template flow renders unchanged

@kevin9foong kevin9foong requested a review from a team as a code owner May 21, 2026 07:15
@kevin9foong kevin9foong force-pushed the feat/duplicate-form-modal-cutover branch from 8421393 to ce0f849 Compare May 21, 2026 07:23
@kevin9foong kevin9foong force-pushed the feat/use-template-modal-cutover branch from 1ed91c8 to 56488d5 Compare May 21, 2026 07:23
@kevin9foong kevin9foong force-pushed the feat/duplicate-form-modal-cutover branch from ce0f849 to 34806ce Compare June 3, 2026 03:51
kevin9foong and others added 3 commits June 3, 2026 11:53
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…cutover

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@kevin9foong kevin9foong force-pushed the feat/use-template-modal-cutover branch from 56488d5 to d54ddb5 Compare June 3, 2026 03:53
@kevin9foong kevin9foong merged commit 06719b5 into feat/duplicate-form-modal-cutover Jun 4, 2026
23 of 24 checks passed
@kevin9foong kevin9foong deleted the feat/use-template-modal-cutover branch June 4, 2026 08:26
kevin9foong added a commit that referenced this pull request Jun 8, 2026
…e escape hatch (5/6) (#9466)

* feat: default CreateFormModal to MRF with escape-hatch link to storage mode

When mrf-cutover is on, the create-form details screen no longer offers
a response-mode choice — Multirespondent is the implicit default. An
"old version of FormSG" link composed from the user's beta flags
navigates to a new storage-mode-only screen (title + create + back).
Submitting routes through the existing storage-mode mutation.

Closes #9453.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(create-form-modal): match Figma fidelity for cutover flow

- Wrap escape-hatch link in an info InlineMessage to match Figma
- Storage-mode page header reads "Set up a Storage mode form"
- Add storage-mode subtitle explaining that storage mode is outdated

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(create-form-modal): hide data-classification infobox + use 2.5rem spacing in cutover flow

The MRF default screen previously showed both the escape-hatch infobox
and the existing data-classification infobox, cluttering the layout.
The cutover Figma drops the latter and uses 2.5rem rhythm around the
escape-hatch infobox and between input/button on the storage-mode page.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix: sliding animation bug and undefined email during escape hatch flow

* feat: add story for all 3 exceptions

* test(duplicate-form-modal): pin MRF default + dispatch under cutover

Covers the dupe-flow contract introduced by #9454 ACs 1 and 6:
the wizard defaults responseMode to Multirespondent regardless of
the source form's mode, and the default submit fires the
multirespondent dupe mutation. These tests are a regression net
on top of the shared cutover behaviour added in #9453.

Refs #9454

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(duplicate-form-modal): default storage dupe emails to admin email

Post-cutover, the escape-hatch storage screen has no email-recipients
input, so the wizard form's `emails` field is undefined on submit and
the existing `emails.filter(Boolean)` would crash. Mirror the
`emails ? filter : cutoverDefaultEmails` guard used by the create
flow (CreateFormWizardProvider.tsx) so the two paths stay symmetric.

Refs #9454

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(duplicate-form-modal): add cutover Storybook stories

No stories existed for DuplicateFormModal. Mirror the
CreateFormModal.stories.tsx variants so Chromatic can baseline the
post-cutover dupe modal: pre-cutover Default, MrfCutoverOn, and the
three beta-flag copy variants (children, webhook v1, both). Closes
AC8 for #9454.

Refs #9454

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Merge pull request #9467 from opengovsg/feat/use-template-modal-cutover

feat(mrf-cutover): default UseTemplateModal to MRF with storage-mode escape hatch (6/6)

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

2 participants