@backstage/plugin-catalog 1.26.2-next.1 → 1.27.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @backstage/plugin-catalog
2
2
 
3
+ ## 1.27.0-next.2
4
+
5
+ ### Minor Changes
6
+
7
+ - b07756e: The Entity Page now retains the visibility of the Inspect Dialog after a reload. This allows sharing the URL with the dialog open.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @backstage/core-components@0.16.4-next.1
13
+ - @backstage/plugin-catalog-react@1.15.2-next.2
14
+ - @backstage/catalog-client@1.9.1
15
+ - @backstage/catalog-model@1.7.3
16
+ - @backstage/core-compat-api@0.3.6-next.2
17
+ - @backstage/core-plugin-api@1.10.4-next.0
18
+ - @backstage/errors@1.2.7
19
+ - @backstage/frontend-plugin-api@0.9.5-next.2
20
+ - @backstage/integration-react@1.2.4-next.0
21
+ - @backstage/types@1.2.1
22
+ - @backstage/plugin-catalog-common@1.1.3
23
+ - @backstage/plugin-permission-react@0.4.31-next.0
24
+ - @backstage/plugin-scaffolder-common@1.5.9
25
+ - @backstage/plugin-search-common@1.2.17
26
+ - @backstage/plugin-search-react@1.8.6-next.2
27
+
3
28
  ## 1.26.2-next.1
4
29
 
5
30
  ### Patch Changes
@@ -2,12 +2,12 @@ import { DEFAULT_NAMESPACE, RELATION_OWNED_BY } from '@backstage/catalog-model';
2
2
  import { Page, Header, Breadcrumbs, Progress, RoutedTabs, Content, WarningPanel, Link, HeaderLabel } from '@backstage/core-components';
3
3
  import { attachComponentData, useRouteRefParams, useElementFilter, useRouteRef, useApi } from '@backstage/core-plugin-api';
4
4
  import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
5
- import { entityRouteRef, useAsyncEntity, catalogApiRef, EntityRefLink, UnregisterEntityDialog, InspectEntityDialog, EntityDisplayName, FavoriteEntity, getEntityRelations, EntityRefLinks } from '@backstage/plugin-catalog-react';
5
+ import { entityRouteRef, useAsyncEntity, catalogApiRef, EntityRefLink, InspectEntityDialog, UnregisterEntityDialog, EntityDisplayName, FavoriteEntity, getEntityRelations, EntityRefLinks } from '@backstage/plugin-catalog-react';
6
6
  import Box from '@material-ui/core/Box';
7
7
  import { makeStyles } from '@material-ui/core/styles';
8
8
  import Alert from '@material-ui/lab/Alert';
9
9
  import React, { useState, useEffect } from 'react';
10
- import { useLocation, useNavigate } from 'react-router-dom';
10
+ import { useLocation, useNavigate, useSearchParams } from 'react-router-dom';
11
11
  import useAsync from 'react-use/esm/useAsync';
12
12
  import { catalogTranslationRef } from '../../alpha/translation.esm.js';
13
13
  import { rootRouteRef, unregisterRedirectRouteRef } from '../../routes.esm.js';
@@ -138,14 +138,13 @@ const EntityLayout = (props) => {
138
138
  entity
139
139
  );
140
140
  const [confirmationDialogOpen, setConfirmationDialogOpen] = useState(false);
141
- const [inspectionDialogOpen, setInspectionDialogOpen] = useState(false);
142
141
  const navigate = useNavigate();
142
+ const [searchParams, setSearchParams] = useSearchParams();
143
143
  const catalogRoute = useRouteRef(rootRouteRef);
144
144
  const unregisterRedirectRoute = useRouteRef(unregisterRedirectRouteRef);
145
145
  const { t } = useTranslationRef(catalogTranslationRef);
146
146
  const cleanUpAfterRemoval = async () => {
147
147
  setConfirmationDialogOpen(false);
148
- setInspectionDialogOpen(false);
149
148
  navigate(
150
149
  unregisterRedirectRoute ? unregisterRedirectRoute() : catalogRoute()
151
150
  );
@@ -166,8 +165,9 @@ const EntityLayout = (props) => {
166
165
  }, [parentEntity]);
167
166
  useEffect(() => {
168
167
  setConfirmationDialogOpen(false);
169
- setInspectionDialogOpen(false);
170
168
  }, [location.pathname]);
