mirror of
https://github.com/discourse/discourse.git
synced 2026-08-06 05:42:36 +08:00
The admin site settings page rendered every setting with a bespoke per-type control layered on a buffered proxy, separate from the shared FormKit field infrastructure (`SettingDefinitionField` and the setting-field registry) that category-type and plugin settings already use. This converts the `bool` and `integer` rows onto that shared infrastructure, gated per-type by an `adminReady` registry flag so every other type keeps its existing control until it is converted in turn. Each converted row wraps its control in a single-field `<Form>` whose form-level `@onSet` writes changes back into the existing `setting.buffered` proxy, so dirty tracking, the changes banner, and the route guard all keep working unchanged mid-migration. The row still owns its chrome (the label, the description rendered below the control to match the unconverted rows, and the warnings), leaving the FormKit field to render only the control. This also resolves latent issues it surfaced. Pressing Enter or clicking the row's save button now submits through the form's validation lifecycle and the row's full save path — including the confirmation dialog — instead of bypassing either, and submitting an unchanged row is a no-op instead of issuing an empty bulk update. `FKControlInput` no longer keeps a stale raw-text buffer that hid an external value change, so Cancel and Reset reliably revert a number field. An integer's wire value is truncated so a pasted decimal never reaches the server, and clearing an integer field is ignored — as the previous control did — instead of marking the row dirty with an empty value the server would coerce to 0. Existing bool specs are updated for the FormKit markup: `toggle_bool_setting` and the new checkbox assertions delegate to page-object helpers that use the shared `FormKitField` component and query the checkbox with `visible: :all` (the new checkbox style hides the native input) instead of clicking the now-ambiguous `.setting-value span`. |
||
|---|---|---|
| .. | ||
| asset-processor | ||
| deprecation-silencer | ||
| discourse | ||
| discourse-i18n | ||
| discourse-markdown-it | ||
| discourse-types | ||
| pretty-text | ||
| .npmrc | ||
| polyfills.js | ||