@backstage/plugin-catalog 1.31.1 → 1.31.2-next.0
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 +13 -0
- package/dist/alpha/components/EntityLayout/EntityLayout.esm.js +11 -11
- package/dist/alpha/components/EntityLayout/EntityLayout.esm.js.map +1 -1
- package/dist/alpha/filters.esm.js +3 -3
- package/dist/alpha/filters.esm.js.map +1 -1
- package/dist/alpha/pages.esm.js +15 -7
- package/dist/alpha/pages.esm.js.map +1 -1
- package/dist/alpha.d.ts +5 -3
- package/dist/package.json.esm.js +1 -1
- package/package.json +25 -25
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @backstage/plugin-catalog
|
|
2
2
|
|
|
3
|
+
## 1.31.2-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f4622e8: Adding a more sensible default order to the default filters
|
|
8
|
+
- 77eebdc: Support multiple headers in new frontend system, and don't render a header until the entity has finished loading
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
- @backstage/plugin-catalog-react@1.19.2-next.0
|
|
11
|
+
- @backstage/core-compat-api@0.4.5-next.0
|
|
12
|
+
- @backstage/integration-react@1.2.9
|
|
13
|
+
- @backstage/frontend-plugin-api@0.10.4
|
|
14
|
+
- @backstage/plugin-search-react@1.9.2
|
|
15
|
+
|
|
3
16
|
## 1.31.1
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import Alert from '@material-ui/lab/Alert';
|
|
3
3
|
import { attachComponentData, useRouteRefParams, useElementFilter } from '@backstage/core-plugin-api';
|
|
4
4
|
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
@@ -18,12 +18,20 @@ const EntityLayout = (props) => {
|
|
|
18
18
|
UNSTABLE_contextMenuOptions,
|
|
19
19
|
contextMenuItems,
|
|
20
20
|
children,
|
|
21
|
-
header,
|
|
22
21
|
NotFoundComponent,
|
|
23
22
|
parentEntityRelations
|
|
24
23
|
} = props;
|
|
25
24
|
const { kind } = useRouteRefParams(entityRouteRef);
|
|
26
25
|
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
|
+
);
|
|
27
35
|
const routes = useElementFilter(
|
|
28
36
|
children,
|
|
29
37
|
(elements) => elements.selectByComponentData({
|
|
@@ -49,15 +57,7 @@ const EntityLayout = (props) => {
|
|
|
49
57
|
);
|
|
50
58
|
const { t } = useTranslationRef(catalogTranslationRef);
|
|
51
59
|
return /* @__PURE__ */ jsxs(Page, { themeId: entity?.spec?.type?.toString() ?? "home", children: [
|
|
52
|
-
|
|
53
|
-
EntityHeader,
|
|
54
|
-
{
|
|
55
|
-
parentEntityRelations,
|
|
56
|
-
UNSTABLE_contextMenuOptions,
|
|
57
|
-
UNSTABLE_extraContextMenuItems,
|
|
58
|
-
contextMenuItems
|
|
59
|
-
}
|
|
60
|
-
),
|
|
60
|
+
!loading && header,
|
|
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
|
|
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 header = props.header ?? (\n <EntityHeader\n parentEntityRelations={parentEntityRelations}\n UNSTABLE_contextMenuOptions={UNSTABLE_contextMenuOptions}\n UNSTABLE_extraContextMenuItems={UNSTABLE_extraContextMenuItems}\n contextMenuItems={contextMenuItems}\n />\n );\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 {!loading && header}\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,OAAU,GAAA,kCAAA;AAChB,MAAM,QAAiD,MAAM,IAAA;AAC7D,mBAAoB,CAAA,KAAA,EAAO,SAAS,IAAI,CAAA;AACxC,mBAAoB,CAAA,KAAA,EAAO,0BAA0B,IAAI,CAAA;AA4C5C,MAAA,YAAA,GAAe,CAAC,KAA6B,KAAA;AACxD,EAAM,MAAA;AAAA,IACJ,8BAAA;AAAA,IACA,2BAAA;AAAA,IACA,gBAAA;AAAA,IACA,QAAA;AAAA,IACA,iB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AEZ,OAAA,wBAAY,QAAS,EAAA,EAAA,CAAA;AAAA,IAErB,MAAA,oBAAW,GAAA,CAAA,UAAA,EAAA,EAAW,MAAgB,EAAA,CAAA;AAAA,IAEtC,KAAA,oBACE,GAAA,CAAA,OAAA,EAAA,EACC,QAAC,kBAAA,GAAA,CAAA,KAAA,EAAA,EAAM,UAAS,OAAS,EAAA,QAAA,EAAA,KAAA,CAAM,QAAS,EAAA,EAAE,CAC5C,EAAA,CAAA;AAAA,IAGD,CAAC,OAAA,IAAW,CAAC,KAAA,IAAS,CAAC,MACtB,oBAAA,GAAA,CAAC,OACE,EAAA,EAAA,QAAA,EAAA,iBAAA,GACC,oCAEC,IAAA,CAAA,YAAA,EAAA,EAAa,KAAO,EAAA,CAAA,CAAE,gCAAgC,CAAG,EAAA,QAAA,EAAA;AAAA,MAAA,cAAA;AAAA,MAC3C,IAAA;AAAA,MAAK,qBAAA;AAAA,MAAoB,GAAA;AAAA,sBACrC,GAAA,CAAA,IAAA,EAAA,EAAK,EAAG,EAAA,gEAAA,EAAiE,QAE1E,EAAA,2BAAA,EAAA,CAAA;AAAA,MAAO;AAAA,KAAA,EAET,CAEJ,EAAA;AAAA,GAEJ,EAAA,CAAA;AAEJ;AAEA,YAAA,CAAa,KAAQ,GAAA,KAAA;;;;"}
|
|
@@ -95,14 +95,14 @@ const catalogListCatalogFilter = CatalogFilterBlueprint.makeWithOverrides({
|
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
97
|
var filters = [
|
|
98
|
-
catalogTagCatalogFilter,
|
|
99
98
|
catalogKindCatalogFilter,
|
|
100
99
|
catalogTypeCatalogFilter,
|
|
100
|
+
catalogListCatalogFilter,
|
|
101
101
|
catalogModeCatalogFilter,
|
|
102
|
-
catalogNamespaceCatalogFilter,
|
|
103
102
|
catalogLifecycleCatalogFilter,
|
|
103
|
+
catalogTagCatalogFilter,
|
|
104
104
|
catalogProcessingStatusCatalogFilter,
|
|
105
|
-
|
|
105
|
+
catalogNamespaceCatalogFilter
|
|
106
106
|
];
|
|
107
107
|
|
|
108
108
|
export { filters as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filters.esm.js","sources":["../../src/alpha/filters.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 { CatalogFilterBlueprint } from '@backstage/plugin-catalog-react/alpha';\n\nconst catalogTagCatalogFilter = CatalogFilterBlueprint.make({\n name: 'tag',\n params: {\n loader: async () => {\n const { EntityTagPicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityTagPicker />;\n },\n },\n});\n\nconst catalogKindCatalogFilter = CatalogFilterBlueprint.makeWithOverrides({\n name: 'kind',\n config: {\n schema: {\n initialFilter: z => z.string().default('component'),\n },\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n loader: async () => {\n const { EntityKindPicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityKindPicker initialFilter={config.initialFilter} />;\n },\n });\n },\n});\n\nconst catalogTypeCatalogFilter = CatalogFilterBlueprint.make({\n name: 'type',\n params: {\n loader: async () => {\n const { EntityTypePicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityTypePicker />;\n },\n },\n});\n\nconst catalogModeCatalogFilter = CatalogFilterBlueprint.makeWithOverrides({\n name: 'mode',\n config: {\n schema: {\n mode: z => z.enum(['owners-only', 'all']).optional(),\n },\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n loader: async () => {\n const { EntityOwnerPicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityOwnerPicker mode={config.mode} />;\n },\n });\n },\n});\n\nconst catalogNamespaceCatalogFilter = CatalogFilterBlueprint.make({\n name: 'namespace',\n params: {\n loader: async () => {\n const { EntityNamespacePicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityNamespacePicker />;\n },\n },\n});\n\nconst catalogLifecycleCatalogFilter = CatalogFilterBlueprint.make({\n name: 'lifecycle',\n params: {\n loader: async () => {\n const { EntityLifecyclePicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityLifecyclePicker />;\n },\n },\n});\n\nconst catalogProcessingStatusCatalogFilter = CatalogFilterBlueprint.make({\n name: 'processing-status',\n params: {\n loader: async () => {\n const { EntityProcessingStatusPicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityProcessingStatusPicker />;\n },\n },\n});\n\nconst catalogListCatalogFilter = CatalogFilterBlueprint.makeWithOverrides({\n name: 'list',\n config: {\n schema: {\n initialFilter: z => z.enum(['owned', 'starred', 'all']).default('owned'),\n },\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n loader: async () => {\n const { UserListPicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <UserListPicker initialFilter={config.initialFilter} />;\n },\n });\n },\n});\n\nexport default [\n
|
|
1
|
+
{"version":3,"file":"filters.esm.js","sources":["../../src/alpha/filters.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 { CatalogFilterBlueprint } from '@backstage/plugin-catalog-react/alpha';\n\nconst catalogTagCatalogFilter = CatalogFilterBlueprint.make({\n name: 'tag',\n params: {\n loader: async () => {\n const { EntityTagPicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityTagPicker />;\n },\n },\n});\n\nconst catalogKindCatalogFilter = CatalogFilterBlueprint.makeWithOverrides({\n name: 'kind',\n config: {\n schema: {\n initialFilter: z => z.string().default('component'),\n },\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n loader: async () => {\n const { EntityKindPicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityKindPicker initialFilter={config.initialFilter} />;\n },\n });\n },\n});\n\nconst catalogTypeCatalogFilter = CatalogFilterBlueprint.make({\n name: 'type',\n params: {\n loader: async () => {\n const { EntityTypePicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityTypePicker />;\n },\n },\n});\n\nconst catalogModeCatalogFilter = CatalogFilterBlueprint.makeWithOverrides({\n name: 'mode',\n config: {\n schema: {\n mode: z => z.enum(['owners-only', 'all']).optional(),\n },\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n loader: async () => {\n const { EntityOwnerPicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityOwnerPicker mode={config.mode} />;\n },\n });\n },\n});\n\nconst catalogNamespaceCatalogFilter = CatalogFilterBlueprint.make({\n name: 'namespace',\n params: {\n loader: async () => {\n const { EntityNamespacePicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityNamespacePicker />;\n },\n },\n});\n\nconst catalogLifecycleCatalogFilter = CatalogFilterBlueprint.make({\n name: 'lifecycle',\n params: {\n loader: async () => {\n const { EntityLifecyclePicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityLifecyclePicker />;\n },\n },\n});\n\nconst catalogProcessingStatusCatalogFilter = CatalogFilterBlueprint.make({\n name: 'processing-status',\n params: {\n loader: async () => {\n const { EntityProcessingStatusPicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <EntityProcessingStatusPicker />;\n },\n },\n});\n\nconst catalogListCatalogFilter = CatalogFilterBlueprint.makeWithOverrides({\n name: 'list',\n config: {\n schema: {\n initialFilter: z => z.enum(['owned', 'starred', 'all']).default('owned'),\n },\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n loader: async () => {\n const { UserListPicker } = await import(\n '@backstage/plugin-catalog-react'\n );\n return <UserListPicker initialFilter={config.initialFilter} />;\n },\n });\n },\n});\n\n// this is the default order that the filters will be applied in\nexport default [\n catalogKindCatalogFilter,\n catalogTypeCatalogFilter,\n catalogListCatalogFilter,\n catalogModeCatalogFilter,\n catalogLifecycleCatalogFilter,\n catalogTagCatalogFilter,\n catalogProcessingStatusCatalogFilter,\n catalogNamespaceCatalogFilter,\n];\n"],"names":[],"mappings":";;;AAkBA,MAAM,uBAAA,GAA0B,uBAAuB,IAAK,CAAA;AAAA,EAC1D,IAAM,EAAA,KAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,QAAQ,YAAY;AAClB,MAAA,MAAM,EAAE,eAAA,EAAoB,GAAA,MAAM,OAChC,iCACF,CAAA;AACA,MAAA,2BAAQ,eAAgB,EAAA,EAAA,CAAA;AAAA;AAC1B;AAEJ,CAAC,CAAA;AAED,MAAM,wBAAA,GAA2B,uBAAuB,iBAAkB,CAAA;AAAA,EACxE,IAAM,EAAA,MAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA;AAAA,MACN,eAAe,CAAK,CAAA,KAAA,CAAA,CAAE,MAAO,EAAA,CAAE,QAAQ,WAAW;AAAA;AACpD,GACF;AAAA,EACA,OAAQ,CAAA,eAAA,EAAiB,EAAE,MAAA,EAAU,EAAA;AACnC,IAAA,OAAO,eAAgB,CAAA;AAAA,MACrB,QAAQ,YAAY;AAClB,QAAA,MAAM,EAAE,gBAAA,EAAqB,GAAA,MAAM,OACjC,iCACF,CAAA;AACA,QAAA,uBAAQ,GAAA,CAAA,gBAAA,EAAA,EAAiB,aAAe,EAAA,MAAA,CAAO,aAAe,EAAA,CAAA;AAAA;AAChE,KACD,CAAA;AAAA;AAEL,CAAC,CAAA;AAED,MAAM,wBAAA,GAA2B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age = PageBlueprint.makeWithOverrides({
|
|
|
48
48
|
const catalogEntityPage = PageBlueprint.makeWithOverrides({
|
|
49
49
|
name: "entity",
|
|
50
50
|
inputs: {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
),
|
|
51
|
+
headers: createExtensionInput([
|
|
52
|
+
EntityHeaderBlueprint.dataRefs.element.optional(),
|
|
53
|
+
EntityHeaderBlueprint.dataRefs.filterFunction.optional()
|
|
54
|
+
]),
|
|
55
55
|
contents: createExtensionInput([
|
|
56
56
|
coreExtensionData.reactElement,
|
|
57
57
|
coreExtensionData.routePath,
|
|
@@ -81,9 +81,14 @@ const catalogEntityPage = PageBlueprint.makeWithOverrides({
|
|
|
81
81
|
element: item.get(coreExtensionData.reactElement),
|
|
82
82
|
filter: item.get(EntityContextMenuItemBlueprint.dataRefs.filterFunction) ?? (() => true)
|
|
83
83
|
}));
|
|
84
|
-
const
|
|
85
|
-
EntityHeaderBlueprint.dataRefs.element
|
|
86
|
-
|
|
84
|
+
const headers = inputs.headers.map((header) => ({
|
|
85
|
+
element: header.get(EntityHeaderBlueprint.dataRefs.element),
|
|
86
|
+
filter: header.get(EntityHeaderBlueprint.dataRefs.filterFunction)
|
|
87
|
+
})).sort((a, b) => {
|
|
88
|
+
if (a.filter && !b.filter) return -1;
|
|
89
|
+
if (!a.filter && b.filter) return 1;
|
|
90
|
+
return 0;
|
|
91
|
+
});
|
|
87
92
|
let groups = Object.entries(defaultEntityContentGroups).reduce(
|
|
88
93
|
(rest, group) => {
|
|
89
94
|
const [groupId, groupValue] = group;
|
|
@@ -118,6 +123,9 @@ const catalogEntityPage = PageBlueprint.makeWithOverrides({
|
|
|
118
123
|
const entityFromUrl = useEntityFromUrl();
|
|
119
124
|
const { entity } = entityFromUrl;
|
|
120
125
|
const filteredMenuItems = entity ? menuItems.filter((i) => i.filter(entity)).map((i) => i.element) : [];
|
|
126
|
+
const header = headers.find(
|
|
127
|
+
(h) => !h.filter || h.filter(entity)
|
|
128
|
+
)?.element;
|
|
121
129
|
return /* @__PURE__ */ jsx(AsyncEntityProvider, { ...entityFromUrl, children: /* @__PURE__ */ jsx(
|
|
122
130
|
EntityLayout,
|
|
123
131
|
{
|
|
@@ -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 {\n compatWrapper,\n convertLegacyRouteRef,\n} 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 EntityHeaderBlueprint,\n EntityContentBlueprint,\n defaultEntityContentGroups,\n EntityContextMenuItemBlueprint,\n} from '@backstage/plugin-catalog-react/alpha';\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 defaultPath: '/catalog',\n routeRef: convertLegacyRouteRef(rootRouteRef),\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 compatWrapper(\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 header: createExtensionInput(\n [EntityHeaderBlueprint.dataRefs.element.optional()],\n { singleton: true, optional: true },\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 ]),\n contextMenuItems: createExtensionInput([\n coreExtensionData.reactElement,\n EntityContextMenuItemBlueprint.dataRefs.filterFunction.optional(),\n ]),\n },\n config: {\n schema: {\n groups: z =>\n z\n .array(z.record(z.string(), z.object({ title: z.string() })))\n .optional(),\n },\n },\n factory(originalFactory, { config, inputs }) {\n return originalFactory({\n defaultPath: '/catalog/:namespace/:kind/:name',\n routeRef: convertLegacyRouteRef(entityRouteRef),\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 type Groups = Record<\n string,\n { title: string; items: Array<(typeof inputs.contents)[0]> }\n >;\n\n const header = inputs.header?.get(\n EntityHeaderBlueprint.dataRefs.element,\n );\n\n let groups = Object.entries(defaultEntityContentGroups).reduce<Groups>(\n (rest, group) => {\n const [groupId, groupValue] = group;\n return {\n ...rest,\n [groupId]: { title: groupValue, items: [] },\n };\n },\n {},\n );\n\n // config groups override default groups\n if (config.groups) {\n groups = config.groups.reduce<Groups>((rest, group) => {\n const [groupId, groupValue] = Object.entries(group)[0];\n return {\n ...rest,\n [groupId]: { title: groupValue.title, items: [] },\n };\n }, {});\n }\n\n for (const output of inputs.contents) {\n const itemId = output.node.spec.id;\n const itemTitle = output.get(EntityContentBlueprint.dataRefs.title);\n const itemGroup = output.get(EntityContentBlueprint.dataRefs.group);\n const group = itemGroup && groups[itemGroup];\n if (!group) {\n groups[itemId] = { title: itemTitle, items: [output] };\n continue;\n }\n group.items.push(output);\n }\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 return (\n <AsyncEntityProvider {...entityFromUrl}>\n <EntityLayout\n header={header}\n contextMenuItems={filteredMenuItems}\n >\n {Object.values(groups).flatMap(({ title, items }) =>\n items.map(output => (\n <EntityLayout.Route\n group={title}\n key={output.get(coreExtensionData.routePath)}\n path={output.get(coreExtensionData.routePath)}\n title={output.get(EntityContentBlueprint.dataRefs.title)}\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 )}\n </EntityLayout>\n </AsyncEntityProvider>\n );\n };\n\n return compatWrapper(<Component />);\n },\n });\n },\n});\n\nexport default [catalogPage, catalogEntityPage];\n"],"names":[],"mappings":";;;;;;;;;AAuCa,MAAA,WAAA,GAAc,cAAc,iBAAkB,CAAA;AAAA,EACzD,MAAQ,EAAA;AAAA,IACN,OAAS,EAAA,oBAAA,CAAqB,CAAC,iBAAA,CAAkB,YAAY,CAAC;AAAA,GAChE;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA;AAAA,MACN,UAAA,EAAY,CACV,CAAA,KAAA,CAAA,CACG,KAAM,CAAA;AAAA,QACL,EAAE,OAAQ,EAAA;AAAA,QACV,EAAE,MAAO,CAAA;AAAA,UACP,MAAM,CAAE,CAAA,IAA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QAAA,EAAA,MAAA,CAAO,GAAI,CAAA,iBAAA,CAAkB,YAAY;AAAA,mBAAA;AAAA,kBAZrC,MAAA,CAAO,GAAI,CAAA,iBAAA,CAAkB,SAAS;AAAA,iBAc9C;AAAA;AACH;AAAA,WAEJ,EAAA,CAAA;AAAA,SAEJ;AAEA,QAAO,OAAA,aAAA,iBAAe,GAAA,CAAA,SAAA,EAAA,EAAU,CAAE,CAAA;AAAA;AACpC,KACD,CAAA;AAAA;AAEL,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 {\n compatWrapper,\n convertLegacyRouteRef,\n} 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 EntityHeaderBlueprint,\n EntityContentBlueprint,\n defaultEntityContentGroups,\n EntityContextMenuItemBlueprint,\n} from '@backstage/plugin-catalog-react/alpha';\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 defaultPath: '/catalog',\n routeRef: convertLegacyRouteRef(rootRouteRef),\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 compatWrapper(\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 ]),\n contextMenuItems: createExtensionInput([\n coreExtensionData.reactElement,\n EntityContextMenuItemBlueprint.dataRefs.filterFunction.optional(),\n ]),\n },\n config: {\n schema: {\n groups: z =>\n z\n .array(z.record(z.string(), z.object({ title: z.string() })))\n .optional(),\n },\n },\n factory(originalFactory, { config, inputs }) {\n return originalFactory({\n defaultPath: '/catalog/:namespace/:kind/:name',\n routeRef: convertLegacyRouteRef(entityRouteRef),\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 type Groups = Record<\n string,\n { title: string; items: Array<(typeof inputs.contents)[0]> }\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 let groups = Object.entries(defaultEntityContentGroups).reduce<Groups>(\n (rest, group) => {\n const [groupId, groupValue] = group;\n return {\n ...rest,\n [groupId]: { title: groupValue, items: [] },\n };\n },\n {},\n );\n\n // config groups override default groups\n if (config.groups) {\n groups = config.groups.reduce<Groups>((rest, group) => {\n const [groupId, groupValue] = Object.entries(group)[0];\n return {\n ...rest,\n [groupId]: { title: groupValue.title, items: [] },\n };\n }, {});\n }\n\n for (const output of inputs.contents) {\n const itemId = output.node.spec.id;\n const itemTitle = output.get(EntityContentBlueprint.dataRefs.title);\n const itemGroup = output.get(EntityContentBlueprint.dataRefs.group);\n const group = itemGroup && groups[itemGroup];\n if (!group) {\n groups[itemId] = { title: itemTitle, items: [output] };\n continue;\n }\n group.items.push(output);\n }\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 >\n {Object.values(groups).flatMap(({ title, items }) =>\n items.map(output => (\n <EntityLayout.Route\n group={title}\n key={output.get(coreExtensionData.routePath)}\n path={output.get(coreExtensionData.routePath)}\n title={output.get(EntityContentBlueprint.dataRefs.title)}\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 )}\n </EntityLayout>\n </AsyncEntityProvider>\n );\n };\n\n return compatWrapper(<Component />);\n },\n });\n },\n});\n\nexport default [catalogPage, catalogEntityPage];\n"],"names":[],"mappings":";;;;;;;;;AAuCa,MAAA,WAAA,GAAc,cAAc,iBAAkB,CAAA;AAAA,EACzD,MAAQ,EAAA;AAAA,IACN,OAAS,EAAA,oBAAA,CAAqB,CAAC,iBAAA,CAAkB,YAAY,CAAC;AAAA,GAChE;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA;AAAA,MACN,UAAA,EAAY,CACV,CAAA,KAAA,CAAA,CACG,KAAM,CAAA;AAAA,QACL,EAAE,OAAQ,EAAA;AAAA,QACV,EAAE,MAAO,CAAA;AAAA,UACP,MAAM,CAAE,CAAA,IAAA,CAAK,CAAC,QAAA,EAAU,QAAQ,CAAC,CAAA;AAAA,UACjC,KAAO,EAAA,CAAA,CAAE,MAAO,EAAA,CAAE,QAAS,EAAA;AAAA,UAC3B,MAAQ,EAAA,CAAA,CAAE,MAAO,EAAA,CAAE,QAAS;AAAA,SAC7B;AAAA,OACF,CACA,CAAA,OAAA,CAAQ,IAAI;AAAA;AACnB,GACF;AAAA,EACA,OAAQ,CAAA,eAAA,EAAiB,EAAE,MAAA,EAAQ,QAAU,EAAA;AAC3C,IAAA,OAAO,eAAgB,CAAA;AAAA,MACrB,WAAa,EAAA,UAAA;AAAA,MACb,QAAA,EAAU,sBAAsB,YAAY,CAAA;AAAA,MAC5C,QAAQ,YAAY;AAClB,QAAA,MAAM,EAAE,eAAA,EAAoB,GAAA,MAAM,OAAO,wCAA2B,CAAA;AACpE,QAAM,MAAA,OAAA,GAAU,OAAO,OAAQ,CAAA,GAAA;AAAA,UAAI,CACjC,MAAA,KAAA,MAAA,CAAO,GAAI,CAAA,iBAAA,CAAkB,YAAY;AAAA,SAC3C;AACA,QAAO,OAAA,aAAA;AAAA,0BACL,GAAA;AAAA,YAAC,eAAA;AAAA,YAAA;AAAA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;AAEA,QAAO,OAAA,aAAA,iBAAe,GAAA,CAAA,SAAA,EAAA,EAAU,CAAE,CAAA;AAAA;AACpC,KACD,CAAA;AAAA;AAEL,CAAC;AAED,YAAe,CAAC,aAAa,iBAAiB,CAAA;;;;"}
|
package/dist/alpha.d.ts
CHANGED
|
@@ -629,11 +629,13 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
629
629
|
optional: true;
|
|
630
630
|
}>;
|
|
631
631
|
inputs: {
|
|
632
|
-
|
|
632
|
+
headers: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
|
|
633
633
|
optional: true;
|
|
634
|
-
}
|
|
635
|
-
singleton: true;
|
|
634
|
+
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {
|
|
636
635
|
optional: true;
|
|
636
|
+
}>, {
|
|
637
|
+
singleton: false;
|
|
638
|
+
optional: false;
|
|
637
639
|
}>;
|
|
638
640
|
contents: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
|
|
639
641
|
optional: true;
|
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.31.
|
|
3
|
+
"version": "1.31.2-next.0",
|
|
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": "
|
|
74
|
-
"@backstage/catalog-model": "
|
|
75
|
-
"@backstage/core-compat-api": "
|
|
76
|
-
"@backstage/core-components": "
|
|
77
|
-
"@backstage/core-plugin-api": "
|
|
78
|
-
"@backstage/errors": "
|
|
79
|
-
"@backstage/frontend-plugin-api": "
|
|
80
|
-
"@backstage/integration-react": "
|
|
81
|
-
"@backstage/plugin-catalog-common": "
|
|
82
|
-
"@backstage/plugin-catalog-react": "
|
|
83
|
-
"@backstage/plugin-permission-react": "
|
|
84
|
-
"@backstage/plugin-scaffolder-common": "
|
|
85
|
-
"@backstage/plugin-search-common": "
|
|
86
|
-
"@backstage/plugin-search-react": "
|
|
87
|
-
"@backstage/plugin-techdocs-common": "
|
|
88
|
-
"@backstage/plugin-techdocs-react": "
|
|
89
|
-
"@backstage/types": "
|
|
90
|
-
"@backstage/version-bridge": "
|
|
73
|
+
"@backstage/catalog-client": "1.10.2",
|
|
74
|
+
"@backstage/catalog-model": "1.7.5",
|
|
75
|
+
"@backstage/core-compat-api": "0.4.5-next.0",
|
|
76
|
+
"@backstage/core-components": "0.17.4",
|
|
77
|
+
"@backstage/core-plugin-api": "1.10.9",
|
|
78
|
+
"@backstage/errors": "1.2.7",
|
|
79
|
+
"@backstage/frontend-plugin-api": "0.10.4",
|
|
80
|
+
"@backstage/integration-react": "1.2.9",
|
|
81
|
+
"@backstage/plugin-catalog-common": "1.1.5",
|
|
82
|
+
"@backstage/plugin-catalog-react": "1.19.2-next.0",
|
|
83
|
+
"@backstage/plugin-permission-react": "0.4.36",
|
|
84
|
+
"@backstage/plugin-scaffolder-common": "1.6.0",
|
|
85
|
+
"@backstage/plugin-search-common": "1.2.19",
|
|
86
|
+
"@backstage/plugin-search-react": "1.9.2",
|
|
87
|
+
"@backstage/plugin-techdocs-common": "0.1.1",
|
|
88
|
+
"@backstage/plugin-techdocs-react": "1.3.1",
|
|
89
|
+
"@backstage/types": "1.2.1",
|
|
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": "
|
|
106
|
-
"@backstage/core-app-api": "
|
|
107
|
-
"@backstage/dev-utils": "
|
|
108
|
-
"@backstage/frontend-test-utils": "
|
|
109
|
-
"@backstage/plugin-permission-common": "
|
|
110
|
-
"@backstage/test-utils": "
|
|
105
|
+
"@backstage/cli": "0.33.1",
|
|
106
|
+
"@backstage/core-app-api": "1.18.0",
|
|
107
|
+
"@backstage/dev-utils": "1.1.13-next.0",
|
|
108
|
+
"@backstage/frontend-test-utils": "0.3.5-next.0",
|
|
109
|
+
"@backstage/plugin-permission-common": "0.9.1",
|
|
110
|
+
"@backstage/test-utils": "1.7.10",
|
|
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",
|