@backstage/plugin-catalog 1.32.0 → 1.32.1-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 +25 -0
- package/dist/alpha/contextMenuItems.esm.js +14 -19
- package/dist/alpha/contextMenuItems.esm.js.map +1 -1
- package/dist/alpha/entityCards.esm.js +10 -31
- package/dist/alpha/entityCards.esm.js.map +1 -1
- package/dist/alpha/navItems.esm.js +1 -2
- package/dist/alpha/navItems.esm.js.map +1 -1
- package/dist/alpha/pages.esm.js +9 -11
- package/dist/alpha/pages.esm.js.map +1 -1
- package/dist/alpha/plugin.esm.js +4 -5
- package/dist/alpha/plugin.esm.js.map +1 -1
- package/dist/alpha.d.ts +11 -11
- package/dist/package.json.esm.js +1 -1
- package/package.json +25 -25
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @backstage/plugin-catalog
|
|
2
2
|
|
|
3
|
+
## 1.32.1-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d02db50: Remove unnecessary use of `compatWrapper` and `convertLegacyRouteRef`(s) for the new frontend system.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/frontend-plugin-api@0.13.2-next.0
|
|
10
|
+
- @backstage/core-plugin-api@1.12.1-next.0
|
|
11
|
+
- @backstage/plugin-catalog-react@1.21.4-next.0
|
|
12
|
+
- @backstage/core-compat-api@0.5.5-next.0
|
|
13
|
+
- @backstage/plugin-search-react@1.10.1-next.0
|
|
14
|
+
- @backstage/plugin-techdocs-react@1.3.6-next.0
|
|
15
|
+
- @backstage/integration-react@1.2.13-next.0
|
|
16
|
+
- @backstage/plugin-scaffolder-common@1.7.4-next.0
|
|
17
|
+
- @backstage/core-components@0.18.4-next.0
|
|
18
|
+
- @backstage/plugin-permission-react@0.4.39-next.0
|
|
19
|
+
- @backstage/catalog-client@1.12.1
|
|
20
|
+
- @backstage/catalog-model@1.7.6
|
|
21
|
+
- @backstage/errors@1.2.7
|
|
22
|
+
- @backstage/types@1.2.2
|
|
23
|
+
- @backstage/version-bridge@1.0.11
|
|
24
|
+
- @backstage/plugin-catalog-common@1.1.7
|
|
25
|
+
- @backstage/plugin-search-common@1.2.21
|
|
26
|
+
- @backstage/plugin-techdocs-common@0.1.1
|
|
27
|
+
|
|
3
28
|
## 1.32.0
|
|
4
29
|
|
|
5
30
|
### Minor Changes
|
|
@@ -12,7 +12,6 @@ import { useEntity, UnregisterEntityDialog } from '@backstage/plugin-catalog-rea
|
|
|
12
12
|
import { rootRouteRef, unregisterRedirectRouteRef } from '../routes.esm.js';
|
|
13
13
|
import { catalogEntityDeletePermission } from '@backstage/plugin-catalog-common/alpha';
|
|
14
14
|
import { useEffect } from 'react';
|
|
15
|
-
import { compatWrapper } from '@backstage/core-compat-api';
|
|
16
15
|
|
|
17
16
|
const copyEntityUrlContextMenuItem = EntityContextMenuItemBlueprint.make(
|
|
18
17
|
{
|
|
@@ -78,24 +77,20 @@ const unregisterEntityContextMenuItem = EntityContextMenuItemBlueprint.make({
|
|
|
78
77
|
title: t("entityContextMenu.unregisterMenuTitle"),
|
|
79
78
|
disabled: !unregisterPermission.allowed,
|
|
80
79
|
onClick: async () => {
|
|
81
|
-
dialogApi.showModal(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
)
|
|
97
|
-
)
|
|
98
|
-
);
|
|
80
|
+
dialogApi.showModal(({ dialog }) => /* @__PURE__ */ jsx(
|
|
81
|
+
UnregisterEntityDialog,
|
|
82
|
+
{
|
|
83
|
+
open: true,
|
|
84
|
+
entity,
|
|
85
|
+
onClose: () => dialog.close(),
|
|
86
|
+
onConfirm: () => {
|
|
87
|
+
dialog.close();
|
|
88
|
+
navigate(
|
|
89
|
+
unregisterRedirectRoute ? unregisterRedirectRoute() : catalogRoute()
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
));
|
|
99
94
|
}
|
|
100
95
|
};
|
|
101
96
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextMenuItems.esm.js","sources":["../../src/alpha/contextMenuItems.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 EntityContextMenuItemBlueprint,\n useEntityPermission,\n} from '@backstage/plugin-catalog-react/alpha';\nimport FileCopyTwoToneIcon from '@material-ui/icons/FileCopyTwoTone';\nimport BugReportIcon from '@material-ui/icons/BugReport';\nimport CancelIcon from '@material-ui/icons/Cancel';\nimport useCopyToClipboard from 'react-use/esm/useCopyToClipboard';\nimport { alertApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api';\nimport {\n dialogApiRef,\n useTranslationRef,\n type DialogApiDialog,\n} from '@backstage/frontend-plugin-api';\nimport { catalogTranslationRef } from './translation';\nimport { useNavigate, useSearchParams } from 'react-router-dom';\nimport {\n UnregisterEntityDialog,\n useEntity,\n} from '@backstage/plugin-catalog-react';\nimport { rootRouteRef, unregisterRedirectRouteRef } from '../routes';\nimport { catalogEntityDeletePermission } from '@backstage/plugin-catalog-common/alpha';\nimport { useEffect } from 'react';\
|
|
1
|
+
{"version":3,"file":"contextMenuItems.esm.js","sources":["../../src/alpha/contextMenuItems.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 EntityContextMenuItemBlueprint,\n useEntityPermission,\n} from '@backstage/plugin-catalog-react/alpha';\nimport FileCopyTwoToneIcon from '@material-ui/icons/FileCopyTwoTone';\nimport BugReportIcon from '@material-ui/icons/BugReport';\nimport CancelIcon from '@material-ui/icons/Cancel';\nimport useCopyToClipboard from 'react-use/esm/useCopyToClipboard';\nimport { alertApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api';\nimport {\n dialogApiRef,\n useTranslationRef,\n type DialogApiDialog,\n} from '@backstage/frontend-plugin-api';\nimport { catalogTranslationRef } from './translation';\nimport { useNavigate, useSearchParams } from 'react-router-dom';\nimport {\n UnregisterEntityDialog,\n useEntity,\n} from '@backstage/plugin-catalog-react';\nimport { rootRouteRef, unregisterRedirectRouteRef } from '../routes';\nimport { catalogEntityDeletePermission } from '@backstage/plugin-catalog-common/alpha';\nimport { useEffect } from 'react';\n\nexport const copyEntityUrlContextMenuItem = EntityContextMenuItemBlueprint.make(\n {\n name: 'copy-entity-url',\n params: {\n icon: <FileCopyTwoToneIcon fontSize=\"small\" />,\n useProps: () => {\n const [copyState, copyToClipboard] = useCopyToClipboard();\n const alertApi = useApi(alertApiRef);\n const { t } = useTranslationRef(catalogTranslationRef);\n\n useEffect(() => {\n if (!copyState.error && copyState.value) {\n alertApi.post({\n message: t('entityContextMenu.copiedMessage'),\n severity: 'info',\n display: 'transient',\n });\n }\n }, [copyState, alertApi, t]);\n\n return {\n title: t('entityContextMenu.copyURLMenuTitle'),\n onClick: async () => {\n copyToClipboard(window.location.toString());\n },\n };\n },\n },\n },\n);\n\nexport const inspectEntityContextMenuItem = EntityContextMenuItemBlueprint.make(\n {\n name: 'inspect-entity',\n params: {\n icon: <BugReportIcon fontSize=\"small\" />,\n useProps: () => {\n const [_, setSearchParams] = useSearchParams();\n const { t } = useTranslationRef(catalogTranslationRef);\n\n return {\n title: t('entityContextMenu.inspectMenuTitle'),\n onClick: async () => {\n setSearchParams('inspect');\n },\n };\n },\n },\n },\n);\n\nexport const unregisterEntityContextMenuItem =\n EntityContextMenuItemBlueprint.make({\n name: 'unregister-entity',\n params: {\n icon: <CancelIcon fontSize=\"small\" />,\n useProps: () => {\n const { entity } = useEntity();\n const dialogApi = useApi(dialogApiRef);\n const navigate = useNavigate();\n const catalogRoute = useRouteRef(rootRouteRef);\n\n const { t } = useTranslationRef(catalogTranslationRef);\n const unregisterRedirectRoute = useRouteRef(unregisterRedirectRouteRef);\n const unregisterPermission = useEntityPermission(\n catalogEntityDeletePermission,\n );\n\n return {\n title: t('entityContextMenu.unregisterMenuTitle'),\n disabled: !unregisterPermission.allowed,\n onClick: async () => {\n dialogApi.showModal(({ dialog }: { dialog: DialogApiDialog }) => (\n <UnregisterEntityDialog\n open\n entity={entity}\n onClose={() => dialog.close()}\n onConfirm={() => {\n dialog.close();\n navigate(\n unregisterRedirectRoute\n ? unregisterRedirectRoute()\n : catalogRoute(),\n );\n }}\n />\n ));\n },\n };\n },\n },\n });\n\nexport default [\n unregisterEntityContextMenuItem,\n inspectEntityContextMenuItem,\n copyEntityUrlContextMenuItem,\n];\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAwCO,MAAM,+BAA+B,8BAAA,CAA+B,IAAA;AAAA,EACzE;AAAA,IACE,IAAA,EAAM,iBAAA;AAAA,IACN,MAAA,EAAQ;AAAA,MACN,IAAA,kBAAM,GAAA,CAAC,mBAAA,EAAA,EAAoB,QAAA,EAAS,OAAA,EAAQ,CAAA;AAAA,MAC5C,UAAU,MAAM;AACd,QAAA,MAAM,CAAC,SAAA,EAAW,eAAe,CAAA,GAAI,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@@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { EntityCardBlueprint, EntityIconLinkBlueprint } from '@backstage/plugin-catalog-react/alpha';
|
|
3
|
-
import { compatWrapper } from '@backstage/core-compat-api';
|
|
4
3
|
import { createExtensionInput } from '@backstage/frontend-plugin-api';
|
|
5
4
|
import { HeaderIconLinkRow } from '@backstage/core-components';
|
|
6
5
|
import { useEntity } from '@backstage/plugin-catalog-react';
|
|
@@ -40,9 +39,7 @@ const catalogAboutEntityCard = EntityCardBlueprint.makeWithOverrides({
|
|
|
40
39
|
},
|
|
41
40
|
async loader() {
|
|
42
41
|
const { InternalAboutCard } = await import('../components/AboutCard/AboutCard.esm.js');
|
|
43
|
-
return
|
|
44
|
-
/* @__PURE__ */ jsx(InternalAboutCard, { variant: "gridItem", subheader: /* @__PURE__ */ jsx(Subheader, {}) })
|
|
45
|
-
);
|
|
42
|
+
return /* @__PURE__ */ jsx(InternalAboutCard, { variant: "gridItem", subheader: /* @__PURE__ */ jsx(Subheader, {}) });
|
|
46
43
|
}
|
|
47
44
|
});
|
|
48
45
|
}
|
|
@@ -52,9 +49,7 @@ const catalogLinksEntityCard = EntityCardBlueprint.make({
|
|
|
52
49
|
params: {
|
|
53
50
|
type: "info",
|
|
54
51
|
filter: { "metadata.links": { $exists: true } },
|
|
55
|
-
loader: async () => import('../components/EntityLinksCard/index.esm.js').then(
|
|
56
|
-
(m) => compatWrapper(/* @__PURE__ */ jsx(m.EntityLinksCard, { variant: "gridItem" }))
|
|
57
|
-
)
|
|
52
|
+
loader: async () => import('../components/EntityLinksCard/index.esm.js').then((m) => /* @__PURE__ */ jsx(m.EntityLinksCard, { variant: "gridItem" }))
|
|
58
53
|
}
|
|
59
54
|
});
|
|
60
55
|
const catalogLabelsEntityCard = EntityCardBlueprint.make({
|
|
@@ -62,72 +57,56 @@ const catalogLabelsEntityCard = EntityCardBlueprint.make({
|
|
|
62
57
|
params: {
|
|
63
58
|
type: "info",
|
|
64
59
|
filter: { "metadata.labels": { $exists: true } },
|
|
65
|
-
loader: async () => import('../components/EntityLabelsCard/index.esm.js').then(
|
|
66
|
-
(m) => compatWrapper(/* @__PURE__ */ jsx(m.EntityLabelsCard, { variant: "gridItem" }))
|
|
67
|
-
)
|
|
60
|
+
loader: async () => import('../components/EntityLabelsCard/index.esm.js').then((m) => /* @__PURE__ */ jsx(m.EntityLabelsCard, { variant: "gridItem" }))
|
|
68
61
|
}
|
|
69
62
|
});
|
|
70
63
|
const catalogDependsOnComponentsEntityCard = EntityCardBlueprint.make({
|
|
71
64
|
name: "depends-on-components",
|
|
72
65
|
params: {
|
|
73
66
|
filter: { kind: "component" },
|
|
74
|
-
loader: async () => import('../components/DependsOnComponentsCard/index.esm.js').then(
|
|
75
|
-
(m) => compatWrapper(/* @__PURE__ */ jsx(m.DependsOnComponentsCard, { variant: "gridItem" }))
|
|
76
|
-
)
|
|
67
|
+
loader: async () => import('../components/DependsOnComponentsCard/index.esm.js').then((m) => /* @__PURE__ */ jsx(m.DependsOnComponentsCard, { variant: "gridItem" }))
|
|
77
68
|
}
|
|
78
69
|
});
|
|
79
70
|
const catalogDependsOnResourcesEntityCard = EntityCardBlueprint.make({
|
|
80
71
|
name: "depends-on-resources",
|
|
81
72
|
params: {
|
|
82
73
|
filter: { kind: "component" },
|
|
83
|
-
loader: async () => import('../components/DependsOnResourcesCard/index.esm.js').then(
|
|
84
|
-
(m) => compatWrapper(/* @__PURE__ */ jsx(m.DependsOnResourcesCard, { variant: "gridItem" }))
|
|
85
|
-
)
|
|
74
|
+
loader: async () => import('../components/DependsOnResourcesCard/index.esm.js').then((m) => /* @__PURE__ */ jsx(m.DependsOnResourcesCard, { variant: "gridItem" }))
|
|
86
75
|
}
|
|
87
76
|
});
|
|
88
77
|
const catalogHasComponentsEntityCard = EntityCardBlueprint.make({
|
|
89
78
|
name: "has-components",
|
|
90
79
|
params: {
|
|
91
80
|
filter: { kind: "system" },
|
|
92
|
-
loader: async () => import('../components/HasComponentsCard/index.esm.js').then(
|
|
93
|
-
(m) => compatWrapper(/* @__PURE__ */ jsx(m.HasComponentsCard, { variant: "gridItem" }))
|
|
94
|
-
)
|
|
81
|
+
loader: async () => import('../components/HasComponentsCard/index.esm.js').then((m) => /* @__PURE__ */ jsx(m.HasComponentsCard, { variant: "gridItem" }))
|
|
95
82
|
}
|
|
96
83
|
});
|
|
97
84
|
const catalogHasResourcesEntityCard = EntityCardBlueprint.make({
|
|
98
85
|
name: "has-resources",
|
|
99
86
|
params: {
|
|
100
87
|
filter: { kind: "system" },
|
|
101
|
-
loader: async () => import('../components/HasResourcesCard/index.esm.js').then(
|
|
102
|
-
(m) => compatWrapper(/* @__PURE__ */ jsx(m.HasResourcesCard, { variant: "gridItem" }))
|
|
103
|
-
)
|
|
88
|
+
loader: async () => import('../components/HasResourcesCard/index.esm.js').then((m) => /* @__PURE__ */ jsx(m.HasResourcesCard, { variant: "gridItem" }))
|
|
104
89
|
}
|
|
105
90
|
});
|
|
106
91
|
const catalogHasSubcomponentsEntityCard = EntityCardBlueprint.make({
|
|
107
92
|
name: "has-subcomponents",
|
|
108
93
|
params: {
|
|
109
94
|
filter: { kind: "component" },
|
|
110
|
-
loader: async () => import('../components/HasSubcomponentsCard/index.esm.js').then(
|
|
111
|
-
(m) => compatWrapper(/* @__PURE__ */ jsx(m.HasSubcomponentsCard, { variant: "gridItem" }))
|
|
112
|
-
)
|
|
95
|
+
loader: async () => import('../components/HasSubcomponentsCard/index.esm.js').then((m) => /* @__PURE__ */ jsx(m.HasSubcomponentsCard, { variant: "gridItem" }))
|
|
113
96
|
}
|
|
114
97
|
});
|
|
115
98
|
const catalogHasSubdomainsEntityCard = EntityCardBlueprint.make({
|
|
116
99
|
name: "has-subdomains",
|
|
117
100
|
params: {
|
|
118
101
|
filter: { kind: "domain" },
|
|
119
|
-
loader: async () => import('../components/HasSubdomainsCard/index.esm.js').then(
|
|
120
|
-
(m) => compatWrapper(/* @__PURE__ */ jsx(m.HasSubdomainsCard, { variant: "gridItem" }))
|
|
121
|
-
)
|
|
102
|
+
loader: async () => import('../components/HasSubdomainsCard/index.esm.js').then((m) => /* @__PURE__ */ jsx(m.HasSubdomainsCard, { variant: "gridItem" }))
|
|
122
103
|
}
|
|
123
104
|
});
|
|
124
105
|
const catalogHasSystemsEntityCard = EntityCardBlueprint.make({
|
|
125
106
|
name: "has-systems",
|
|
126
107
|
params: {
|
|
127
108
|
filter: { kind: "domain" },
|
|
128
|
-
loader: async () => import('../components/HasSystemsCard/index.esm.js').then(
|
|
129
|
-
(m) => compatWrapper(/* @__PURE__ */ jsx(m.HasSystemsCard, { variant: "gridItem" }))
|
|
130
|
-
)
|
|
109
|
+
loader: async () => import('../components/HasSystemsCard/index.esm.js').then((m) => /* @__PURE__ */ jsx(m.HasSystemsCard, { variant: "gridItem" }))
|
|
131
110
|
}
|
|
132
111
|
});
|
|
133
112
|
var entityCards = [
|
|
@@ -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 { compatWrapper } from '@backstage/core-compat-api';\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 props = iconLink.get(EntityIconLinkBlueprint.dataRefs.useProps)();\n const filter = buildFilterFn(\n iconLink.get(EntityIconLinkBlueprint.dataRefs.filterFunction),\n iconLink.get(EntityIconLinkBlueprint.dataRefs.filterExpression),\n );\n if (filter(entity)) {\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 compatWrapper(\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 compatWrapper(<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 compatWrapper(<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 compatWrapper(<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 compatWrapper(<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 compatWrapper(<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 compatWrapper(<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 compatWrapper(<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 compatWrapper(<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 compatWrapper(<m.HasSystemsCard variant=\"gridItem\" />),\n ),\n },\n});\n\nexport default [\n catalogAboutEntityCard,\n catalogLinksEntityCard,\n catalogLabelsEntityCard,\n catalogDependsOnComponentsEntityCard,\n catalogDependsOnResourcesEntityCard,\n catalogHasComponentsEntityCard,\n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ED,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 props = iconLink.get(EntityIconLinkBlueprint.dataRefs.useProps)();\n const filter = buildFilterFn(\n iconLink.get(EntityIconLinkBlueprint.dataRefs.filterFunction),\n iconLink.get(EntityIconLinkBlueprint.dataRefs.filterExpression),\n );\n if (filter(entity)) {\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,IAA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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;;;;"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import HomeIcon from '@material-ui/icons/Home';
|
|
2
|
-
import { convertLegacyRouteRef } from '@backstage/core-compat-api';
|
|
3
2
|
import { NavItemBlueprint } from '@backstage/frontend-plugin-api';
|
|
4
3
|
import { rootRouteRef } from '../routes.esm.js';
|
|
5
4
|
|
|
6
5
|
const catalogNavItem = NavItemBlueprint.make({
|
|
7
6
|
params: {
|
|
8
|
-
routeRef:
|
|
7
|
+
routeRef: rootRouteRef,
|
|
9
8
|
title: "Catalog",
|
|
10
9
|
icon: HomeIcon
|
|
11
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navItems.esm.js","sources":["../../src/alpha/navItems.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 HomeIcon from '@material-ui/icons/Home';\nimport {
|
|
1
|
+
{"version":3,"file":"navItems.esm.js","sources":["../../src/alpha/navItems.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 HomeIcon from '@material-ui/icons/Home';\nimport { NavItemBlueprint } from '@backstage/frontend-plugin-api';\nimport { rootRouteRef } from '../routes';\n\nexport const catalogNavItem = NavItemBlueprint.make({\n params: {\n routeRef: rootRouteRef,\n title: 'Catalog',\n icon: HomeIcon,\n },\n});\n\nexport default [catalogNavItem];\n"],"names":[],"mappings":";;;;AAoBO,MAAM,cAAA,GAAiB,iBAAiB,IAAA,CAAK;AAAA,EAClD,MAAA,EAAQ;AAAA,IACN,QAAA,EAAU,YAAA;AAAA,IACV,KAAA,EAAO,SAAA;AAAA,IACP,IAAA,EAAM;AAAA;AAEV,CAAC;AAED,eAAe,CAAC,cAAc,CAAA;;;;"}
|
package/dist/alpha/pages.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { convertLegacyRouteRef
|
|
2
|
+
import { convertLegacyRouteRef } from '@backstage/core-compat-api';
|
|
3
3
|
import { PageBlueprint, createExtensionInput, coreExtensionData } from '@backstage/frontend-plugin-api';
|
|
4
4
|
import { entityRouteRef, AsyncEntityProvider } from '@backstage/plugin-catalog-react';
|
|
5
5
|
import { EntityContextMenuItemBlueprint, EntityHeaderBlueprint, defaultEntityContentGroups, EntityContentBlueprint } from '@backstage/plugin-catalog-react/alpha';
|
|
@@ -26,20 +26,18 @@ const catalogPage = PageBlueprint.makeWithOverrides({
|
|
|
26
26
|
factory(originalFactory, { inputs, config }) {
|
|
27
27
|
return originalFactory({
|
|
28
28
|
path: "/catalog",
|
|
29
|
-
routeRef:
|
|
29
|
+
routeRef: rootRouteRef,
|
|
30
30
|
loader: async () => {
|
|
31
31
|
const { BaseCatalogPage } = await import('../components/CatalogPage/index.esm.js');
|
|
32
32
|
const filters = inputs.filters.map(
|
|
33
33
|
(filter) => filter.get(coreExtensionData.reactElement)
|
|
34
34
|
);
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
{
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
)
|
|
35
|
+
return /* @__PURE__ */ jsx(
|
|
36
|
+
BaseCatalogPage,
|
|
37
|
+
{
|
|
38
|
+
filters: /* @__PURE__ */ jsx(Fragment, { children: filters }),
|
|
39
|
+
pagination: config.pagination
|
|
40
|
+
}
|
|
43
41
|
);
|
|
44
42
|
}
|
|
45
43
|
});
|
|
@@ -161,7 +159,7 @@ const catalogEntityPage = PageBlueprint.makeWithOverrides({
|
|
|
161
159
|
}
|
|
162
160
|
) });
|
|
163
161
|
};
|
|
164
|
-
return
|
|
162
|
+
return /* @__PURE__ */ jsx(Component, {});
|
|
165
163
|
}
|
|
166
164
|
});
|
|
167
165
|
}
|
|
@@ -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 path: '/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 path: '/catalog/:namespace/:kind/:name',\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 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":";;;;;;;;;AAuCO,MAAM,WAAA,GAAc,cAAc,iBAAA,CAAkB;AAAA,EACzD,MAAA,EAAQ;AAAA,IACN,OAAA,EAAS,oBAAA,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A;;;;"}
|
|
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 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 path: '/catalog',\n routeRef: 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 (\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 path: '/catalog/:namespace/:kind/:name',\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 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 <Component />;\n },\n });\n },\n});\n\nexport default [catalogPage, catalogEntityPage];\n"],"names":[],"mappings":";;;;;;;;;AAoCO,MAAM,WAAA,GAAc,cAAc,iBAAA,CAAkB;AAAA,EACzD,MAAA,EAAQ;AAAA,IACN,OA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,4 +1,3 @@
|
|
|
1
|
-
import { convertLegacyRouteRefs } from '@backstage/core-compat-api';
|
|
2
1
|
import { createFrontendPlugin } from '@backstage/frontend-plugin-api';
|
|
3
2
|
import { entityRouteRef } from '@backstage/plugin-catalog-react';
|
|
4
3
|
import { unregisterRedirectRouteRef, createFromTemplateRouteRef, createComponentRouteRef, viewTechDocRouteRef, rootRouteRef } from '../routes.esm.js';
|
|
@@ -15,16 +14,16 @@ import contextMenuItems from './contextMenuItems.esm.js';
|
|
|
15
14
|
var plugin = createFrontendPlugin({
|
|
16
15
|
pluginId: "catalog",
|
|
17
16
|
info: { packageJson: () => import('../package.json.esm.js') },
|
|
18
|
-
routes:
|
|
17
|
+
routes: {
|
|
19
18
|
catalogIndex: rootRouteRef,
|
|
20
19
|
catalogEntity: entityRouteRef
|
|
21
|
-
}
|
|
22
|
-
externalRoutes:
|
|
20
|
+
},
|
|
21
|
+
externalRoutes: {
|
|
23
22
|
viewTechDoc: viewTechDocRouteRef,
|
|
24
23
|
createComponent: createComponentRouteRef,
|
|
25
24
|
createFromTemplate: createFromTemplateRouteRef,
|
|
26
25
|
unregisterRedirect: unregisterRedirectRouteRef
|
|
27
|
-
}
|
|
26
|
+
},
|
|
28
27
|
extensions: [
|
|
29
28
|
...apis,
|
|
30
29
|
...pages,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.esm.js","sources":["../../src/alpha/plugin.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 {
|
|
1
|
+
{"version":3,"file":"plugin.esm.js","sources":["../../src/alpha/plugin.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 { createFrontendPlugin } from '@backstage/frontend-plugin-api';\n\nimport { entityRouteRef } from '@backstage/plugin-catalog-react';\n\nimport {\n createComponentRouteRef,\n createFromTemplateRouteRef,\n rootRouteRef,\n unregisterRedirectRouteRef,\n viewTechDocRouteRef,\n} from '../routes';\n\nimport apis from './apis';\nimport pages from './pages';\nimport filters from './filters';\nimport navItems from './navItems';\nimport entityCards from './entityCards';\nimport entityContents from './entityContents';\nimport entityIconLinks from './entityIconLinks';\nimport searchResultItems from './searchResultItems';\nimport contextMenuItems from './contextMenuItems';\n\n/** @alpha */\nexport default createFrontendPlugin({\n pluginId: 'catalog',\n info: { packageJson: () => import('../../package.json') },\n routes: {\n catalogIndex: rootRouteRef,\n catalogEntity: entityRouteRef,\n },\n externalRoutes: {\n viewTechDoc: viewTechDocRouteRef,\n createComponent: createComponentRouteRef,\n createFromTemplate: createFromTemplateRouteRef,\n unregisterRedirect: unregisterRedirectRouteRef,\n },\n extensions: [\n ...apis,\n ...pages,\n ...filters,\n ...navItems,\n ...entityCards,\n ...entityContents,\n ...entityIconLinks,\n ...contextMenuItems,\n ...searchResultItems,\n ],\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;AAuCA,aAAe,oBAAA,CAAqB;AAAA,EAClC,QAAA,EAAU,SAAA;AAAA,EACV,MAAM,EAAE,WAAA,EAAa,MAAM,OAAO,wBAAoB,CAAA,EAAE;AAAA,EACxD,MAAA,EAAQ;AAAA,IACN,YAAA,EAAc,YAAA;AAAA,IACd,aAAA,EAAe;AAAA,GACjB;AAAA,EACA,cAAA,EAAgB;AAAA,IACd,WAAA,EAAa,mBAAA;AAAA,IACb,eAAA,EAAiB,uBAAA;AAAA,IACjB,kBAAA,EAAoB,0BAAA;AAAA,IACpB,kBAAA,EAAoB;AAAA,GACtB;AAAA,EACA,UAAA,EAAY;AAAA,IACV,GAAG,IAAA;AAAA,IACH,GAAG,KAAA;AAAA,IACH,GAAG,OAAA;AAAA,IACH,GAAG,QAAA;AAAA,IACH,GAAG,WAAA;AAAA,IACH,GAAG,cAAA;AAAA,IACH,GAAG,eAAA;AAAA,IACH,GAAG,gBAAA;AAAA,IACH,GAAG;AAAA;AAEP,CAAC,CAAA;;;;"}
|
package/dist/alpha.d.ts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import * as _backstage_plugin_search_react_alpha from '@backstage/plugin-search-react/alpha';
|
|
2
|
-
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
3
2
|
import * as _backstage_core_components from '@backstage/core-components';
|
|
4
3
|
import * as _backstage_catalog_model from '@backstage/catalog-model';
|
|
5
4
|
import * as _backstage_plugin_catalog_react_alpha from '@backstage/plugin-catalog-react/alpha';
|
|
6
5
|
import * as react from 'react';
|
|
7
6
|
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
7
|
+
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
8
8
|
import * as _backstage_core_plugin_api_alpha from '@backstage/core-plugin-api/alpha';
|
|
9
9
|
|
|
10
10
|
/** @alpha */
|
|
11
11
|
declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin<{
|
|
12
|
-
catalogIndex:
|
|
13
|
-
catalogEntity:
|
|
12
|
+
catalogIndex: _backstage_core_plugin_api.RouteRef<undefined>;
|
|
13
|
+
catalogEntity: _backstage_core_plugin_api.RouteRef<{
|
|
14
14
|
name: string;
|
|
15
15
|
kind: string;
|
|
16
16
|
namespace: string;
|
|
17
17
|
}>;
|
|
18
18
|
}, {
|
|
19
|
-
viewTechDoc:
|
|
19
|
+
viewTechDoc: _backstage_core_plugin_api.ExternalRouteRef<{
|
|
20
20
|
name: string;
|
|
21
21
|
kind: string;
|
|
22
22
|
namespace: string;
|
|
23
|
-
}>;
|
|
24
|
-
createComponent:
|
|
25
|
-
createFromTemplate:
|
|
23
|
+
}, true>;
|
|
24
|
+
createComponent: _backstage_core_plugin_api.ExternalRouteRef<undefined, true>;
|
|
25
|
+
createFromTemplate: _backstage_core_plugin_api.ExternalRouteRef<{
|
|
26
26
|
namespace: string;
|
|
27
27
|
templateName: string;
|
|
28
|
-
}>;
|
|
29
|
-
unregisterRedirect:
|
|
28
|
+
}, true>;
|
|
29
|
+
unregisterRedirect: _backstage_core_plugin_api.ExternalRouteRef<undefined, true>;
|
|
30
30
|
}, {
|
|
31
31
|
"api:catalog": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
32
32
|
kind: "api";
|
|
@@ -561,13 +561,13 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
|
|
|
561
561
|
configInput: {};
|
|
562
562
|
output: _backstage_frontend_plugin_api.ExtensionDataRef<{
|
|
563
563
|
title: string;
|
|
564
|
-
icon:
|
|
564
|
+
icon: _backstage_frontend_plugin_api.IconComponent;
|
|
565
565
|
routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
566
566
|
}, "core.nav-item.target", {}>;
|
|
567
567
|
inputs: {};
|
|
568
568
|
params: {
|
|
569
569
|
title: string;
|
|
570
|
-
icon:
|
|
570
|
+
icon: _backstage_frontend_plugin_api.IconComponent;
|
|
571
571
|
routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
572
572
|
};
|
|
573
573
|
}>;
|
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.0",
|
|
3
|
+
"version": "1.32.1-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.12.1",
|
|
74
|
+
"@backstage/catalog-model": "1.7.6",
|
|
75
|
+
"@backstage/core-compat-api": "0.5.5-next.0",
|
|
76
|
+
"@backstage/core-components": "0.18.4-next.0",
|
|
77
|
+
"@backstage/core-plugin-api": "1.12.1-next.0",
|
|
78
|
+
"@backstage/errors": "1.2.7",
|
|
79
|
+
"@backstage/frontend-plugin-api": "0.13.2-next.0",
|
|
80
|
+
"@backstage/integration-react": "1.2.13-next.0",
|
|
81
|
+
"@backstage/plugin-catalog-common": "1.1.7",
|
|
82
|
+
"@backstage/plugin-catalog-react": "1.21.4-next.0",
|
|
83
|
+
"@backstage/plugin-permission-react": "0.4.39-next.0",
|
|
84
|
+
"@backstage/plugin-scaffolder-common": "1.7.4-next.0",
|
|
85
|
+
"@backstage/plugin-search-common": "1.2.21",
|
|
86
|
+
"@backstage/plugin-search-react": "1.10.1-next.0",
|
|
87
|
+
"@backstage/plugin-techdocs-common": "0.1.1",
|
|
88
|
+
"@backstage/plugin-techdocs-react": "1.3.6-next.0",
|
|
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": "
|
|
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.34.6-next.0",
|
|
106
|
+
"@backstage/core-app-api": "1.19.3-next.0",
|
|
107
|
+
"@backstage/dev-utils": "1.1.18-next.0",
|
|
108
|
+
"@backstage/frontend-test-utils": "0.4.2-next.0",
|
|
109
|
+
"@backstage/plugin-permission-common": "0.9.3",
|
|
110
|
+
"@backstage/test-utils": "1.7.14-next.0",
|
|
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",
|