169
+ const selectedInspectTab = searchParams.get("inspect");
170
+ const showInspectTab = typeof selectedInspectTab === "string";
171
171
  return /* @__PURE__ */ React.createElement(Page, { themeId: entity?.spec?.type?.toString() ?? "home" }, /* @__PURE__ */ React.createElement(
172
172
  Header,
173
173
  {
@@ -194,23 +194,25 @@ const EntityLayout = (props) => {
194
194
  UNSTABLE_extraContextMenuItems,
195
195
  UNSTABLE_contextMenuOptions,
196
196
  onUnregisterEntity: () => setConfirmationDialogOpen(true),
197
- onInspectEntity: () => setInspectionDialogOpen(true)
197
+ onInspectEntity: () => setSearchParams("inspect")
198
198
  }
199
199
  ))
200
- ), loading && /* @__PURE__ */ React.createElement(Progress, null), entity && /* @__PURE__ */ React.createElement(RoutedTabs, { routes }), error && /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(Alert, { severity: "error" }, error.toString())), !loading && !error && !entity && /* @__PURE__ */ React.createElement(Content, null, NotFoundComponent ? NotFoundComponent : /* @__PURE__ */ React.createElement(WarningPanel, { title: t("entityLabels.warningPanelTitle") }, "There is no ", kind, " with the requested", " ", /* @__PURE__ */ React.createElement(Link, { to: "https://backstage.io/docs/features/software-catalog/references" }, "kind, namespace, and name"), ".")), /* @__PURE__ */ React.createElement(
201
- UnregisterEntityDialog,
200
+ ), loading && /* @__PURE__ */ React.createElement(Progress, null), entity && /* @__PURE__ */ React.createElement(RoutedTabs, { routes }), error && /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(Alert, { severity: "error" }, error.toString())), !loading && !error && !entity && /* @__PURE__ */ React.createElement(Content, null, NotFoundComponent ? NotFoundComponent : /* @__PURE__ */ React.createElement(WarningPanel, { title: t("entityLabels.warningPanelTitle") }, "There is no ", kind, " with the requested", " ", /* @__PURE__ */ React.createElement(Link, { to: "https://backstage.io/docs/features/software-catalog/references" }, "kind, namespace, and name"), ".")), showInspectTab && /* @__PURE__ */ React.createElement(
201
+ InspectEntityDialog,
202
202
  {
203
- open: confirmationDialogOpen,
204
203
  entity,
205
- onConfirm: cleanUpAfterRemoval,
206
- onClose: () => setConfirmationDialogOpen(false)
204
+ initialTab: selectedInspectTab || void 0,
205
+ onSelect: (newTab) => setSearchParams(`inspect=${newTab}`),
206
+ open: true,
207
+ onClose: () => setSearchParams()
207
208
  }
208
209
  ), /* @__PURE__ */ React.createElement(
209
- InspectEntityDialog,
210
+ UnregisterEntityDialog,
210
211
  {
211
- open: inspectionDialogOpen,
212
+ open: confirmationDialogOpen,
212
213
  entity,
213
- onClose: () => setInspectionDialogOpen(false)
214
+ onConfirm: cleanUpAfterRemoval,
215
+ onClose: () => setConfirmationDialogOpen(false)
214
216
  }
215
217
  ));
216
218
  };
