0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-12 05:37:26 +08:00
discourse/spec
Régis Hanol 8b03a42cd7
DEV: Linkify site setting references in descriptions (#40338)
Site setting descriptions frequently mention other settings, but the
YAML had no consistent convention. The same reference appeared in at
least four styles -- `foo` in backticks, 'foo' in single quotes,
'humanized name' in single quotes, or just `bare_snake_case` -- and none
of them rendered as a link the admin could click to jump to the
referenced setting.

Introduce a compact marker, `{{setting:foo}}`, and expand it in
`SiteSettings::LabelFormatter.description`. The marker resolves to a
linkified anchor pointing at
`/admin/site_settings/category/all_results?filter=foo`, with the
humanized setting name as the visible label. Wiring the expansion at the
description seam (rather than in the I18n freedom patch) keeps the
change surgical: no impact on `I18n.t` for unrelated translations, no
`html_safe` plumbing changes in the JSON error pipeline.

Migrate ~67 references in `config/locales/server.en.yml` to the new
marker, covering every flavour of inconsistency found by two sweeps
(snake_case identifiers and quoted humanized names). The sweep also
turned up a stale reference: `enable_linkedin_oidc_logins` described
`linkedin_client_id`/`linkedin_client_secret`, which were renamed to
`linkedin_oidc_client_id`/`linkedin_oidc_client_secret` years ago.

Teach `script/i18n_lint.rb` to whitelist the new marker -- previously
any `{{...}}` was flagged as an accidental Handlebars-style mistake.
Reset the `label a` margin inherited from `discourse.scss` inside
`.setting-value`, so the linkified anchors sit flush against surrounding
text in checkbox-label descriptions.

Ref - t/148687

**BEFORE**

<img width="1594" height="1279" alt="2026-05-27 @ 14 27 33"
src="https://github.com/user-attachments/assets/aeaf2ee3-ce8c-484c-805d-cec9298f068b"
/>

**AFTER**

<img width="1594" height="1279" alt="2026-05-27 @ 14 25 32"
src="https://github.com/user-attachments/assets/bbead088-6f80-4903-b320-31b87d821428"
/>
2026-06-01 10:31:18 +02:00
..
db DEV: Move Community sidebar section + links from migrations to seed fixture (#39973) 2026-05-13 12:13:12 +01:00
fabricators FEATURE: Add top countries and top referrers cards to the admin dashboard (#40215) 2026-05-22 12:59:16 +08:00
fixtures DEV: Allow plugins to register admin-panel-specific CSS (#40345) 2026-05-28 11:03:38 +01:00
generator DEV: Enable Rails/FilePath rubocop rule (#40097) 2026-05-19 19:07:54 +02:00
helpers DEV: Replace JS build system with Rolldown (#35963) 2026-05-29 11:11:55 +01:00
import_export
initializers Revert "FEATURE: discourse-workflows (#39704)" (#40366) 2026-05-28 13:59:42 +01:00
integration FIX: Correctly rescue failed embed_mode parsing (#40298) 2026-05-26 15:29:48 +01:00
integrity DEV: Enforce learn_more_url for upcoming changes (#40150) 2026-05-20 16:18:28 +10:00
jobs FIX: Delete BrowserPageviewEventScore rows during cleanup (#40390) 2026-05-29 12:25:35 +08:00
lib DEV: Linkify site setting references in descriptions (#40338) 2026-06-01 10:31:18 +02:00
mailers DEV: Automatically detect and revert translation overrides in specs (#40003) 2026-05-13 22:09:23 +02:00
models FIX: Average daily engaged users KPI instead of summing the period (#40384) 2026-05-29 09:22:13 +08:00
multisite DEV: Enable Rails/FilePath rubocop rule (#40097) 2026-05-19 19:07:54 +02:00
queries/reports FEATURE: Activity by category section of the new dashboard's engagement section (#40227) 2026-05-22 13:10:38 +08:00
requests FIX: Staged user emails bypass moderator email visibility setting (#40411) 2026-05-29 19:26:17 -03:00
script/import_scripts
serializers FIX: Staged user emails bypass moderator email visibility setting (#40411) 2026-05-29 19:26:17 -03:00
services DEV: Add descriptive error message when creating requestable group with no owner (#40391) 2026-05-29 11:11:59 +08:00
support DEV: to-markdown prosemirror HTML parsing (#35563) 2026-05-29 18:14:32 -03:00
system DEV: Fix dashboard date picker spec (#40434) 2026-06-01 13:57:45 +10:00
tasks DEV: Replace JS build system with Rolldown (#35963) 2026-05-29 11:11:55 +01:00
views FIX: remove ItemList schema from linkbacks in crawler view (#36608) 2025-12-11 10:41:47 +01:00
rails_helper.rb DEV: Fix dashboard date picker spec (#40434) 2026-06-01 13:57:45 +10:00
regenerate_swagger_docs
swagger_helper.rb