@backstage/plugin-catalog 1.32.2-next.1 → 1.32.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
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @backstage/plugin-catalog
|
|
2
2
|
|
|
3
|
+
## 1.32.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7ca91e8: Header in EntityLayout should always be shown.
|
|
8
|
+
Monitoring the loading status caused flickering when the refresh() method of the Async Entity was invoked.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
- @backstage/frontend-plugin-api@0.13.3
|
|
11
|
+
- @backstage/core-components@0.18.5
|
|
12
|
+
- @backstage/core-compat-api@0.5.6
|
|
13
|
+
- @backstage/plugin-search-react@1.10.2
|
|
14
|
+
- @backstage/integration-react@1.2.14
|
|
15
|
+
- @backstage/plugin-catalog-react@1.21.5
|
|
16
|
+
- @backstage/plugin-scaffolder-common@1.7.5
|
|
17
|
+
- @backstage/plugin-techdocs-react@1.3.7
|
|
18
|
+
|
|
19
|
+
## 1.32.2-next.2
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- 7ca91e8: Header in EntityLayout should always be shown.
|
|
24
|
+
Monitoring the loading status caused flickering when the refresh() method of the Async Entity was invoked.
|
|
25
|
+
|
|
3
26
|
## 1.32.2-next.1
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import Alert from '@material-ui/lab/Alert';
|
|
3
3
|
import { useRouteRefParams, useElementFilter, attachComponentData } from '@backstage/core-plugin-api';
|
|
4
4
|
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
@@ -18,20 +18,12 @@ const EntityLayout = (props) => {
|
|
|
18
18
|
UNSTABLE_contextMenuOptions,
|
|
19
19
|
contextMenuItems,
|
|
20
20
|
children,
|
|
21
|
+
header,
|
|
21
22
|
NotFoundComponent,
|
|
22
23
|
parentEntityRelations
|
|
23
24
|
} = props;
|
|
24
25
|
const { kind } = useRouteRefParams(entityRouteRef);
|
|
25
26
|
const { entity, loading, error } = useAsyncEntity();
|
|
26
|
-
const header = props.header ?? /* @__PURE__ */ jsx(
|
|
27
|
-
EntityHeader,
|
|
28
|
-
{
|
|
29
|
-
parentEntityRelations,
|
|
30
|
-
UNSTABLE_contextMenuOptions,
|
|
31
|
-
UNSTABLE_extraContextMenuItems,
|
|
32
|
-
contextMenuItems
|
|
33
|
-
}
|
|
34
|
-
);
|
|
35
27
|
const routes = useElementFilter(
|
|
36
28
|
children,
|
|
37
29
|
(elements) => elements.selectByComponentData({
|
|
@@ -57,7 +49,15 @@ const EntityLayout = (props) => {
|
|
|
57
49
|
);
|
|
58
50
|
const { t } = useTranslationRef(catalogTranslationRef);
|
|
59
51
|
return /* @__PURE__ */ jsxs(Page, { themeId: entity?.spec?.type?.toString() ?? "home", children: [
|
|
60
|
-
|
|
52
|
+
header ?? /* @__PURE__ */ jsx(
|
|
53
|
+
EntityHeader,
|
|
54
|
+
{
|
|
55
|
+
parentEntityRelations,
|
|
56
|
+
UNSTABLE_contextMenuOptions,
|
|
57
|
+
UNSTABLE_extraContextMenuItems,
|
|
58
|
+
contextMenuItems
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
61
|
loading && /* @__PURE__ */ jsx(Progress, {}),
|
|
62
62
|
entity && /* @__PURE__ */ jsx(EntityTabs, { routes }),
|
|
63
63
|
error && /* @__PURE__ */ jsx(Content, { children: /* @__PURE__ */ jsx(Alert, { severity: "error", children: error.toString() }) }),
|
|
@@ -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 } 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';\n\nexport type EntityLayoutRouteProps = {\n path: string;\n title: string;\n group: string;\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}\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 NotFoundComponent,\n parentEntityRelations,\n } = props;\n const { kind } = useRouteRefParams(entityRouteRef);\n const { entity, loading, error } = useAsyncEntity();\n\n const
|
|
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 } 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';\n\nexport type EntityLayoutRouteProps = {\n path: string;\n title: string;\n group: string;\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}\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 } = 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 },\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 && <EntityTabs routes={routes} />}\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 There is no {kind} with the requested{' '}\n <Link to=\"https://backstage.io/docs/features/software-catalog/references\">\n kind, namespace, and name\n </Link>\n .\n </WarningPanel>\n )}\n </Content>\n )}\n </Page>\n );\n};\n\nEntityLayout.Route = Route;\n"],"names":[],"mappings":";;;;;;;;;;AAmDA,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;AA4ClD,MAAM,YAAA,GAAe,CAAC,KAAA,KAA6B;AACxD,EAAA,MAA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A;AAAA,QACA,8BAAA;AAAA,QACA;AAAA;AAAA,KACF;AAAA,IAGD,OAAA,wBAAY,QAAA,EAAA,EAAS,CAAA;AAAA,IAErB,MAAA,oBAAU,GAAA,CAAC,UAAA,EAAA,EAAW,MAAA,EAAgB,CAAA;AAAA,IAEtC,KAAA,oBACC,GAAA,CAAC,OAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAM,UAAS,OAAA,EAAS,QAAA,EAAA,KAAA,CAAM,QAAA,EAAS,EAAE,CAAA,EAC5C,CAAA;AAAA,IAGD,CAAC,OAAA,IAAW,CAAC,KAAA,IAAS,CAAC,MAAA,oBACtB,GAAA,CAAC,OAAA,EAAA,EACE,QAAA,EAAA,iBAAA,GACC,oCAEA,IAAA,CAAC,YAAA,EAAA,EAAa,KAAA,EAAO,CAAA,CAAE,gCAAgC,CAAA,EAAG,QAAA,EAAA;AAAA,MAAA,cAAA;AAAA,MAC3C,IAAA;AAAA,MAAK,qBAAA;AAAA,MAAoB,GAAA;AAAA,sBACtC,GAAA,CAAC,IAAA,EAAA,EAAK,EAAA,EAAG,gEAAA,EAAiE,QAAA,EAAA,2BAAA,EAE1E,CAAA;AAAA,MAAO;AAAA,KAAA,EAET,CAAA,EAEJ;AAAA,GAAA,EAEJ,CAAA;AAEJ;AAEA,YAAA,CAAa,KAAA,GAAQ,KAAA;;;;"}
|
package/dist/package.json.esm.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-catalog",
|
|
3
|
-
"version": "1.32.2
|
|
3
|
+
"version": "1.32.2",
|
|
4
4
|
"description": "The Backstage plugin for browsing the Backstage catalog",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "frontend-plugin",
|
|
@@ -70,24 +70,24 @@
|
|
|
70
70
|
"test": "backstage-cli package test"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@backstage/catalog-client": "1.12.1",
|
|
74
|
-
"@backstage/catalog-model": "1.7.6",
|
|
75
|
-
"@backstage/core-compat-api": "0.5.6
|
|
76
|
-
"@backstage/core-components": "0.18.5
|
|
77
|
-
"@backstage/core-plugin-api": "1.12.1",
|
|
78
|
-
"@backstage/errors": "1.2.7",
|
|
79
|
-
"@backstage/frontend-plugin-api": "0.13.
|
|
80
|
-
"@backstage/integration-react": "1.2.14
|
|
81
|
-
"@backstage/plugin-catalog-common": "1.1.7",
|
|
82
|
-
"@backstage/plugin-catalog-react": "1.21.5
|
|
83
|
-
"@backstage/plugin-permission-react": "0.4.39",
|
|
84
|
-
"@backstage/plugin-scaffolder-common": "1.7.5
|
|
85
|
-
"@backstage/plugin-search-common": "1.2.21",
|
|
86
|
-
"@backstage/plugin-search-react": "1.10.2
|
|
87
|
-
"@backstage/plugin-techdocs-common": "0.1.1",
|
|
88
|
-
"@backstage/plugin-techdocs-react": "1.3.7
|
|
89
|
-
"@backstage/types": "1.2.2",
|
|
90
|
-
"@backstage/version-bridge": "1.0.11",
|
|
73
|
+
"@backstage/catalog-client": "^1.12.1",
|
|
74
|
+
"@backstage/catalog-model": "^1.7.6",
|
|
75
|
+
"@backstage/core-compat-api": "^0.5.6",
|
|
76
|
+
"@backstage/core-components": "^0.18.5",
|
|
77
|
+
"@backstage/core-plugin-api": "^1.12.1",
|
|
78
|
+
"@backstage/errors": "^1.2.7",
|
|
79
|
+
"@backstage/frontend-plugin-api": "^0.13.3",
|
|
80
|
+
"@backstage/integration-react": "^1.2.14",
|
|
81
|
+
"@backstage/plugin-catalog-common": "^1.1.7",
|
|
82
|
+
"@backstage/plugin-catalog-react": "^1.21.5",
|
|
83
|
+
"@backstage/plugin-permission-react": "^0.4.39",
|
|
84
|
+
"@backstage/plugin-scaffolder-common": "^1.7.5",
|
|
85
|
+
"@backstage/plugin-search-common": "^1.2.21",
|
|
86
|
+
"@backstage/plugin-search-react": "^1.10.2",
|
|
87
|
+
"@backstage/plugin-techdocs-common": "^0.1.1",
|
|
88
|
+
"@backstage/plugin-techdocs-react": "^1.3.7",
|
|
89
|
+
"@backstage/types": "^1.2.2",
|
|
90
|
+
"@backstage/version-bridge": "^1.0.11",
|
|
91
91
|
"@material-ui/core": "^4.12.2",
|
|
92
92
|
"@material-ui/icons": "^4.9.1",
|
|
93
93
|
"@material-ui/lab": "4.0.0-alpha.61",
|
|
@@ -102,12 +102,12 @@
|
|
|
102
102
|
"zen-observable": "^0.10.0"
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
105
|
-
"@backstage/cli": "0.35.2
|
|
106
|
-
"@backstage/core-app-api": "1.19.3",
|
|
107
|
-
"@backstage/dev-utils": "1.1.19
|
|
108
|
-
"@backstage/frontend-test-utils": "0.4.3
|
|
109
|
-
"@backstage/plugin-permission-common": "0.9.
|
|
110
|
-
"@backstage/test-utils": "1.7.14",
|
|
105
|
+
"@backstage/cli": "^0.35.2",
|
|
106
|
+
"@backstage/core-app-api": "^1.19.3",
|
|
107
|
+
"@backstage/dev-utils": "^1.1.19",
|
|
108
|
+
"@backstage/frontend-test-utils": "^0.4.3",
|
|
109
|
+
"@backstage/plugin-permission-common": "^0.9.4",
|
|
110
|
+
"@backstage/test-utils": "^1.7.14",
|
|
111
111
|
"@testing-library/dom": "^10.0.0",
|
|
112
112
|
"@testing-library/jest-dom": "^6.0.0",
|
|
113
113
|
"@testing-library/react": "^16.0.0",
|