0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 05:42:36 +08:00
discourse/frontend
Régis Hanol 2f4c996c3d
DEV: Render bool and integer site settings with FormKit
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`.
2026-07-24 20:59:51 +02:00
..
asset-processor DEV: add typescript support for core, themes and plugins (#41478) 2026-07-08 12:57:18 +01:00
deprecation-silencer
discourse DEV: Render bool and integer site settings with FormKit 2026-07-24 20:59:51 +02:00
discourse-i18n DEV: add typescript support for core, themes and plugins (#41478) 2026-07-08 12:57:18 +01:00
discourse-markdown-it DEV: Bump eslint/lint-configs, and correct violations (#41321) 2026-07-01 10:39:57 +01:00
discourse-types DEV: Use bundler module resolution for @discourse/types consumers (#41661) 2026-07-13 21:43:39 -03:00
pretty-text FIX: clean up onebox loading decorations on fetch failure (#39277) 2026-07-23 19:50:41 -03:00
.npmrc
polyfills.js