@backstage/plugin-catalog 1.33.1 → 2.0.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +87 -2
- package/dist/alpha/components/EntityLayout/EntityLayout.esm.js +2 -0
- package/dist/alpha/components/EntityLayout/EntityLayout.esm.js.map +1 -1
- package/dist/alpha/components/EntityTabs/EntityTabs.esm.js +3 -2
- package/dist/alpha/components/EntityTabs/EntityTabs.esm.js.map +1 -1
- package/dist/alpha/components/EntityTabs/EntityTabsList.esm.js +52 -6
- package/dist/alpha/components/EntityTabs/EntityTabsList.esm.js.map +1 -1
- package/dist/alpha/entityCards.esm.js +3 -3
- package/dist/alpha/entityCards.esm.js.map +1 -1
- package/dist/alpha/pages.esm.js +5 -1
- package/dist/alpha/pages.esm.js.map +1 -1
- package/dist/alpha/translation.esm.js +2 -0
- package/dist/alpha/translation.esm.js.map +1 -1
- package/dist/alpha.d.ts +8 -2
- package/dist/components/AboutCard/AboutCard.esm.js +57 -86
- package/dist/components/AboutCard/AboutCard.esm.js.map +1 -1
- package/dist/components/AboutCard/AboutContent.esm.js +22 -42
- package/dist/components/AboutCard/AboutContent.esm.js.map +1 -1
- package/dist/components/AboutCard/AboutField.esm.js +2 -3
- package/dist/components/AboutCard/AboutField.esm.js.map +1 -1
- package/dist/components/EntityLabelsCard/EntityLabelsCard.esm.js +33 -40
- package/dist/components/EntityLabelsCard/EntityLabelsCard.esm.js.map +1 -1
- package/dist/components/EntityLinksCard/EntityLinksCard.esm.js +3 -4
- package/dist/components/EntityLinksCard/EntityLinksCard.esm.js.map +1 -1
- package/dist/components/EntityLinksCard/LinksGridList.esm.js +9 -3
- package/dist/components/EntityLinksCard/LinksGridList.esm.js.map +1 -1
- package/dist/index.d.ts +3 -15
- package/dist/index.esm.js +7 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/package.json.esm.js +1 -1
- package/dist/plugin.esm.js.map +1 -1
- package/package.json +26 -26
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,95 @@
|
|
|
1
1
|
# @backstage/plugin-catalog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 2.0.0-next.2
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 5fc35bb: Migrated `EntityAboutCard`, `EntityLinksCard`, `EntityLabelsCard`, `GroupProfileCard`, and `UserProfileCard` from MUI/InfoCard to use the new BUI card layout and BUI components where possible.
|
|
8
|
+
|
|
9
|
+
**BREAKING**: Removed `variant` prop from EntityAboutCard, EntityUserProfileCard, EntityGroupProfileCard, EntityLabelsCard, EntityLinksCard. Removed `gridSizes` prop from `AboutField`.
|
|
10
|
+
|
|
11
|
+
**Migration:**
|
|
12
|
+
|
|
13
|
+
Simply delete the obsolete `variant` and `gridSizes` props, e.g:
|
|
14
|
+
|
|
15
|
+
```diff
|
|
16
|
+
- <EntityAboutCard variant="gridItem" />
|
|
17
|
+
+ <EntityAboutCard />
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
```diff
|
|
21
|
+
- <AboutField label="Owner" gridSizes={{ xs: 12, sm: 6, lg: 4 }} />
|
|
22
|
+
+ <AboutField label="Owner" />
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies
|
|
28
|
+
- @backstage/core-compat-api@0.5.9-next.2
|
|
29
|
+
- @backstage/ui@0.13.0-next.2
|
|
30
|
+
- @backstage/frontend-plugin-api@0.15.0-next.1
|
|
31
|
+
- @backstage/core-plugin-api@1.12.4-next.1
|
|
32
|
+
- @backstage/catalog-client@1.14.0-next.2
|
|
33
|
+
- @backstage/plugin-catalog-react@2.1.0-next.2
|
|
34
|
+
- @backstage/core-components@0.18.8-next.1
|
|
35
|
+
- @backstage/plugin-scaffolder-common@2.0.0-next.2
|
|
36
|
+
- @backstage/plugin-search-react@1.10.5-next.1
|
|
37
|
+
- @backstage/plugin-techdocs-react@1.3.9-next.1
|
|
38
|
+
|
|
39
|
+
## 1.34.0-next.1
|
|
40
|
+
|
|
41
|
+
### Minor Changes
|
|
42
|
+
|
|
43
|
+
- 4d58894: 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.
|
|
4
44
|
|
|
5
45
|
### Patch Changes
|
|
6
46
|
|
|
7
|
-
-
|
|
47
|
+
- 07ba746: Fixed entity page tab groups not respecting the ordering from the `groups` configuration.
|
|
48
|
+
- Updated dependencies
|
|
49
|
+
- @backstage/ui@0.13.0-next.1
|
|
50
|
+
- @backstage/catalog-client@1.14.0-next.1
|
|
51
|
+
- @backstage/plugin-catalog-react@2.1.0-next.1
|
|
52
|
+
- @backstage/plugin-scaffolder-common@2.0.0-next.1
|
|
53
|
+
- @backstage/catalog-model@1.7.6
|
|
54
|
+
- @backstage/core-compat-api@0.5.9-next.1
|
|
55
|
+
- @backstage/core-components@0.18.8-next.0
|
|
56
|
+
- @backstage/core-plugin-api@1.12.4-next.0
|
|
57
|
+
- @backstage/errors@1.2.7
|
|
58
|
+
- @backstage/frontend-plugin-api@0.14.2-next.0
|
|
59
|
+
- @backstage/integration-react@1.2.16-next.1
|
|
60
|
+
- @backstage/types@1.2.2
|
|
61
|
+
- @backstage/version-bridge@1.0.12
|
|
62
|
+
- @backstage/plugin-catalog-common@1.1.8
|
|
63
|
+
- @backstage/plugin-permission-react@0.4.41-next.0
|
|
64
|
+
- @backstage/plugin-search-common@1.2.22
|
|
65
|
+
- @backstage/plugin-search-react@1.10.5-next.0
|
|
66
|
+
- @backstage/plugin-techdocs-common@0.1.1
|
|
67
|
+
- @backstage/plugin-techdocs-react@1.3.9-next.0
|
|
68
|
+
|
|
69
|
+
## 1.33.1-next.0
|
|
70
|
+
|
|
71
|
+
### Patch Changes
|
|
72
|
+
|
|
73
|
+
- Updated dependencies
|
|
74
|
+
- @backstage/ui@0.12.1-next.0
|
|
75
|
+
- @backstage/plugin-search-react@1.10.5-next.0
|
|
76
|
+
- @backstage/frontend-plugin-api@0.14.2-next.0
|
|
77
|
+
- @backstage/catalog-client@1.13.1-next.0
|
|
78
|
+
- @backstage/plugin-catalog-react@2.0.1-next.0
|
|
79
|
+
- @backstage/catalog-model@1.7.6
|
|
80
|
+
- @backstage/core-compat-api@0.5.9-next.0
|
|
81
|
+
- @backstage/core-components@0.18.8-next.0
|
|
82
|
+
- @backstage/core-plugin-api@1.12.4-next.0
|
|
83
|
+
- @backstage/errors@1.2.7
|
|
84
|
+
- @backstage/integration-react@1.2.16-next.0
|
|
85
|
+
- @backstage/types@1.2.2
|
|
86
|
+
- @backstage/version-bridge@1.0.12
|
|
87
|
+
- @backstage/plugin-catalog-common@1.1.8
|
|
88
|
+
- @backstage/plugin-permission-react@0.4.41-next.0
|
|
89
|
+
- @backstage/plugin-scaffolder-common@1.7.7-next.0
|
|
90
|
+
- @backstage/plugin-search-common@1.2.22
|
|
91
|
+
- @backstage/plugin-techdocs-common@0.1.1
|
|
92
|
+
- @backstage/plugin-techdocs-react@1.3.9-next.0
|
|
8
93
|
|
|
9
94
|
## 1.33.0
|
|
10
95
|
|
|
@@ -22,6 +22,7 @@ const EntityLayout = (props) => {
|
|
|
22
22
|
NotFoundComponent,
|
|
23
23
|
parentEntityRelations,
|
|
24
24
|
groupDefinitions,
|
|
25
|
+
defaultContentOrder,
|
|
25
26
|
showNavItemIcons
|
|
26
27
|
} = props;
|
|
27
28
|
const { kind } = useRouteRefParams(entityRouteRef);
|
|
@@ -67,6 +68,7 @@ const EntityLayout = (props) => {
|
|
|
67
68
|
{
|
|
68
69
|
routes,
|
|
69
70
|
groupDefinitions,
|
|
71
|
+
defaultContentOrder,
|
|
70
72
|
showIcons: showNavItemIcons
|
|
71
73
|
}
|
|
72
74
|
),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityLayout.esm.js","sources":["../../../../src/alpha/components/EntityLayout/EntityLayout.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ComponentProps, ReactNode, ReactElement } from 'react';\n\nimport Alert from '@material-ui/lab/Alert';\n\nimport {\n attachComponentData,\n useElementFilter,\n useRouteRefParams,\n} from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport {\n Content,\n Link,\n Page,\n Progress,\n WarningPanel,\n} from '@backstage/core-components';\nimport { Entity } from '@backstage/catalog-model';\nimport {\n entityRouteRef,\n useAsyncEntity,\n} from '@backstage/plugin-catalog-react';\n\nimport { catalogTranslationRef } from '../../translation';\nimport { EntityHeader } from '../EntityHeader';\nimport { EntityTabs } from '../EntityTabs';\nimport { EntityContentGroupDefinitions } from '@backstage/plugin-catalog-react/alpha';\n\nexport type EntityLayoutRouteProps = {\n path: string;\n title: string;\n group?: string;\n icon?: string | ReactElement;\n children: JSX.Element;\n if?: (entity: Entity) => boolean;\n};\n\nconst dataKey = 'plugin.catalog.entityLayoutRoute';\nconst Route: (props: EntityLayoutRouteProps) => null = () => null;\nattachComponentData(Route, dataKey, true);\nattachComponentData(Route, 'core.gatherMountPoints', true); // This causes all mount points that are discovered within this route to use the path of the route itself\n\n/** @public */\nexport interface EntityLayoutProps {\n UNSTABLE_contextMenuOptions?: ComponentProps<\n typeof EntityHeader\n >['UNSTABLE_contextMenuOptions'];\n UNSTABLE_extraContextMenuItems?: ComponentProps<\n typeof EntityHeader\n >['UNSTABLE_extraContextMenuItems'];\n contextMenuItems?: ComponentProps<typeof EntityHeader>['contextMenuItems'];\n children?: ReactNode;\n header?: JSX.Element;\n NotFoundComponent?: ReactNode;\n /**\n * An array of relation types used to determine the parent entities in the hierarchy.\n * These relations are prioritized in the order provided, allowing for flexible\n * navigation through entity relationships.\n *\n * For example, use relation types like `[\"partOf\", \"memberOf\", \"ownedBy\"]` to define how the entity is related to\n * its parents in the Entity Catalog.\n *\n * It adds breadcrumbs in the Entity page to enhance user navigation and context awareness.\n */\n parentEntityRelations?: string[];\n groupDefinitions: EntityContentGroupDefinitions;\n showNavItemIcons?: boolean;\n}\n\n/**\n * EntityLayout is a compound component, which allows you to define a layout for\n * entities using a sub-navigation mechanism.\n *\n * Consists of two parts: EntityLayout and EntityLayout.Route\n *\n * @example\n * ```jsx\n * <EntityLayout>\n * <EntityLayout.Route path=\"/example\" title=\"Example tab\">\n * <div>This is rendered under /example/anything-here route</div>\n * </EntityLayout.Route>\n * </EntityLayout>\n * ```\n *\n * @public\n */\nexport const EntityLayout = (props: EntityLayoutProps) => {\n const {\n UNSTABLE_extraContextMenuItems,\n UNSTABLE_contextMenuOptions,\n contextMenuItems,\n children,\n header,\n NotFoundComponent,\n parentEntityRelations,\n groupDefinitions,\n showNavItemIcons,\n } = props;\n const { kind } = useRouteRefParams(entityRouteRef);\n const { entity, loading, error } = useAsyncEntity();\n\n const routes = useElementFilter(\n children,\n elements =>\n elements\n .selectByComponentData({\n key: dataKey,\n withStrictError:\n 'Child of EntityLayout must be an EntityLayout.Route',\n })\n .getElements<EntityLayoutRouteProps>() // all nodes, element data, maintain structure or not?\n .flatMap(({ props: elementProps }) => {\n if (!entity) {\n return [];\n }\n if (elementProps.if && !elementProps.if(entity)) {\n return [];\n }\n return [\n {\n path: elementProps.path,\n title: elementProps.title,\n group: elementProps.group,\n children: elementProps.children,\n icon: elementProps.icon,\n },\n ];\n }),\n [entity],\n );\n\n const { t } = useTranslationRef(catalogTranslationRef);\n\n return (\n <Page themeId={entity?.spec?.type?.toString() ?? 'home'}>\n {header ?? (\n <EntityHeader\n parentEntityRelations={parentEntityRelations}\n UNSTABLE_contextMenuOptions={UNSTABLE_contextMenuOptions}\n UNSTABLE_extraContextMenuItems={UNSTABLE_extraContextMenuItems}\n contextMenuItems={contextMenuItems}\n />\n )}\n\n {loading && <Progress />}\n\n {entity && (\n <EntityTabs\n routes={routes}\n groupDefinitions={groupDefinitions}\n showIcons={showNavItemIcons}\n />\n )}\n\n {error && (\n <Content>\n <Alert severity=\"error\">{error.toString()}</Alert>\n </Content>\n )}\n\n {!loading && !error && !entity && (\n <Content>\n {NotFoundComponent ? (\n NotFoundComponent\n ) : (\n <WarningPanel title={t('entityLabels.warningPanelTitle')}>\n {t('entityPage.notFoundMessage', {\n kind,\n link: (\n <Link to=\"https://backstage.io/docs/features/software-catalog/references\">\n {t('entityPage.notFoundLinkText')}\n </Link>\n ),\n })}\n </WarningPanel>\n )}\n </Content>\n )}\n </Page>\n );\n};\n\nEntityLayout.Route = Route;\n"],"names":[],"mappings":";;;;;;;;;;AAqDA,MAAM,OAAA,GAAU,kCAAA;AAChB,MAAM,QAAiD,MAAM,IAAA;AAC7D,mBAAA,CAAoB,KAAA,EAAO,SAAS,IAAI,CAAA;AACxC,mBAAA,CAAoB,KAAA,EAAO,0BAA0B,IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"EntityLayout.esm.js","sources":["../../../../src/alpha/components/EntityLayout/EntityLayout.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ComponentProps, ReactNode, ReactElement } from 'react';\n\nimport Alert from '@material-ui/lab/Alert';\n\nimport {\n attachComponentData,\n useElementFilter,\n useRouteRefParams,\n} from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport {\n Content,\n Link,\n Page,\n Progress,\n WarningPanel,\n} from '@backstage/core-components';\nimport { Entity } from '@backstage/catalog-model';\nimport {\n entityRouteRef,\n useAsyncEntity,\n} from '@backstage/plugin-catalog-react';\n\nimport { catalogTranslationRef } from '../../translation';\nimport { EntityHeader } from '../EntityHeader';\nimport { EntityTabs } from '../EntityTabs';\nimport { EntityContentGroupDefinitions } from '@backstage/plugin-catalog-react/alpha';\n\nexport type EntityLayoutRouteProps = {\n path: string;\n title: string;\n group?: string;\n icon?: string | ReactElement;\n children: JSX.Element;\n if?: (entity: Entity) => boolean;\n};\n\nconst dataKey = 'plugin.catalog.entityLayoutRoute';\nconst Route: (props: EntityLayoutRouteProps) => null = () => null;\nattachComponentData(Route, dataKey, true);\nattachComponentData(Route, 'core.gatherMountPoints', true); // This causes all mount points that are discovered within this route to use the path of the route itself\n\n/** @public */\nexport interface EntityLayoutProps {\n UNSTABLE_contextMenuOptions?: ComponentProps<\n typeof EntityHeader\n >['UNSTABLE_contextMenuOptions'];\n UNSTABLE_extraContextMenuItems?: ComponentProps<\n typeof EntityHeader\n >['UNSTABLE_extraContextMenuItems'];\n contextMenuItems?: ComponentProps<typeof EntityHeader>['contextMenuItems'];\n children?: ReactNode;\n header?: JSX.Element;\n NotFoundComponent?: ReactNode;\n /**\n * An array of relation types used to determine the parent entities in the hierarchy.\n * These relations are prioritized in the order provided, allowing for flexible\n * navigation through entity relationships.\n *\n * For example, use relation types like `[\"partOf\", \"memberOf\", \"ownedBy\"]` to define how the entity is related to\n * its parents in the Entity Catalog.\n *\n * It adds breadcrumbs in the Entity page to enhance user navigation and context awareness.\n */\n parentEntityRelations?: string[];\n groupDefinitions: EntityContentGroupDefinitions;\n defaultContentOrder?: 'title' | 'natural';\n showNavItemIcons?: boolean;\n}\n\n/**\n * EntityLayout is a compound component, which allows you to define a layout for\n * entities using a sub-navigation mechanism.\n *\n * Consists of two parts: EntityLayout and EntityLayout.Route\n *\n * @example\n * ```jsx\n * <EntityLayout>\n * <EntityLayout.Route path=\"/example\" title=\"Example tab\">\n * <div>This is rendered under /example/anything-here route</div>\n * </EntityLayout.Route>\n * </EntityLayout>\n * ```\n *\n * @public\n */\nexport const EntityLayout = (props: EntityLayoutProps) => {\n const {\n UNSTABLE_extraContextMenuItems,\n UNSTABLE_contextMenuOptions,\n contextMenuItems,\n children,\n header,\n NotFoundComponent,\n parentEntityRelations,\n groupDefinitions,\n defaultContentOrder,\n showNavItemIcons,\n } = props;\n const { kind } = useRouteRefParams(entityRouteRef);\n const { entity, loading, error } = useAsyncEntity();\n\n const routes = useElementFilter(\n children,\n elements =>\n elements\n .selectByComponentData({\n key: dataKey,\n withStrictError:\n 'Child of EntityLayout must be an EntityLayout.Route',\n })\n .getElements<EntityLayoutRouteProps>() // all nodes, element data, maintain structure or not?\n .flatMap(({ props: elementProps }) => {\n if (!entity) {\n return [];\n }\n if (elementProps.if && !elementProps.if(entity)) {\n return [];\n }\n return [\n {\n path: elementProps.path,\n title: elementProps.title,\n group: elementProps.group,\n children: elementProps.children,\n icon: elementProps.icon,\n },\n ];\n }),\n [entity],\n );\n\n const { t } = useTranslationRef(catalogTranslationRef);\n\n return (\n <Page themeId={entity?.spec?.type?.toString() ?? 'home'}>\n {header ?? (\n <EntityHeader\n parentEntityRelations={parentEntityRelations}\n UNSTABLE_contextMenuOptions={UNSTABLE_contextMenuOptions}\n UNSTABLE_extraContextMenuItems={UNSTABLE_extraContextMenuItems}\n contextMenuItems={contextMenuItems}\n />\n )}\n\n {loading && <Progress />}\n\n {entity && (\n <EntityTabs\n routes={routes}\n groupDefinitions={groupDefinitions}\n defaultContentOrder={defaultContentOrder}\n showIcons={showNavItemIcons}\n />\n )}\n\n {error && (\n <Content>\n <Alert severity=\"error\">{error.toString()}</Alert>\n </Content>\n )}\n\n {!loading && !error && !entity && (\n <Content>\n {NotFoundComponent ? (\n NotFoundComponent\n ) : (\n <WarningPanel title={t('entityLabels.warningPanelTitle')}>\n {t('entityPage.notFoundMessage', {\n kind,\n link: (\n <Link to=\"https://backstage.io/docs/features/software-catalog/references\">\n {t('entityPage.notFoundLinkText')}\n </Link>\n ),\n })}\n </WarningPanel>\n )}\n </Content>\n )}\n </Page>\n );\n};\n\nEntityLayout.Route = Route;\n"],"names":[],"mappings":";;;;;;;;;;AAqDA,MAAM,OAAA,GAAU,kCAAA;AAChB,MAAM,QAAiD,MAAM,IAAA;AAC7D,mBAAA,CAAoB,KAAA,EAAO,SAAS,IAAI,CAAA;AACxC,mBAAA,CAAoB,KAAA,EAAO,0BAA0B,IAAI,CAAA;AA+ClD,MAAM,YAAA,GAAe,CAAC,KAAA,KAA6B;AACxD,EAAA,MAAM;AAAA,IACJ,8BAAA;AAAA,IACA,2BAAA;AAAA,IACA,gBAAA;AAAA,IACA,QAAA;AAAA,IACA,MAAA;AAAA,IACA,iBAAA;AAAA,IACA,qBAAA;AAAA,IACA,gBAAA;AAAA,IACA,mBAAA;AAAA,IACA;AAAA,GACF,GAAI,KAAA;AACJ,EAAA,MAAM,EAAE,IAAA,EAAK,GAAI,iBAAA,CAAkB,cAAc,CAAA;AACjD,EAAA,MAAM,EAAE,MAAA,EAAQ,OAAA,EAAS,KAAA,KAAU,cAAA,EAAe;AAElD,EAAA,MAAM,MAAA,GAAS,gBAAA;AAAA,IACb,QAAA;AAAA,IACA,CAAA,QAAA,KACE,SACG,qBAAA,CAAsB;AAAA,MACrB,GAAA,EAAK,OAAA;AAAA,MACL,eAAA,EACE;AAAA,KACH,EACA,WAAA,EAAoC,CACpC,QAAQ,CAAC,EAAE,KAAA,EAAO,YAAA,EAAa,KAAM;AACpC,MAAA,IAAI,CAAC,MAAA,EAAQ;AACX,QAAA,OAAO,EAAC;AAAA,MACV;AACA,MAAA,IAAI,aAAa,EAAA,IAAM,CAAC,YAAA,CAAa,EAAA,CAAG,MAAM,CA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;AAAA,MAC/B,IAAA;AAAA,MACA,sBACE,GAAA,CAAC,IAAA,EAAA,EAAK,IAAG,gEAAA,EACN,QAAA,EAAA,CAAA,CAAE,6BAA6B,CAAA,EAClC;AAAA,KAEH,GACH,CAAA,EAEJ;AAAA,GAAA,EAEJ,CAAA;AAEJ;AAEA,YAAA,CAAa,KAAA,GAAQ,KAAA;;;;"}
|
|
@@ -32,7 +32,7 @@ function useSelectedSubRoute(subRoutes) {
|
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
function EntityTabs(props) {
|
|
35
|
-
const { routes, groupDefinitions, showIcons } = props;
|
|
35
|
+
const { routes, groupDefinitions, defaultContentOrder, showIcons } = props;
|
|
36
36
|
const { index, route, element } = useSelectedSubRoute(routes);
|
|
37
37
|
const tabs = useMemo(
|
|
38
38
|
() => routes.map((t) => {
|
|
@@ -57,7 +57,8 @@ function EntityTabs(props) {
|
|
|
57
57
|
tabs,
|
|
58
58
|
selectedIndex: index,
|
|
59
59
|
showIcons,
|
|
60
|
-
groupDefinitions
|
|
60
|
+
groupDefinitions,
|
|
61
|
+
defaultContentOrder
|
|
61
62
|
}
|
|
62
63
|
),
|
|
63
64
|
/* @__PURE__ */ jsxs(EntityTabsPanel, { children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityTabs.esm.js","sources":["../../../../src/alpha/components/EntityTabs/EntityTabs.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ReactElement, useMemo } from 'react';\nimport { Helmet } from 'react-helmet';\nimport { matchRoutes, useParams, useRoutes } from 'react-router-dom';\nimport { EntityTabsPanel } from './EntityTabsPanel';\nimport { EntityTabsList } from './EntityTabsList';\nimport { EntityContentGroupDefinitions } from '@backstage/plugin-catalog-react/alpha';\n\ntype SubRoute = {\n group?: string;\n path: string;\n title: string;\n icon?: string | ReactElement;\n children: JSX.Element;\n};\n\nexport function useSelectedSubRoute(subRoutes: SubRoute[]): {\n index: number;\n route?: SubRoute;\n element?: JSX.Element;\n} {\n const params = useParams();\n\n const routes = subRoutes.map(({ path, children }) => ({\n caseSensitive: false,\n path: `${path}/*`,\n element: children,\n }));\n\n // TODO: remove once react-router updated\n const sortedRoutes = routes.sort((a, b) =>\n // remove \"/*\" symbols from path end before comparing\n b.path.replace(/\\/\\*$/, '').localeCompare(a.path.replace(/\\/\\*$/, '')),\n );\n\n const element = useRoutes(sortedRoutes) ?? subRoutes[0]?.children;\n\n // TODO(Rugvip): Once we only support v6 stable we can always prefix\n // This avoids having a double / prefix for react-router v6 beta, which in turn breaks\n // the tab highlighting when using relative paths for the tabs.\n let currentRoute = params['*'] ?? '';\n if (!currentRoute.startsWith('/')) {\n currentRoute = `/${currentRoute}`;\n }\n\n const [matchedRoute] = matchRoutes(sortedRoutes, currentRoute) ?? [];\n const foundIndex = matchedRoute\n ? subRoutes.findIndex(t => `${t.path}/*` === matchedRoute.route.path)\n : 0;\n\n return {\n index: foundIndex === -1 ? 0 : foundIndex,\n element,\n route: subRoutes[foundIndex] ?? subRoutes[0],\n };\n}\n\ntype EntityTabsProps = {\n routes: SubRoute[];\n groupDefinitions: EntityContentGroupDefinitions;\n showIcons?: boolean;\n};\n\nexport function EntityTabs(props: EntityTabsProps) {\n const { routes, groupDefinitions, showIcons } = props;\n\n const { index, route, element } = useSelectedSubRoute(routes);\n\n const tabs = useMemo(\n () =>\n routes.map(t => {\n const { path, title, group, icon } = t;\n let to = path;\n // Remove trailing /*\n to = to.replace(/\\/\\*$/, '');\n // And remove leading / for relative navigation\n to = to.replace(/^\\//, '');\n return {\n group,\n id: path,\n path: to,\n label: title,\n icon,\n };\n }),\n [routes],\n );\n\n return (\n <>\n <EntityTabsList\n tabs={tabs}\n selectedIndex={index}\n showIcons={showIcons}\n groupDefinitions={groupDefinitions}\n />\n <EntityTabsPanel>\n <Helmet title={route?.title} />\n {element}\n </EntityTabsPanel>\n </>\n );\n}\n"],"names":[],"mappings":";;;;;;;AA8BO,SAAS,oBAAoB,SAAA,EAIlC;AACA,EAAA,MAAM,SAAS,SAAA,EAAU;AAEzB,EAAA,MAAM,SAAS,SAAA,CAAU,GAAA,CAAI,CAAC,EAAE,IAAA,EAAM,UAAS,MAAO;AAAA,IACpD,aAAA,EAAe,KAAA;AAAA,IACf,IAAA,EAAM,GAAG,IAAI,CAAA,EAAA,CAAA;AAAA,IACb,OAAA,EAAS;AAAA,GACX,CAAE,CAAA;AAGF,EAAA,MAAM,eAAe,MAAA,CAAO,IAAA;AAAA,IAAK,CAAC,CAAA,EAAG,CAAA;AAAA;AAAA,MAEnC,CAAA,CAAE,IAAA,CAAK,OAAA,CAAQ,OAAA,EAAS,EAAE,CAAA,CAAE,aAAA,CAAc,CAAA,CAAE,IAAA,CAAK,OAAA,CAAQ,OAAA,EAAS,EAAE,CAAC;AAAA;AAAA,GACvE;AAEA,EAAA,MAAM,UAAU,SAAA,CAAU,YAAY,CAAA,IAAK,SAAA,CAAU,CAAC,CAAA,EAAG,QAAA;AAKzD,EAAA,IAAI,YAAA,GAAe,MAAA,CAAO,GAAG,CAAA,IAAK,EAAA;AAClC,EAAA,IAAI,CAAC,YAAA,CAAa,UAAA,CAAW,GAAG,CAAA,EAAG;AACjC,IAAA,YAAA,GAAe,IAAI,YAAY,CAAA,CAAA;AAAA,EACjC;AAEA,EAAA,MAAM,CAAC,YAAY,CAAA,GAAI,YAAY,YAAA,EAAc,YAAY,KAAK,EAAC;AACnE,EAAA,MAAM,UAAA,GAAa,YAAA,GACf,SAAA,CAAU,SAAA,CAAU,CAAA,CAAA,KAAK,CAAA,EAAG,CAAA,CAAE,IAAI,CAAA,EAAA,CAAA,KAAS,YAAA,CAAa,KAAA,CAAM,IAAI,CAAA,GAClE,CAAA;AAEJ,EAAA,OAAO;AAAA,IACL,KAAA,EAAO,UAAA,KAAe,EAAA,GAAK,CAAA,GAAI,UAAA;AAAA,IAC/B,OAAA;AAAA,IACA,KAAA,EAAO,SAAA,CAAU,UAAU,CAAA,IAAK,UAAU,CAAC;AAAA,GAC7C;AACF;
|
|
1
|
+
{"version":3,"file":"EntityTabs.esm.js","sources":["../../../../src/alpha/components/EntityTabs/EntityTabs.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ReactElement, useMemo } from 'react';\nimport { Helmet } from 'react-helmet';\nimport { matchRoutes, useParams, useRoutes } from 'react-router-dom';\nimport { EntityTabsPanel } from './EntityTabsPanel';\nimport { EntityTabsList } from './EntityTabsList';\nimport { EntityContentGroupDefinitions } from '@backstage/plugin-catalog-react/alpha';\n\ntype SubRoute = {\n group?: string;\n path: string;\n title: string;\n icon?: string | ReactElement;\n children: JSX.Element;\n};\n\nexport function useSelectedSubRoute(subRoutes: SubRoute[]): {\n index: number;\n route?: SubRoute;\n element?: JSX.Element;\n} {\n const params = useParams();\n\n const routes = subRoutes.map(({ path, children }) => ({\n caseSensitive: false,\n path: `${path}/*`,\n element: children,\n }));\n\n // TODO: remove once react-router updated\n const sortedRoutes = routes.sort((a, b) =>\n // remove \"/*\" symbols from path end before comparing\n b.path.replace(/\\/\\*$/, '').localeCompare(a.path.replace(/\\/\\*$/, '')),\n );\n\n const element = useRoutes(sortedRoutes) ?? subRoutes[0]?.children;\n\n // TODO(Rugvip): Once we only support v6 stable we can always prefix\n // This avoids having a double / prefix for react-router v6 beta, which in turn breaks\n // the tab highlighting when using relative paths for the tabs.\n let currentRoute = params['*'] ?? '';\n if (!currentRoute.startsWith('/')) {\n currentRoute = `/${currentRoute}`;\n }\n\n const [matchedRoute] = matchRoutes(sortedRoutes, currentRoute) ?? [];\n const foundIndex = matchedRoute\n ? subRoutes.findIndex(t => `${t.path}/*` === matchedRoute.route.path)\n : 0;\n\n return {\n index: foundIndex === -1 ? 0 : foundIndex,\n element,\n route: subRoutes[foundIndex] ?? subRoutes[0],\n };\n}\n\ntype EntityTabsProps = {\n routes: SubRoute[];\n groupDefinitions: EntityContentGroupDefinitions;\n defaultContentOrder?: 'title' | 'natural';\n showIcons?: boolean;\n};\n\nexport function EntityTabs(props: EntityTabsProps) {\n const { routes, groupDefinitions, defaultContentOrder, showIcons } = props;\n\n const { index, route, element } = useSelectedSubRoute(routes);\n\n const tabs = useMemo(\n () =>\n routes.map(t => {\n const { path, title, group, icon } = t;\n let to = path;\n // Remove trailing /*\n to = to.replace(/\\/\\*$/, '');\n // And remove leading / for relative navigation\n to = to.replace(/^\\//, '');\n return {\n group,\n id: path,\n path: to,\n label: title,\n icon,\n };\n }),\n [routes],\n );\n\n return (\n <>\n <EntityTabsList\n tabs={tabs}\n selectedIndex={index}\n showIcons={showIcons}\n groupDefinitions={groupDefinitions}\n defaultContentOrder={defaultContentOrder}\n />\n <EntityTabsPanel>\n <Helmet title={route?.title} />\n {element}\n </EntityTabsPanel>\n </>\n );\n}\n"],"names":[],"mappings":";;;;;;;AA8BO,SAAS,oBAAoB,SAAA,EAIlC;AACA,EAAA,MAAM,SAAS,SAAA,EAAU;AAEzB,EAAA,MAAM,SAAS,SAAA,CAAU,GAAA,CAAI,CAAC,EAAE,IAAA,EAAM,UAAS,MAAO;AAAA,IACpD,aAAA,EAAe,KAAA;AAAA,IACf,IAAA,EAAM,GAAG,IAAI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AAI,oBAAoB,MAAM,CAAA;AAE5D,EAAA,MAAM,IAAA,GAAO,OAAA;AAAA,IACX,MACE,MAAA,CAAO,GAAA,CAAI,CAAA,CAAA,KAAK;AACd,MAAA,MAAM,EAAE,IAAA,EAAM,KAAA,EAAO,KAAA,EAAO,MAAK,GAAI,CAAA;AACrC,MAAA,IAAI,EAAA,GAAK,IAAA;AAET,MAAA,EAAA,GAAK,EAAA,CAAG,OAAA,CAAQ,OAAA,EAAS,EAAE,CAAA;AAE3B,MAAA,EAAA,GAAK,EAAA,CAAG,OAAA,CAAQ,KAAA,EAAO,EAAE,CAAA;AACzB,MAAA,OAAO;AAAA,QACL,KAAA;AAAA,QACA,EAAA,EAAI,IAAA;AAAA,QACJ,IAAA,EAAM,EAAA;AAAA,QACN,KAAA,EAAO,KAAA;AAAA,QACP;AAAA,OACF;AAAA,IACF,CAAC,CAAA;AAAA,IACH,CAAC,MAAM;AAAA,GACT;AAEA,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,cAAA;AAAA,MAAA;AAAA,QACC,IAAA;AAAA,QACA,aAAA,EAAe,KAAA;AAAA,QACf,SAAA;AAAA,QACA,gBAAA;AAAA,QACA;AAAA;AAAA,KACF;AAAA,yBACC,eAAA,EAAA,EACC,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,MAAA,EAAA,EAAO,KAAA,EAAO,KAAA,EAAO,KAAA,EAAO,CAAA;AAAA,MAC5B;AAAA,KAAA,EACH;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -34,14 +34,43 @@ const useStyles = makeStyles(
|
|
|
34
34
|
}),
|
|
35
35
|
{ name: "BackstageHeaderTabs" }
|
|
36
36
|
);
|
|
37
|
+
function resolveGroupId(tabGroup, groupDefinitions, aliasToGroup) {
|
|
38
|
+
if (!tabGroup) {
|
|
39
|
+
return void 0;
|
|
40
|
+
}
|
|
41
|
+
if (groupDefinitions[tabGroup]) {
|
|
42
|
+
return tabGroup;
|
|
43
|
+
}
|
|
44
|
+
return aliasToGroup[tabGroup];
|
|
45
|
+
}
|
|
37
46
|
function EntityTabsList(props) {
|
|
38
47
|
const styles = useStyles();
|
|
39
48
|
const { t } = useTranslationRef(catalogTranslationRef);
|
|
40
|
-
const {
|
|
49
|
+
const {
|
|
50
|
+
tabs: items,
|
|
51
|
+
selectedIndex = 0,
|
|
52
|
+
showIcons,
|
|
53
|
+
groupDefinitions,
|
|
54
|
+
defaultContentOrder = "title"
|
|
55
|
+
} = props;
|
|
56
|
+
const aliasToGroup = useMemo(
|
|
57
|
+
() => Object.entries(groupDefinitions).reduce((map, [groupId, def]) => {
|
|
58
|
+
for (const alias of def.aliases ?? []) {
|
|
59
|
+
map[alias] = groupId;
|
|
60
|
+
}
|
|
61
|
+
return map;
|
|
62
|
+
}, {}),
|
|
63
|
+
[groupDefinitions]
|
|
64
|
+
);
|
|
41
65
|
const groups = useMemo(() => {
|
|
42
66
|
const byKey = items.reduce((result, tab) => {
|
|
43
|
-
const
|
|
44
|
-
|
|
67
|
+
const resolvedGroupId = resolveGroupId(
|
|
68
|
+
tab.group,
|
|
69
|
+
groupDefinitions,
|
|
70
|
+
aliasToGroup
|
|
71
|
+
);
|
|
72
|
+
const group = resolvedGroupId ? groupDefinitions[resolvedGroupId] : void 0;
|
|
73
|
+
const groupOrId = group && resolvedGroupId ? resolvedGroupId : tab.id;
|
|
45
74
|
result[groupOrId] = result[groupOrId] ?? {
|
|
46
75
|
group,
|
|
47
76
|
items: []
|
|
@@ -50,7 +79,7 @@ function EntityTabsList(props) {
|
|
|
50
79
|
return result;
|
|
51
80
|
}, {});
|
|
52
81
|
const groupOrder = Object.keys(groupDefinitions);
|
|
53
|
-
|
|
82
|
+
const sorted = Object.entries(byKey).sort(([a], [b]) => {
|
|
54
83
|
const ai = groupOrder.indexOf(a);
|
|
55
84
|
const bi = groupOrder.indexOf(b);
|
|
56
85
|
if (ai !== -1 && bi !== -1) {
|
|
@@ -64,8 +93,25 @@ function EntityTabsList(props) {
|
|
|
64
93
|
}
|
|
65
94
|
return 0;
|
|
66
95
|
});
|
|
67
|
-
|
|
96
|
+
for (const [id, tabGroup] of sorted) {
|
|
97
|
+
const groupDef = groupDefinitions[id];
|
|
98
|
+
if (groupDef) {
|
|
99
|
+
const order = groupDef.contentOrder ?? defaultContentOrder;
|
|
100
|
+
if (order === "title") {
|
|
101
|
+
tabGroup.items.sort(
|
|
102
|
+
(a, b) => a.label.localeCompare(b.label, void 0, { sensitivity: "base" })
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return sorted;
|
|
108
|
+
}, [items, groupDefinitions, aliasToGroup, defaultContentOrder]);
|
|
68
109
|
const selectedItem = items[selectedIndex];
|
|
110
|
+
const selectedGroup = resolveGroupId(
|
|
111
|
+
selectedItem?.group,
|
|
112
|
+
groupDefinitions,
|
|
113
|
+
aliasToGroup
|
|
114
|
+
);
|
|
69
115
|
return /* @__PURE__ */ jsx(Box, { className: styles.tabsWrapper, children: /* @__PURE__ */ jsx(
|
|
70
116
|
Tabs,
|
|
71
117
|
{
|
|
@@ -75,7 +121,7 @@ function EntityTabsList(props) {
|
|
|
75
121
|
variant: "scrollable",
|
|
76
122
|
scrollButtons: "auto",
|
|
77
123
|
"aria-label": t("entityTabs.tabsAriaLabel"),
|
|
78
|
-
value:
|
|
124
|
+
value: selectedGroup ?? selectedItem?.id,
|
|
79
125
|
children: groups.map(([id, tabGroup]) => /* @__PURE__ */ jsx(
|
|
80
126
|
EntityTabsGroup,
|
|
81
127
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityTabsList.esm.js","sources":["../../../../src/alpha/components/EntityTabs/EntityTabsList.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ReactElement, useMemo } from 'react';\nimport Box from '@material-ui/core/Box';\nimport Tabs from '@material-ui/core/Tabs';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { EntityContentGroupDefinitions } from '@backstage/plugin-catalog-react/alpha';\n\nimport { EntityTabsGroup } from './EntityTabsGroup';\nimport { catalogTranslationRef } from '../../translation';\n\n/** @public */\nexport type HeaderTabsClassKey =\n | 'tabsWrapper'\n | 'defaultTab'\n | 'selected'\n | 'tabRoot';\n\nconst useStyles = makeStyles(\n theme => ({\n tabsWrapper: {\n gridArea: 'pageSubheader',\n backgroundColor: theme.palette.background.paper,\n paddingLeft: theme.spacing(3),\n minWidth: 0,\n },\n defaultTab: {\n ...theme.typography.caption,\n padding: theme.spacing(3, 3),\n textTransform: 'uppercase',\n fontWeight: theme.typography.fontWeightBold,\n color: theme.palette.text.secondary,\n },\n selected: {\n color: theme.palette.text.primary,\n },\n tabRoot: {\n '&:hover': {\n backgroundColor: theme.palette.background.default,\n color: theme.palette.text.primary,\n },\n },\n }),\n { name: 'BackstageHeaderTabs' },\n);\n\ntype Tab = {\n id: string;\n label: string;\n path: string;\n group?: string;\n icon?: string | ReactElement;\n};\n\ntype TabGroup = {\n group?: {\n title: string;\n icon?: string | ReactElement;\n };\n items: Array<Omit<Tab, 'group'>>;\n};\n\ntype EntityTabsListProps = {\n tabs: Tab[];\n groupDefinitions: EntityContentGroupDefinitions;\n showIcons?: boolean;\n selectedIndex?: number;\n};\n\nexport function EntityTabsList(props: EntityTabsListProps) {\n const styles = useStyles();\n const { t } = useTranslationRef(catalogTranslationRef);\n\n const { tabs: items, selectedIndex = 0, showIcons, groupDefinitions } = props;\n\n const groups = useMemo(() => {\n const byKey = items.reduce((result, tab) => {\n const group = tab.group ? groupDefinitions[tab.group] : undefined;\n const groupOrId = group && tab.group ? tab.group : tab.id;\n result[groupOrId] = result[groupOrId] ?? {\n group,\n items: [],\n };\n result[groupOrId].items.push(tab);\n return result;\n }, {} as Record<string, TabGroup>);\n\n const groupOrder = Object.keys(groupDefinitions);\n return Object.entries(byKey).sort(([a], [b]) => {\n const ai = groupOrder.indexOf(a);\n const bi = groupOrder.indexOf(b);\n if (ai !== -1 && bi !== -1) {\n return ai - bi;\n }\n if (ai !== -1) {\n return -1;\n }\n if (bi !== -1) {\n return 1;\n }\n return 0;\n });\n }, [items, groupDefinitions]);\n\n const selectedItem = items[selectedIndex];\n return (\n <Box className={styles.tabsWrapper}>\n <Tabs\n selectionFollowsFocus\n indicatorColor=\"primary\"\n textColor=\"inherit\"\n variant=\"scrollable\"\n scrollButtons=\"auto\"\n aria-label={t('entityTabs.tabsAriaLabel')}\n value={selectedItem?.group ?? selectedItem?.id}\n >\n {groups.map(([id, tabGroup]) => (\n <EntityTabsGroup\n data-testid={`header-tab-${id}`}\n className={styles.defaultTab}\n classes={{ selected: styles.selected, root: styles.tabRoot }}\n key={id}\n label={tabGroup.group?.title}\n icon={tabGroup.group?.icon}\n value={id}\n items={tabGroup.items}\n highlightedButton={selectedItem?.id}\n showIcons={showIcons}\n />\n ))}\n </Tabs>\n </Box>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AAiCA,MAAM,SAAA,GAAY,UAAA;AAAA,EAChB,CAAA,KAAA,MAAU;AAAA,IACR,WAAA,EAAa;AAAA,MACX,QAAA,EAAU,eAAA;AAAA,MACV,eAAA,EAAiB,KAAA,CAAM,OAAA,CAAQ,UAAA,CAAW,KAAA;AAAA,MAC1C,WAAA,EAAa,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,MAC5B,QAAA,EAAU;AAAA,KACZ;AAAA,IACA,UAAA,EAAY;AAAA,MAC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AAA,EAAY,EAAE,0BAA0B,CAAA;AAAA,MACxC,KAAA,EAAO,YAAA,EAAc,KAAA,IAAS,YAAA,EAAc,EAAA;AAAA,MAE3C,iBAAO,GAAA,CAAI,CAAC,CAAC,EAAA,EAAI,QAAQ,CAAA,qBACxB,GAAA;AAAA,QAAC,eAAA;AAAA,QAAA;AAAA,UACC,aAAA,EAAa,cAAc,EAAE,CAAA,CAAA;AAAA,UAC7B,WAAW,MAAA,CAAO,UAAA;AAAA,UAClB,SAAS,EAAE,QAAA,EAAU,OAAO,QAAA,EAAU,IAAA,EAAM,OAAO,OAAA,EAAQ;AAAA,UAE3D,KAAA,EAAO,SAAS,KAAA,EAAO,KAAA;AAAA,UACvB,IAAA,EAAM,SAAS,KAAA,EAAO,IAAA;AAAA,UACtB,KAAA,EAAO,EAAA;AAAA,UACP,OAAO,QAAA,CAAS,KAAA;AAAA,UAChB,mBAAmB,YAAA,EAAc,EAAA;AAAA,UACjC;AAAA,SAAA;AAAA,QANK;AAAA,OAQR;AAAA;AAAA,GACH,EACF,CAAA;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"EntityTabsList.esm.js","sources":["../../../../src/alpha/components/EntityTabs/EntityTabsList.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ReactElement, useMemo } from 'react';\nimport Box from '@material-ui/core/Box';\nimport Tabs from '@material-ui/core/Tabs';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { EntityContentGroupDefinitions } from '@backstage/plugin-catalog-react/alpha';\n\nimport { EntityTabsGroup } from './EntityTabsGroup';\nimport { catalogTranslationRef } from '../../translation';\n\n/** @public */\nexport type HeaderTabsClassKey =\n | 'tabsWrapper'\n | 'defaultTab'\n | 'selected'\n | 'tabRoot';\n\nconst useStyles = makeStyles(\n theme => ({\n tabsWrapper: {\n gridArea: 'pageSubheader',\n backgroundColor: theme.palette.background.paper,\n paddingLeft: theme.spacing(3),\n minWidth: 0,\n },\n defaultTab: {\n ...theme.typography.caption,\n padding: theme.spacing(3, 3),\n textTransform: 'uppercase',\n fontWeight: theme.typography.fontWeightBold,\n color: theme.palette.text.secondary,\n },\n selected: {\n color: theme.palette.text.primary,\n },\n tabRoot: {\n '&:hover': {\n backgroundColor: theme.palette.background.default,\n color: theme.palette.text.primary,\n },\n },\n }),\n { name: 'BackstageHeaderTabs' },\n);\n\ntype Tab = {\n id: string;\n label: string;\n path: string;\n group?: string;\n icon?: string | ReactElement;\n};\n\ntype TabGroup = {\n group?: {\n title: string;\n icon?: string | ReactElement;\n };\n items: Array<Omit<Tab, 'group'>>;\n};\n\ntype EntityTabsListProps = {\n tabs: Tab[];\n groupDefinitions: EntityContentGroupDefinitions;\n defaultContentOrder?: 'title' | 'natural';\n showIcons?: boolean;\n selectedIndex?: number;\n};\n\nfunction resolveGroupId(\n tabGroup: string | undefined,\n groupDefinitions: EntityContentGroupDefinitions,\n aliasToGroup: Record<string, string>,\n): string | undefined {\n if (!tabGroup) {\n return undefined;\n }\n if (groupDefinitions[tabGroup]) {\n return tabGroup;\n }\n return aliasToGroup[tabGroup];\n}\n\nexport function EntityTabsList(props: EntityTabsListProps) {\n const styles = useStyles();\n const { t } = useTranslationRef(catalogTranslationRef);\n\n const {\n tabs: items,\n selectedIndex = 0,\n showIcons,\n groupDefinitions,\n defaultContentOrder = 'title',\n } = props;\n\n const aliasToGroup = useMemo(\n () =>\n Object.entries(groupDefinitions).reduce((map, [groupId, def]) => {\n for (const alias of def.aliases ?? []) {\n map[alias] = groupId;\n }\n return map;\n }, {} as Record<string, string>),\n [groupDefinitions],\n );\n\n const groups = useMemo(() => {\n const byKey = items.reduce((result, tab) => {\n const resolvedGroupId = resolveGroupId(\n tab.group,\n groupDefinitions,\n aliasToGroup,\n );\n const group = resolvedGroupId\n ? groupDefinitions[resolvedGroupId]\n : undefined;\n const groupOrId = group && resolvedGroupId ? resolvedGroupId : tab.id;\n result[groupOrId] = result[groupOrId] ?? {\n group,\n items: [],\n };\n result[groupOrId].items.push(tab);\n return result;\n }, {} as Record<string, TabGroup>);\n\n const groupOrder = Object.keys(groupDefinitions);\n const sorted = Object.entries(byKey).sort(([a], [b]) => {\n const ai = groupOrder.indexOf(a);\n const bi = groupOrder.indexOf(b);\n if (ai !== -1 && bi !== -1) {\n return ai - bi;\n }\n if (ai !== -1) {\n return -1;\n }\n if (bi !== -1) {\n return 1;\n }\n return 0;\n });\n\n for (const [id, tabGroup] of sorted) {\n const groupDef = groupDefinitions[id];\n if (groupDef) {\n const order = groupDef.contentOrder ?? defaultContentOrder;\n if (order === 'title') {\n tabGroup.items.sort((a, b) =>\n a.label.localeCompare(b.label, undefined, { sensitivity: 'base' }),\n );\n }\n }\n }\n\n return sorted;\n }, [items, groupDefinitions, aliasToGroup, defaultContentOrder]);\n\n const selectedItem = items[selectedIndex];\n const selectedGroup = resolveGroupId(\n selectedItem?.group,\n groupDefinitions,\n aliasToGroup,\n );\n return (\n <Box className={styles.tabsWrapper}>\n <Tabs\n selectionFollowsFocus\n indicatorColor=\"primary\"\n textColor=\"inherit\"\n variant=\"scrollable\"\n scrollButtons=\"auto\"\n aria-label={t('entityTabs.tabsAriaLabel')}\n value={selectedGroup ?? selectedItem?.id}\n >\n {groups.map(([id, tabGroup]) => (\n <EntityTabsGroup\n data-testid={`header-tab-${id}`}\n className={styles.defaultTab}\n classes={{ selected: styles.selected, root: styles.tabRoot }}\n key={id}\n label={tabGroup.group?.title}\n icon={tabGroup.group?.icon}\n value={id}\n items={tabGroup.items}\n highlightedButton={selectedIt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AAEJ;;;;"}
|
|
@@ -41,7 +41,7 @@ const catalogAboutEntityCard = EntityCardBlueprint.makeWithOverrides({
|
|
|
41
41
|
},
|
|
42
42
|
async loader() {
|
|
43
43
|
const { InternalAboutCard } = await import('../components/AboutCard/AboutCard.esm.js');
|
|
44
|
-
return /* @__PURE__ */ jsx(InternalAboutCard, {
|
|
44
|
+
return /* @__PURE__ */ jsx(InternalAboutCard, { iconLinks: /* @__PURE__ */ jsx(Subheader, {}) });
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
}
|
|
@@ -51,7 +51,7 @@ const catalogLinksEntityCard = EntityCardBlueprint.make({
|
|
|
51
51
|
params: {
|
|
52
52
|
type: "info",
|
|
53
53
|
filter: { "metadata.links": { $exists: true } },
|
|
54
|
-
loader: async () => import('../components/EntityLinksCard/index.esm.js').then((m) => /* @__PURE__ */ jsx(m.EntityLinksCard, {
|
|
54
|
+
loader: async () => import('../components/EntityLinksCard/index.esm.js').then((m) => /* @__PURE__ */ jsx(m.EntityLinksCard, {}))
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
const catalogLabelsEntityCard = EntityCardBlueprint.make({
|
|
@@ -59,7 +59,7 @@ const catalogLabelsEntityCard = EntityCardBlueprint.make({
|
|
|
59
59
|
params: {
|
|
60
60
|
type: "info",
|
|
61
61
|
filter: { "metadata.labels": { $exists: true } },
|
|
62
|
-
loader: async () => import('../components/EntityLabelsCard/index.esm.js').then((m) => /* @__PURE__ */ jsx(m.EntityLabelsCard, {
|
|
62
|
+
loader: async () => import('../components/EntityLabelsCard/index.esm.js').then((m) => /* @__PURE__ */ jsx(m.EntityLabelsCard, {}))
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
const catalogDependsOnComponentsEntityCard = EntityCardBlueprint.make({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entityCards.esm.js","sources":["../../src/alpha/entityCards.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n EntityIconLinkBlueprint,\n EntityCardBlueprint,\n} from '@backstage/plugin-catalog-react/alpha';\nimport { createExtensionInput } from '@backstage/frontend-plugin-api';\nimport {\n HeaderIconLinkRow,\n IconLinkVerticalProps,\n} from '@backstage/core-components';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { buildFilterFn } from './filter/FilterWrapper';\n\nexport const catalogAboutEntityCard = EntityCardBlueprint.makeWithOverrides({\n name: 'about',\n inputs: {\n iconLinks: createExtensionInput([\n EntityIconLinkBlueprint.dataRefs.filterFunction.optional(),\n EntityIconLinkBlueprint.dataRefs.filterExpression.optional(),\n EntityIconLinkBlueprint.dataRefs.useProps,\n ]),\n },\n factory(originalFactory, { inputs }) {\n function Subheader() {\n const { entity } = useEntity();\n // The \"useProps\" functions may be calling other hooks, so we need to\n // call them in a component function to avoid breaking the rules of hooks.\n const links = inputs.iconLinks.reduce((rest, iconLink) => {\n const filter = buildFilterFn(\n iconLink.get(EntityIconLinkBlueprint.dataRefs.filterFunction),\n iconLink.get(EntityIconLinkBlueprint.dataRefs.filterExpression),\n );\n if (filter(entity)) {\n const props = iconLink.get(\n EntityIconLinkBlueprint.dataRefs.useProps,\n )();\n return [...rest, props];\n }\n return rest;\n }, new Array<IconLinkVerticalProps>());\n return links.length ? <HeaderIconLinkRow links={links} /> : null;\n }\n return originalFactory({\n type: 'info',\n filter: {\n $not: {\n kind: { $in: ['user', 'group'] },\n },\n },\n async loader() {\n const { InternalAboutCard } = await import(\n '../components/AboutCard/AboutCard'\n );\n return (\n <InternalAboutCard variant=\"gridItem\" subheader={<Subheader />} />\n );\n },\n });\n },\n});\n\nexport const catalogLinksEntityCard = EntityCardBlueprint.make({\n name: 'links',\n params: {\n type: 'info',\n filter: { 'metadata.links': { $exists: true } },\n loader: async () =>\n import('../components/EntityLinksCard').then(m => (\n <m.EntityLinksCard variant=\"gridItem\" />\n )),\n },\n});\n\nexport const catalogLabelsEntityCard = EntityCardBlueprint.make({\n name: 'labels',\n params: {\n type: 'info',\n filter: { 'metadata.labels': { $exists: true } },\n loader: async () =>\n import('../components/EntityLabelsCard').then(m => (\n <m.EntityLabelsCard variant=\"gridItem\" />\n )),\n },\n});\n\nexport const catalogDependsOnComponentsEntityCard = EntityCardBlueprint.make({\n name: 'depends-on-components',\n params: {\n filter: { kind: 'component' },\n loader: async () =>\n import('../components/DependsOnComponentsCard').then(m => (\n <m.DependsOnComponentsCard variant=\"gridItem\" />\n )),\n },\n});\n\nexport const catalogDependsOnResourcesEntityCard = EntityCardBlueprint.make({\n name: 'depends-on-resources',\n params: {\n filter: { kind: 'component' },\n loader: async () =>\n import('../components/DependsOnResourcesCard').then(m => (\n <m.DependsOnResourcesCard variant=\"gridItem\" />\n )),\n },\n});\n\nexport const catalogHasComponentsEntityCard = EntityCardBlueprint.make({\n name: 'has-components',\n params: {\n filter: { kind: 'system' },\n loader: async () =>\n import('../components/HasComponentsCard').then(m => (\n <m.HasComponentsCard variant=\"gridItem\" />\n )),\n },\n});\n\nexport const catalogHasResourcesEntityCard = EntityCardBlueprint.make({\n name: 'has-resources',\n params: {\n filter: { kind: 'system' },\n loader: async () =>\n import('../components/HasResourcesCard').then(m => (\n <m.HasResourcesCard variant=\"gridItem\" />\n )),\n },\n});\n\nexport const catalogHasSubcomponentsEntityCard = EntityCardBlueprint.make({\n name: 'has-subcomponents',\n params: {\n filter: { kind: 'component' },\n loader: async () =>\n import('../components/HasSubcomponentsCard').then(m => (\n <m.HasSubcomponentsCard variant=\"gridItem\" />\n )),\n },\n});\n\nexport const catalogHasSubdomainsEntityCard = EntityCardBlueprint.make({\n name: 'has-subdomains',\n params: {\n filter: { kind: 'domain' },\n loader: async () =>\n import('../components/HasSubdomainsCard').then(m => (\n <m.HasSubdomainsCard variant=\"gridItem\" />\n )),\n },\n});\n\nexport const catalogHasSystemsEntityCard = EntityCardBlueprint.make({\n name: 'has-systems',\n params: {\n filter: { kind: 'domain' },\n loader: async () =>\n import('../components/HasSystemsCard').then(m => (\n <m.HasSystemsCard variant=\"gridItem\" />\n )),\n },\n});\n\nexport default [\n catalogAboutEntityCard,\n catalogLinksEntityCard,\n catalogLabelsEntityCard,\n catalogDependsOnComponentsEntityCard,\n catalogDependsOnResourcesEntityCard,\n catalogHasComponentsEntityCard,\n catalogHasResourcesEntityCard,\n catalogHasSubcomponentsEntityCard,\n catalogHasSubdomainsEntityCard,\n catalogHasSystemsEntityCard,\n];\n"],"names":[],"mappings":";;;;;;;AA4BO,MAAM,sBAAA,GAAyB,oBAAoB,iBAAA,CAAkB;AAAA,EAC1E,IAAA,EAAM,OAAA;AAAA,EACN,MAAA,EAAQ;AAAA,IACN,WAAW,oBAAA,CAAqB;AAAA,MAC9B,uBAAA,CAAwB,QAAA,CAAS,cAAA,CAAe,QAAA,EAAS;AAAA,MACzD,uBAAA,CAAwB,QAAA,CAAS,gBAAA,CAAiB,QAAA,EAAS;AAAA,MAC3D,wBAAwB,QAAA,CAAS;AAAA,KAClC;AAAA,GACH;AAAA,EACA,OAAA,CAAQ,eAAA,EAAiB,EAAE,MAAA,EAAO,EAAG;AACnC,IAAA,SAAS,SAAA,GAAY;AACnB,MAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAU;AAG7B,MAAA,MAAM,QAAQ,MAAA,CAAO,SAAA,CAAU,MAAA,CAAO,CAAC,MAAM,QAAA,KAAa;AACxD,QAAA,MAAM,MAAA,GAAS,aAAA;AAAA,UACb,QAAA,CAAS,GAAA,CAAI,uBAAA,CAAwB,QAAA,CAAS,cAAc,CAAA;AAAA,UAC5D,QAAA,CAAS,GAA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AAAA,EAClE,IAAA,EAAM,aAAA;AAAA,EACN,MAAA,EAAQ;AAAA,IACN,MAAA,EAAQ,EAAE,IAAA,EAAM,QAAA,EAAS;AAAA,IACzB,MAAA,EAAQ,YACN,OAAO,2CAA8B,CAAA,CAAE,IAAA,CAAK,CAAA,CAAA,qBAC1C,GAAA,CAAC,CAAA,CAAE,cAAA,EAAF,EAAiB,OAAA,EAAQ,YAAW,CACtC;AAAA;AAEP,CAAC;AAED,kBAAe;AAAA,EACb,sBAAA;AAAA,EACA,sBAAA;AAAA,EACA,uBAAA;AAAA,EACA,oCAAA;AAAA,EACA,mCAAA;AAAA,EACA,8BAAA;AAAA,EACA,6BAAA;AAAA,EACA,iCAAA;AAAA,EACA,8BAAA;AAAA,EACA;AACF,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"entityCards.esm.js","sources":["../../src/alpha/entityCards.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n EntityIconLinkBlueprint,\n EntityCardBlueprint,\n} from '@backstage/plugin-catalog-react/alpha';\nimport { createExtensionInput } from '@backstage/frontend-plugin-api';\nimport {\n HeaderIconLinkRow,\n IconLinkVerticalProps,\n} from '@backstage/core-components';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { buildFilterFn } from './filter/FilterWrapper';\n\nexport const catalogAboutEntityCard = EntityCardBlueprint.makeWithOverrides({\n name: 'about',\n inputs: {\n iconLinks: createExtensionInput([\n EntityIconLinkBlueprint.dataRefs.filterFunction.optional(),\n EntityIconLinkBlueprint.dataRefs.filterExpression.optional(),\n EntityIconLinkBlueprint.dataRefs.useProps,\n ]),\n },\n factory(originalFactory, { inputs }) {\n function Subheader() {\n const { entity } = useEntity();\n // The \"useProps\" functions may be calling other hooks, so we need to\n // call them in a component function to avoid breaking the rules of hooks.\n const links = inputs.iconLinks.reduce((rest, iconLink) => {\n const filter = buildFilterFn(\n iconLink.get(EntityIconLinkBlueprint.dataRefs.filterFunction),\n iconLink.get(EntityIconLinkBlueprint.dataRefs.filterExpression),\n );\n if (filter(entity)) {\n const props = iconLink.get(\n EntityIconLinkBlueprint.dataRefs.useProps,\n )();\n return [...rest, props];\n }\n return rest;\n }, new Array<IconLinkVerticalProps>());\n return links.length ? <HeaderIconLinkRow links={links} /> : null;\n }\n return originalFactory({\n type: 'info',\n filter: {\n $not: {\n kind: { $in: ['user', 'group'] },\n },\n },\n async loader() {\n const { InternalAboutCard } = await import(\n '../components/AboutCard/AboutCard'\n );\n return <InternalAboutCard iconLinks={<Subheader />} />;\n },\n });\n },\n});\n\nexport const catalogLinksEntityCard = EntityCardBlueprint.make({\n name: 'links',\n params: {\n type: 'info',\n filter: { 'metadata.links': { $exists: true } },\n loader: async () =>\n import('../components/EntityLinksCard').then(m => <m.EntityLinksCard />),\n },\n});\n\nexport const catalogLabelsEntityCard = EntityCardBlueprint.make({\n name: 'labels',\n params: {\n type: 'info',\n filter: { 'metadata.labels': { $exists: true } },\n loader: async () =>\n import('../components/EntityLabelsCard').then(m => (\n <m.EntityLabelsCard />\n )),\n },\n});\n\nexport const catalogDependsOnComponentsEntityCard = EntityCardBlueprint.make({\n name: 'depends-on-components',\n params: {\n filter: { kind: 'component' },\n loader: async () =>\n import('../components/DependsOnComponentsCard').then(m => (\n <m.DependsOnComponentsCard variant=\"gridItem\" />\n )),\n },\n});\n\nexport const catalogDependsOnResourcesEntityCard = EntityCardBlueprint.make({\n name: 'depends-on-resources',\n params: {\n filter: { kind: 'component' },\n loader: async () =>\n import('../components/DependsOnResourcesCard').then(m => (\n <m.DependsOnResourcesCard variant=\"gridItem\" />\n )),\n },\n});\n\nexport const catalogHasComponentsEntityCard = EntityCardBlueprint.make({\n name: 'has-components',\n params: {\n filter: { kind: 'system' },\n loader: async () =>\n import('../components/HasComponentsCard').then(m => (\n <m.HasComponentsCard variant=\"gridItem\" />\n )),\n },\n});\n\nexport const catalogHasResourcesEntityCard = EntityCardBlueprint.make({\n name: 'has-resources',\n params: {\n filter: { kind: 'system' },\n loader: async () =>\n import('../components/HasResourcesCard').then(m => (\n <m.HasResourcesCard variant=\"gridItem\" />\n )),\n },\n});\n\nexport const catalogHasSubcomponentsEntityCard = EntityCardBlueprint.make({\n name: 'has-subcomponents',\n params: {\n filter: { kind: 'component' },\n loader: async () =>\n import('../components/HasSubcomponentsCard').then(m => (\n <m.HasSubcomponentsCard variant=\"gridItem\" />\n )),\n },\n});\n\nexport const catalogHasSubdomainsEntityCard = EntityCardBlueprint.make({\n name: 'has-subdomains',\n params: {\n filter: { kind: 'domain' },\n loader: async () =>\n import('../components/HasSubdomainsCard').then(m => (\n <m.HasSubdomainsCard variant=\"gridItem\" />\n )),\n },\n});\n\nexport const catalogHasSystemsEntityCard = EntityCardBlueprint.make({\n name: 'has-systems',\n params: {\n filter: { kind: 'domain' },\n loader: async () =>\n import('../components/HasSystemsCard').then(m => (\n <m.HasSystemsCard variant=\"gridItem\" />\n )),\n },\n});\n\nexport default [\n catalogAboutEntityCard,\n catalogLinksEntityCard,\n catalogLabelsEntityCard,\n catalogDependsOnComponentsEntityCard,\n catalogDependsOnResourcesEntityCard,\n catalogHasComponentsEntityCard,\n catalogHasResourcesEntityCard,\n catalogHasSubcomponentsEntityCard,\n catalogHasSubdomainsEntityCard,\n catalogHasSystemsEntityCard,\n];\n"],"names":[],"mappings":";;;;;;;AA4BO,MAAM,sBAAA,GAAyB,oBAAoB,iBAAA,CAAkB;AAAA,EAC1E,IAAA,EAAM,OAAA;AAAA,EACN,MAAA,EAAQ;AAAA,IACN,WAAW,oBAAA,CAAqB;AAAA,MAC9B,u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,CAAK,CAAA,CAAA,qBAChD,GAAA,CAAC,CAAA,CAAE,oBAAA,EAAF,EAAuB,OAAA,EAAQ,YAAW,CAC5C;AAAA;AAEP,CAAC;AAEM,MAAM,8BAAA,GAAiC,oBAAoB,IAAA,CAAK;AAAA,EACrE,IAAA,EAAM,gBAAA;AAAA,EACN,MAAA,EAAQ;AAAA,IACN,MAAA,EAAQ,EAAE,IAAA,EAAM,QAAA,EAAS;AAAA,IACzB,MAAA,EAAQ,YACN,OAAO,8CAAiC,CAAA,CAAE,IAAA,CAAK,CAAA,CAAA,qBAC7C,GAAA,CAAC,CAAA,CAAE,iBAAA,EAAF,EAAoB,OAAA,EAAQ,YAAW,CACzC;AAAA;AAEP,CAAC;AAEM,MAAM,2BAAA,GAA8B,oBAAoB,IAAA,CAAK;AAAA,EAClE,IAAA,EAAM,aAAA;AAAA,EACN,MAAA,EAAQ;AAAA,IACN,MAAA,EAAQ,EAAE,IAAA,EAAM,QAAA,EAAS;AAAA,IACzB,MAAA,EAAQ,YACN,OAAO,2CAA8B,CAAA,CAAE,IAAA,CAAK,CAAA,CAAA,qBAC1C,GAAA,CAAC,CAAA,CAAE,cAAA,EAAF,EAAiB,OAAA,EAAQ,YAAW,CACtC;AAAA;AAEP,CAAC;AAED,kBAAe;AAAA,EACb,sBAAA;AAAA,EACA,sBAAA;AAAA,EACA,uBAAA;AAAA,EACA,oCAAA;AAAA,EACA,mCAAA;AAAA,EACA,8BAAA;AAAA,EACA,6BAAA;AAAA,EACA,iCAAA;AAAA,EACA,8BAAA;AAAA,EACA;AACF,CAAA;;;;"}
|
package/dist/alpha/pages.esm.js
CHANGED
|
@@ -75,10 +75,13 @@ const catalogEntityPage = PageBlueprint.makeWithOverrides({
|
|
|
75
75
|
z.string(),
|
|
76
76
|
z.object({
|
|
77
77
|
title: z.string(),
|
|
78
|
-
icon: z.string().optional()
|
|
78
|
+
icon: z.string().optional(),
|
|
79
|
+
aliases: z.array(z.string()).optional(),
|
|
80
|
+
contentOrder: z.enum(["title", "natural"]).optional()
|
|
79
81
|
})
|
|
80
82
|
)
|
|
81
83
|
).optional(),
|
|
84
|
+
defaultContentOrder: (z) => z.enum(["title", "natural"]).optional().default("title"),
|
|
82
85
|
showNavItemIcons: (z) => z.boolean().optional().default(false)
|
|
83
86
|
}
|
|
84
87
|
},
|
|
@@ -125,6 +128,7 @@ const catalogEntityPage = PageBlueprint.makeWithOverrides({
|
|
|
125
128
|
header,
|
|
126
129
|
contextMenuItems: filteredMenuItems,
|
|
127
130
|
groupDefinitions,
|
|
131
|
+
defaultContentOrder: config.defaultContentOrder,
|
|
128
132
|
showNavItemIcons: config.showNavItemIcons,
|
|
129
133
|
children: inputs.contents.map((output) => /* @__PURE__ */ jsx(
|
|
130
134
|
EntityLayout.Route,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pages.esm.js","sources":["../../src/alpha/pages.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { convertLegacyRouteRef } from '@backstage/core-compat-api';\nimport {\n coreExtensionData,\n createExtensionInput,\n PageBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport {\n AsyncEntityProvider,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport {\n defaultEntityContentGroupDefinitions,\n EntityContentBlueprint,\n EntityContextMenuItemBlueprint,\n EntityHeaderBlueprint,\n EntityContentGroupDefinitions,\n} from '@backstage/plugin-catalog-react/alpha';\nimport CategoryIcon from '@material-ui/icons/Category';\nimport { rootRouteRef } from '../routes';\nimport { useEntityFromUrl } from '../components/CatalogEntityPage/useEntityFromUrl';\nimport { buildFilterFn } from './filter/FilterWrapper';\n\nexport const catalogPage = PageBlueprint.makeWithOverrides({\n inputs: {\n filters: createExtensionInput([coreExtensionData.reactElement]),\n },\n config: {\n schema: {\n pagination: z =>\n z\n .union([\n z.boolean(),\n z.object({\n mode: z.enum(['cursor', 'offset']),\n limit: z.number().optional(),\n offset: z.number().optional(),\n }),\n ])\n .default(true),\n },\n },\n factory(originalFactory, { inputs, config }) {\n return originalFactory({\n path: '/catalog',\n routeRef: rootRouteRef,\n icon: <CategoryIcon />,\n title: 'Catalog',\n loader: async () => {\n const { BaseCatalogPage } = await import('../components/CatalogPage');\n const filters = inputs.filters.map(filter =>\n filter.get(coreExtensionData.reactElement),\n );\n return (\n <BaseCatalogPage\n filters={<>{filters}</>}\n pagination={config.pagination}\n />\n );\n },\n });\n },\n});\n\nexport const catalogEntityPage = PageBlueprint.makeWithOverrides({\n name: 'entity',\n inputs: {\n headers: createExtensionInput([\n EntityHeaderBlueprint.dataRefs.element.optional(),\n EntityHeaderBlueprint.dataRefs.filterFunction.optional(),\n ]),\n contents: createExtensionInput([\n coreExtensionData.reactElement,\n coreExtensionData.routePath,\n coreExtensionData.routeRef.optional(),\n EntityContentBlueprint.dataRefs.title,\n EntityContentBlueprint.dataRefs.filterFunction.optional(),\n EntityContentBlueprint.dataRefs.filterExpression.optional(),\n EntityContentBlueprint.dataRefs.group.optional(),\n EntityContentBlueprint.dataRefs.icon.optional(),\n ]),\n contextMenuItems: createExtensionInput([\n coreExtensionData.reactElement,\n EntityContextMenuItemBlueprint.dataRefs.filterFunction.optional(),\n ]),\n },\n config: {\n schema: {\n groups: z =>\n z\n .array(\n z.record(\n z.string(),\n z.object({\n title: z.string(),\n icon: z.string().optional(),\n }),\n ),\n )\n .optional(),\n showNavItemIcons: z => z.boolean().optional().default(false),\n },\n },\n factory(originalFactory, { config, inputs }) {\n return originalFactory({\n path: '/catalog/:namespace/:kind/:name',\n title: 'Catalog Entity',\n // NOTE: The `convertLegacyRouteRef` call here ensures that this route ref\n // is mutated to support the new frontend system. Removing this conversion\n // is a potentially breaking change since this is a singleton and the\n // route refs from `core-plugin-api` used to not support the new format.\n // This shouldn't be removed until we completely deprecate the\n // `core-compat-api` package.\n routeRef: convertLegacyRouteRef(entityRouteRef), // READ THE ABOVE\n loader: async () => {\n const { EntityLayout } = await import('./components/EntityLayout');\n\n const menuItems = inputs.contextMenuItems.map(item => ({\n element: item.get(coreExtensionData.reactElement),\n filter:\n item.get(EntityContextMenuItemBlueprint.dataRefs.filterFunction) ??\n (() => true),\n }));\n\n // Get available headers, sorted by if they have a filter function or not.\n // TODO(blam): we should really have priority or some specificity here which can be used to sort the headers.\n // That can be done with embedding the priority in the dataRef alongside the filter function.\n const headers = inputs.headers\n .map(header => ({\n element: header.get(EntityHeaderBlueprint.dataRefs.element),\n filter: header.get(EntityHeaderBlueprint.dataRefs.filterFunction),\n }))\n .sort((a, b) => {\n if (a.filter && !b.filter) return -1;\n if (!a.filter && b.filter) return 1;\n return 0;\n });\n\n const groupDefinitions =\n config.groups?.reduce(\n (rest, group) => ({ ...rest, ...group }),\n {} as EntityContentGroupDefinitions,\n ) ?? defaultEntityContentGroupDefinitions;\n\n const Component = () => {\n const entityFromUrl = useEntityFromUrl();\n const { entity } = entityFromUrl;\n const filteredMenuItems = entity\n ? menuItems.filter(i => i.filter(entity)).map(i => i.element)\n : [];\n\n const header = headers.find(\n h => !h.filter || h.filter(entity!),\n )?.element;\n\n return (\n <AsyncEntityProvider {...entityFromUrl}>\n <EntityLayout\n header={header}\n contextMenuItems={filteredMenuItems}\n groupDefinitions={groupDefinitions}\n showNavItemIcons={config.showNavItemIcons}\n >\n {inputs.contents.map(output => (\n <EntityLayout.Route\n group={output.get(EntityContentBlueprint.dataRefs.group)}\n key={output.get(coreExtensionData.routePath)}\n path={output.get(coreExtensionData.routePath)}\n title={output.get(EntityContentBlueprint.dataRefs.title)}\n icon={output.get(EntityContentBlueprint.dataRefs.icon)}\n if={buildFilterFn(\n output.get(\n EntityContentBlueprint.dataRefs.filterFunction,\n ),\n output.get(\n EntityContentBlueprint.dataRefs.filterExpression,\n ),\n )}\n >\n {output.get(coreExtensionData.reactElement)}\n </EntityLayout.Route>\n ))}\n </EntityLayout>\n </AsyncEntityProvider>\n );\n };\n\n return <Component />;\n },\n });\n },\n});\n\nexport default [catalogPage, catalogEntityPage];\n"],"names":[],"mappings":";;;;;;;;;;AAsCO,MAAM,WAAA,GAAc,cAAc,iBAAA,CAAkB;AAAA,EACzD,MAAA,EAAQ;AAAA,IACN,OAAA,EAAS,oBAAA,CAAqB,CAAC,iBAAA,CAAkB,YAAY,CAAC;AAAA,GAChE;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,MAAA,EAAQ;AAAA,MACN,UAAA,EAAY,CAAA,CAAA,KACV,CAAA,CACG,KAAA,CAAM;AAAA,QACL,EAAE,OAAA,EAAQ;AAAA,QACV,EAAE,MAAA,CAAO;AAAA,UACP,MAAM,CAAA,CAAE,IAAA,CAAK,CAAC,QAAA,EAAU,QAAQ,CAAC,CAAA;AAAA,UACjC,KAAA,EAAO,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,UAC3B,MAAA,EAAQ,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA;AAAS,SAC7B;AAAA,OACF,CAAA,CACA,OAAA,CAAQ,IAAI;AAAA;AACnB,GACF;AAAA,EACA,OAAA,CAAQ,eAAA,EAAiB,EAAE,MAAA,EAAQ,QAAO,EAAG;AAC3C,IAAA,OAAO,eAAA,CAAgB;AAAA,MACrB,IAAA,EAAM,UAAA;AAAA,MACN,QAAA,EAAU,YAAA;AAAA,MACV,IAAA,sBAAO,YAAA,EAAA,EAAa,CAAA;AAAA,MACpB,KAAA,EAAO,SAAA;AAAA,MACP,QAAQ,YAAY;AAClB,QAAA,MAAM,EAAE,eAAA,EAAgB,GAAI,MAAM,OAAO,wCAA2B,CAAA;AACpE,QAAA,MAAM,OAAA,GAAU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;AAAA,gBAAb;AAAA,kBACC,KAAA,EAAO,MAAA,CAAO,GAAA,CAAI,sBAAA,CAAuB,SAAS,KAAK,CAAA;AAAA,kBAEvD,IAAA,EAAM,MAAA,CAAO,GAAA,CAAI,iBAAA,CAAkB,SAAS,CAAA;AAAA,kBAC5C,KAAA,EAAO,MAAA,CAAO,GAAA,CAAI,sBAAA,CAAuB,SAAS,KAAK,CAAA;AAAA,kBACvD,IAAA,EAAM,MAAA,CAAO,GAAA,CAAI,sBAAA,CAAuB,SAAS,IAAI,CAAA;AAAA,kBACrD,EAAA,EAAI,aAAA;AAAA,oBACF,MAAA,CAAO,GAAA;AAAA,sBACL,uBAAuB,QAAA,CAAS;AAAA,qBAClC;AAAA,oBACA,MAAA,CAAO,GAAA;AAAA,sBACL,uBAAuB,QAAA,CAAS;AAAA;AAClC,mBACF;AAAA,kBAEC,QAAA,EAAA,MAAA,CAAO,GAAA,CAAI,iBAAA,CAAkB,YAAY;AAAA,iBAAA;AAAA,gBAbrC,MAAA,CAAO,GAAA,CAAI,iBAAA,CAAkB,SAAS;AAAA,eAe9C;AAAA;AAAA,WACH,EACF,CAAA;AAAA,QAEJ,CAAA;AAEA,QAAA,2BAAQ,SAAA,EAAA,EAAU,CAAA;AAAA,MACpB;AAAA,KACD,CAAA;AAAA,EACH;AACF,CAAC;AAED,YAAe,CAAC,aAAa,iBAAiB,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"pages.esm.js","sources":["../../src/alpha/pages.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { convertLegacyRouteRef } from '@backstage/core-compat-api';\nimport {\n coreExtensionData,\n createExtensionInput,\n PageBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport {\n AsyncEntityProvider,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport {\n defaultEntityContentGroupDefinitions,\n EntityContentBlueprint,\n EntityContextMenuItemBlueprint,\n EntityHeaderBlueprint,\n EntityContentGroupDefinitions,\n} from '@backstage/plugin-catalog-react/alpha';\nimport CategoryIcon from '@material-ui/icons/Category';\nimport { rootRouteRef } from '../routes';\nimport { useEntityFromUrl } from '../components/CatalogEntityPage/useEntityFromUrl';\nimport { buildFilterFn } from './filter/FilterWrapper';\n\nexport const catalogPage = PageBlueprint.makeWithOverrides({\n inputs: {\n filters: createExtensionInput([coreExtensionData.reactElement]),\n },\n config: {\n schema: {\n pagination: z =>\n z\n .union([\n z.boolean(),\n z.object({\n mode: z.enum(['cursor', 'offset']),\n limit: z.number().optional(),\n offset: z.number().optional(),\n }),\n ])\n .default(true),\n },\n },\n factory(originalFactory, { inputs, config }) {\n return originalFactory({\n path: '/catalog',\n routeRef: rootRouteRef,\n icon: <CategoryIcon />,\n title: 'Catalog',\n loader: async () => {\n const { BaseCatalogPage } = await import('../components/CatalogPage');\n const filters = inputs.filters.map(filter =>\n filter.get(coreExtensionData.reactElement),\n );\n return (\n <BaseCatalogPage\n filters={<>{filters}</>}\n pagination={config.pagination}\n />\n );\n },\n });\n },\n});\n\nexport const catalogEntityPage = PageBlueprint.makeWithOverrides({\n name: 'entity',\n inputs: {\n headers: createExtensionInput([\n EntityHeaderBlueprint.dataRefs.element.optional(),\n EntityHeaderBlueprint.dataRefs.filterFunction.optional(),\n ]),\n contents: createExtensionInput([\n coreExtensionData.reactElement,\n coreExtensionData.routePath,\n coreExtensionData.routeRef.optional(),\n EntityContentBlueprint.dataRefs.title,\n EntityContentBlueprint.dataRefs.filterFunction.optional(),\n EntityContentBlueprint.dataRefs.filterExpression.optional(),\n EntityContentBlueprint.dataRefs.group.optional(),\n EntityContentBlueprint.dataRefs.icon.optional(),\n ]),\n contextMenuItems: createExtensionInput([\n coreExtensionData.reactElement,\n EntityContextMenuItemBlueprint.dataRefs.filterFunction.optional(),\n ]),\n },\n config: {\n schema: {\n groups: z =>\n z\n .array(\n z.record(\n z.string(),\n z.object({\n title: z.string(),\n icon: z.string().optional(),\n aliases: z.array(z.string()).optional(),\n contentOrder: z.enum(['title', 'natural']).optional(),\n }),\n ),\n )\n .optional(),\n defaultContentOrder: z =>\n z.enum(['title', 'natural']).optional().default('title'),\n showNavItemIcons: z => z.boolean().optional().default(false),\n },\n },\n factory(originalFactory, { config, inputs }) {\n return originalFactory({\n path: '/catalog/:namespace/:kind/:name',\n title: 'Catalog Entity',\n // NOTE: The `convertLegacyRouteRef` call here ensures that this route ref\n // is mutated to support the new frontend system. Removing this conversion\n // is a potentially breaking change since this is a singleton and the\n // route refs from `core-plugin-api` used to not support the new format.\n // This shouldn't be removed until we completely deprecate the\n // `core-compat-api` package.\n routeRef: convertLegacyRouteRef(entityRouteRef), // READ THE ABOVE\n loader: async () => {\n const { EntityLayout } = await import('./components/EntityLayout');\n\n const menuItems = inputs.contextMenuItems.map(item => ({\n element: item.get(coreExtensionData.reactElement),\n filter:\n item.get(EntityContextMenuItemBlueprint.dataRefs.filterFunction) ??\n (() => true),\n }));\n\n // Get available headers, sorted by if they have a filter function or not.\n // TODO(blam): we should really have priority or some specificity here which can be used to sort the headers.\n // That can be done with embedding the priority in the dataRef alongside the filter function.\n const headers = inputs.headers\n .map(header => ({\n element: header.get(EntityHeaderBlueprint.dataRefs.element),\n filter: header.get(EntityHeaderBlueprint.dataRefs.filterFunction),\n }))\n .sort((a, b) => {\n if (a.filter && !b.filter) return -1;\n if (!a.filter && b.filter) return 1;\n return 0;\n });\n\n const groupDefinitions =\n config.groups?.reduce(\n (rest, group) => ({ ...rest, ...group }),\n {} as EntityContentGroupDefinitions,\n ) ?? defaultEntityContentGroupDefinitions;\n\n const Component = () => {\n const entityFromUrl = useEntityFromUrl();\n const { entity } = entityFromUrl;\n const filteredMenuItems = entity\n ? menuItems.filter(i => i.filter(entity)).map(i => i.element)\n : [];\n\n const header = headers.find(\n h => !h.filter || h.filter(entity!),\n )?.element;\n\n return (\n <AsyncEntityProvider {...entityFromUrl}>\n <EntityLayout\n header={header}\n contextMenuItems={filteredMenuItems}\n groupDefinitions={groupDefinitions}\n defaultContentOrder={config.defaultContentOrder}\n showNavItemIcons={config.showNavItemIcons}\n >\n {inputs.contents.map(output => (\n <EntityLayout.Route\n group={output.get(EntityContentBlueprint.dataRefs.group)}\n key={output.get(coreExtensionData.routePath)}\n path={output.get(coreExtensionData.routePath)}\n title={output.get(EntityContentBlueprint.dataRefs.title)}\n icon={output.get(EntityContentBlueprint.dataRefs.icon)}\n if={buildFilterFn(\n output.get(\n EntityContentBlueprint.dataRefs.filterFunction,\n ),\n output.get(\n EntityContentBlueprint.dataRefs.filterExpression,\n ),\n )}\n >\n {output.get(coreExtensionData.reactElement)}\n </EntityLayout.Route>\n ))}\n </EntityLayout>\n </AsyncEntityProvider>\n );\n };\n\n return <Component />;\n },\n });\n },\n});\n\nexport default [catalogPage, catalogEntityPage];\n"],"names":[],"mappings":";;;;;;;;;;AAsCO,MAAM,WAAA,GAAc,cAAc,iBAAA,CAAkB;AAAA,EACzD,MAAA,EAAQ;AAAA,IACN,OAAA,EAAS,oBAAA,CAAqB,CAAC,iBAAA,CAAkB,YAAY,CAAC;AAAA,GAChE;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,MAAA,EAAQ;AAAA,MACN,UAAA,EAAY,CAAA,CAAA,KACV,CAAA,CACG,KAAA,CAAM;AAAA,QACL,EAAE,OAAA,EAAQ;AAAA,QACV,EAAE,MAAA,CAAO;AAAA,UACP,MAAM,CAAA,CAAE,IAAA,CAAK,CAAC,QAAA,EAAU,QAAQ,CAAC,CAAA;AAAA,UACjC,KAAA,EAAO,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA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A,CAAO,GAAA;AAAA,sBACL,uBAAuB,QAAA,CAAS;AAAA,qBAClC;AAAA,oBACA,MAAA,CAAO,GAAA;AAAA,sBACL,uBAAuB,QAAA,CAAS;AAAA;AAClC,mBACF;AAAA,kBAEC,QAAA,EAAA,MAAA,CAAO,GAAA,CAAI,iBAAA,CAAkB,YAAY;AAAA,iBAAA;AAAA,gBAbrC,MAAA,CAAO,GAAA,CAAI,iBAAA,CAAkB,SAAS;AAAA,eAe9C;AAAA;AAAA,WACH,EACF,CAAA;AAAA,QAEJ,CAAA;AAEA,QAAA,2BAAQ,SAAA,EAAA,EAAU,CAAA;AAAA,MACpB;AAAA,KACD,CAAA;AAAA,EACH;AACF,CAAC;AAED,YAAe,CAAC,aAAa,iBAAiB,CAAA;;;;"}
|
|
@@ -94,6 +94,8 @@ const catalogTranslationRef = createTranslationRef({
|
|
|
94
94
|
},
|
|
95
95
|
entityLabelsCard: {
|
|
96
96
|
title: "Labels",
|
|
97
|
+
columnKeyLabel: "Label",
|
|
98
|
+
columnValueLabel: "Value",
|
|
97
99
|
emptyDescription: "No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:",
|
|
98
100
|
readMoreButtonTitle: "Read more"
|
|
99
101
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.esm.js","sources":["../../src/alpha/translation.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @alpha */\nexport const catalogTranslationRef = createTranslationRef({\n id: 'catalog',\n messages: {\n indexPage: {\n title: `{{orgName}} Catalog`,\n createButtonTitle: 'Create',\n supportButtonContent: 'All your software catalog entities',\n },\n entityPage: {\n notFoundMessage: 'There is no {{kind}} with the requested {{link}}.',\n notFoundLinkText: 'kind, namespace, and name',\n },\n aboutCard: {\n title: 'About',\n refreshButtonTitle: 'Schedule entity refresh',\n editButtonTitle: 'Edit Metadata',\n editButtonAriaLabel: 'Edit',\n createSimilarButtonTitle: 'Create something similar',\n refreshScheduledMessage: 'Refresh scheduled',\n refreshButtonAriaLabel: 'Refresh',\n launchTemplate: 'Launch Template',\n viewTechdocs: 'View TechDocs',\n viewSource: 'View Source',\n unknown: 'unknown',\n descriptionField: {\n label: 'Description',\n value: 'No description',\n },\n ownerField: {\n label: 'Owner',\n value: 'No Owner',\n },\n domainField: {\n label: 'Domain',\n value: 'No Domain',\n },\n systemField: {\n label: 'System',\n value: 'No System',\n },\n parentComponentField: {\n label: 'Parent Component',\n value: 'No Parent Component',\n },\n typeField: {\n label: 'Type',\n },\n lifecycleField: {\n label: 'Lifecycle',\n },\n tagsField: {\n label: 'Tags',\n value: 'No Tags',\n },\n targetsField: {\n label: 'Targets',\n },\n },\n searchResultItem: {\n kind: 'Kind',\n type: 'Type',\n lifecycle: 'Lifecycle',\n owner: 'Owner',\n },\n catalogTable: {\n warningPanelTitle: 'Could not fetch catalog entities.',\n viewActionTitle: 'View',\n editActionTitle: 'Edit',\n starActionTitle: 'Add to favorites',\n unStarActionTitle: 'Remove from favorites',\n allFilters: 'All',\n },\n dependencyOfComponentsCard: {\n title: 'Dependency of components',\n emptyMessage: 'No component depends on this component',\n },\n dependsOnComponentsCard: {\n title: 'Depends on components',\n emptyMessage: 'No component is a dependency of this component',\n },\n dependsOnResourcesCard: {\n title: 'Depends on resources',\n emptyMessage: 'No resource is a dependency of this component',\n },\n entityContextMenu: {\n copiedMessage: 'Copied!',\n moreButtonTitle: 'More',\n inspectMenuTitle: 'Inspect entity',\n copyURLMenuTitle: 'Copy entity URL',\n unregisterMenuTitle: 'Unregister entity',\n moreButtonAriaLabel: 'more',\n },\n entityLabelsCard: {\n title: 'Labels',\n emptyDescription:\n 'No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:',\n readMoreButtonTitle: 'Read more',\n },\n entityLabels: {\n warningPanelTitle: 'Entity not found',\n ownerLabel: 'Owner',\n lifecycleLabel: 'Lifecycle',\n },\n entityLinksCard: {\n title: 'Links',\n emptyDescription:\n 'No links defined for this entity. You can add links to your entity YAML as shown in the highlighted example below:',\n readMoreButtonTitle: 'Read more',\n },\n entityNotFound: {\n title: 'Entity was not found',\n description:\n 'Want to help us build this? Check out our Getting Started documentation.',\n docButtonTitle: 'DOCS',\n },\n entityTabs: {\n tabsAriaLabel: 'Tabs',\n },\n deleteEntity: {\n dialogTitle: 'Are you sure you want to delete this entity?',\n deleteButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n description:\n 'This entity is not referenced by any location and is therefore not receiving updates.',\n actionButtonTitle: 'Delete entity',\n },\n entityProcessingErrorsDescription: 'The error below originates from',\n entityRelationWarningDescription:\n \"This entity has relations to other entities, which can't be found in the catalog.\\n Entities not found are: \",\n hasComponentsCard: {\n title: 'Has components',\n emptyMessage: 'No component is part of this system',\n },\n hasResourcesCard: {\n title: 'Has resources',\n emptyMessage: 'No resource is part of this system',\n },\n hasSubcomponentsCard: {\n title: 'Has subcomponents',\n emptyMessage: 'No subcomponent is part of this component',\n },\n hasSubdomainsCard: {\n title: 'Has subdomains',\n emptyMessage: 'No subdomain is part of this domain',\n },\n hasSystemsCard: {\n title: 'Has systems',\n emptyMessage: 'No system is part of this domain',\n },\n relatedEntitiesCard: {\n emptyHelpLinkTitle: 'Learn how to change this',\n },\n systemDiagramCard: {\n title: 'System Diagram',\n description: 'Use pinch & zoom to move around the diagram.',\n edgeLabels: {\n partOf: 'part of',\n provides: 'provides',\n dependsOn: 'depends on',\n },\n },\n },\n});\n"],"names":[],"mappings":";;AAmBO,MAAM,wBAAwB,oB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AAU,UAAA;AAAA,QACV,SAAA,EAAW;AAAA;AACb;AACF;AAEJ,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"translation.esm.js","sources":["../../src/alpha/translation.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @alpha */\nexport const catalogTranslationRef = createTranslationRef({\n id: 'catalog',\n messages: {\n indexPage: {\n title: `{{orgName}} Catalog`,\n createButtonTitle: 'Create',\n supportButtonContent: 'All your software catalog entities',\n },\n entityPage: {\n notFoundMessage: 'There is no {{kind}} with the requested {{link}}.',\n notFoundLinkText: 'kind, namespace, and name',\n },\n aboutCard: {\n title: 'About',\n refreshButtonTitle: 'Schedule entity refresh',\n editButtonTitle: 'Edit Metadata',\n editButtonAriaLabel: 'Edit',\n createSimilarButtonTitle: 'Create something similar',\n refreshScheduledMessage: 'Refresh scheduled',\n refreshButtonAriaLabel: 'Refresh',\n launchTemplate: 'Launch Template',\n viewTechdocs: 'View TechDocs',\n viewSource: 'View Source',\n unknown: 'unknown',\n descriptionField: {\n label: 'Description',\n value: 'No description',\n },\n ownerField: {\n label: 'Owner',\n value: 'No Owner',\n },\n domainField: {\n label: 'Domain',\n value: 'No Domain',\n },\n systemField: {\n label: 'System',\n value: 'No System',\n },\n parentComponentField: {\n label: 'Parent Component',\n value: 'No Parent Component',\n },\n typeField: {\n label: 'Type',\n },\n lifecycleField: {\n label: 'Lifecycle',\n },\n tagsField: {\n label: 'Tags',\n value: 'No Tags',\n },\n targetsField: {\n label: 'Targets',\n },\n },\n searchResultItem: {\n kind: 'Kind',\n type: 'Type',\n lifecycle: 'Lifecycle',\n owner: 'Owner',\n },\n catalogTable: {\n warningPanelTitle: 'Could not fetch catalog entities.',\n viewActionTitle: 'View',\n editActionTitle: 'Edit',\n starActionTitle: 'Add to favorites',\n unStarActionTitle: 'Remove from favorites',\n allFilters: 'All',\n },\n dependencyOfComponentsCard: {\n title: 'Dependency of components',\n emptyMessage: 'No component depends on this component',\n },\n dependsOnComponentsCard: {\n title: 'Depends on components',\n emptyMessage: 'No component is a dependency of this component',\n },\n dependsOnResourcesCard: {\n title: 'Depends on resources',\n emptyMessage: 'No resource is a dependency of this component',\n },\n entityContextMenu: {\n copiedMessage: 'Copied!',\n moreButtonTitle: 'More',\n inspectMenuTitle: 'Inspect entity',\n copyURLMenuTitle: 'Copy entity URL',\n unregisterMenuTitle: 'Unregister entity',\n moreButtonAriaLabel: 'more',\n },\n entityLabelsCard: {\n title: 'Labels',\n columnKeyLabel: 'Label',\n columnValueLabel: 'Value',\n emptyDescription:\n 'No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:',\n readMoreButtonTitle: 'Read more',\n },\n entityLabels: {\n warningPanelTitle: 'Entity not found',\n ownerLabel: 'Owner',\n lifecycleLabel: 'Lifecycle',\n },\n entityLinksCard: {\n title: 'Links',\n emptyDescription:\n 'No links defined for this entity. You can add links to your entity YAML as shown in the highlighted example below:',\n readMoreButtonTitle: 'Read more',\n },\n entityNotFound: {\n title: 'Entity was not found',\n description:\n 'Want to help us build this? Check out our Getting Started documentation.',\n docButtonTitle: 'DOCS',\n },\n entityTabs: {\n tabsAriaLabel: 'Tabs',\n },\n deleteEntity: {\n dialogTitle: 'Are you sure you want to delete this entity?',\n deleteButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n description:\n 'This entity is not referenced by any location and is therefore not receiving updates.',\n actionButtonTitle: 'Delete entity',\n },\n entityProcessingErrorsDescription: 'The error below originates from',\n entityRelationWarningDescription:\n \"This entity has relations to other entities, which can't be found in the catalog.\\n Entities not found are: \",\n hasComponentsCard: {\n title: 'Has components',\n emptyMessage: 'No component is part of this system',\n },\n hasResourcesCard: {\n title: 'Has resources',\n emptyMessage: 'No resource is part of this system',\n },\n hasSubcomponentsCard: {\n title: 'Has subcomponents',\n emptyMessage: 'No subcomponent is part of this component',\n },\n hasSubdomainsCard: {\n title: 'Has subdomains',\n emptyMessage: 'No subdomain is part of this domain',\n },\n hasSystemsCard: {\n title: 'Has systems',\n emptyMessage: 'No system is part of this domain',\n },\n relatedEntitiesCard: {\n emptyHelpLinkTitle: 'Learn how to change this',\n },\n systemDiagramCard: {\n title: 'System Diagram',\n description: 'Use pinch & zoom to move around the diagram.',\n edgeLabels: {\n partOf: 'part of',\n provides: 'provides',\n dependsOn: 'depends on',\n },\n },\n },\n});\n"],"names":[],"mappings":";;AAmBO,MAAM,wBAAwB,oBAAA,CAAqB;AAAA,EACxD,EAAA,EAAI,SAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,SAAA,EAAW;AAAA,MACT,KAAA,EAAO,CAAA,mBAAA,CAAA;AAAA,MACP,iBAAA,EAAmB,QAAA;AAAA,MACnB,oBAAA,EAAsB;AAAA,KACxB;AAAA,IACA,UAAA,EAAY;AAAA,MACV,eAAA,EAAiB,mDAAA;AAAA,MACjB,gBAAA,EAAkB;AAAA,KACpB;AAAA,IACA,SAAA,EAAW;AAAA,MACT,KAAA,EAAO,OAAA;AAAA,MACP,kBAAA,EAAoB,yBAAA;AAAA,MACpB,eAAA,EAAiB,eAAA;AAAA,MACjB,mBAAA,EAAqB,MAAA;AAAA,MACrB,wBAAA,EAA0B,0BAAA;AAAA,MAC1B,uBAAA,EAAyB,mBAAA;AAAA,MACzB,sBAAA,EAAwB,SAAA;AAAA,MACxB,cAAA,EAAgB,iBAAA;AAAA,MAChB,YAAA,EAAc,eAAA;AAAA,MACd,UAAA,EAAY,aAAA;AAAA,MACZ,OAAA,EAAS,SAAA;AAAA,MACT,gB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;AAAA,MACP,YAAA,EAAc;AAAA,KAChB;AAAA,IACA,gBAAA,EAAkB;AAAA,MAChB,KAAA,EAAO,eAAA;AAAA,MACP,YAAA,EAAc;AAAA,KAChB;AAAA,IACA,oBAAA,EAAsB;AAAA,MACpB,KAAA,EAAO,mBAAA;AAAA,MACP,YAAA,EAAc;AAAA,KAChB;AAAA,IACA,iBAAA,EAAmB;AAAA,MACjB,KAAA,EAAO,gBAAA;AAAA,MACP,YAAA,EAAc;AAAA,KAChB;AAAA,IACA,cAAA,EAAgB;AAAA,MACd,KAAA,EAAO,aAAA;AAAA,MACP,YAAA,EAAc;AAAA,KAChB;AAAA,IACA,mBAAA,EAAqB;AAAA,MACnB,kBAAA,EAAoB;AAAA,KACtB;AAAA,IACA,iBAAA,EAAmB;AAAA,MACjB,KAAA,EAAO,gBAAA;AAAA,MACP,WAAA,EAAa,8CAAA;AAAA,MACb,UAAA,EAAY;AAAA,QACV,MAAA,EAAQ,SAAA;AAAA,QACR,QAAA,EAAU,UAAA;AAAA,QACV,SAAA,EAAW;AAAA;AACb;AACF;AAEJ,CAAC;;;;"}
|
package/dist/alpha.d.ts
CHANGED
|
@@ -611,7 +611,6 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
|
|
|
611
611
|
kind: "page";
|
|
612
612
|
name: undefined;
|
|
613
613
|
params: {
|
|
614
|
-
defaultPath?: [Error: `Use the 'path' param instead`];
|
|
615
614
|
path: string;
|
|
616
615
|
title?: string;
|
|
617
616
|
icon?: _backstage_frontend_plugin_api.IconElement;
|
|
@@ -625,7 +624,10 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
|
|
|
625
624
|
groups: Record<string, {
|
|
626
625
|
title: string;
|
|
627
626
|
icon?: string | undefined;
|
|
627
|
+
aliases?: string[] | undefined;
|
|
628
|
+
contentOrder?: "title" | "natural" | undefined;
|
|
628
629
|
}>[] | undefined;
|
|
630
|
+
defaultContentOrder: "title" | "natural";
|
|
629
631
|
showNavItemIcons: boolean;
|
|
630
632
|
path: string | undefined;
|
|
631
633
|
title: string | undefined;
|
|
@@ -634,7 +636,10 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
|
|
|
634
636
|
groups?: Record<string, {
|
|
635
637
|
title: string;
|
|
636
638
|
icon?: string | undefined;
|
|
639
|
+
aliases?: string[] | undefined;
|
|
640
|
+
contentOrder?: "title" | "natural" | undefined;
|
|
637
641
|
}>[] | undefined;
|
|
642
|
+
defaultContentOrder?: "title" | "natural" | undefined;
|
|
638
643
|
showNavItemIcons?: boolean | undefined;
|
|
639
644
|
title?: string | undefined;
|
|
640
645
|
path?: string | undefined;
|
|
@@ -693,7 +698,6 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
|
|
|
693
698
|
kind: "page";
|
|
694
699
|
name: "entity";
|
|
695
700
|
params: {
|
|
696
|
-
defaultPath?: [Error: `Use the 'path' param instead`];
|
|
697
701
|
path: string;
|
|
698
702
|
title?: string;
|
|
699
703
|
icon?: _backstage_frontend_plugin_api.IconElement;
|
|
@@ -783,6 +787,8 @@ declare const catalogTranslationRef: _backstage_frontend_plugin_api.TranslationR
|
|
|
783
787
|
readonly "entityContextMenu.moreButtonAriaLabel": "more";
|
|
784
788
|
readonly "entityLabelsCard.title": "Labels";
|
|
785
789
|
readonly "entityLabelsCard.readMoreButtonTitle": "Read more";
|
|
790
|
+
readonly "entityLabelsCard.columnKeyLabel": "Label";
|
|
791
|
+
readonly "entityLabelsCard.columnValueLabel": "Value";
|
|
786
792
|
readonly "entityLabelsCard.emptyDescription": "No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:";
|
|
787
793
|
readonly "entityLabels.ownerLabel": "Owner";
|
|
788
794
|
readonly "entityLabels.warningPanelTitle": "Entity not found";
|