Files
summercms/.planning/quick/261007-qgx-admin-record-heading-uses-translatable-m/261007-qgx-PLAN.md

1.4 KiB

quick_id, mode
quick_id mode
261007-qgx quick

Quick 261007-qgx: admin record heading uses translatable (mltext) fields

The admin record heading, breadcrumb record crumb and document title read the first text field only, so records whose name field is mltext (journal Post title, Category name) fall back to "Edit record".

Task 1: shared recordDisplayName helper

  • files: admin/src/components/form/formState.ts, admin/src/views/FormView.vue, admin/src/views/PreviewView.vue
  • action: add recordDisplayName(fields, values, enabledLocales): first field of type text or an ML type (isMLFieldType) in schema order; plain values as today (string/number, trimmed); ML values use the default (first enabled) locale, else the first non-empty locale, else ''. Both views use it with schemaEnabledLocales(schema.meta).
  • done: plain text behaviour unchanged; an mltext first field names the record.

Task 2: tests

  • files: admin/tests/form/formState.test.ts, admin/tests/form/FormView.test.ts, admin/tests/form/PreviewView.test.ts
  • action: helper cases (plain, default locale filled, default empty + other filled, all empty, non-text first field skipped); FormView and PreviewView show the default-locale value as heading and record crumb for an mltext field.
  • verify: npm test, vue-tsc --noEmit.

Task 3: ship

  • rebuild the embedded admin shell (npm run build → modules/boardwalk/dist), go vet ./... && go test ./..., tag and push v0.1.12.