diff --git a/.changeset/entity-page-group-aliases-and-ordering-catalog.md b/.changeset/entity-page-group-aliases-and-ordering-catalog.md index c2a17ae773..5db7c0fc4b 100644 --- a/.changeset/entity-page-group-aliases-and-ordering-catalog.md +++ b/.changeset/entity-page-group-aliases-and-ordering-catalog.md @@ -2,4 +2,4 @@ '@backstage/plugin-catalog': minor --- -Added support for group alias IDs and configurable content ordering on the entity page. Groups can now declare `aliases` so that content targeting an aliased group is included in the group. A new `contentOrder` option (default `title`) controls how content items within each group are sorted, with support for both a page-level default and per-group overrides. +Added support for group alias IDs and configurable content ordering on the entity page. Groups can now declare `aliases` so that content targeting an aliased group is included in the group. A new `defaultContentOrder` option (default `title`) controls how content items within each group are sorted, with support for both a page-level default and per-group overrides. diff --git a/docs/features/software-catalog/catalog-customization.md b/docs/features/software-catalog/catalog-customization.md index 5ddcb7d5a4..2e984d2942 100644 --- a/docs/features/software-catalog/catalog-customization.md +++ b/docs/features/software-catalog/catalog-customization.md @@ -730,12 +730,12 @@ Notes: ### Content ordering within groups -By default, content items within each group are sorted alphabetically by title. You can change this with the `contentOrder` option, which supports two modes: +By default, content items within each group are sorted alphabetically by title. You can change this with the `defaultContentOrder` option, which supports two modes: - **`title`** (default) — sort alphabetically by the content extension's title (case-insensitive). - **`natural`** — preserve the natural extension discovery/registration order. -A page-level `contentOrder` sets the default for all groups, and individual groups can override it: +A page-level `defaultContentOrder` sets the default for all groups, and individual groups can override it with a per-group `contentOrder`: ```yaml app: @@ -743,7 +743,7 @@ app: - page:catalog/entity: config: # Default content order for all groups - contentOrder: title + defaultContentOrder: title groups: - documentation: diff --git a/packages/app/app-config.yaml b/packages/app/app-config.yaml index 0e49365c08..37893722f7 100644 --- a/packages/app/app-config.yaml +++ b/packages/app/app-config.yaml @@ -49,7 +49,7 @@ app: config: showNavItemIcons: true # default content order for all groups, can be 'title' or 'natural' - # contentOrder: title + # defaultContentOrder: title groups: # placing a tab at the beginning - overview: diff --git a/plugins/catalog/report-alpha.api.md b/plugins/catalog/report-alpha.api.md index 3aae7d8920..82b6837cc7 100644 --- a/plugins/catalog/report-alpha.api.md +++ b/plugins/catalog/report-alpha.api.md @@ -1097,12 +1097,12 @@ const _default: OverridableFrontendPlugin< { title: string; icon?: string | undefined; - contentOrder?: 'title' | 'natural' | undefined; aliases?: string[] | undefined; + contentOrder?: 'title' | 'natural' | undefined; } >[] | undefined; - contentOrder: 'title' | 'natural'; + defaultContentOrder: 'title' | 'natural'; showNavItemIcons: boolean; path: string | undefined; title: string | undefined; @@ -1114,13 +1114,13 @@ const _default: OverridableFrontendPlugin< { title: string; icon?: string | undefined; - contentOrder?: 'title' | 'natural' | undefined; aliases?: string[] | undefined; + contentOrder?: 'title' | 'natural' | undefined; } >[] | undefined; + defaultContentOrder?: 'title' | 'natural' | undefined; showNavItemIcons?: boolean | undefined; - contentOrder?: 'title' | 'natural' | undefined; title?: string | undefined; path?: string | undefined; }; diff --git a/plugins/catalog/src/alpha/pages.test.tsx b/plugins/catalog/src/alpha/pages.test.tsx index 39f96f8d5e..a19c9017c0 100644 --- a/plugins/catalog/src/alpha/pages.test.tsx +++ b/plugins/catalog/src/alpha/pages.test.tsx @@ -523,7 +523,7 @@ describe('Entity page', () => { Object.assign({ namespace: 'catalog' }, catalogEntityPage), { config: { - contentOrder: 'natural', + defaultContentOrder: 'natural', }, }, ) @@ -564,7 +564,7 @@ describe('Entity page', () => { Object.assign({ namespace: 'catalog' }, catalogEntityPage), { config: { - contentOrder: 'title', + defaultContentOrder: 'title', groups: [ { documentation: { diff --git a/plugins/catalog/src/alpha/pages.tsx b/plugins/catalog/src/alpha/pages.tsx index 4d37a18c98..ab71cf39dc 100644 --- a/plugins/catalog/src/alpha/pages.tsx +++ b/plugins/catalog/src/alpha/pages.tsx @@ -115,7 +115,7 @@ export const catalogEntityPage = PageBlueprint.makeWithOverrides({ ), ) .optional(), - contentOrder: z => + defaultContentOrder: z => z.enum(['title', 'natural']).optional().default('title'), showNavItemIcons: z => z.boolean().optional().default(false), }, @@ -178,7 +178,7 @@ export const catalogEntityPage = PageBlueprint.makeWithOverrides({ header={header} contextMenuItems={filteredMenuItems} groupDefinitions={groupDefinitions} - defaultContentOrder={config.contentOrder} + defaultContentOrder={config.defaultContentOrder} showNavItemIcons={config.showNavItemIcons} > {inputs.contents.map(output => (