@@ -1 +1 @@
1
- {"version":3,"file":"EntityLayout.esm.js","sources":["../../../src/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 {\n DEFAULT_NAMESPACE,\n Entity,\n EntityRelation,\n RELATION_OWNED_BY,\n} from '@backstage/catalog-model';\nimport {\n Breadcrumbs,\n Content,\n Header,\n HeaderLabel,\n Link,\n Page,\n Progress,\n RoutedTabs,\n WarningPanel,\n} from '@backstage/core-components';\nimport {\n attachComponentData,\n IconComponent,\n useApi,\n useElementFilter,\n useRouteRef,\n useRouteRefParams,\n} from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport {\n catalogApiRef,\n EntityDisplayName,\n EntityRefLink,\n EntityRefLinks,\n entityRouteRef,\n FavoriteEntity,\n getEntityRelations,\n InspectEntityDialog,\n UnregisterEntityDialog,\n useAsyncEntity,\n} from '@backstage/plugin-catalog-react';\nimport Box from '@material-ui/core/Box';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { TabProps } from '@material-ui/core/Tab';\nimport Alert from '@material-ui/lab/Alert';\nimport React, { useEffect, useState } from 'react';\nimport { useLocation, useNavigate } from 'react-router-dom';\nimport useAsync from 'react-use/esm/useAsync';\nimport { catalogTranslationRef } from '../../alpha/translation';\nimport { rootRouteRef, unregisterRedirectRouteRef } from '../../routes';\nimport { EntityContextMenu } from '../EntityContextMenu/EntityContextMenu';\n\n/** @public */\nexport type EntityLayoutRouteProps = {\n path: string;\n title: string;\n children: JSX.Element;\n if?: (entity: Entity) => boolean;\n tabProps?: TabProps<React.ElementType, { component?: React.ElementType }>;\n};\n\nconst dataKey = 'plugin.catalog.entityLayoutRoute';\n\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\nfunction EntityLayoutTitle(props: {\n title: string;\n entity: Entity | undefined;\n}) {\n const { entity, title } = props;\n return (\n <Box display=\"inline-flex\" alignItems=\"center\" height=\"1em\" maxWidth=\"100%\">\n <Box\n component=\"span\"\n textOverflow=\"ellipsis\"\n whiteSpace=\"nowrap\"\n overflow=\"hidden\"\n >\n {entity ? <EntityDisplayName entityRef={entity} hideIcon /> : title}\n </Box>\n {entity && <FavoriteEntity entity={entity} />}\n </Box>\n );\n}\n\nfunction headerProps(\n paramKind: string | undefined,\n paramNamespace: string | undefined,\n paramName: string | undefined,\n entity: Entity | undefined,\n): { headerTitle: string; headerType: string } {\n const kind = paramKind ?? entity?.kind ?? '';\n const namespace = paramNamespace ?? entity?.metadata.namespace ?? '';\n const name =\n entity?.metadata.title ?? paramName ?? entity?.metadata.name ?? '';\n\n return {\n headerTitle: `${name}${\n namespace && namespace !== DEFAULT_NAMESPACE ? ` in ${namespace}` : ''\n }`,\n headerType: (() => {\n let t = kind.toLocaleLowerCase('en-US');\n if (entity && entity.spec && 'type' in entity.spec) {\n t += ' — ';\n t += (entity.spec as { type: string }).type.toLocaleLowerCase('en-US');\n }\n return t;\n })(),\n };\n}\n\nfunction EntityLabels(props: { entity: Entity }) {\n const { entity } = props;\n const ownedByRelations = getEntityRelations(entity, RELATION_OWNED_BY);\n const { t } = useTranslationRef(catalogTranslationRef);\n return (\n <>\n {ownedByRelations.length > 0 && (\n <HeaderLabel\n label={t('entityLabels.ownerLabel')}\n contentTypograpyRootComponent=\"p\"\n value={\n <EntityRefLinks\n entityRefs={ownedByRelations}\n defaultKind=\"Group\"\n color=\"inherit\"\n />\n }\n />\n )}\n {entity.spec?.lifecycle && (\n <HeaderLabel\n label={t('entityLabels.lifecycleLabel')}\n value={entity.spec.lifecycle?.toString()}\n />\n )}\n </>\n );\n}\n\n// NOTE(freben): Intentionally not exported at this point, since it's part of\n// the unstable extra context menu items concept below\ninterface ExtraContextMenuItem {\n title: string;\n Icon: IconComponent;\n onClick: () => void;\n}\n\ntype VisibleType = 'visible' | 'hidden' | 'disable';\n\n// NOTE(blam): Intentionally not exported at this point, since it's part of\n// unstable context menu option, eg: disable the unregister entity menu\ninterface EntityContextMenuOptions {\n disableUnregister: boolean | VisibleType;\n}\n\n/** @public */\nexport interface EntityLayoutProps {\n UNSTABLE_extraContextMenuItems?: ExtraContextMenuItem[];\n UNSTABLE_contextMenuOptions?: EntityContextMenuOptions;\n children?: React.ReactNode;\n NotFoundComponent?: React.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\nfunction findParentRelation(\n entityRelations: EntityRelation[] = [],\n relationTypes: string[] = [],\n) {\n for (const type of relationTypes) {\n const foundRelation = entityRelations.find(\n relation => relation.type === type,\n );\n if (foundRelation) {\n return foundRelation; // Return the first found relation and stop\n }\n }\n return null;\n}\n\nconst useStyles = makeStyles(theme => ({\n breadcrumbs: {\n color: theme.page.fontColor,\n fontSize: theme.typography.caption.fontSize,\n textTransform: 'uppercase',\n marginTop: theme.spacing(1),\n opacity: 0.8,\n '& span ': {\n color: theme.page.fontColor,\n textDecoration: 'underline',\n textUnderlineOffset: '3px',\n },\n },\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 children,\n NotFoundComponent,\n parentEntityRelations,\n } = props;\n const classes = useStyles();\n const { kind, namespace, name } = useRouteRefParams(entityRouteRef);\n const { entity, loading, error } = useAsyncEntity();\n const location = useLocation();\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 } else if (elementProps.if && !elementProps.if(entity)) {\n return [];\n }\n\n return [\n {\n path: elementProps.path,\n title: elementProps.title,\n children: elementProps.children,\n tabProps: elementProps.tabProps,\n },\n ];\n }),\n [entity],\n );\n\n const { headerTitle, headerType } = headerProps(\n kind,\n namespace,\n name,\n entity,\n );\n\n const [confirmationDialogOpen, setConfirmationDialogOpen] = useState(false);\n const [inspectionDialogOpen, setInspectionDialogOpen] = useState(false);\n const navigate = useNavigate();\n const catalogRoute = useRouteRef(rootRouteRef);\n const unregisterRedirectRoute = useRouteRef(unregisterRedirectRouteRef);\n const { t } = useTranslationRef(catalogTranslationRef);\n\n const cleanUpAfterRemoval = async () => {\n setConfirmationDialogOpen(false);\n setInspectionDialogOpen(false);\n navigate(\n unregisterRedirectRoute ? unregisterRedirectRoute() : catalogRoute(),\n );\n };\n\n const parentEntity = findParentRelation(\n entity?.relations ?? [],\n parentEntityRelations ?? [],\n );\n\n const catalogApi = useApi(catalogApiRef);\n const { value: ancestorEntity } = useAsync(async () => {\n if (parentEntity) {\n return findParentRelation(\n (await catalogApi.getEntityByRef(parentEntity?.targetRef))?.relations,\n parentEntityRelations,\n );\n }\n return null;\n }, [parentEntity]);\n\n // Make sure to close the dialog if the user clicks links in it that navigate\n // to another entity.\n useEffect(() => {\n setConfirmationDialogOpen(false);\n setInspectionDialogOpen(false);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [location.pathname]);\n\n return (\n <Page themeId={entity?.spec?.type?.toString() ?? 'home'}>\n <Header\n title={<EntityLayoutTitle title={headerTitle} entity={entity!} />}\n pageTitleOverride={headerTitle}\n type={headerType}\n subtitle={\n parentEntity && (\n <Breadcrumbs separator=\">\" className={classes.breadcrumbs}>\n {ancestorEntity && (\n <EntityRefLink\n entityRef={ancestorEntity.targetRef}\n disableTooltip\n />\n )}\n <EntityRefLink\n entityRef={parentEntity.targetRef}\n disableTooltip\n />\n {name}\n </Breadcrumbs>\n )\n }\n >\n {entity && (\n <>\n <EntityLabels entity={entity} />\n <EntityContextMenu\n UNSTABLE_extraContextMenuItems={UNSTABLE_extraContextMenuItems}\n UNSTABLE_contextMenuOptions={UNSTABLE_contextMenuOptions}\n onUnregisterEntity={() => setConfirmationDialogOpen(true)}\n onInspectEntity={() => setInspectionDialogOpen(true)}\n />\n </>\n )}\n </Header>\n\n {loading && <Progress />}\n\n {entity && <RoutedTabs 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\n <UnregisterEntityDialog\n open={confirmationDialogOpen}\n entity={entity!}\n onConfirm={cleanUpAfterRemoval}\n onClose={() => setConfirmationDialogOpen(false)}\n />\n <InspectEntityDialog\n open={inspectionDialogOpen}\n entity={entity!}\n onClose={() => setInspectionDialogOpen(false)}\n />\n </Page>\n );\n};\n\nEntityLayout.Route = Route;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AA0EA,MAAM,OAAU,GAAA,kCAAA;AAEhB,MAAM,QAAiD,MAAM,IAAA;AAC7D,mBAAoB,CAAA,KAAA,EAAO,SAAS,IAAI,CAAA;AACxC,mBAAoB,CAAA,KAAA,EAAO,0BAA0B,IAAI,CAAA;AAEzD,SAAS,kBAAkB,KAGxB,EAAA;AACD,EAAM,MAAA,EAAE,MAAQ,EAAA,KAAA,EAAU,GAAA,KAAA;AAC1B,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,OAAI,OAAQ,EAAA,aAAA,EAAc,YAAW,QAAS,EAAA,MAAA,EAAO,KAAM,EAAA,QAAA,EAAS,MACnE,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,SAAU,EAAA,MAAA;AAAA,MACV,YAAa,EAAA,UAAA;AAAA,MACb,UAAW,EAAA,QAAA;AAAA,MACX,QAAS,EAAA;AAAA,KAAA;AAAA,IAER,yBAAU,KAAA,CAAA,aAAA,CAAA,iBAAA,EAAA,EAAkB,WAAW,MAAQ,EAAA,QAAA,EAAQ,MAAC,CAAK,GAAA;AAAA,GAE/D,EAAA,MAAA,oBAAW,KAAA,CAAA,aAAA,CAAA,cAAA,EAAA,EAAe,QAAgB,CAC7C,CAAA;AAEJ;AAEA,SAAS,WACP,CAAA,SAAA,EACA,cACA,EAAA,SAAA,EACA,MAC6C,EAAA;AAC7C,EAAM,MAAA,IAAA,GAAO,SAAa,I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AAS,EAAA,EAAA,KAAA,CAAM,UAAW,CAC5C,CAGD,EAAA,CAAC,OAAW,IAAA,CAAC,SAAS,CAAC,MAAA,wCACrB,OACE,EAAA,IAAA,EAAA,iBAAA,GACC,oCAEC,KAAA,CAAA,aAAA,CAAA,YAAA,EAAA,EAAa,KAAO,EAAA,CAAA,CAAE,gCAAgC,CAAA,EAAA,EAAG,gBAC3C,IAAK,EAAA,qBAAA,EAAoB,GACtC,kBAAA,KAAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,EAAA,EAAG,oEAAiE,2BAE1E,CAAA,EAAO,GAET,CAEJ,CAGF,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,sBAAA;AAAA,IAAA;AAAA,MACC,IAAM,EAAA,sBAAA;AAAA,MACN,MAAA;AAAA,MACA,SAAW,EAAA,mBAAA;AAAA,MACX,OAAA,EAAS,MAAM,yBAAA,CAA0B,KAAK;AAAA;AAAA,GAEhD,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,mBAAA;AAAA,IAAA;AAAA,MACC,IAAM,EAAA,oBAAA;AAAA,MACN,MAAA;AAAA,MACA,OAAA,EAAS,MAAM,uBAAA,CAAwB,KAAK;AAAA;AAAA,GAEhD,CAAA;AAEJ;AAEA,YAAA,CAAa,KAAQ,GAAA,KAAA;;;;"}
1
+ {"version":3,"file":"EntityLayout.esm.js","sources":["../../../src/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 {\n DEFAULT_NAMESPACE,\n Entity,\n EntityRelation,\n RELATION_OWNED_BY,\n} from '@backstage/catalog-model';\nimport {\n Breadcrumbs,\n Content,\n Header,\n HeaderLabel,\n Link,\n Page,\n Progress,\n RoutedTabs,\n WarningPanel,\n} from '@backstage/core-components';\nimport {\n attachComponentData,\n IconComponent,\n useApi,\n useElementFilter,\n useRouteRef,\n useRouteRefParams,\n} from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport {\n catalogApiRef,\n EntityDisplayName,\n EntityRefLink,\n EntityRefLinks,\n entityRouteRef,\n FavoriteEntity,\n getEntityRelations,\n InspectEntityDialog,\n UnregisterEntityDialog,\n useAsyncEntity,\n} from '@backstage/plugin-catalog-react';\nimport Box from '@material-ui/core/Box';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { TabProps } from '@material-ui/core/Tab';\nimport Alert from '@material-ui/lab/Alert';\nimport React, { ComponentProps, useEffect, useState } from 'react';\nimport { useLocation, useNavigate, useSearchParams } from 'react-router-dom';\nimport useAsync from 'react-use/esm/useAsync';\nimport { catalogTranslationRef } from '../../alpha/translation';\nimport { rootRouteRef, unregisterRedirectRouteRef } from '../../routes';\nimport { EntityContextMenu } from '../EntityContextMenu/EntityContextMenu';\n\n/** @public */\nexport type EntityLayoutRouteProps = {\n path: string;\n title: string;\n children: JSX.Element;\n if?: (entity: Entity) => boolean;\n tabProps?: TabProps<React.ElementType, { component?: React.ElementType }>;\n};\n\nconst dataKey = 'plugin.catalog.entityLayoutRoute';\n\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\nfunction EntityLayoutTitle(props: {\n title: string;\n entity: Entity | undefined;\n}) {\n const { entity, title } = props;\n return (\n <Box display=\"inline-flex\" alignItems=\"center\" height=\"1em\" maxWidth=\"100%\">\n <Box\n component=\"span\"\n textOverflow=\"ellipsis\"\n whiteSpace=\"nowrap\"\n overflow=\"hidden\"\n >\n {entity ? <EntityDisplayName entityRef={entity} hideIcon /> : title}\n </Box>\n {entity && <FavoriteEntity entity={entity} />}\n </Box>\n );\n}\n\nfunction headerProps(\n paramKind: string | undefined,\n paramNamespace: string | undefined,\n paramName: string | undefined,\n entity: Entity | undefined,\n): { headerTitle: string; headerType: string } {\n const kind = paramKind ?? entity?.kind ?? '';\n const namespace = paramNamespace ?? entity?.metadata.namespace ?? '';\n const name =\n entity?.metadata.title ?? paramName ?? entity?.metadata.name ?? '';\n\n return {\n headerTitle: `${name}${\n namespace && namespace !== DEFAULT_NAMESPACE ? ` in ${namespace}` : ''\n }`,\n headerType: (() => {\n let t = kind.toLocaleLowerCase('en-US');\n if (entity && entity.spec && 'type' in entity.spec) {\n t += ' — ';\n t += (entity.spec as { type: string }).type.toLocaleLowerCase('en-US');\n }\n return t;\n })(),\n };\n}\n\nfunction EntityLabels(props: { entity: Entity }) {\n const { entity } = props;\n const ownedByRelations = getEntityRelations(entity, RELATION_OWNED_BY);\n const { t } = useTranslationRef(catalogTranslationRef);\n return (\n <>\n {ownedByRelations.length > 0 && (\n <HeaderLabel\n label={t('entityLabels.ownerLabel')}\n contentTypograpyRootComponent=\"p\"\n value={\n <EntityRefLinks\n entityRefs={ownedByRelations}\n defaultKind=\"Group\"\n color=\"inherit\"\n />\n }\n />\n )}\n {entity.spec?.lifecycle && (\n <HeaderLabel\n label={t('entityLabels.lifecycleLabel')}\n value={entity.spec.lifecycle?.toString()}\n />\n )}\n </>\n );\n}\n\n// NOTE(freben): Intentionally not exported at this point, since it's part of\n// the unstable extra context menu items concept below\ninterface ExtraContextMenuItem {\n title: string;\n Icon: IconComponent;\n onClick: () => void;\n}\n\ntype VisibleType = 'visible' | 'hidden' | 'disable';\n\n// NOTE(blam): Intentionally not exported at this point, since it's part of\n// unstable context menu option, eg: disable the unregister entity menu\ninterface EntityContextMenuOptions {\n disableUnregister: boolean | VisibleType;\n}\n\n/** @public */\nexport interface EntityLayoutProps {\n UNSTABLE_extraContextMenuItems?: ExtraContextMenuItem[];\n UNSTABLE_contextMenuOptions?: EntityContextMenuOptions;\n children?: React.ReactNode;\n NotFoundComponent?: React.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\nfunction findParentRelation(\n entityRelations: EntityRelation[] = [],\n relationTypes: string[] = [],\n) {\n for (const type of relationTypes) {\n const foundRelation = entityRelations.find(\n relation => relation.type === type,\n );\n if (foundRelation) {\n return foundRelation; // Return the first found relation and stop\n }\n }\n return null;\n}\n\nconst useStyles = makeStyles(theme => ({\n breadcrumbs: {\n color: theme.page.fontColor,\n fontSize: theme.typography.caption.fontSize,\n textTransform: 'uppercase',\n marginTop: theme.spacing(1),\n opacity: 0.8,\n '& span ': {\n color: theme.page.fontColor,\n textDecoration: 'underline',\n textUnderlineOffset: '3px',\n },\n },\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 children,\n NotFoundComponent,\n parentEntityRelations,\n } = props;\n const classes = useStyles();\n const { kind, namespace, name } = useRouteRefParams(entityRouteRef);\n const { entity, loading, error } = useAsyncEntity();\n const location = useLocation();\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 } else if (elementProps.if && !elementProps.if(entity)) {\n return [];\n }\n\n return [\n {\n path: elementProps.path,\n title: elementProps.title,\n children: elementProps.children,\n tabProps: elementProps.tabProps,\n },\n ];\n }),\n [entity],\n );\n\n const { headerTitle, headerType } = headerProps(\n kind,\n namespace,\n name,\n entity,\n );\n\n const [confirmationDialogOpen, setConfirmationDialogOpen] = useState(false);\n const navigate = useNavigate();\n const [searchParams, setSearchParams] = useSearchParams();\n\n const catalogRoute = useRouteRef(rootRouteRef);\n const unregisterRedirectRoute = useRouteRef(unregisterRedirectRouteRef);\n const { t } = useTranslationRef(catalogTranslationRef);\n\n const cleanUpAfterRemoval = async () => {\n setConfirmationDialogOpen(false);\n navigate(\n unregisterRedirectRoute ? unregisterRedirectRoute() : catalogRoute(),\n );\n };\n\n const parentEntity = findParentRelation(\n entity?.relations ?? [],\n parentEntityRelations ?? [],\n );\n\n const catalogApi = useApi(catalogApiRef);\n const { value: ancestorEntity } = useAsync(async () => {\n if (parentEntity) {\n return findParentRelation(\n (await catalogApi.getEntityByRef(parentEntity?.targetRef))?.relations,\n parentEntityRelations,\n );\n }\n return null;\n }, [parentEntity]);\n\n // Make sure to close the dialog if the user clicks links in it that navigate\n // to another entity.\n useEffect(() => {\n setConfirmationDialogOpen(false);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [location.pathname]);\n\n const selectedInspectTab = searchParams.get('inspect');\n const showInspectTab = typeof selectedInspectTab === 'string';\n\n return (\n <Page themeId={entity?.spec?.type?.toString() ?? 'home'}>\n <Header\n title={<EntityLayoutTitle title={headerTitle} entity={entity!} />}\n pageTitleOverride={headerTitle}\n type={headerType}\n subtitle={\n parentEntity && (\n <Breadcrumbs separator=\">\" className={classes.breadcrumbs}>\n {ancestorEntity && (\n <EntityRefLink\n entityRef={ancestorEntity.targetRef}\n disableTooltip\n />\n )}\n <EntityRefLink\n entityRef={parentEntity.targetRef}\n disableTooltip\n />\n {name}\n </Breadcrumbs>\n )\n }\n >\n {entity && (\n <>\n <EntityLabels entity={entity} />\n <EntityContextMenu\n UNSTABLE_extraContextMenuItems={UNSTABLE_extraContextMenuItems}\n UNSTABLE_contextMenuOptions={UNSTABLE_contextMenuOptions}\n onUnregisterEntity={() => setConfirmationDialogOpen(true)}\n onInspectEntity={() => setSearchParams('inspect')}\n />\n </>\n )}\n </Header>\n\n {loading && <Progress />}\n\n {entity && <RoutedTabs 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\n {showInspectTab && (\n <InspectEntityDialog\n entity={entity!}\n initialTab={\n (selectedInspectTab as ComponentProps<\n typeof InspectEntityDialog\n >['initialTab']) || undefined\n }\n onSelect={newTab => setSearchParams(`inspect=${newTab}`)}\n open\n onClose={() => setSearchParams()}\n />\n )}\n\n <UnregisterEntityDialog\n open={confirmationDialogOpen}\n entity={entity!}\n onConfirm={cleanUpAfterRemoval}\n onClose={() => setConfirmationDialogOpen(false)}\n />\n </Page>\n );\n};\n\nEntityLayout.Route = Route;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AA0EA,MAAM,OAAU,GAAA,kCAAA;AAEhB,MAAM,QAAiD,MAAM,IAAA;AAC7D,mBAAoB,CAAA,KAAA,EAAO,SAAS,IAAI,CAAA;AACxC,mBAAoB,CAAA,KAAA,EAAO,0BAA0B,IAAI,CAAA;AAEzD,SAAS,kBAAkB,KAGxB,EAAA;AACD,EAAM,MAAA,EAAE,M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KAAA,CAAA;AAAA,MAEtB,QAAU,EAAA,CAAA,MAAA,KAAU,eAAgB,CAAA,CAAA,QAAA,EAAW,MAAM,CAAE,CAAA,CAAA;AAAA,MACvD,IAAI,EAAA,IAAA;AAAA,MACJ,OAAA,EAAS,MAAM,eAAgB;AAAA;AAAA,GAInC,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,sBAAA;AAAA,IAAA;AAAA,MACC,IAAM,EAAA,sBAAA;AAAA,MACN,MAAA;AAAA,MACA,SAAW,EAAA,mBAAA;AAAA,MACX,OAAA,EAAS,MAAM,yBAAA,CAA0B,KAAK;AAAA;AAAA,GAElD,CAAA;AAEJ;AAEA,YAAA,CAAa,KAAQ,GAAA,KAAA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog",
3
- "version": "1.26.2-next.1",
3
+ "version": "1.27.0-next.2",
4
4
  "description": "The Backstage plugin for browsing the Backstage catalog",
5
5
  "backstage": {
6
6
  "role": "frontend-plugin",
@@ -11,7 +11,10 @@
11
11
  "@backstage/plugin-catalog-common",
12
12
  "@backstage/plugin-catalog-node",
13
13
  "@backstage/plugin-catalog-react"
14
- ]
14
+ ],
15
+ "features": {
16
+ "./alpha": "@backstage/FrontendPlugin"
17
+ }
15
18
  },
16
19
  "publishConfig": {
17
20
  "access": "public"
@@ -69,18 +72,18 @@
69
72
  "dependencies": {
70
73
  "@backstage/catalog-client": "1.9.1",
71
74
  "@backstage/catalog-model": "1.7.3",
72
- "@backstage/core-compat-api": "0.3.6-next.1",
73
- "@backstage/core-components": "0.16.4-next.0",
75
+ "@backstage/core-compat-api": "0.3.6-next.2",
76
+ "@backstage/core-components": "0.16.4-next.1",
74
77
  "@backstage/core-plugin-api": "1.10.4-next.0",
75
78
  "@backstage/errors": "1.2.7",
76
- "@backstage/frontend-plugin-api": "0.9.5-next.1",
79
+ "@backstage/frontend-plugin-api": "0.9.5-next.2",
77
80
  "@backstage/integration-react": "1.2.4-next.0",
78
81
  "@backstage/plugin-catalog-common": "1.1.3",
79
- "@backstage/plugin-catalog-react": "1.15.2-next.1",
82
+ "@backstage/plugin-catalog-react": "1.15.2-next.2",
80
83
  "@backstage/plugin-permission-react": "0.4.31-next.0",
81
84
  "@backstage/plugin-scaffolder-common": "1.5.9",
82
85
  "@backstage/plugin-search-common": "1.2.17",
83
- "@backstage/plugin-search-react": "1.8.6-next.1",
86
+ "@backstage/plugin-search-react": "1.8.6-next.2",
84
87
  "@backstage/types": "1.2.1",
85
88
  "@material-ui/core": "^4.12.2",
86
89
  "@material-ui/icons": "^4.9.1",
@@ -95,10 +98,10 @@
95
98
  "zen-observable": "^0.10.0"
96
99
  },
97
100
  "devDependencies": {
98
- "@backstage/cli": "0.30.0-next.1",
101
+ "@backstage/cli": "0.30.0-next.2",
99
102
  "@backstage/core-app-api": "1.15.5-next.0",
100
- "@backstage/dev-utils": "1.1.7-next.1",
101
- "@backstage/frontend-test-utils": "0.2.6-next.1",
103
+ "@backstage/dev-utils": "1.1.7-next.2",
104
+ "@backstage/frontend-test-utils": "0.2.6-next.2",
102
105
  "@backstage/plugin-permission-common": "0.8.4",
103
106
  "@backstage/test-utils": "1.7.5-next.0",
104
107
  "@testing-library/dom": "^10.0.0",