Skip to content

Form lifecycle: archive/delete, rename, and real draft invisibility #419

Description

@hamin2006

Context

Form lifecycle management is incomplete: old/botched forms pile up forever, forms can't be renamed after creation, and a "draft" is not actually hidden from applicants (the New Form dialog promises otherwise).

Current behavior

  • No delete/archive: no deleteForm/archive action; forms list only offers New Form + Clone. Prisma forms has no archived flag; deleting a form cascades submissions (schema.prisma, onDelete: Cascade).
  • No rename: updateForm accepts title (unique column) but no UI passes it; title is read-only in list + header.
  • Draft ≠ invisible: draft in config.application only locks the Questions builder. isFormOpen() (src/lib/utils/forms/helpers.ts) checks dates only; apply/page.tsx and startApplication never check draft. A draft with no dates set is treated as open and reachable by URL.
  • New Form dialog copy ("Nothing is visible to applicants until you launch it") is inaccurate today.

Desired behavior

  • Delete with guardrails: confirm dialog explaining cascade (submissions + related rows), archive alternative so past forms remain queryable.
  • Rename affordance on the Questions/Builder page header (and/or list row) writing via updateForm.
  • Draft visibility: applicants must not be able to reach or start a draft form (isFormOpen and/or entry pages consult the draft flag). Launch flips it off.
  • Clarify dialog copy and the "Launched" chip on the Questions page accordingly.

Acceptance criteria

  • Archive (hide from list/applicants, keep data) and/or hard delete with explicit confirmation
  • Title editable post-creation with uniqueness handling
  • Draft forms return "closed"/unavailable to applicants and can't be started
  • Existing forms unaffected (no draft flag → treated as launched/live)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BacklogNot in the works at the momentfeature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions