@backstage/plugin-catalog 1.31.1 → 1.31.2-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,44 @@
1
1
  # @backstage/plugin-catalog
2
2
 
3
+ ## 1.31.2-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - c0ea01b: Fix card scrolling behaviour
8
+ - f2f133c: Internal update to use the new variant of `ApiBlueprint`.
9
+ - Updated dependencies
10
+ - @backstage/plugin-scaffolder-common@1.7.0-next.0
11
+ - @backstage/core-compat-api@0.4.5-next.1
12
+ - @backstage/plugin-catalog-react@1.20.0-next.1
13
+ - @backstage/frontend-plugin-api@0.11.0-next.0
14
+ - @backstage/catalog-client@1.11.0-next.0
15
+ - @backstage/plugin-search-react@1.9.3-next.0
16
+ - @backstage/plugin-techdocs-react@1.3.2-next.0
17
+ - @backstage/core-components@0.17.5-next.0
18
+ - @backstage/catalog-model@1.7.5
19
+ - @backstage/core-plugin-api@1.10.9
20
+ - @backstage/errors@1.2.7
21
+ - @backstage/integration-react@1.2.9
22
+ - @backstage/types@1.2.1
23
+ - @backstage/version-bridge@1.0.11
24
+ - @backstage/plugin-catalog-common@1.1.5
25
+ - @backstage/plugin-permission-react@0.4.36
26
+ - @backstage/plugin-search-common@1.2.19
27
+ - @backstage/plugin-techdocs-common@0.1.1
28
+
29
+ ## 1.31.2-next.0
30
+
31
+ ### Patch Changes
32
+
33
+ - f4622e8: Adding a more sensible default order to the default filters
34
+ - 77eebdc: Support multiple headers in new frontend system, and don't render a header until the entity has finished loading
35
+ - Updated dependencies
36
+ - @backstage/plugin-catalog-react@1.19.2-next.0
37
+ - @backstage/core-compat-api@0.4.5-next.0
38
+ - @backstage/integration-react@1.2.9
39
+ - @backstage/frontend-plugin-api@0.10.4
40
+ - @backstage/plugin-search-react@1.9.2
41
+
3
42
  ## 1.31.1
4
43
 
5
44
  ### Patch Changes
