0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-12 05:37:26 +08:00
discourse/plugins/discourse-workflows/test/javascripts
Régis Hanol 77f10640ec
DEV: Reuse SettingDefinitionField for workflows forms (#41185)
Follow-up to #41099.

Previously, the workflows form hand-rolled its own `if/else` chain of
FormKit fields, duplicating the type-to-control mapping that
`SettingDefinitionField` was introduced to centralize.

This change builds a setting definition per field and renders the shared
component instead, so workflows forms render consistently with the rest
of admin and the mapping lives in one place. Along the way it:

- extends the registry with the field types workflows needs and adds a
`radio-group` control;
- collapses the registry's repeated entries into two layout profiles (a
labelled "row" and a compact inline control) to cut boilerplate;
- falls back to a bare FormKit control when an entry has no custom
renderer, retiring the redundant `StringControl`; and
- focuses the first field at the form level (the per-field autofocus
modifier can no longer reach the control now that it's encapsulated
inside `SettingDefinitionField`), deferred to `afterRender` and passing
`preventScroll` so loading a form no longer jumps the page to the first
input.
2026-07-01 17:07:49 +02:00
..
acceptance FEATURE: adds a modal node to discourse workflows (#40978) 2026-06-17 12:12:51 +02:00
integration/components DEV: Reuse SettingDefinitionField for workflows forms (#41185) 2026-07-01 17:07:49 +02:00
unit FEAT: Add workflow canvas clipboard (#41217) 2026-06-30 18:07:17 +02:00