feat(admin): open controller-link settings entries from the settings index

A settings entry with a controller opens that controller's route from
its card (settingsPath); singleton cards still open /settings/<code>.
On a linked controller with no navigation entry of its own the rail
marks Settings current, the breadcrumbs read Settings > entry label
(plus the record title on record and create routes) and the page title
uses the entry label. The settings docs describe the admin behaviour;
the embedded admin shell is rebuilt.
This commit is contained in:
Jakub Zych
2026-10-07 18:24:54 +02:00
parent 4a9b0896b1
commit 0b09acdb0c
13 changed files with 149 additions and 19 deletions

View File

@@ -3,7 +3,7 @@ import { controllerIdFromPath } from './controllerRoutes'
import { t } from './i18n'
import { recordCrumb } from '../state/useBreadcrumbs'
import { activeEntry } from '../state/useNavigation'
import { settingsEntry } from '../state/useSettings'
import { settingsEntry, settingsLinkFor } from '../state/useSettings'
const PRODUCT_TITLE = 'SummerCMS'
@@ -28,7 +28,7 @@ export function pageIndicator(route: RouteLocationNormalizedLoaded): string {
const plugin = activeEntry(String(route.params.vendor ?? ''), String(route.params.plugin ?? ''))
const controller = controllerIdFromPath(route.path)
const section = plugin?.sideMenu.find((item) => item.controller === controller)
const controllerLabel = section?.label ?? plugin?.label ?? ''
const controllerLabel = section?.label ?? plugin?.label ?? settingsLinkFor(controller)?.label ?? ''
if (route.name === 'create' || route.name === 'record' || route.name === 'preview') {
return recordCrumb.value || controllerLabel
}