@@ -13,7 +13,7 @@ const useStyles = makeStyles((theme) => ({
13
13
  flexFlow: "column nowrap",
14
14
  gap: theme.spacing(3)
15
15
  },
16
- contentArea: {
16
+ mainContent: {
17
17
  display: "flex",
18
18
  flexFlow: "column",
19
19
  gap: theme.spacing(3),
@@ -23,9 +23,13 @@ const useStyles = makeStyles((theme) => ({
23
23
  infoArea: {
24
24
  display: "flex",
25
25
  flexFlow: "column nowrap",
26
- alignItems: "stretch",
26
+ alignItems: "flex-start",
27
27
  gap: theme.spacing(3),
28
- minWidth: 0
28
+ minWidth: 0,
29
+ "& > *": {
30
+ flexShrink: 0,
31
+ flexGrow: 0
32
+ }
29
33
  },
30
34
  summaryArea: {
31
35
  minWidth: 0,
@@ -38,10 +42,17 @@ const useStyles = makeStyles((theme) => ({
38
42
  marginLeft: theme.spacing(3)
39
43
  }
40
44
  },
45
+ contentArea: {
46
+ display: "flex",
47
+ flexFlow: "column",
48
+ gap: theme.spacing(3),
49
+ alignItems: "stretch",
50
+ minWidth: 0
51
+ },
41
52
  [theme.breakpoints.up("md")]: {
42
53
  root: {
43
54
  display: "grid",
44
- gap: 0,
55
+ gap: theme.spacing(3),
45
56
  gridTemplateAreas: ({ summaryCards }) => `
46
57
  "${summaryCards ? "summary" : "content"} info"
47
58
  "content info"
@@ -49,11 +60,8 @@ const useStyles = makeStyles((theme) => ({
49
60
  gridTemplateColumns: ({ infoCards }) => infoCards ? "2fr 1fr" : "1fr",
50
61
  alignItems: "start"
51
62
  },
52
- infoArea: {
53
- gridArea: "info",
54
- position: "sticky",
55
- top: theme.spacing(3),
56
- marginLeft: theme.spacing(3)
63
+ mainContent: {
64
+ display: "contents"
57
65
  },
58
66
  contentArea: {
59
67
  gridArea: "content"
@@ -61,6 +69,25 @@ const useStyles = makeStyles((theme) => ({
61
69
  summaryArea: {
62
70
  gridArea: "summary",
63
71
  marginBottom: theme.spacing(3)
72
+ },
73
+ infoArea: {
74
+ gridArea: "info",
75
+ position: "sticky",
76
+ top: theme.spacing(3),
77
+ // this is a little unfortunate, but it's required to make the info cards scrollable
78
+ // in a fixed container of the full height when it's stuck.
79
+ // 100% doesn't work as that's the height of the entire layout, which is what powers the card scrolling.
80
+ maxHeight: "100vh",
81
+ overflowY: "auto",
82
+ alignSelf: "start",
83
+ alignItems: "stretch",
84
+ // Hide the scrollbar for the inner info cards
85
+ // kind of an accessibility nightmare, but we see.
86
+ scrollbarWidth: "none",
87
+ msOverflowStyle: "none",
88
+ "&::-webkit-scrollbar": {
89
+ display: "none"
90
+ }
64
91
  }
65
92
  }
66
93
  }));
@@ -85,8 +112,10 @@ function DefaultEntityContentLayout(props) {
85
112
  entityWarningContent,
86
113
  /* @__PURE__ */ jsxs("div", { className: classes.root, children: [
87
114
  infoCards.length > 0 ? /* @__PURE__ */ jsx("div", { className: classes.infoArea, children: infoCards.map((card) => card.element) }) : null,
88
- summaryCards.length > 0 ? /* @__PURE__ */ jsx("div", { className: classes.summaryArea, children: /* @__PURE__ */ jsx(HorizontalScrollGrid, { scrollStep: 400, scrollSpeed: 100, children: summaryCards.map((card) => /* @__PURE__ */ jsx("div", { className: classes.summaryCard, children: card.element })) }) }) : null,
89
- contentCards.length > 0 ? /* @__PURE__ */ jsx("div", { className: classes.contentArea, children: contentCards.map((card) => card.element) }) : null
115
+ /* @__PURE__ */ jsxs("div", { className: classes.mainContent, children: [
116
+ summaryCards.length > 0 ? /* @__PURE__ */ jsx("div", { className: classes.summaryArea, children: /* @__PURE__ */ jsx(HorizontalScrollGrid, { scrollStep: 400, scrollSpeed: 100, children: summaryCards.map((card) => /* @__PURE__ */ jsx("div", { className: classes.summaryCard, children: card.element })) }) }) : null,
117
+ contentCards.length > 0 ? /* @__PURE__ */ jsx("div", { className: classes.contentArea, children: contentCards.map((card) => card.element) }) : null
118
+ ] })
90
119
  ] })
91
120
  ] });
92
121
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultEntityContentLayout.esm.js","sources":["../../src/alpha/DefaultEntityContentLayout.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 Grid from '@material-ui/core/Grid';\nimport { makeStyles, Theme } from '@material-ui/core/styles';\nimport { EntityContentLayoutProps } from '@backstage/plugin-catalog-react/alpha';\nimport { EntitySwitch } from '../components/EntitySwitch';\nimport {\n EntityOrphanWarning,\n isOrphan,\n} from '../components/EntityOrphanWarning';\nimport {\n EntityRelationWarning,\n hasRelationWarnings,\n} from '../components/EntityRelationWarning';\nimport {\n EntityProcessingErrorsPanel,\n hasCatalogProcessingErrors,\n} from '../components/EntityProcessingErrorsPanel';\nimport { HorizontalScrollGrid } from '@backstage/core-components';\n\nconst useStyles = makeStyles<\n Theme,\n { infoCards: boolean; summaryCards: boolean; contentCards: boolean }\n>(theme => ({\n root: {\n display: 'flex',\n flexFlow: 'column nowrap',\n gap: theme.spacing(3),\n },\n contentArea: {\n display: 'flex',\n flexFlow: 'column',\n gap: theme.spacing(3),\n alignItems: 'stretch',\n minWidth: 0,\n },\n infoArea: {\n display: 'flex',\n flexFlow: 'column nowrap',\n alignItems: 'stretch',\n gap: theme.spacing(3),\n minWidth: 0,\n },\n summaryArea: {\n minWidth: 0,\n margin: theme.spacing(1.5), // To counteract MUI negative grid margin\n },\n summaryCard: {\n flex: '0 0 auto',\n '& + &': {\n marginLeft: theme.spacing(3),\n },\n },\n [theme.breakpoints.up('md')]: {\n root: {\n display: 'grid',\n gap: 0,\n gridTemplateAreas: ({ summaryCards }) => `\n \"${summaryCards ? 'summary' : 'content'} info\"\n \"content info\"\n `,\n gridTemplateColumns: ({ infoCards }) => (infoCards ? '2fr 1fr' : '1fr'),\n alignItems: 'start',\n },\n infoArea: {\n gridArea: 'info',\n position: 'sticky',\n top: theme.spacing(3),\n marginLeft: theme.spacing(3),\n },\n contentArea: {\n gridArea: 'content',\n },\n summaryArea: {\n gridArea: 'summary',\n marginBottom: theme.spacing(3),\n },\n },\n}));\n\nconst entityWarningContent = (\n <>\n <EntitySwitch>\n <EntitySwitch.Case if={isOrphan}>\n <Grid item xs={12}>\n <EntityOrphanWarning />\n </Grid>\n </EntitySwitch.Case>\n </EntitySwitch>\n\n <EntitySwitch>\n <EntitySwitch.Case if={hasRelationWarnings}>\n <Grid item xs={12}>\n <EntityRelationWarning />\n </Grid>\n </EntitySwitch.Case>\n </EntitySwitch>\n\n <EntitySwitch>\n <EntitySwitch.Case if={hasCatalogProcessingErrors}>\n <Grid item xs={12}>\n <EntityProcessingErrorsPanel />\n </Grid>\n </EntitySwitch.Case>\n </EntitySwitch>\n </>\n);\n\nexport function DefaultEntityContentLayout(props: EntityContentLayoutProps) {\n const { cards } = props;\n\n const infoCards = cards.filter(card => card.type === 'info');\n const summaryCards = cards.filter(card => card.type === 'summary');\n const contentCards = cards.filter(\n card => !card.type || card.type === 'content',\n );\n\n const classes = useStyles({\n infoCards: !!infoCards.length,\n summaryCards: !!summaryCards.length,\n contentCards: !!contentCards.length,\n });\n\n return (\n <>\n {entityWarningContent}\n <div className={classes.root}>\n {infoCards.length > 0 ? (\n <div className={classes.infoArea}>\n {infoCards.map(card => card.element)}\n </div>\n ) : null}\n {summaryCards.length > 0 ? (\n <div className={classes.summaryArea}>\n <HorizontalScrollGrid scrollStep={400} scrollSpeed={100}>\n {summaryCards.map(card => (\n <div className={classes.summaryCard}>{card.element}</div>\n ))}\n </HorizontalScrollGrid>\n </div>\n ) : null}\n {contentCards.length > 0 ? (\n <div className={classes.contentArea}>\n {contentCards.map(card => card.element)}\n </div>\n ) : null}\n </div>\n </>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AAkCA,MAAM,SAAA,GAAY,WAG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A,QAAA,EAAA,YAAA,CAAa,GAAI,CAAA,CAAA,IAAA,qBACf,GAAA,CAAA,KAAA,EAAA,EAAI,SAAW,EAAA,OAAA,CAAQ,WAAc,EAAA,QAAA,EAAA,IAAA,CAAK,OAAQ,EAAA,CACpD,CACH,EAAA,CAAA,EACF,CACE,GAAA,IAAA;AAAA,MACH,YAAa,CAAA,MAAA,GAAS,CACrB,mBAAA,GAAA,CAAC,SAAI,SAAW,EAAA,OAAA,CAAQ,WACrB,EAAA,QAAA,EAAA,YAAA,CAAa,GAAI,CAAA,CAAA,IAAA,KAAQ,IAAK,CAAA,OAAO,GACxC,CACE,GAAA;AAAA,KACN,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"DefaultEntityContentLayout.esm.js","sources":["../../src/alpha/DefaultEntityContentLayout.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 Grid from '@material-ui/core/Grid';\nimport { makeStyles, Theme } from '@material-ui/core/styles';\nimport { EntityContentLayoutProps } from '@backstage/plugin-catalog-react/alpha';\nimport { EntitySwitch } from '../components/EntitySwitch';\nimport {\n EntityOrphanWarning,\n isOrphan,\n} from '../components/EntityOrphanWarning';\nimport {\n EntityRelationWarning,\n hasRelationWarnings,\n} from '../components/EntityRelationWarning';\nimport {\n EntityProcessingErrorsPanel,\n hasCatalogProcessingErrors,\n} from '../components/EntityProcessingErrorsPanel';\nimport { HorizontalScrollGrid } from '@backstage/core-components';\n\nconst useStyles = makeStyles<\n Theme,\n { infoCards: boolean; summaryCards: boolean; contentCards: boolean }\n>(theme => ({\n root: {\n display: 'flex',\n flexFlow: 'column nowrap',\n gap: theme.spacing(3),\n },\n mainContent: {\n display: 'flex',\n flexFlow: 'column',\n gap: theme.spacing(3),\n alignItems: 'stretch',\n minWidth: 0,\n },\n infoArea: {\n display: 'flex',\n flexFlow: 'column nowrap',\n alignItems: 'flex-start',\n gap: theme.spacing(3),\n minWidth: 0,\n '& > *': {\n flexShrink: 0,\n flexGrow: 0,\n },\n },\n summaryArea: {\n minWidth: 0,\n margin: theme.spacing(1.5), // To counteract MUI negative grid margin\n },\n summaryCard: {\n flex: '0 0 auto',\n '& + &': {\n marginLeft: theme.spacing(3),\n },\n },\n contentArea: {\n display: 'flex',\n flexFlow: 'column',\n gap: theme.spacing(3),\n alignItems: 'stretch',\n minWidth: 0,\n },\n [theme.breakpoints.up('md')]: {\n root: {\n display: 'grid',\n gap: theme.spacing(3),\n gridTemplateAreas: ({ summaryCards }) => `\n \"${summaryCards ? 'summary' : 'content'} info\"\n \"content info\"\n `,\n gridTemplateColumns: ({ infoCards }) => (infoCards ? '2fr 1fr' : '1fr'),\n alignItems: 'start',\n },\n mainContent: {\n display: 'contents',\n },\n contentArea: {\n gridArea: 'content',\n },\n summaryArea: {\n gridArea: 'summary',\n marginBottom: theme.spacing(3),\n },\n infoArea: {\n gridArea: 'info',\n position: 'sticky',\n top: theme.spacing(3),\n // this is a little unfortunate, but it's required to make the info cards scrollable\n // in a fixed container of the full height when it's stuck.\n // 100% doesn't work as that's the height of the entire layout, which is what powers the card scrolling.\n maxHeight: '100vh',\n overflowY: 'auto',\n alignSelf: 'start',\n alignItems: 'stretch',\n // Hide the scrollbar for the inner info cards\n // kind of an accessibility nightmare, but we see.\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n '&::-webkit-scrollbar': {\n display: 'none',\n },\n },\n },\n}));\n\nconst entityWarningContent = (\n <>\n <EntitySwitch>\n <EntitySwitch.Case if={isOrphan}>\n <Grid item xs={12}>\n <EntityOrphanWarning />\n </Grid>\n </EntitySwitch.Case>\n </EntitySwitch>\n\n <EntitySwitch>\n <EntitySwitch.Case if={hasRelationWarnings}>\n <Grid item xs={12}>\n <EntityRelationWarning />\n </Grid>\n </EntitySwitch.Case>\n </EntitySwitch>\n\n <EntitySwitch>\n <EntitySwitch.Case if={hasCatalogProcessingErrors}>\n <Grid item xs={12}>\n <EntityProcessingErrorsPanel />\n </Grid>\n </EntitySwitch.Case>\n </EntitySwitch>\n </>\n);\n\nexport function DefaultEntityContentLayout(props: EntityContentLayoutProps) {\n const { cards } = props;\n\n const infoCards = cards.filter(card => card.type === 'info');\n const summaryCards = cards.filter(card => card.type === 'summary');\n const contentCards = cards.filter(\n card => !card.type || card.type === 'content',\n );\n\n const classes = useStyles({\n infoCards: !!infoCards.length,\n summaryCards: !!summaryCards.length,\n contentCards: !!contentCards.length,\n });\n\n return (\n <>\n {entityWarningContent}\n <div className={classes.root}>\n {infoCards.length > 0 ? (\n <div className={classes.infoArea}>\n {infoCards.map(card => card.element)}\n </div>\n ) : null}\n <div className={classes.mainContent}>\n {summaryCards.length > 0 ? (\n <div className={classes.summaryArea}>\n <HorizontalScrollGrid scrollStep={400} scrollSpeed={100}>\n {summaryCards.map(card => (\n <div className={classes.summaryCard}>{card.element}</div>\n ))}\n </HorizontalScrollGrid>\n </div>\n ) : null}\n {contentCards.length > 0 ? (\n <div className={classes.contentArea}>\n {contentCards.map(card => card.element)}\n </div>\n ) : null}\n </div>\n </div>\n </>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AAkCA,MAAM,SAAA,GAAY,WAGhB,CAAU,KAAA,MAAA;AAAA,EACV,IAAM,EAAA;AAAA,IACJ,OAAS,EAAA,MAAA;AAAA,IACT,QAAU,EAAA,eAAA;AAAA,IACV,GAAA,EAAK,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA,GACtB;AAAA,EACA,WAAa,EAAA;AAAA,IACX,OAAS,EAAA,MAAA;AAAA,IACT,QAAU,EAAA,QAAA;AAA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AW,EAAA,OAAA,CAAQ,QACrB,EAAA,QAAA,EAAA,SAAA,CAAU,GAAI,CAAA,CAAA,IAAA,KAAQ,IAAK,CAAA,OAAO,GACrC,CACE,GAAA,IAAA;AAAA,sBACH,IAAA,CAAA,KAAA,EAAA,EAAI,SAAW,EAAA,OAAA,CAAQ,WACrB,EAAA,QAAA,EAAA;AAAA,QAAa,YAAA,CAAA,MAAA,GAAS,CACrB,mBAAA,GAAA,CAAC,KAAI,EAAA,EAAA,SAAA,EAAW,OAAQ,CAAA,WAAA,EACtB,QAAC,kBAAA,GAAA,CAAA,oBAAA,EAAA,EAAqB,UAAY,EAAA,GAAA,EAAK,WAAa,EAAA,GAAA,EACjD,uBAAa,GAAI,CAAA,CAAA,IAAA,qBACf,GAAA,CAAA,KAAA,EAAA,EAAI,SAAW,EAAA,OAAA,CAAQ,WAAc,EAAA,QAAA,EAAA,IAAA,CAAK,OAAQ,EAAA,CACpD,CACH,EAAA,CAAA,EACF,CACE,GAAA,IAAA;AAAA,QACH,YAAa,CAAA,MAAA,GAAS,CACrB,mBAAA,GAAA,CAAC,SAAI,SAAW,EAAA,OAAA,CAAQ,WACrB,EAAA,QAAA,EAAA,YAAA,CAAa,GAAI,CAAA,CAAA,IAAA,KAAQ,IAAK,CAAA,OAAO,GACxC,CACE,GAAA;AAAA,OACN,EAAA;AAAA,KACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
@@ -1,4 +1,4 @@
1
- import { createApiFactory, discoveryApiRef, fetchApiRef, storageApiRef } from '@backstage/core-plugin-api';
1
+ import { discoveryApiRef, fetchApiRef, storageApiRef } from '@backstage/core-plugin-api';
2
2
  import { CatalogClient } from '@backstage/catalog-client';
3
3
  import { ApiBlueprint } from '@backstage/frontend-plugin-api';
4
4
  import { catalogApiRef, starredEntitiesApiRef, entityPresentationApiRef } from '@backstage/plugin-catalog-react';
@@ -6,36 +6,30 @@ import { DefaultEntityPresentationApi } from '../apis/EntityPresentationApi/Defa
6
6
  import { DefaultStarredEntitiesApi } from '../apis/StarredEntitiesApi/DefaultStarredEntitiesApi.esm.js';
7
7
 
8
8
  const catalogApi = ApiBlueprint.make({
9
- params: {
10
- factory: createApiFactory({
11
- api: catalogApiRef,
12
- deps: {
13
- discoveryApi: discoveryApiRef,
14
- fetchApi: fetchApiRef
15
- },
16
- factory: ({ discoveryApi, fetchApi }) => new CatalogClient({ discoveryApi, fetchApi })
17
- })
18
- }
9
+ params: (define) => define({
10
+ api: catalogApiRef,
11
+ deps: {
12
+ discoveryApi: discoveryApiRef,
13
+ fetchApi: fetchApiRef
14
+ },
15
+ factory: ({ discoveryApi, fetchApi }) => new CatalogClient({ discoveryApi, fetchApi })
16
+ })
19
17
  });
20
18
  const catalogStarredEntitiesApi = ApiBlueprint.make({
21
19
  name: "starred-entities",
22
- params: {
23
- factory: createApiFactory({
24
- api: starredEntitiesApiRef,
25
- deps: { storageApi: storageApiRef },
26
- factory: ({ storageApi }) => new DefaultStarredEntitiesApi({ storageApi })
27
- })
28
- }
20
+ params: (define) => define({
21
+ api: starredEntitiesApiRef,
22
+ deps: { storageApi: storageApiRef },
23
+ factory: ({ storageApi }) => new DefaultStarredEntitiesApi({ storageApi })
24
+ })
29
25
  });
30
26
  const entityPresentationApi = ApiBlueprint.make({
31
27
  name: "entity-presentation",
32
- params: {
33
- factory: createApiFactory({
34
- api: entityPresentationApiRef,
35
- deps: { catalogApiImp: catalogApiRef },
36
- factory: ({ catalogApiImp }) => DefaultEntityPresentationApi.create({ catalogApi: catalogApiImp })
37
- })
38
- }
28
+ params: (define) => define({
29
+ api: entityPresentationApiRef,
30
+ deps: { catalogApiImp: catalogApiRef },
31
+ factory: ({ catalogApiImp }) => DefaultEntityPresentationApi.create({ catalogApi: catalogApiImp })
32
+ })
39
33
  });
40
34
  var apis = [catalogApi, catalogStarredEntitiesApi, entityPresentationApi];
41
35
 
@@ -1 +1 @@
1
- {"version":3,"file":"apis.esm.js","sources":["../../src/alpha/apis.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 createApiFactory,\n discoveryApiRef,\n fetchApiRef,\n storageApiRef,\n} from '@backstage/core-plugin-api';\nimport { CatalogClient } from '@backstage/catalog-client';\nimport { ApiBlueprint } from '@backstage/frontend-plugin-api';\nimport {\n catalogApiRef,\n entityPresentationApiRef,\n starredEntitiesApiRef,\n} from '@backstage/plugin-catalog-react';\nimport {\n DefaultEntityPresentationApi,\n DefaultStarredEntitiesApi,\n} from '../apis';\n\nexport const catalogApi = ApiBlueprint.make({\n params: {\n factory: createApiFactory({\n api: catalogApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) =>\n new CatalogClient({ discoveryApi, fetchApi }),\n }),\n },\n});\n\nexport const catalogStarredEntitiesApi = ApiBlueprint.make({\n name: 'starred-entities',\n params: {\n factory: createApiFactory({\n api: starredEntitiesApiRef,\n deps: { storageApi: storageApiRef },\n factory: ({ storageApi }) =>\n new DefaultStarredEntitiesApi({ storageApi }),\n }),\n },\n});\n\nexport const entityPresentationApi = ApiBlueprint.make({\n name: 'entity-presentation',\n params: {\n factory: createApiFactory({\n api: entityPresentationApiRef,\n deps: { catalogApiImp: catalogApiRef },\n factory: ({ catalogApiImp }) =>\n DefaultEntityPresentationApi.create({ catalogApi: catalogApiImp }),\n }),\n },\n});\n\nexport default [catalogApi, catalogStarredEntitiesApi, entityPresentationApi];\n"],"names":[],"mappings":";;;;;;;AAkCa,MAAA,UAAA,GAAa,aAAa,IAAK,CAAA;AAAA,EAC1C,MAAQ,EAAA;AAAA,IACN,SAAS,gBAAiB,CAAA;AAAA,MACxB,GAAK,EAAA,aAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA,eAAA;AAAA,QACd,QAAU,EAAA;AAAA,OACZ;AAAA,MACA,OAAA,EAAS,CAAC,EAAE,YAAc,EAAA,QAAA,EACxB,KAAA,IAAI,aAAc,CAAA,EAAE,YAAc,EAAA,QAAA,EAAU;AAAA,KAC/C;AAAA;AAEL,CAAC;AAEY,MAAA,yBAAA,GAA4B,aAAa,IAAK,CAAA;AAAA,EACzD,IAAM,EAAA,kBAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,SAAS,gBAAiB,CAAA;AAAA,MACxB,GAAK,EAAA,qBAAA;AAAA,MACL,IAAA,EAAM,EAAE,UAAA,EAAY,aAAc,EAAA;AAAA,MAClC,OAAA,EAAS,CAAC,EAAE,UAAA,OACV,IAAI,yBAAA,CAA0B,EAAE,UAAA,EAAY;AAAA,KAC/C;AAAA;AAEL,CAAC;AAEY,MAAA,qBAAA,GAAwB,aAAa,IAAK,CAAA;AAAA,EACrD,IAAM,EAAA,qBAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,SAAS,gBAAiB,CAAA;AAAA,MACxB,GAAK,EAAA,wBAAA;AAAA,MACL,IAAA,EAAM,EAAE,aAAA,EAAe,aAAc,EAAA;AAAA,MACrC,OAAA,EAAS,CAAC,EAAE,aAAc,EAAA,KACxB,6BAA6B,MAAO,CAAA,EAAE,UAAY,EAAA,aAAA,EAAe;AAAA,KACpE;AAAA;AAEL,CAAC;AAED,WAAe,CAAC,UAAY,EAAA,yBAAA,EAA2B,qBAAqB,CAAA;;;;"}
1
+ {"version":3,"file":"apis.esm.js","sources":["../../src/alpha/apis.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 discoveryApiRef,\n fetchApiRef,\n storageApiRef,\n} from '@backstage/core-plugin-api';\nimport { CatalogClient } from '@backstage/catalog-client';\nimport { ApiBlueprint } from '@backstage/frontend-plugin-api';\nimport {\n catalogApiRef,\n entityPresentationApiRef,\n starredEntitiesApiRef,\n} from '@backstage/plugin-catalog-react';\nimport {\n DefaultEntityPresentationApi,\n DefaultStarredEntitiesApi,\n} from '../apis';\n\nexport const catalogApi = ApiBlueprint.make({\n params: define =>\n define({\n api: catalogApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) =>\n new CatalogClient({ discoveryApi, fetchApi }),\n }),\n});\n\nexport const catalogStarredEntitiesApi = ApiBlueprint.make({\n name: 'starred-entities',\n params: define =>\n define({\n api: starredEntitiesApiRef,\n deps: { storageApi: storageApiRef },\n factory: ({ storageApi }) =>\n new DefaultStarredEntitiesApi({ storageApi }),\n }),\n});\n\nexport const entityPresentationApi = ApiBlueprint.make({\n name: 'entity-presentation',\n params: define =>\n define({\n api: entityPresentationApiRef,\n deps: { catalogApiImp: catalogApiRef },\n factory: ({ catalogApiImp }) =>\n DefaultEntityPresentationApi.create({ catalogApi: catalogApiImp }),\n }),\n});\n\nexport default [catalogApi, catalogStarredEntitiesApi, entityPresentationApi];\n"],"names":[],"mappings":";;;;;;;AAiCa,MAAA,UAAA,GAAa,aAAa,IAAK,CAAA;AAAA,EAC1C,MAAA,EAAQ,YACN,MAAO,CAAA;AAAA,IACL,GAAK,EAAA,aAAA;AAAA,IACL,IAAM,EAAA;AAAA,MACJ,YAAc,EAAA,eAAA;AAAA,MACd,QAAU,EAAA;AAAA,KACZ;AAAA,IACA,OAAA,EAAS,CAAC,EAAE,YAAc,EAAA,QAAA,EACxB,KAAA,IAAI,aAAc,CAAA,EAAE,YAAc,EAAA,QAAA,EAAU;AAAA,GAC/C;AACL,CAAC;AAEY,MAAA,yBAAA,GAA4B,aAAa,IAAK,CAAA;AAAA,EACzD,IAAM,EAAA,kBAAA;AAAA,EACN,MAAA,EAAQ,YACN,MAAO,CAAA;AAAA,IACL,GAAK,EAAA,qBAAA;AAAA,IACL,IAAA,EAAM,EAAE,UAAA,EAAY,aAAc,EAAA;AAAA,IAClC,OAAA,EAAS,CAAC,EAAE,UAAA,OACV,IAAI,yBAAA,CAA0B,EAAE,UAAA,EAAY;AAAA,GAC/C;AACL,CAAC;AAEY,MAAA,qBAAA,GAAwB,aAAa,IAAK,CAAA;AAAA,EACrD,IAAM,EAAA,qBAAA;AAAA,EACN,MAAA,EAAQ,YACN,MAAO,CAAA;AAAA,IACL,GAAK,EAAA,wBAAA;AAAA,IACL,IAAA,EAAM,EAAE,aAAA,EAAe,aAAc,EAAA;AAAA,IACrC,OAAA,EAAS,CAAC,EAAE,aAAc,EAAA,KACxB,6BAA6B,MAAO,CAAA,EAAE,UAAY,EAAA,aAAA,EAAe;AAAA,GACpE;AACL,CAAC;AAED,WAAe,CAAC,UAAY,EAAA,yBAAA,EAA2B,qBAAqB,CAAA;;;;"}
@@ -1,4 +1,4 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
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
- header ?? /* @__PURE__ */ jsx(
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 header,\n NotFoundComponent,\n parentEntityRelations,\n } = props;\n const { kind } = useRouteRefParams(entityRouteRef);\n const { entity, loading, error } = useAsyncEntity();\n\n const routes = useElementFilter(\n children,\n elements =>\n elements\n .selectByComponentData({\n key: dataKey,\n withStrictError:\n 'Child of EntityLayout must be an EntityLayout.Route',\n })\n .getElements<EntityLayoutRouteProps>() // all nodes, element data, maintain structure or not?\n .flatMap(({ props: elementProps }) => {\n if (!entity) {\n return [];\n }\n if (elementProps.if && !elementProps.if(entity)) {\n return [];\n }\n return [\n {\n path: elementProps.path,\n title: elementProps.title,\n group: elementProps.group,\n children: elementProps.children,\n },\n ];\n }),\n [entity],\n );\n\n const { t } = useTranslationRef(catalogTranslationRef);\n\n return (\n <Page themeId={entity?.spec?.type?.toString() ?? 'home'}>\n {header ?? (\n <EntityHeader\n parentEntityRelations={parentEntityRelations}\n UNSTABLE_contextMenuOptions={UNSTABLE_contextMenuOptions}\n UNSTABLE_extraContextMenuItems={UNSTABLE_extraContextMenuItems}\n contextMenuItems={contextMenuItems}\n />\n )}\n\n {loading && <Progress />}\n\n {entity && <EntityTabs routes={routes} />}\n\n {error && (\n <Content>\n <Alert severity=\"error\">{error.toString()}</Alert>\n </Content>\n )}\n\n {!loading && !error && !entity && (\n <Content>\n {NotFoundComponent ? (\n NotFoundComponent\n ) : (\n <WarningPanel title={t('entityLabels.warningPanelTitle')}>\n There is no {kind} with the requested{' '}\n <Link to=\"https://backstage.io/docs/features/software-catalog/references\">\n kind, namespace, and name\n </Link>\n .\n </WarningPanel>\n )}\n </Content>\n )}\n </Page>\n );\n};\n\nEntityLayout.Route = Route;\n"],"names":[],"mappings":";;;;;;;;;;AAmDA,MAAM,OAAU,GAAA,kCAAA;AAChB,MAAM,QAAiD,MAAM,IAAA;AAC7D,mBAAoB,CAAA,KAAA,EAAO,SAAS,I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,EAAA,QAAA,EAAA;AAAA,IACC,MAAA,oBAAA,GAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,qBAAA;AAAA,QACA,2BAAA;AAAA,QACA,8BAAA;AAAA,QACA;AAAA;AAAA,KACF;AAAA,IAGD,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;;;;"}
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,iBAAA;AAAA,IACA;AAAA,GACE,GAAA,KAAA;AACJ,EAAA,MAAM,EAAE,IAAA,EAAS,GAAA,iBAAA,CAAkB,cAAc,CAAA;AACjD,EAAA,MAAM,EAAE,MAAA,EAAQ,OAAS,EAAA,KAAA,KAAU,cAAe,EAAA;AAElD,EAAM,MAAA,MAAA,GAAS,MAAM,MACnB,oBAAA,GAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,qBAAA;AAAA,MACA,2BAAA;AAAA,MACA,8BAAA;AAAA,MACA;AAAA;AAAA,GACF;AAGF,EAAA,MAAM,MAAS,GAAA,gBAAA;AAAA,IACb,QAAA;AAAA,IACA,CAAA,QAAA,KACE,SACG,qBAAsB,CAAA;AAAA,MACrB,GAAK,EAAA,OAAA;AAAA,MACL,eACE,EAAA;AAAA,KACH,EACA,WAAoC,EAAA,CACpC,QAAQ,CAAC,EAAE,KAAO,EAAA,YAAA,EAAmB,KAAA;AACpC,MAAA,IAAI,CAAC,MAAQ,EAAA;AACX,QAAA,OAAO,EAAC;AAAA;AAEV,MAAA,IAAI,aAAa,EAAM,IAAA,CAAC,YAAa,CAAA,EAAA,CAAG,MAAM,CAAG,EAAA;AAC/C,QAAA,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AAA;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
- catalogListCatalogFilter
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 catalogTagCatalogFilter,\n catalogKindCatalogFilter,\n catalogTypeCatalogFilter,\n catalogModeCatalogFilter,\n catalogNamespaceCatalogFilter,\n catalogLifecycleCatalogFilter,\n catalog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AAA,2BAAQ,4BAA6B,EAAA,EAAA,CAAA;AAAA;AACvC;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,aAAA,EAAe,CAAK,CAAA,KAAA,CAAA,CAAE,IAAK,CAAA,CAAC,OAAS,EAAA,SAAA,EAAW,KAAK,CAAC,CAAE,CAAA,OAAA,CAAQ,OAAO;AAAA;AACzE,GACF;AAAA,EACA,OAAQ,CAAA,eAAA,EAAiB,EAAE,MAAA,EAAU,EAAA;AACnC,IAAA,OAAO,eAAgB,CAAA;AAAA,MACrB,QAAQ,YAAY;AAClB,QAAA,MAAM,EAAE,cAAA,EAAmB,GAAA,MAAM,OAC/B,iCACF,CAAA;AACA,QAAA,uBAAQ,GAAA,CAAA,cAAA,EAAA,EAAe,aAAe,EAAA,MAAA,CAAO,aAAe,EAAA,CAAA;AAAA;AAC9D,KACD,CAAA;AAAA;AAEL,CAAC,CAAA;AAED,cAAe;AAAA,EACb,uBAAA;AAAA,EACA,wBAAA;AAAA,EACA,wBAAA;AAAA,EACA,wBAAA;AAAA,EACA,6BAAA;AAAA,EACA,6BAAA;AAAA,EACA,oCAAA;AAAA,EACA;AACF,CAAA;;;;"}
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,a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;AAAA,EACA;AACF,CAAA;;;;"}
@@ -48,10 +48,10 @@ const catalogPage = PageBlueprint.makeWithOverrides({
48
48
  const catalogEntityPage = PageBlueprint.makeWithOverrides({
49
49
  name: "entity",
50
50
  inputs: {
51
- header: createExtensionInput(
52
- [EntityHeaderBlueprint.dataRefs.element.optional()],
53
- { singleton: true, optional: true }
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 header = inputs.header?.get(
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,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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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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GED
@@ -35,9 +35,7 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
35
35
  configInput: {};
36
36
  output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.AnyApiFactory, "core.api.factory", {}>;
37
37
  inputs: {};
38
- params: {
39
- factory: _backstage_frontend_plugin_api.AnyApiFactory;
40
- };
38
+ params: <TApi, TImpl extends TApi, TDeps extends { [name in string]: unknown; }>(params: _backstage_frontend_plugin_api.ApiFactory<TApi, TImpl, TDeps>) => _backstage_frontend_plugin_api.ExtensionBlueprintParams<_backstage_frontend_plugin_api.AnyApiFactory>;
41
39
  }>;
42
40
  "api:catalog/entity-presentation": _backstage_frontend_plugin_api.ExtensionDefinition<{
43
41
  kind: "api";
@@ -46,9 +44,7 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
46
44
  configInput: {};
47
45
  output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.AnyApiFactory, "core.api.factory", {}>;
48
46
  inputs: {};
49
- params: {
50
- factory: _backstage_frontend_plugin_api.AnyApiFactory;
51
- };
47
+ params: <TApi, TImpl extends TApi, TDeps extends { [name in string]: unknown; }>(params: _backstage_frontend_plugin_api.ApiFactory<TApi, TImpl, TDeps>) => _backstage_frontend_plugin_api.ExtensionBlueprintParams<_backstage_frontend_plugin_api.AnyApiFactory>;
52
48
  }>;
53
49
  "api:catalog/starred-entities": _backstage_frontend_plugin_api.ExtensionDefinition<{
54
50
  kind: "api";
@@ -57,9 +53,7 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
57
53
  configInput: {};
58
54
  output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.AnyApiFactory, "core.api.factory", {}>;
59
55
  inputs: {};
60
- params: {
61
- factory: _backstage_frontend_plugin_api.AnyApiFactory;
62
- };
56
+ params: <TApi, TImpl extends TApi, TDeps extends { [name in string]: unknown; }>(params: _backstage_frontend_plugin_api.ApiFactory<TApi, TImpl, TDeps>) => _backstage_frontend_plugin_api.ExtensionBlueprintParams<_backstage_frontend_plugin_api.AnyApiFactory>;
63
57
  }>;
64
58
  "catalog-filter:catalog/kind": _backstage_frontend_plugin_api.ExtensionDefinition<{
65
59
  config: {
@@ -629,11 +623,13 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
629
623
  optional: true;
630
624
  }>;
631
625
  inputs: {
632
- header: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {
626
+ headers: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
633
627
  optional: true;
634
- }>, {
635
- singleton: true;
628
+ }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {
636
629
  optional: true;
630
+ }>, {
631
+ singleton: false;
632
+ optional: false;
637
633
  }>;
638
634
  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
635
  optional: true;
@@ -1,5 +1,5 @@
1
1
  var name = "@backstage/plugin-catalog";
2
- var version = "1.31.1";
2
+ var version = "1.31.2-next.1";
3
3
  var description = "The Backstage plugin for browsing the Backstage catalog";
4
4
  var backstage = {
5
5
  role: "frontend-plugin",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog",
3
- "version": "1.31.1",
3
+ "version": "1.31.2-next.1",
4
4
  "description": "The Backstage plugin for browsing the Backstage catalog",
5
5
  "backstage": {
6
6
  "role": "frontend-plugin",
@@ -70,24 +70,24 @@
70
70
  "test": "backstage-cli package test"
71
71
  },
72
72
  "dependencies": {
73
- "@backstage/catalog-client": "^1.10.2",
74
- "@backstage/catalog-model": "^1.7.5",
75
- "@backstage/core-compat-api": "^0.4.4",
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.1",
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",
73
+ "@backstage/catalog-client": "1.11.0-next.0",
74
+ "@backstage/catalog-model": "1.7.5",
75
+ "@backstage/core-compat-api": "0.4.5-next.1",
76
+ "@backstage/core-components": "0.17.5-next.0",
77
+ "@backstage/core-plugin-api": "1.10.9",
78
+ "@backstage/errors": "1.2.7",
79
+ "@backstage/frontend-plugin-api": "0.11.0-next.0",
80
+ "@backstage/integration-react": "1.2.9",
81
+ "@backstage/plugin-catalog-common": "1.1.5",
82
+ "@backstage/plugin-catalog-react": "1.20.0-next.1",
83
+ "@backstage/plugin-permission-react": "0.4.36",
84
+ "@backstage/plugin-scaffolder-common": "1.7.0-next.0",
85
+ "@backstage/plugin-search-common": "1.2.19",
86
+ "@backstage/plugin-search-react": "1.9.3-next.0",
87
+ "@backstage/plugin-techdocs-common": "0.1.1",
88
+ "@backstage/plugin-techdocs-react": "1.3.2-next.0",
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": "^0.33.1",
106
- "@backstage/core-app-api": "^1.18.0",
107
- "@backstage/dev-utils": "^1.1.12",
108
- "@backstage/frontend-test-utils": "^0.3.4",
109
- "@backstage/plugin-permission-common": "^0.9.1",
110
- "@backstage/test-utils": "^1.7.10",
105
+ "@backstage/cli": "0.33.2-next.0",
106
+ "@backstage/core-app-api": "1.18.0",
107
+ "@backstage/dev-utils": "1.1.13-next.1",
108
+ "@backstage/frontend-test-utils": "0.3.5-next.1",
109
+ "@backstage/plugin-permission-common": "0.9.1",
110
+ "@backstage/test-utils": "1.7.11-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",