Skip to content

[AUTOWORK-417] Form and Workflow radio buttons to use existing/configure new end up in invalid state - #27373

Open
dfriquet wants to merge 6 commits into
release/18.0from
bug/autowork-417-form-and-workflow-radio-buttons-invalid-state
Open

dfriquet wants to merge 6 commits into
release/18.0from
bug/autowork-417-form-and-workflow-radio-buttons-invalid-state

Conversation

@dfriquet

Copy link
Copy Markdown
Contributor

Ticket

https://community.openproject.org/wp/AUTOWORK-417

What are you trying to accomplish?

  • In the creation wizard, "Use an existing …" lists every form or workflow except the one being created
  • Picking an existing one deletes the unused new one on Next
  • Clicking "Configure a new …" again replaces the abandoned one, so no "(2)", "(3)" pile up
    • Opportunistic: the "Copy from" list leaves the abandoned one out too
  • Outside the wizard, the type and variant tabs still list every form and workflow

What approach did you choose and why?

  • NamedReferences::DiscardStartedService owns the started_form_configuration_id / started_workflow_id parameters (params_for, id_in, carry_in) and the deletion
  • A record any variant uses is never deleted: destroy is refused by has_many :type_variants, dependent: :restrict_with_error, so callers don't check usage
  • The started id travels as its own parameter next to back_url, rather than being read back out of it
  • Leaving the wizard (Cancel, closing the tab) still leaves an abandoned record behind: there is no hook for it, out of scope here
  • A malformed started id is now ignored instead of raising a 500

AI involvement

Collaborative – AI generated a substantial part of the code; I reviewed and understand every line.

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome)

@github-actions github-actions Bot added the ai: Collaborative 💻 AI generated a substantial part of the code; A human reviewed and understands every line. label Nov 26, 2026
@dfriquet
dfriquet force-pushed the bug/autowork-417-form-and-workflow-radio-buttons-invalid-state branch from 1abf247 to 4141231 Compare November 27, 2026 08:24
@dfriquet
dfriquet marked this pull request as ready for review November 27, 2026 08:24

This branch has not been deployed

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

Labels

ai: Collaborative 💻 AI generated a substantial part of the code; A human reviewed and understands every line.

Development

Successfully merging this pull request may close these issues.

2 participants