@backstage/plugin-catalog 2.0.9-next.0 → 2.0.9-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.
Files changed (34) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/alpha/components/CatalogEntityPage.esm.js +46 -0
  3. package/dist/alpha/components/CatalogEntityPage.esm.js.map +1 -0
  4. package/dist/alpha/components/CatalogOverviewPage.esm.js +22 -0
  5. package/dist/alpha/components/CatalogOverviewPage.esm.js.map +1 -0
  6. package/dist/alpha/components/EntityContextMenu/EntityContextMenu.esm.js +1 -1
  7. package/dist/alpha/components/EntityContextMenu/EntityContextMenu.esm.js.map +1 -1
  8. package/dist/alpha/entityContents.esm.js +13 -43
  9. package/dist/alpha/entityContents.esm.js.map +1 -1
  10. package/dist/alpha/entityIconLinks.esm.js +1 -1
  11. package/dist/alpha/entityIconLinks.esm.js.map +1 -1
  12. package/dist/alpha/pages.esm.js +14 -44
  13. package/dist/alpha/pages.esm.js.map +1 -1
  14. package/dist/components/AboutCard/AboutCard.esm.js +4 -19
  15. package/dist/components/AboutCard/AboutCard.esm.js.map +1 -1
  16. package/dist/components/AboutCard/useCatalogSourceIconLinkProps.esm.js +25 -0
  17. package/dist/components/AboutCard/useCatalogSourceIconLinkProps.esm.js.map +1 -0
  18. package/dist/components/CatalogExportButton/CatalogExportButton.esm.js +1 -5
  19. package/dist/components/CatalogExportButton/CatalogExportButton.esm.js.map +1 -1
  20. package/dist/components/CatalogExportButton/CatalogExportType.esm.js +8 -0
  21. package/dist/components/CatalogExportButton/CatalogExportType.esm.js.map +1 -0
  22. package/dist/components/CatalogExportButton/file-download/useStreamingExport.esm.js +1 -1
  23. package/dist/components/CatalogExportButton/file-download/useStreamingExport.esm.js.map +1 -1
  24. package/dist/components/CatalogPage/DefaultCatalogPage.esm.js +1 -1
  25. package/dist/components/CatalogPage/DefaultCatalogPage.esm.js.map +1 -1
  26. package/dist/components/CatalogTable/CatalogTable.esm.js +1 -1
  27. package/dist/components/CatalogTable/CatalogTable.esm.js.map +1 -1
  28. package/dist/components/EntitySwitch/EntitySwitch.esm.js +1 -1
  29. package/dist/index.d.ts +8 -8
  30. package/dist/plugin.esm.js.map +1 -1
  31. package/dist/plugins/catalog/package.json.esm.js +1 -1
  32. package/package.json +21 -21
  33. package/dist/alpha/components/EntityLayout/index.esm.js +0 -2
  34. package/dist/alpha/components/EntityLayout/index.esm.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,46 @@
1
1
  # @backstage/plugin-catalog
2
2
 
3
+ ## 2.0.9-next.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 4611178: Add support for legacy props in catalog entity card exports by widening the public TypeScript prop types. This ensures compatibility for consumers still using legacy properties such as `variant` and `columns`.
8
+ - acc6666: Fixed entity context menus to report errors from contributed items without disrupting the menu.
9
+ - Updated dependencies
10
+ - @backstage/plugin-catalog-common@1.2.0-next.0
11
+ - @backstage/ui@0.18.0-next.2
12
+ - @backstage/catalog-client@1.16.2-next.1
13
+ - @backstage/plugin-catalog-react@3.2.3-next.2
14
+ - @backstage/core-components@0.18.14-next.2
15
+ - @backstage/core-plugin-api@1.12.10-next.1
16
+ - @backstage/frontend-plugin-api@0.18.1-next.1
17
+ - @backstage/integration-react@1.2.22-next.1
18
+ - @backstage/plugin-permission-react@0.5.5-next.1
19
+ - @backstage/plugin-techdocs-react@1.3.15-next.2
20
+ - @backstage/plugin-scaffolder-common@2.3.0-next.2
21
+ - @backstage/plugin-search-common@1.2.25-next.0
22
+ - @backstage/plugin-search-react@1.11.8-next.2
23
+
24
+ ## 2.0.9-next.1
25
+
26
+ ### Patch Changes
27
+
28
+ - e3781a3: Fixed circular dependency warnings when building the catalog plugin.
29
+ - d421187: Reduced the initial app bundle size by loading page and optional UI implementations only when their extensions render.
30
+ - Updated dependencies
31
+ - @backstage/core-components@0.18.14-next.1
32
+ - @backstage/plugin-scaffolder-common@2.3.0-next.1
33
+ - @backstage/frontend-plugin-api@0.18.1-next.0
34
+ - @backstage/plugin-catalog-react@3.2.3-next.1
35
+ - @backstage/ui@0.18.0-next.1
36
+ - @backstage/integration-react@1.2.22-next.0
37
+ - @backstage/core-compat-api@0.5.15-next.1
38
+ - @backstage/core-plugin-api@1.12.10-next.0
39
+ - @backstage/plugin-search-react@1.11.8-next.1
40
+ - @backstage/plugin-techdocs-react@1.3.15-next.1
41
+ - @backstage/catalog-client@1.16.2-next.0
42
+ - @backstage/plugin-permission-react@0.5.5-next.0
43
+
3
44
  ## 2.0.9-next.0
4
45
 
5
46
  ### Patch Changes
@@ -0,0 +1,46 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { stringifyEntityRef } from '@backstage/catalog-model';
3
+ import { useRouteRefParams } from '@backstage/core-plugin-api';
4
+ import { entityRouteRef, AsyncEntityProvider } from '@backstage/plugin-catalog-react';
5
+ import { useEntityFromUrl } from '../../components/CatalogEntityPage/useEntityFromUrl.esm.js';
6
+ import { EntityLayout } from './EntityLayout/EntityLayout.esm.js';
7
+ import { EntityLayoutBui } from './EntityLayout/EntityLayoutBui.esm.js';
8
+
9
+ function CatalogEntityPage(props) {
10
+ const routeParams = useRouteRefParams(entityRouteRef);
11
+ const entityFromUrl = useEntityFromUrl();
12
+ const matchesRoute = !!entityFromUrl.entity && stringifyEntityRef(entityFromUrl.entity) === stringifyEntityRef(routeParams);
13
+ const entity = matchesRoute ? entityFromUrl.entity : void 0;
14
+ const entityProviderProps = {
15
+ ...entityFromUrl,
16
+ entity,
17
+ loading: entityFromUrl.loading || !!entityFromUrl.entity && !matchesRoute
18
+ };
19
+ const filteredMenuItems = entity ? props.menuItems.filter((item) => item.filter(entity)).map(({ data, node }) => ({ data, node })) : [];
20
+ const HeaderComponent = entity ? props.headerLayouts.find((layout2) => layout2.filter(entity))?.Component : void 0;
21
+ const legacyHeader = entity ? props.headers.find((header) => header.filter(entity))?.element : void 0;
22
+ const layout = HeaderComponent || !legacyHeader ? /* @__PURE__ */ jsx(
23
+ EntityLayoutBui,
24
+ {
25
+ routes: props.routes,
26
+ HeaderComponent,
27
+ contextMenuItems: filteredMenuItems,
28
+ groupDefinitions: props.groupDefinitions,
29
+ defaultContentOrder: props.defaultContentOrder
30
+ }
31
+ ) : /* @__PURE__ */ jsx(
32
+ EntityLayout,
33
+ {
34
+ routes: props.routes,
35
+ header: legacyHeader,
36
+ contextMenuItems: filteredMenuItems,
37
+ groupDefinitions: props.groupDefinitions,
38
+ defaultContentOrder: props.defaultContentOrder,
39
+ showNavItemIcons: props.showNavItemIcons
40
+ }
41
+ );
42
+ return /* @__PURE__ */ jsx(AsyncEntityProvider, { ...entityProviderProps, children: layout });
43
+ }
44
+
45
+ export { CatalogEntityPage };
46
+ //# sourceMappingURL=CatalogEntityPage.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CatalogEntityPage.esm.js","sources":["../../../src/alpha/components/CatalogEntityPage.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { ComponentType, ReactElement } from 'react';\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { useRouteRefParams } from '@backstage/core-plugin-api';\nimport {\n AsyncEntityProvider,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport {\n type EntityContentGroupDefinitions,\n type EntityHeaderLayoutProps,\n} from '@backstage/plugin-catalog-react/alpha';\nimport { useEntityFromUrl } from '../../components/CatalogEntityPage/useEntityFromUrl';\nimport { EntityLayout } from './EntityLayout';\nimport { EntityLayoutBui } from './EntityLayout/EntityLayoutBui';\nimport type { EntityLayoutRoute } from './EntityLayout/entityLayoutRoutes';\nimport type { EntityContextMenuItemDataWithNode } from './EntityContextMenu';\n\nexport interface CatalogEntityPageProps {\n menuItems: Array<\n EntityContextMenuItemDataWithNode & { filter: (entity: Entity) => boolean }\n >;\n headerLayouts: Array<{\n Component: ComponentType<EntityHeaderLayoutProps>;\n filter: (entity: Entity) => boolean;\n }>;\n headers: Array<{\n element?: ReactElement;\n filter: (entity: Entity) => boolean;\n }>;\n routes: EntityLayoutRoute[];\n groupDefinitions: EntityContentGroupDefinitions;\n defaultContentOrder: 'title' | 'natural';\n showNavItemIcons: boolean;\n}\n\nexport function CatalogEntityPage(props: CatalogEntityPageProps) {\n const routeParams = useRouteRefParams(entityRouteRef);\n const entityFromUrl = useEntityFromUrl();\n const matchesRoute =\n !!entityFromUrl.entity &&\n stringifyEntityRef(entityFromUrl.entity) ===\n stringifyEntityRef(routeParams);\n const entity = matchesRoute ? entityFromUrl.entity : undefined;\n const entityProviderProps = {\n ...entityFromUrl,\n entity,\n loading: entityFromUrl.loading || (!!entityFromUrl.entity && !matchesRoute),\n };\n const filteredMenuItems = entity\n ? props.menuItems\n .filter(item => item.filter(entity))\n .map(({ data, node }) => ({ data, node }))\n : [];\n\n const HeaderComponent = entity\n ? props.headerLayouts.find(layout => layout.filter(entity))?.Component\n : undefined;\n const legacyHeader = entity\n ? props.headers.find(header => header.filter(entity))?.element\n : undefined;\n\n const layout =\n HeaderComponent || !legacyHeader ? (\n <EntityLayoutBui\n routes={props.routes}\n HeaderComponent={HeaderComponent}\n contextMenuItems={filteredMenuItems}\n groupDefinitions={props.groupDefinitions}\n defaultContentOrder={props.defaultContentOrder}\n />\n ) : (\n <EntityLayout\n routes={props.routes}\n header={legacyHeader}\n contextMenuItems={filteredMenuItems}\n groupDefinitions={props.groupDefinitions}\n defaultContentOrder={props.defaultContentOrder}\n showNavItemIcons={props.showNavItemIcons}\n />\n );\n\n return (\n <AsyncEntityProvider {...entityProviderProps}>{layout}</AsyncEntityProv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A;AAAA,MACd,eAAA;AAAA,MACA,gBAAA,EAAkB,iBAAA;AAAA,MAClB,kBAAkB,KAAA,CAAM,gBAAA;AAAA,MACxB,qBAAqB,KAAA,CAAM;AAAA;AAAA,GAC7B,mBAEA,GAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,QAAQ,KAAA,CAAM,MAAA;AAAA,MACd,MAAA,EAAQ,YAAA;AAAA,MACR,gBAAA,EAAkB,iBAAA;AAAA,MAClB,kBAAkB,KAAA,CAAM,gBAAA;AAAA,MACxB,qBAAqB,KAAA,CAAM,mBAAA;AAAA,MAC3B,kBAAkB,KAAA,CAAM;AAAA;AAAA,GAC1B;AAGJ,EAAA,uBACE,GAAA,CAAC,mBAAA,EAAA,EAAqB,GAAG,mBAAA,EAAsB,QAAA,EAAA,MAAA,EAAO,CAAA;AAE1D;;;;"}
@@ -0,0 +1,22 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { lazy } from 'react';
3
+ import { ExtensionBoundary } from '@backstage/frontend-plugin-api';
4
+ import { useEntity } from '@backstage/plugin-catalog-react';
5
+
6
+ const LazyDefaultLayoutComponent = lazy(
7
+ () => import('../DefaultEntityContentLayout.esm.js').then((m) => ({
8
+ default: m.DefaultEntityContentLayout
9
+ }))
10
+ );
11
+ function CatalogOverviewPage(props) {
12
+ const { entity } = useEntity();
13
+ const layout = props.layouts.find((item) => item.filter(entity));
14
+ const cards = props.cards.filter((card) => card.filter(entity));
15
+ if (layout) {
16
+ return /* @__PURE__ */ jsx(layout.Component, { cards });
17
+ }
18
+ return /* @__PURE__ */ jsx(ExtensionBoundary, { node: props.node, children: /* @__PURE__ */ jsx(LazyDefaultLayoutComponent, { cards }) });
19
+ }
20
+
21
+ export { CatalogOverviewPage };
22
+ //# sourceMappingURL=CatalogOverviewPage.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CatalogOverviewPage.esm.js","sources":["../../../src/alpha/components/CatalogOverviewPage.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { ComponentType, lazy as reactLazy, ReactElement } from 'react';\nimport { Entity } from '@backstage/catalog-model';\nimport {\n type AppNode,\n ExtensionBoundary,\n} from '@backstage/frontend-plugin-api';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport {\n type EntityCardType,\n type EntityContentLayoutProps,\n} from '@backstage/plugin-catalog-react/alpha';\n\nconst LazyDefaultLayoutComponent = reactLazy(() =>\n import('../DefaultEntityContentLayout').then(m => ({\n default: m.DefaultEntityContentLayout,\n })),\n);\n\nexport interface CatalogOverviewPageProps {\n node: AppNode;\n layouts: Array<{\n filter: (entity: Entity) => boolean;\n Component: ComponentType<EntityContentLayoutProps>;\n }>;\n cards: Array<{\n element: ReactElement;\n type?: EntityCardType;\n filter: (entity: Entity) => boolean;\n }>;\n}\n\nexport function CatalogOverviewPage(props: CatalogOverviewPageProps) {\n const { entity } = useEntity();\n const layout = props.layouts.find(item => item.filter(entity));\n const cards = props.cards.filter(card => card.filter(entity));\n\n if (layout) {\n return <layout.Component cards={cards} />;\n }\n\n return (\n <ExtensionBoundary node={props.node}>\n <LazyDefaultLayoutComponent cards={cards} />\n </ExtensionBoundary>\n );\n}\n"],"names":["reactLazy"],"mappings":";;;;;AA4BA,MAAM,0BAAA,GAA6BA,IAAA;AAAA,EAAU,MAC3C,OAAO,sCAA+B,CAAA,CAAE,KAAK,CAAA,CAAA,MAAM;AAAA,IACjD,SAAS,CAAA,CAAE;AAAA,GACb,CAAE;AACJ,CAAA;AAeO,SAAS,oBAAoB,KAAA,EAAiC;AACnE,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAU;AAC7B,EAAA,MAAM,MAAA,GAAS,MAAM,OAAA,CAAQ,IAAA,CAAK,UAAQ,IAAA,CAAK,MAAA,CAAO,MAAM,CAAC,CAAA;AAC7D,EAAA,MAAM,KAAA,GAAQ,MAAM,KAAA,CAAM,MAAA,CAAO,UAAQ,IAAA,CAAK,MAAA,CAAO,MAAM,CAAC,CAAA;AAE5D,EAAA,IAAI,MAAA,EAAQ;AACV,IAAA,uBAAO,GAAA,CAAC,MAAA,CAAO,SAAA,EAAP,EAAiB,KAAA,EAAc,CAAA;AAAA,EACzC;AAEA,EAAA,uBACE,GAAA,CAAC,qBAAkB,IAAA,EAAM,KAAA,CAAM,MAC7B,QAAA,kBAAA,GAAA,CAAC,0BAAA,EAAA,EAA2B,OAAc,CAAA,EAC5C,CAAA;AAEJ;;;;"}
@@ -29,7 +29,7 @@ function EntityContextMenuItemContent(props) {
29
29
  return /* @__PURE__ */ jsx(MenuItem, { iconStart: icon, onAction, isDisabled: disabled, children: title });
30
30
  }
31
31
  function EntityContextMenuItem(props) {
32
- return /* @__PURE__ */ jsx(ExtensionBoundary, { node: props.item.node, children: /* @__PURE__ */ jsx(EntityContextMenuItemContent, { data: props.item.data }) });
32
+ return /* @__PURE__ */ jsx(ExtensionBoundary, { node: props.item.node, errorPresentation: "error-api", children: /* @__PURE__ */ jsx(EntityContextMenuItemContent, { data: props.item.data }) });
33
33
  }
34
34
  function EntityContextMenu(props) {
35
35
  const { UNSTABLE_extraContextMenuItems, contextMenuItems } = props;
@@ -1 +1 @@
1
- {"version":3,"file":"EntityContextMenu.esm.js","sources":["../../../../src/alpha/components/EntityContextMenu/EntityContextMenu.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 type AppNode,\n ExtensionBoundary,\n IconComponent,\n useTranslationRef,\n} from '@backstage/frontend-plugin-api';\nimport type { EntityContextMenuItemData } from '@backstage/plugin-catalog-react/alpha';\nimport {\n ButtonIcon,\n Menu,\n MenuItem,\n MenuSeparator,\n MenuTrigger,\n} from '@backstage/ui';\nimport { RiMore2Line } from '@remixicon/react';\nimport { catalogTranslationRef } from '../../translation';\n\nexport type EntityContextMenuItemDataWithNode = {\n data: EntityContextMenuItemData;\n node: AppNode;\n};\n\nfunction EntityContextMenuItemContent(props: {\n data: EntityContextMenuItemData;\n}) {\n const { icon, useProps } = props.data;\n const { title, disabled, onClick, ...menuItemProps } = useProps();\n const onAction = onClick\n ? () => {\n const result = onClick();\n if (result) {\n // Prevent rejected async actions from becoming unhandled rejections.\n void result.catch(() => {});\n }\n }\n : undefined;\n\n if ('href' in menuItemProps) {\n return (\n <MenuItem\n iconStart={icon}\n href={menuItemProps.href}\n onAction={onAction}\n isDisabled={disabled}\n >\n {title}\n </MenuItem>\n );\n }\n\n return (\n <MenuItem iconStart={icon} onAction={onAction} isDisabled={disabled}>\n {title}\n </MenuItem>\n );\n}\n\nfunction EntityContextMenuItem(props: {\n item: EntityContextMenuItemDataWithNode;\n}) {\n return (\n <ExtensionBoundary node={props.item.node}>\n <EntityContextMenuItemContent data={props.item.data} />\n </ExtensionBoundary>\n );\n}\n\n/** @alpha */\nexport function EntityContextMenu(props: {\n UNSTABLE_extraContextMenuItems?: {\n title: string;\n Icon: IconComponent;\n onClick: () => void;\n }[];\n contextMenuItems?: EntityContextMenuItemDataWithNode[];\n}) {\n const { UNSTABLE_extraContextMenuItems, contextMenuItems } = props;\n const { t } = useTranslationRef(catalogTranslationRef);\n\n return (\n <MenuTrigger>\n <ButtonIcon\n variant=\"secondary\"\n icon={<RiMore2Line />}\n aria-label={t('entityContextMenu.moreButtonAriaLabel')}\n />\n <Menu placement=\"bottom end\">\n {UNSTABLE_extraContextMenuItems?.map((item, index) => (\n <MenuItem\n key={`${item.title}-${index}`}\n iconStart={<item.Icon />}\n onAction={() => item.onClick()}\n >\n {item.title}\n </MenuItem>\n ))}\n {UNSTABLE_extraContextMenuItems?.length && contextMenuItems?.length ? (\n <MenuSeparator />\n ) : null}\n {contextMenuItems?.map(item => (\n <EntityContextMenuItem key={item.node.spec.id} item={item} />\n ))}\n </Menu>\n </MenuTrigger>\n );\n}\n"],"names":[],"mappings":";;;;;;AAsCA,SAAS,6BAA6B,KAAA,EAEnC;AACD,EAAA,MAAM,EAAE,IAAA,EAAM,QAAA,EAAS,GAAI,KAAA,CAAM,IAAA;AACjC,EAAA,MAAM,EAAE,KAAA,EAAO,QAAA,EAAU,SAAS,GAAG,aAAA,KAAkB,QAAA,EAAS;AAChE,EAAA,MAAM,QAAA,GAAW,UACb,MAAM;AACJ,IAAA,MAAM,SAAS,OAAA,EAAQ;AACvB,IAAA,IAAI,MAAA,EAAQ;AAEV,MAAA,KAAK,MAAA,CAAO,MAAM,MAAM;AAAA,MAAC,CAAC,CAAA;AAAA,IAC5B;AAAA,EACF,CAAA,GACA,MAAA;AAEJ,EAAA,IAAI,UAAU,aAAA,EAAe;AAC3B,IAAA,uBACE,GAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,IAAA;AAAA,QACX,MAAM,aAAA,CAAc,IAAA;AAAA,QACpB,QAAA;AAAA,QACA,UAAA,EAAY,QAAA;AAAA,QAEX,QAAA,EAAA;AAAA;AAAA,KACH;AAAA,EAEJ;AAEA,EAAA,2BACG,QAAA,EAAA,EAAS,SAAA,EAAW,MAAM,QAAA,EAAoB,UAAA,EAAY,UACxD,QAAA,EAAA,KAAA,EACH,CAAA;AAEJ;AAEA,SAAS,sBAAsB,KAAA,EAE5B;AACD,EAA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A,EAAA,EAA8C,QAAnB,IAAA,CAAK,IAAA,CAAK,IAAA,CAAK,EAAgB,CAC5D;AAAA,KAAA,EACH;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"EntityContextMenu.esm.js","sources":["../../../../src/alpha/components/EntityContextMenu/EntityContextMenu.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 type AppNode,\n ExtensionBoundary,\n IconComponent,\n useTranslationRef,\n} from '@backstage/frontend-plugin-api';\nimport type { EntityContextMenuItemData } from '@backstage/plugin-catalog-react/alpha';\nimport {\n ButtonIcon,\n Menu,\n MenuItem,\n MenuSeparator,\n MenuTrigger,\n} from '@backstage/ui';\nimport { RiMore2Line } from '@remixicon/react';\nimport { catalogTranslationRef } from '../../translation';\n\nexport type EntityContextMenuItemDataWithNode = {\n data: EntityContextMenuItemData;\n node: AppNode;\n};\n\nfunction EntityContextMenuItemContent(props: {\n data: EntityContextMenuItemData;\n}) {\n const { icon, useProps } = props.data;\n const { title, disabled, onClick, ...menuItemProps } = useProps();\n const onAction = onClick\n ? () => {\n const result = onClick();\n if (result) {\n // Prevent rejected async actions from becoming unhandled rejections.\n void result.catch(() => {});\n }\n }\n : undefined;\n\n if ('href' in menuItemProps) {\n return (\n <MenuItem\n iconStart={icon}\n href={menuItemProps.href}\n onAction={onAction}\n isDisabled={disabled}\n >\n {title}\n </MenuItem>\n );\n }\n\n return (\n <MenuItem iconStart={icon} onAction={onAction} isDisabled={disabled}>\n {title}\n </MenuItem>\n );\n}\n\nfunction EntityContextMenuItem(props: {\n item: EntityContextMenuItemDataWithNode;\n}) {\n return (\n <ExtensionBoundary node={props.item.node} errorPresentation=\"error-api\">\n <EntityContextMenuItemContent data={props.item.data} />\n </ExtensionBoundary>\n );\n}\n\n/** @alpha */\nexport function EntityContextMenu(props: {\n UNSTABLE_extraContextMenuItems?: {\n title: string;\n Icon: IconComponent;\n onClick: () => void;\n }[];\n contextMenuItems?: EntityContextMenuItemDataWithNode[];\n}) {\n const { UNSTABLE_extraContextMenuItems, contextMenuItems } = props;\n const { t } = useTranslationRef(catalogTranslationRef);\n\n return (\n <MenuTrigger>\n <ButtonIcon\n variant=\"secondary\"\n icon={<RiMore2Line />}\n aria-label={t('entityContextMenu.moreButtonAriaLabel')}\n />\n <Menu placement=\"bottom end\">\n {UNSTABLE_extraContextMenuItems?.map((item, index) => (\n <MenuItem\n key={`${item.title}-${index}`}\n iconStart={<item.Icon />}\n onAction={() => item.onClick()}\n >\n {item.title}\n </MenuItem>\n ))}\n {UNSTABLE_extraContextMenuItems?.length && contextMenuItems?.length ? (\n <MenuSeparator />\n ) : null}\n {contextMenuItems?.map(item => (\n <EntityContextMenuItem key={item.node.spec.id} item={item} />\n ))}\n </Menu>\n </MenuTrigger>\n );\n}\n"],"names":[],"mappings":";;;;;;AAsCA,SAAS,6BAA6B,KAAA,EAEnC;AACD,EAAA,MAAM,EAAE,IAAA,EAAM,QAAA,EAAS,GAAI,KAAA,CAAM,IAAA;AACjC,EAAA,MAAM,EAAE,KAAA,EAAO,QAAA,EAAU,SAAS,GAAG,aAAA,KAAkB,QAAA,EAAS;AAChE,EAAA,MAAM,QAAA,GAAW,UACb,MAAM;AACJ,IAAA,MAAM,SAAS,OAAA,EAAQ;AACvB,IAAA,IAAI,MAAA,EAAQ;AAEV,MAAA,KAAK,MAAA,CAAO,MAAM,MAAM;AAAA,MAAC,CAAC,CAAA;AAAA,IAC5B;AAAA,EACF,CAAA,GACA,MAAA;AAEJ,EAAA,IAAI,UAAU,aAAA,EAAe;A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A,CAAK,IAAA,EAAL,EAAU,CAAA;AAAA,UACtB,QAAA,EAAU,MAAM,IAAA,CAAK,OAAA,EAAQ;AAAA,UAE5B,QAAA,EAAA,IAAA,CAAK;AAAA,SAAA;AAAA,QAJD,CAAA,EAAG,IAAA,CAAK,KAAK,CAAA,CAAA,EAAI,KAAK,CAAA;AAAA,OAM9B,CAAA;AAAA,MACA,gCAAgC,MAAA,IAAU,gBAAA,EAAkB,MAAA,mBAC3D,GAAA,CAAC,iBAAc,CAAA,GACb,IAAA;AAAA,MACH,gBAAA,EAAkB,GAAA,CAAI,CAAA,IAAA,qBACrB,GAAA,CAAC,qBAAA,EAAA,EAA8C,QAAnB,IAAA,CAAK,IAAA,CAAK,IAAA,CAAK,EAAgB,CAC5D;AAAA,KAAA,EACH;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
@@ -1,9 +1,7 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
- import { lazy } from 'react';
3
- import { coreExtensionData, createExtensionInput, ExtensionBoundary } from '@backstage/frontend-plugin-api';
2
+ import { coreExtensionData, createExtensionInput } from '@backstage/frontend-plugin-api';
4
3
  import { EntityContentBlueprint, EntityContentLayoutBlueprint, EntityCardBlueprint } from '@backstage/plugin-catalog-react/alpha';
5
4
  import { buildFilterFn } from './filter/FilterWrapper.esm.js';
6
- import { useEntity } from '@backstage/plugin-catalog-react';
7
5
 
8
6
  const catalogOverviewEntityContent = EntityContentBlueprint.makeWithOverrides({
9
7
  name: "overview",
@@ -26,33 +24,18 @@ const catalogOverviewEntityContent = EntityContentBlueprint.makeWithOverrides({
26
24
  title: "Overview",
27
25
  group: "overview",
28
26
  loader: async () => {
29
- const LazyDefaultLayoutComponent = lazy(
30
- () => import('./DefaultEntityContentLayout.esm.js').then((m) => ({
31
- default: m.DefaultEntityContentLayout
32
- }))
33
- );
34
- const DefaultLayoutComponent = (props) => {
35
- return /* @__PURE__ */ jsx(ExtensionBoundary, { node, children: /* @__PURE__ */ jsx(LazyDefaultLayoutComponent, { ...props }) });
36
- };
37
- const layouts = [
38
- ...inputs.layouts.map((layout) => ({
39
- filter: buildFilterFn(
40
- layout.get(
41
- EntityContentLayoutBlueprint.dataRefs.filterFunction
42
- ),
43
- layout.get(
44
- EntityContentLayoutBlueprint.dataRefs.filterExpression
45
- )
46
- ),
47
- Component: layout.get(
48
- EntityContentLayoutBlueprint.dataRefs.component
27
+ const { CatalogOverviewPage } = await import('./components/CatalogOverviewPage.esm.js');
28
+ const layouts = inputs.layouts.map((layout) => ({
29
+ filter: buildFilterFn(
30
+ layout.get(EntityContentLayoutBlueprint.dataRefs.filterFunction),
31
+ layout.get(
32
+ EntityContentLayoutBlueprint.dataRefs.filterExpression
49
33
  )
50
- })),
51
- {
52
- filter: buildFilterFn(),
53
- Component: DefaultLayoutComponent
54
- }
55
- ];
34
+ ),
35
+ Component: layout.get(
36
+ EntityContentLayoutBlueprint.dataRefs.component
37
+ )
38
+ }));
56
39
  const cards = inputs.cards.map((card) => ({
57
40
  element: card.get(coreExtensionData.reactElement),
58
41
  type: card.get(EntityCardBlueprint.dataRefs.type),
@@ -61,20 +44,7 @@ const catalogOverviewEntityContent = EntityContentBlueprint.makeWithOverrides({
61
44
  card.get(EntityContentBlueprint.dataRefs.filterExpression)
62
45
  )
63
46
  }));
64
- const Component = () => {
65
- const { entity } = useEntity();
66
- const layout = layouts.find((l) => l.filter(entity));
67
- if (!layout) {
68
- throw new Error("No layout found for entity");
69
- }
70
- return /* @__PURE__ */ jsx(
71
- layout.Component,
72
- {
73
- cards: cards.filter((card) => card.filter(entity))
74
- }
75
- );
76
- };
77
- return /* @__PURE__ */ jsx(Component, {});
47
+ return /* @__PURE__ */ jsx(CatalogOverviewPage, { node, layouts, cards });
78
48
  }
79
49
  });
80
50
  }
@@ -1 +1 @@
1
- {"version":3,"file":"entityContents.esm.js","sources":["../../src/alpha/entityContents.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 { lazy as reactLazy } from 'react';\nimport {\n coreExtensionData,\n createExtensionInput,\n ExtensionBoundary,\n} from '@backstage/frontend-plugin-api';\nimport {\n EntityCardBlueprint,\n EntityContentBlueprint,\n EntityContentLayoutBlueprint,\n EntityContentLayoutProps,\n} from '@backstage/plugin-catalog-react/alpha';\nimport { buildFilterFn } from './filter/FilterWrapper';\nimport { useEntity } from '@backstage/plugin-catalog-react';\n\nexport const catalogOverviewEntityContent =\n EntityContentBlueprint.makeWithOverrides({\n name: 'overview',\n inputs: {\n layouts: createExtensionInput([\n EntityContentLayoutBlueprint.dataRefs.filterFunction.optional(),\n EntityContentLayoutBlueprint.dataRefs.filterExpression.optional(),\n EntityContentLayoutBlueprint.dataRefs.component,\n ]),\n cards: createExtensionInput([\n coreExtensionData.reactElement,\n EntityContentBlueprint.dataRefs.filterFunction.optional(),\n EntityContentBlueprint.dataRefs.filterExpression.optional(),\n EntityCardBlueprint.dataRefs.type.optional(),\n ]),\n },\n factory: (originalFactory, { node, inputs }) => {\n return originalFactory({\n path: '/',\n title: 'Overview',\n group: 'overview',\n loader: async () => {\n const LazyDefaultLayoutComponent = reactLazy(() =>\n import('./DefaultEntityContentLayout').then(m => ({\n default: m.DefaultEntityContentLayout,\n })),\n );\n\n const DefaultLayoutComponent = (props: EntityContentLayoutProps) => {\n return (\n <ExtensionBoundary node={node}>\n <LazyDefaultLayoutComponent {...props} />\n </ExtensionBoundary>\n );\n };\n\n const layouts = [\n ...inputs.layouts.map(layout => ({\n filter: buildFilterFn(\n layout.get(\n EntityContentLayoutBlueprint.dataRefs.filterFunction,\n ),\n layout.get(\n EntityContentLayoutBlueprint.dataRefs.filterExpression,\n ),\n ),\n Component: layout.get(\n EntityContentLayoutBlueprint.dataRefs.component,\n ),\n })),\n {\n filter: buildFilterFn(),\n Component: DefaultLayoutComponent,\n },\n ];\n\n const cards = inputs.cards.map(card => ({\n element: card.get(coreExtensionData.reactElement),\n type: card.get(EntityCardBlueprint.dataRefs.type),\n filter: buildFilterFn(\n card.get(EntityContentBlueprint.dataRefs.filterFunction),\n card.get(EntityContentBlueprint.dataRefs.filterExpression),\n ),\n }));\n\n const Component = () => {\n const { entity } = useEntity();\n\n // Use the first layout that matches the entity filter\n const layout = layouts.find(l => l.filter(entity));\n if (!layout) {\n throw new Error('No layout found for entity'); // Shouldn't be able to happen\n }\n\n return (\n <layout.Component\n cards={cards.filter(card => card.filter(entity))}\n />\n );\n };\n\n return <Component />;\n },\n });\n },\n });\n\nexport default [catalogOverviewEntityContent];\n"],"names":["reactLazy"],"mappings":";;;;;;;AA+BO,MAAM,4BAAA,GACX,uBAAuB,iBAAA,CAAkB;AAAA,EACvC,IAAA,EAAM,UAAA;AAAA,EACN,MAAA,EAAQ;AAAA,IACN,SAAS,oBAAA,CAAqB;AAAA,MAC5B,4BAAA,CAA6B,QAAA,CAAS,cAAA,CAAe,QAAA,EAAS;AAAA,MAC9D,4BAAA,CAA6B,QAAA,CAAS,gBAAA,CAAiB,QAAA,EAAS;AAAA,MAChE,6BAA6B,QAAA,CAAS;AAAA,KACvC,CAAA;AAAA,IACD,OAAO,oBAAA,CAAqB;AAAA,MAC1B,iBAAA,CAAkB,YAAA;AAAA,MAClB,sBAAA,CAAuB,QAAA,CAAS,cAAA,CAAe,QAAA,EAAS;AAAA,MACxD,sBAAA,CAAuB,QAAA,CAAS,gBAAA,CAAiB,QAAA,EAAS;AAAA,MAC1D,mBAAA,CAAoB,QAAA,CAAS,IAAA,CAAK,QAAA;AAAS,KAC5C;AAAA,GACH;AAAA,EACA,SAAS,CAAC,eAAA,EAAiB,EAAE,IAAA,EAAM,QA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AAA;AAAA,YACN,IAAA,CAAK,GAAA,CAAI,sBAAA,CAAuB,QAAA,CAAS,cAAc,CAAA;AAAA,YACvD,IAAA,CAAK,GAAA,CAAI,sBAAA,CAAuB,QAAA,CAAS,gBAAgB;AAAA;AAC3D,SACF,CAAE,CAAA;AAEF,QAAA,MAAM,YAAY,MAAM;AACtB,UAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAU;AAG7B,UAAA,MAAM,SAAS,OAAA,CAAQ,IAAA,CAAK,OAAK,CAAA,CAAE,MAAA,CAAO,MAAM,CAAC,CAAA;AACjD,UAAA,IAAI,CAAC,MAAA,EAAQ;AACX,YAAA,MAAM,IAAI,MAAM,4BAA4B,CAAA;AAAA,UAC9C;AAEA,UAAA,uBACE,GAAA;AAAA,YAAC,MAAA,CAAO,SAAA;AAAA,YAAP;AAAA,cACC,OAAO,KAAA,CAAM,MAAA,CAAO,UAAQ,IAAA,CAAK,MAAA,CAAO,MAAM,CAAC;AAAA;AAAA,WACjD;AAAA,QAEJ,CAAA;AAEA,QAAA,2BAAQ,SAAA,EAAA,EAAU,CAAA;AAAA,MACpB;AAAA,KACD,CAAA;AAAA,EACH;AACF,CAAC;AAEH,qBAAe,CAAC,4BAA4B,CAAA;;;;"}
1
+ {"version":3,"file":"entityContents.esm.js","sources":["../../src/alpha/entityContents.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 coreExtensionData,\n createExtensionInput,\n} from '@backstage/frontend-plugin-api';\nimport {\n EntityCardBlueprint,\n EntityContentBlueprint,\n EntityContentLayoutBlueprint,\n} from '@backstage/plugin-catalog-react/alpha';\nimport { buildFilterFn } from './filter/FilterWrapper';\n\nexport const catalogOverviewEntityContent =\n EntityContentBlueprint.makeWithOverrides({\n name: 'overview',\n inputs: {\n layouts: createExtensionInput([\n EntityContentLayoutBlueprint.dataRefs.filterFunction.optional(),\n EntityContentLayoutBlueprint.dataRefs.filterExpression.optional(),\n EntityContentLayoutBlueprint.dataRefs.component,\n ]),\n cards: createExtensionInput([\n coreExtensionData.reactElement,\n EntityContentBlueprint.dataRefs.filterFunction.optional(),\n EntityContentBlueprint.dataRefs.filterExpression.optional(),\n EntityCardBlueprint.dataRefs.type.optional(),\n ]),\n },\n factory: (originalFactory, { node, inputs }) => {\n return originalFactory({\n path: '/',\n title: 'Overview',\n group: 'overview',\n loader: async () => {\n const { CatalogOverviewPage } = await import(\n './components/CatalogOverviewPage'\n );\n const layouts = inputs.layouts.map(layout => ({\n filter: buildFilterFn(\n layout.get(EntityContentLayoutBlueprint.dataRefs.filterFunction),\n layout.get(\n EntityContentLayoutBlueprint.dataRefs.filterExpression,\n ),\n ),\n Component: layout.get(\n EntityContentLayoutBlueprint.dataRefs.component,\n ),\n }));\n\n const cards = inputs.cards.map(card => ({\n element: card.get(coreExtensionData.reactElement),\n type: card.get(EntityCardBlueprint.dataRefs.type),\n filter: buildFilterFn(\n card.get(EntityContentBlueprint.dataRefs.filterFunction),\n card.get(EntityContentBlueprint.dataRefs.filterExpression),\n ),\n }));\n\n return (\n <CatalogOverviewPage node={node} layouts={layouts} cards={cards} />\n );\n },\n });\n },\n });\n\nexport default [catalogOverviewEntityContent];\n"],"names":[],"mappings":";;;;;AA2BO,MAAM,4BAAA,GACX,uBAAuB,iBAAA,CAAkB;AAAA,EACvC,IAAA,EAAM,UAAA;AAAA,EACN,MAAA,EAAQ;AAAA,IACN,SAAS,oBAAA,CAAqB;AAAA,MAC5B,4BAAA,CAA6B,QAAA,CAAS,cAAA,CAAe,QAAA,EAAS;AAAA,MAC9D,4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AAA,CAAoB,SAAS,IAAI,CAAA;AAAA,UAChD,MAAA,EAAQ,aAAA;AAAA,YACN,IAAA,CAAK,GAAA,CAAI,sBAAA,CAAuB,QAAA,CAAS,cAAc,CAAA;AAAA,YACvD,IAAA,CAAK,GAAA,CAAI,sBAAA,CAAuB,QAAA,CAAS,gBAAgB;AAAA;AAC3D,SACF,CAAE,CAAA;AAEF,QAAA,uBACE,GAAA,CAAC,mBAAA,EAAA,EAAoB,IAAA,EAAY,OAAA,EAAkB,KAAA,EAAc,CAAA;AAAA,MAErE;AAAA,KACD,CAAA;AAAA,EACH;AACF,CAAC;AAEH,qBAAe,CAAC,4BAA4B,CAAA;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { EntityIconLinkBlueprint } from '@backstage/plugin-catalog-react/alpha';
2
- import { useCatalogSourceIconLinkProps } from '../components/AboutCard/AboutCard.esm.js';
2
+ import { useCatalogSourceIconLinkProps } from '../components/AboutCard/useCatalogSourceIconLinkProps.esm.js';
3
3
 
4
4
  const catalogViewSourceEntityIconLink = EntityIconLinkBlueprint.make({
5
5
  name: "view-source",
@@ -1 +1 @@
1
- {"version":3,"file":"entityIconLinks.esm.js","sources":["../../src/alpha/entityIconLinks.tsx"],"sourcesContent":["/*\n * Copyright 2025 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 { EntityIconLinkBlueprint } from '@backstage/plugin-catalog-react/alpha';\nimport { useCatalogSourceIconLinkProps } from '../components/AboutCard/AboutCard';\n\nconst catalogViewSourceEntityIconLink = EntityIconLinkBlueprint.make({\n name: 'view-source',\n params: {\n useProps: useCatalogSourceIconLinkProps,\n },\n});\n\nexport default [catalogViewSourceEntityIconLink];\n"],"names":[],"mappings":";;;AAmBA,MAAM,+BAAA,GAAkC,wBAAwB,IAAA,CAAK;AAAA,EACnE,IAAA,EAAM,aAAA;AAAA,EACN,MAAA,EAAQ;AAAA,IACN,QAAA,EAAU;AAAA;AAEd,CAAC,CAAA;AAED,sBAAe,CAAC,+BAA+B,CAAA;;;;"}
1
+ {"version":3,"file":"entityIconLinks.esm.js","sources":["../../src/alpha/entityIconLinks.tsx"],"sourcesContent":["/*\n * Copyright 2025 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 { EntityIconLinkBlueprint } from '@backstage/plugin-catalog-react/alpha';\nimport { useCatalogSourceIconLinkProps } from '../components/AboutCard/useCatalogSourceIconLinkProps';\n\nconst catalogViewSourceEntityIconLink = EntityIconLinkBlueprint.make({\n name: 'view-source',\n params: {\n useProps: useCatalogSourceIconLinkProps,\n },\n});\n\nexport default [catalogViewSourceEntityIconLink];\n"],"names":[],"mappings":";;;AAmBA,MAAM,+BAAA,GAAkC,wBAAwB,IAAA,CAAK;AAAA,EACnE,IAAA,EAAM,aAAA;AAAA,EACN,MAAA,EAAQ;AAAA,IACN,QAAA,EAAU;AAAA;AAEd,CAAC,CAAA;AAED,sBAAe,CAAC,+BAA+B,CAAA;;;;"}
@@ -1,14 +1,11 @@
1
1
  import { jsx, Fragment } from 'react/jsx-runtime';
2
2
  import { convertLegacyRouteRef } from '@backstage/core-compat-api';
3
- import { stringifyEntityRef } from '@backstage/catalog-model';
4
- import { useRouteRefParams } from '@backstage/core-plugin-api';
5
3
  import { createExtensionDataRef, createExtensionBlueprint, PageBlueprint, coreExtensionData, createExtensionInput } from '@backstage/frontend-plugin-api';
6
4
  import { z } from 'zod/v4';
7
- import { entityRouteRef, AsyncEntityProvider } from '@backstage/plugin-catalog-react';
5
+ import { entityRouteRef } from '@backstage/plugin-catalog-react';
8
6
  import { EntityContextMenuItemBlueprint, EntityHeaderLayoutBlueprint, EntityHeaderBlueprint, defaultEntityContentGroupDefinitions, EntityContentBlueprint } from '@backstage/plugin-catalog-react/alpha';
9
7
  import CategoryIcon from '@material-ui/icons/Category';
10
8
  import { rootRouteRef } from '../routes.esm.js';
11
- import { useEntityFromUrl } from '../components/CatalogEntityPage/useEntityFromUrl.esm.js';
12
9
  import { buildFilterFn } from './filter/FilterWrapper.esm.js';
13
10
 
14
11
  const catalogExportConfigDataRef = createExtensionDataRef().with({
@@ -145,10 +142,7 @@ const catalogEntityPage = PageBlueprint.makeWithOverrides({
145
142
  routeRef: convertLegacyRouteRef(entityRouteRef),
146
143
  // READ THE ABOVE
147
144
  loader: async () => {
148
- const [{ EntityLayout }, { EntityLayoutBui }] = await Promise.all([
149
- import('./components/EntityLayout/index.esm.js'),
150
- import('./components/EntityLayout/EntityLayoutBui.esm.js')
151
- ]);
145
+ const { CatalogEntityPage } = await import('./components/CatalogEntityPage.esm.js');
152
146
  const menuItems = inputs.contextMenuItems.map((item) => ({
153
147
  data: item.get(EntityContextMenuItemBlueprint.dataRefs.data),
154
148
  node: item.node,
@@ -191,42 +185,18 @@ const catalogEntityPage = PageBlueprint.makeWithOverrides({
191
185
  ),
192
186
  children: output.get(coreExtensionData.reactElement)
193
187
  }));
194
- const Component = () => {
195
- const routeParams = useRouteRefParams(entityRouteRef);
196
- const entityFromUrl = useEntityFromUrl();
197
- const matchesRoute = !!entityFromUrl.entity && stringifyEntityRef(entityFromUrl.entity) === stringifyEntityRef(routeParams);
198
- const entity = matchesRoute ? entityFromUrl.entity : void 0;
199
- const entityProviderProps = {
200
- ...entityFromUrl,
201
- entity,
202
- loading: entityFromUrl.loading || !!entityFromUrl.entity && !matchesRoute
203
- };
204
- const filteredMenuItems = entity ? menuItems.filter((i) => i.filter(entity)).map(({ data, node }) => ({ data, node })) : [];
205
- const HeaderComponent = entity ? headerLayouts.find((layout2) => layout2.filter(entity))?.Component : void 0;
206
- const legacyHeader = entity ? headers.find((header) => header.filter(entity))?.element : void 0;
207
- const layout = HeaderComponent || !legacyHeader ? /* @__PURE__ */ jsx(
208
- EntityLayoutBui,
209
- {
210
- routes,
211
- HeaderComponent,
212
- contextMenuItems: filteredMenuItems,
213
- groupDefinitions,
214
- defaultContentOrder: config.defaultContentOrder
215
- }
216
- ) : /* @__PURE__ */ jsx(
217
- EntityLayout,
218
- {
219
- routes,
220
- header: legacyHeader,
221
- contextMenuItems: filteredMenuItems,
222
- groupDefinitions,
223
- defaultContentOrder: config.defaultContentOrder,
224
- showNavItemIcons: config.showNavItemIcons
225
- }
226
- );
227
- return /* @__PURE__ */ jsx(AsyncEntityProvider, { ...entityProviderProps, children: layout });
228
- };
229
- return /* @__PURE__ */ jsx(Component, {});
188
+ return /* @__PURE__ */ jsx(
189
+ CatalogEntityPage,
190
+ {
191
+ menuItems,
192
+ headerLayouts,
193
+ headers,
194
+ routes,
195
+ groupDefinitions,
196
+ defaultContentOrder: config.defaultContentOrder,
197
+ showNavItemIcons: config.showNavItemIcons
198
+ }
199
+ );
230
200
  }
231
201
  });
232
202
  }
@@ -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 { convertLegacyRouteRef } from '@backstage/core-compat-api';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport { useRouteRefParams } from '@backstage/core-plugin-api';\nimport {\n coreExtensionData,\n createExtensionInput,\n createExtensionDataRef,\n createExtensionBlueprint,\n PageBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport { z } from 'zod/v4';\nimport {\n AsyncEntityProvider,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport {\n defaultEntityContentGroupDefinitions,\n EntityContentBlueprint,\n EntityContextMenuItemBlueprint,\n EntityHeaderBlueprint,\n EntityHeaderLayoutBlueprint,\n EntityContentGroupDefinitions,\n} from '@backstage/plugin-catalog-react/alpha';\nimport CategoryIcon from '@material-ui/icons/Category';\nimport { rootRouteRef } from '../routes';\nimport { useEntityFromUrl } from '../components/CatalogEntityPage/useEntityFromUrl';\nimport { buildFilterFn } from './filter/FilterWrapper';\nimport type { CatalogExportSettings } from '../components/CatalogExportButton';\n\nconst catalogExportConfigDataRef = createExtensionDataRef<{\n exporters?: CatalogExportSettings['exporters'];\n columns?: CatalogExportSettings['columns'];\n onSuccess?: CatalogExportSettings['onSuccess'];\n onError?: CatalogExportSettings['onError'];\n}>().with({\n id: 'catalog.export-customization',\n});\n\n/**\n * Blueprint for creating catalog export configuration extensions.\n * @public\n */\nexport const CatalogExportConfigBlueprint = createExtensionBlueprint({\n kind: 'catalog-export-config',\n attachTo: { id: 'page:catalog', input: 'exportConfig' },\n output: [catalogExportConfigDataRef],\n factory(params: {\n exporters?: CatalogExportSettings['exporters'];\n columns?: CatalogExportSettings['columns'];\n onSuccess?: CatalogExportSettings['onSuccess'];\n onError?: CatalogExportSettings['onError'];\n }) {\n return [catalogExportConfigDataRef(params)];\n },\n});\n\nexport const catalogPage = PageBlueprint.makeWithOverrides({\n inputs: {\n filters: createExtensionInput([coreExtensionData.reactElement]),\n exportConfig: createExtensionInput([catalogExportConfigDataRef.optional()]),\n },\n configSchema: {\n pagination: 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 exportSettings: z\n .object({\n /** When true, displays the export button in the catalog interface. */\n enabled: z.boolean().optional(),\n /**\n * When true, hides the built-in CSV and JSON export options.\n * Useful when only custom exporters (provided via extensions) should be available.\n */\n disableBuiltinExporters: z.boolean().optional(),\n })\n .optional(),\n },\n factory(originalFactory, { inputs, config }) {\n return originalFactory({\n path: '/catalog',\n routeRef: rootRouteRef,\n icon: <CategoryIcon fontSize=\"inherit\" />,\n title: 'Catalog',\n loader: async () => {\n const { NfsDefaultCatalogPage } = await import(\n '../components/CatalogPage/DefaultCatalogPage'\n );\n const filters = inputs.filters.map(filter =>\n filter.get(coreExtensionData.reactElement),\n );\n\n // Merge export customizers from all attached extensions\n const mergedExportSettings: CatalogExportSettings = {\n ...config.exportSettings,\n };\n\n for (const exportConfigInput of inputs.exportConfig) {\n const data = exportConfigInput.get(catalogExportConfigDataRef);\n if (data) {\n if (data.exporters) {\n mergedExportSettings.exporters = {\n ...mergedExportSettings.exporters,\n ...data.exporters,\n };\n }\n if (data.columns && !mergedExportSettings.columns) {\n mergedExportSettings.columns = data.columns;\n }\n if (data.onSuccess && !mergedExportSettings.onSuccess) {\n mergedExportSettings.onSuccess = data.onSuccess;\n }\n if (data.onError && !mergedExportSettings.onError) {\n mergedExportSettings.onError = data.onError;\n }\n }\n }\n\n return (\n <NfsDefaultCatalogPage\n filters={<>{filters}</>}\n pagination={config.pagination}\n exportSettings={\n mergedExportSettings.enabled ? mergedExportSettings : undefined\n }\n />\n );\n },\n });\n },\n});\n\nexport const catalogEntityPage = PageBlueprint.makeWithOverrides({\n name: 'entity',\n inputs: {\n headerLayouts: createExtensionInput([\n EntityHeaderLayoutBlueprint.dataRefs.component,\n EntityHeaderLayoutBlueprint.dataRefs.filterFunction.optional(),\n ]),\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 EntityContentBlueprint.dataRefs.icon.optional(),\n ]),\n contextMenuItems: createExtensionInput([\n EntityContextMenuItemBlueprint.dataRefs.data,\n EntityContextMenuItemBlueprint.dataRefs.filterFunction.optional(),\n ]),\n },\n configSchema: {\n groups: z\n .array(\n z.record(\n z.string(),\n z.object({\n title: z.string(),\n icon: z.string().optional(),\n aliases: z.array(z.string()).optional(),\n contentOrder: z.enum(['title', 'natural']).optional(),\n }),\n ),\n )\n .optional(),\n defaultContentOrder: z\n .enum(['title', 'natural'])\n .optional()\n .default('title'),\n showNavItemIcons: z.boolean().optional().default(false),\n },\n factory(originalFactory, { config, inputs }) {\n return originalFactory({\n path: '/catalog/:namespace/:kind/:name',\n // NOTE: The `convertLegacyRouteRef` call here ensures that this route ref\n // is mutated to support the new frontend system. Removing this conversion\n // is a potentially breaking change since this is a singleton and the\n // route refs from `core-plugin-api` used to not support the new format.\n // This shouldn't be removed until we completely deprecate the\n // `core-compat-api` package.\n routeRef: convertLegacyRouteRef(entityRouteRef), // READ THE ABOVE\n loader: async () => {\n const [{ EntityLayout }, { EntityLayoutBui }] = await Promise.all([\n import('./components/EntityLayout'),\n import('./components/EntityLayout/EntityLayoutBui'),\n ]);\n\n const menuItems = inputs.contextMenuItems.map(item => ({\n data: item.get(EntityContextMenuItemBlueprint.dataRefs.data),\n node: item.node,\n filter:\n item.get(EntityContextMenuItemBlueprint.dataRefs.filterFunction) ??\n (() => true),\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 headerLayouts = inputs.headerLayouts\n .map(layout => {\n const filterFunction = layout.get(\n EntityHeaderLayoutBlueprint.dataRefs.filterFunction,\n );\n return {\n Component: layout.get(\n EntityHeaderLayoutBlueprint.dataRefs.component,\n ),\n filter: filterFunction ?? (() => true),\n hasFilter: Boolean(filterFunction),\n };\n })\n .sort((a, b) => Number(b.hasFilter) - Number(a.hasFilter));\n\n const headers = inputs.headers\n .map(header => {\n const filterFunction = header.get(\n EntityHeaderBlueprint.dataRefs.filterFunction,\n );\n return {\n element: header.get(EntityHeaderBlueprint.dataRefs.element),\n filter: filterFunction ?? (() => true),\n hasFilter: Boolean(filterFunction),\n };\n })\n .sort((a, b) => Number(b.hasFilter) - Number(a.hasFilter));\n\n const groupDefinitions =\n config.groups?.reduce(\n (rest, group) => ({ ...rest, ...group }),\n {} as EntityContentGroupDefinitions,\n ) ?? defaultEntityContentGroupDefinitions;\n\n const routes = inputs.contents.map(output => ({\n group: output.get(EntityContentBlueprint.dataRefs.group),\n path: output.get(coreExtensionData.routePath),\n title: output.get(EntityContentBlueprint.dataRefs.title),\n icon: output.get(EntityContentBlueprint.dataRefs.icon),\n if: buildFilterFn(\n output.get(EntityContentBlueprint.dataRefs.filterFunction),\n output.get(EntityContentBlueprint.dataRefs.filterExpression),\n ),\n children: output.get(coreExtensionData.reactElement),\n }));\n\n const Component = () => {\n const routeParams = useRouteRefParams(entityRouteRef);\n const entityFromUrl = useEntityFromUrl();\n const matchesRoute =\n !!entityFromUrl.entity &&\n stringifyEntityRef(entityFromUrl.entity) ===\n stringifyEntityRef(routeParams);\n const entity = matchesRoute ? entityFromUrl.entity : undefined;\n const entityProviderProps = {\n ...entityFromUrl,\n entity,\n loading:\n entityFromUrl.loading ||\n (!!entityFromUrl.entity && !matchesRoute),\n };\n const filteredMenuItems = entity\n ? menuItems\n .filter(i => i.filter(entity))\n .map(({ data, node }) => ({ data, node }))\n : [];\n\n const HeaderComponent = entity\n ? headerLayouts.find(layout => layout.filter(entity))?.Component\n : undefined;\n const legacyHeader = entity\n ? headers.find(header => header.filter(entity))?.element\n : undefined;\n\n const layout =\n HeaderComponent || !legacyHeader ? (\n <EntityLayoutBui\n routes={routes}\n HeaderComponent={HeaderComponent}\n contextMenuItems={filteredMenuItems}\n groupDefinitions={groupDefinitions}\n defaultContentOrder={config.defaultContentOrder}\n />\n ) : (\n <EntityLayout\n routes={routes}\n header={legacyHeader}\n contextMenuItems={filteredMenuItems}\n groupDefinitions={groupDefinitions}\n defaultContentOrder={config.defaultContentOrder}\n showNavItemIcons={config.showNavItemIcons}\n />\n );\n\n return (\n <AsyncEntityProvider {...entityProviderProps}>\n {layout}\n </AsyncEntityProvider>\n );\n };\n\n return <Component />;\n },\n });\n },\n});\n\nexport default [catalogPage, catalogEntityPage];\n"],"names":["layout"],"mappings":";;;;;;;;;;;;;AA6CA,MAAM,0BAAA,GAA6B,sBAAA,EAKhC,CAAE,IAAA,CAAK;AAAA,EACR,EAAA,EAAI;AACN,CAAC,CAAA;AAMM,MAAM,+BAA+B,wBAAA,CAAyB;AAAA,EACnE,IAAA,EAAM,uBAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,cAAA,EAAgB,OAAO,cAAA,EAAe;AAAA,EACtD,MAAA,EAAQ,CAAC,0BAA0B,CAAA;AAAA,EACnC,QAAQ,MAAA,EAKL;AACD,IAAA,OAAO,CAAC,0BAAA,CAA2B,MAAM,CAAC,CAAA;AAAA,EAC5C;AACF,CAAC;AAEM,MAAM,WAAA,GAAc,cAAc,iBAAA,CAAkB;AAAA,EACzD,MAAA,EAAQ;AAAA,IACN,OAAA,EAAS,oBAAA,CAAqB,CAAC,iBAAA,CAAkB,YAAY,CAAC,CAAA;AAAA,IAC9D,cAAc,oBAAA,CAAqB,CAAC,0BAAA,CAA2B,QAAA,EAAU,CAAC;AAAA,GAC5E;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,UAAA,EAAY,EACT,KAAA,CAAM;AAAA,MACL,EAAE,OAAA,EAAQ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AAA,GACjB,OAAA,CAAQ,IAAA,CAAK,CAAA,MAAA,KAAU,OAAO,MAAA,CAAO,MAAM,CAAC,CAAA,EAAG,OAAA,GAC/C,MAAA;AAEJ,UAAA,MAAM,MAAA,GACJ,eAAA,IAAmB,CAAC,YAAA,mBAClB,GAAA;AAAA,YAAC,eAAA;AAAA,YAAA;AAAA,cACC,MAAA;AAAA,cACA,eAAA;AAAA,cACA,gBAAA,EAAkB,iBAAA;AAAA,cAClB,gBAAA;AAAA,cACA,qBAAqB,MAAA,CAAO;AAAA;AAAA,WAC9B,mBAEA,GAAA;AAAA,YAAC,YAAA;AAAA,YAAA;AAAA,cACC,MAAA;AAAA,cACA,MAAA,EAAQ,YAAA;AAAA,cACR,gBAAA,EAAkB,iBAAA;AAAA,cAClB,gBAAA;AAAA,cACA,qBAAqB,MAAA,CAAO,mBAAA;AAAA,cAC5B,kBAAkB,MAAA,CAAO;AAAA;AAAA,WAC3B;AAGJ,UAAA,uBACE,GAAA,CAAC,mBAAA,EAAA,EAAqB,GAAG,mBAAA,EACtB,QAAA,EAAA,MAAA,EACH,CAAA;AAAA,QAEJ,CAAA;AAEA,QAAA,2BAAQ,SAAA,EAAA,EAAU,CAAA;AAAA,MACpB;AAAA,KACD,CAAA;AAAA,EACH;AACF,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 { convertLegacyRouteRef } from '@backstage/core-compat-api';\nimport {\n coreExtensionData,\n createExtensionInput,\n createExtensionDataRef,\n createExtensionBlueprint,\n PageBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport { z } from 'zod/v4';\nimport { entityRouteRef } from '@backstage/plugin-catalog-react';\nimport {\n defaultEntityContentGroupDefinitions,\n EntityContentBlueprint,\n EntityContextMenuItemBlueprint,\n EntityHeaderBlueprint,\n EntityHeaderLayoutBlueprint,\n EntityContentGroupDefinitions,\n} from '@backstage/plugin-catalog-react/alpha';\nimport CategoryIcon from '@material-ui/icons/Category';\nimport { rootRouteRef } from '../routes';\nimport { buildFilterFn } from './filter/FilterWrapper';\nimport type { CatalogExportSettings } from '../components/CatalogExportButton';\n\nconst catalogExportConfigDataRef = createExtensionDataRef<{\n exporters?: CatalogExportSettings['exporters'];\n columns?: CatalogExportSettings['columns'];\n onSuccess?: CatalogExportSettings['onSuccess'];\n onError?: CatalogExportSettings['onError'];\n}>().with({\n id: 'catalog.export-customization',\n});\n\n/**\n * Blueprint for creating catalog export configuration extensions.\n * @public\n */\nexport const CatalogExportConfigBlueprint = createExtensionBlueprint({\n kind: 'catalog-export-config',\n attachTo: { id: 'page:catalog', input: 'exportConfig' },\n output: [catalogExportConfigDataRef],\n factory(params: {\n exporters?: CatalogExportSettings['exporters'];\n columns?: CatalogExportSettings['columns'];\n onSuccess?: CatalogExportSettings['onSuccess'];\n onError?: CatalogExportSettings['onError'];\n }) {\n return [catalogExportConfigDataRef(params)];\n },\n});\n\nexport const catalogPage = PageBlueprint.makeWithOverrides({\n inputs: {\n filters: createExtensionInput([coreExtensionData.reactElement]),\n exportConfig: createExtensionInput([catalogExportConfigDataRef.optional()]),\n },\n configSchema: {\n pagination: 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 exportSettings: z\n .object({\n /** When true, displays the export button in the catalog interface. */\n enabled: z.boolean().optional(),\n /**\n * When true, hides the built-in CSV and JSON export options.\n * Useful when only custom exporters (provided via extensions) should be available.\n */\n disableBuiltinExporters: z.boolean().optional(),\n })\n .optional(),\n },\n factory(originalFactory, { inputs, config }) {\n return originalFactory({\n path: '/catalog',\n routeRef: rootRouteRef,\n icon: <CategoryIcon fontSize=\"inherit\" />,\n title: 'Catalog',\n loader: async () => {\n const { NfsDefaultCatalogPage } = await import(\n '../components/CatalogPage/DefaultCatalogPage'\n );\n const filters = inputs.filters.map(filter =>\n filter.get(coreExtensionData.reactElement),\n );\n\n // Merge export customizers from all attached extensions\n const mergedExportSettings: CatalogExportSettings = {\n ...config.exportSettings,\n };\n\n for (const exportConfigInput of inputs.exportConfig) {\n const data = exportConfigInput.get(catalogExportConfigDataRef);\n if (data) {\n if (data.exporters) {\n mergedExportSettings.exporters = {\n ...mergedExportSettings.exporters,\n ...data.exporters,\n };\n }\n if (data.columns && !mergedExportSettings.columns) {\n mergedExportSettings.columns = data.columns;\n }\n if (data.onSuccess && !mergedExportSettings.onSuccess) {\n mergedExportSettings.onSuccess = data.onSuccess;\n }\n if (data.onError && !mergedExportSettings.onError) {\n mergedExportSettings.onError = data.onError;\n }\n }\n }\n\n return (\n <NfsDefaultCatalogPage\n filters={<>{filters}</>}\n pagination={config.pagination}\n exportSettings={\n mergedExportSettings.enabled ? mergedExportSettings : undefined\n }\n />\n );\n },\n });\n },\n});\n\nexport const catalogEntityPage = PageBlueprint.makeWithOverrides({\n name: 'entity',\n inputs: {\n headerLayouts: createExtensionInput([\n EntityHeaderLayoutBlueprint.dataRefs.component,\n EntityHeaderLayoutBlueprint.dataRefs.filterFunction.optional(),\n ]),\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 EntityContentBlueprint.dataRefs.icon.optional(),\n ]),\n contextMenuItems: createExtensionInput([\n EntityContextMenuItemBlueprint.dataRefs.data,\n EntityContextMenuItemBlueprint.dataRefs.filterFunction.optional(),\n ]),\n },\n configSchema: {\n groups: z\n .array(\n z.record(\n z.string(),\n z.object({\n title: z.string(),\n icon: z.string().optional(),\n aliases: z.array(z.string()).optional(),\n contentOrder: z.enum(['title', 'natural']).optional(),\n }),\n ),\n )\n .optional(),\n defaultContentOrder: z\n .enum(['title', 'natural'])\n .optional()\n .default('title'),\n showNavItemIcons: z.boolean().optional().default(false),\n },\n factory(originalFactory, { config, inputs }) {\n return originalFactory({\n path: '/catalog/:namespace/:kind/:name',\n // NOTE: The `convertLegacyRouteRef` call here ensures that this route ref\n // is mutated to support the new frontend system. Removing this conversion\n // is a potentially breaking change since this is a singleton and the\n // route refs from `core-plugin-api` used to not support the new format.\n // This shouldn't be removed until we completely deprecate the\n // `core-compat-api` package.\n routeRef: convertLegacyRouteRef(entityRouteRef), // READ THE ABOVE\n loader: async () => {\n const { CatalogEntityPage } = await import(\n './components/CatalogEntityPage'\n );\n\n const menuItems = inputs.contextMenuItems.map(item => ({\n data: item.get(EntityContextMenuItemBlueprint.dataRefs.data),\n node: item.node,\n filter:\n item.get(EntityContextMenuItemBlueprint.dataRefs.filterFunction) ??\n (() => true),\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 headerLayouts = inputs.headerLayouts\n .map(layout => {\n const filterFunction = layout.get(\n EntityHeaderLayoutBlueprint.dataRefs.filterFunction,\n );\n return {\n Component: layout.get(\n EntityHeaderLayoutBlueprint.dataRefs.component,\n ),\n filter: filterFunction ?? (() => true),\n hasFilter: Boolean(filterFunction),\n };\n })\n .sort((a, b) => Number(b.hasFilter) - Number(a.hasFilter));\n\n const headers = inputs.headers\n .map(header => {\n const filterFunction = header.get(\n EntityHeaderBlueprint.dataRefs.filterFunction,\n );\n return {\n element: header.get(EntityHeaderBlueprint.dataRefs.element),\n filter: filterFunction ?? (() => true),\n hasFilter: Boolean(filterFunction),\n };\n })\n .sort((a, b) => Number(b.hasFilter) - Number(a.hasFilter));\n\n const groupDefinitions =\n config.groups?.reduce(\n (rest, group) => ({ ...rest, ...group }),\n {} as EntityContentGroupDefinitions,\n ) ?? defaultEntityContentGroupDefinitions;\n\n const routes = inputs.contents.map(output => ({\n group: output.get(EntityContentBlueprint.dataRefs.group),\n path: output.get(coreExtensionData.routePath),\n title: output.get(EntityContentBlueprint.dataRefs.title),\n icon: output.get(EntityContentBlueprint.dataRefs.icon),\n if: buildFilterFn(\n output.get(EntityContentBlueprint.dataRefs.filterFunction),\n output.get(EntityContentBlueprint.dataRefs.filterExpression),\n ),\n children: output.get(coreExtensionData.reactElement),\n }));\n\n return (\n <CatalogEntityPage\n menuItems={menuItems}\n headerLayouts={headerLayouts}\n headers={headers}\n routes={routes}\n groupDefinitions={groupDefinitions}\n defaultContentOrder={config.defaultContentOrder}\n showNavItemIcons={config.showNavItemIcons}\n />\n );\n },\n });\n },\n});\n\nexport default [catalogPage, catalogEntityPage];\n"],"names":[],"mappings":";;;;;;;;;;AAuCA,MAAM,0BAAA,GAA6B,sBAAA,EAKhC,CAAE,IAAA,CAAK;AAAA,EACR,EAAA,EAAI;AACN,CAAC,CAAA;AAMM,MAAM,+BAA+B,wBAAA,CAAyB;AAAA,EACnE,IAAA,EAAM,uBAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,cAAA,EAAgB,OAAO,cAAA,EAAe;AAAA,EACtD,MAAA,EAAQ,CAAC,0BAA0B,CAAA;AAAA,EACnC,QAAQ,MAAA,EAKL;AACD,IAAA,OAAO,CAAC,0BAAA,CAA2B,MAAM,CAAC,CAAA;AAAA,EAC5C;AACF,CAAC;AAEM,MAAM,WAAA,GAAc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AAS,KAAK,CAAA;AAAA,UACvD,IAAA,EAAM,MAAA,CAAO,GAAA,CAAI,iBAAA,CAAkB,SAAS,CAAA;AAAA,UAC5C,KAAA,EAAO,MAAA,CAAO,GAAA,CAAI,sBAAA,CAAuB,SAAS,KAAK,CAAA;AAAA,UACvD,IAAA,EAAM,MAAA,CAAO,GAAA,CAAI,sBAAA,CAAuB,SAAS,IAAI,CAAA;AAAA,UACrD,EAAA,EAAI,aAAA;AAAA,YACF,MAAA,CAAO,GAAA,CAAI,sBAAA,CAAuB,QAAA,CAAS,cAAc,CAAA;AAAA,YACzD,MAAA,CAAO,GAAA,CAAI,sBAAA,CAAuB,QAAA,CAAS,gBAAgB;AAAA,WAC7D;AAAA,UACA,QAAA,EAAU,MAAA,CAAO,GAAA,CAAI,iBAAA,CAAkB,YAAY;AAAA,SACrD,CAAE,CAAA;AAEF,QAAA,uBACE,GAAA;AAAA,UAAC,iBAAA;AAAA,UAAA;AAAA,YACC,SAAA;AAAA,YACA,aAAA;AAAA,YACA,OAAA;AAAA,YACA,MAAA;AAAA,YACA,gBAAA;AAAA,YACA,qBAAqB,MAAA,CAAO,mBAAA;AAAA,YAC5B,kBAAkB,MAAA,CAAO;AAAA;AAAA,SAC3B;AAAA,MAEJ;AAAA,KACD,CAAA;AAAA,EACH;AACF,CAAC;AAED,YAAe,CAAC,aAAa,iBAAiB,CAAA;;;;"}
@@ -1,4 +1,4 @@
1
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { useCallback } from 'react';
3
3
  import IconButton from '@material-ui/core/IconButton';
4
4
  import CachedIcon from '@material-ui/icons/Cached';
@@ -6,10 +6,9 @@ import EditIcon from '@material-ui/icons/Edit';
6
6
  import DocsIcon from '@material-ui/icons/Description';
7
7
  import CreateComponentIcon from '@material-ui/icons/AddCircleOutline';
8
8
  import { Link, AppIcon, HeaderIconLinkRow } from '@backstage/core-components';
9
- import { useEntity, catalogApiRef, EntityInfoCard, getEntitySourceLocation } from '@backstage/plugin-catalog-react';
9
+ import { useEntity, catalogApiRef, EntityInfoCard } from '@backstage/plugin-catalog-react';
10
10
  import { useApi, alertApiRef, errorApiRef, useRouteRef, useApp } from '@backstage/core-plugin-api';
11
11
  import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
12
- import { scmIntegrationsApiRef, ScmIntegrationIcon } from '@backstage/integration-react';
13
12
  import { ANNOTATION_EDIT_URL, ANNOTATION_LOCATION, stringifyEntityRef, DEFAULT_NAMESPACE } from '@backstage/catalog-model';
14
13
  import { useEntityPermission } from '@backstage/plugin-catalog-react/alpha';
15
14
  import { catalogEntityRefreshPermission } from '@backstage/plugin-catalog-common/alpha';
@@ -23,6 +22,7 @@ import { catalogTranslationRef } from '../../alpha/translation.esm.js';
23
22
  import { useSourceTemplateCompoundEntityRef } from './hooks.esm.js';
24
23
  import { AboutContent } from './AboutContent.esm.js';
25
24
  import { makeStyles } from '@material-ui/core/styles';
25
+ import { useCatalogSourceIconLinkProps } from './useCatalogSourceIconLinkProps.esm.js';
26
26
 
27
27
  const useStyles = makeStyles({
28
28
  linkContainer: {
@@ -32,21 +32,6 @@ const useStyles = makeStyles({
32
32
  marginBottom: "var(--bui-space-6)"
33
33
  }
34
34
  });
35
- function useCatalogSourceIconLinkProps() {
36
- const { entity } = useEntity();
37
- const scmIntegrationsApi = useApi(scmIntegrationsApiRef);
38
- const { t } = useTranslationRef(catalogTranslationRef);
39
- const entitySourceLocation = getEntitySourceLocation(
40
- entity,
41
- scmIntegrationsApi
42
- );
43
- return {
44
- label: t("aboutCard.viewSource"),
45
- disabled: !entitySourceLocation,
46
- icon: /* @__PURE__ */ jsx(ScmIntegrationIcon, { type: entitySourceLocation?.integrationType }),
47
- href: entitySourceLocation?.locationTargetUrl
48
- };
49
- }
50
35
  function useTechdocsReaderIconLinkProps() {
51
36
  const { entity } = useEntity();
52
37
  const viewTechdocLink = useRouteRef(viewTechDocRouteRef);
@@ -165,5 +150,5 @@ function AboutCard() {
165
150
  return /* @__PURE__ */ jsx(InternalAboutCard, {});
166
151
  }
167
152
 
168
- export { AboutCard, InternalAboutCard, useCatalogSourceIconLinkProps };
153
+ export { AboutCard, InternalAboutCard };
169
154
  //# sourceMappingURL=AboutCard.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AboutCard.esm.js","sources":["../../../src/components/AboutCard/AboutCard.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 { useCallback } from 'react';\n\nimport IconButton from '@material-ui/core/IconButton';\nimport CachedIcon from '@material-ui/icons/Cached';\nimport EditIcon from '@material-ui/icons/Edit';\nimport DocsIcon from '@material-ui/icons/Description';\nimport CreateComponentIcon from '@material-ui/icons/AddCircleOutline';\n\nimport {\n AppIcon,\n HeaderIconLinkRow,\n IconLinkVerticalProps,\n Link,\n} from '@backstage/core-components';\nimport { EntityInfoCard } from '@backstage/plugin-catalog-react';\nimport {\n alertApiRef,\n errorApiRef,\n useApp,\n useApi,\n useRouteRef,\n} from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nimport {\n ScmIntegrationIcon,\n scmIntegrationsApiRef,\n} from '@backstage/integration-react';\n\nimport {\n DEFAULT_NAMESPACE,\n ANNOTATION_EDIT_URL,\n ANNOTATION_LOCATION,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport {\n catalogApiRef,\n getEntitySourceLocation,\n useEntity,\n} from '@backstage/plugin-catalog-react';\nimport { useEntityPermission } from '@backstage/plugin-catalog-react/alpha';\nimport { catalogEntityRefreshPermission } from '@backstage/plugin-catalog-common/alpha';\n\nimport {\n TECHDOCS_ANNOTATION,\n TECHDOCS_EXTERNAL_ANNOTATION,\n} from '@backstage/plugin-techdocs-common';\nimport { buildTechDocsURL } from '@backstage/plugin-techdocs-react';\n\nimport { isTemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport { taskCreatePermission } from '@backstage/plugin-scaffolder-common/alpha';\n\nimport { usePermission } from '@backstage/plugin-permission-react';\n\nimport { createFromTemplateRouteRef, viewTechDocRouteRef } from '../../routes';\nimport { catalogTranslationRef } from '../../alpha/translation';\nimport { useSourceTemplateCompoundEntityRef } from './hooks';\nimport { AboutContent } from './AboutContent';\nimport { makeStyles } from '@material-ui/core/styles';\n\nconst useStyles = makeStyles({\n linkContainer: {\n border: '1px solid var(--bui-border-1)',\n borderLeft: 'none',\n borderRight: 'none',\n marginBottom: 'var(--bui-space-6)',\n },\n});\n\nexport function useCatalogSourceIconLinkProps() {\n const { entity } = useEntity();\n const scmIntegrationsApi = useApi(scmIntegrationsApiRef);\n const { t } = useTranslationRef(catalogTranslationRef);\n const entitySourceLocation = getEntitySourceLocation(\n entity,\n scmIntegrationsApi,\n );\n return {\n label: t('aboutCard.viewSource'),\n disabled: !entitySourceLocation,\n icon: <ScmIntegrationIcon type={entitySourceLocation?.integrationType} />,\n href: entitySourceLocation?.locationTargetUrl,\n };\n}\n\n// TODO: This hook is duplicated from the TechDocs plugin for backwards compatibility\n// Remove it when the the legacy frontend system support is dropped.\nfunction useTechdocsReaderIconLinkProps(): IconLinkVerticalProps {\n const { entity } = useEntity();\n const viewTechdocLink = useRouteRef(viewTechDocRouteRef);\n const { t } = useTranslationRef(catalogTranslationRef);\n\n return {\n label: t('aboutCard.viewTechdocs'),\n disabled:\n !(\n entity.metadata.annotations?.[TECHDOCS_ANNOTATION] ||\n entity.metadata.annotations?.[TECHDOCS_EXTERNAL_ANNOTATION]\n ) || !viewTechdocLink,\n icon: <DocsIcon />,\n href: buildTechDocsURL(entity, viewTechdocLink),\n };\n}\n\n// TODO: This hook is duplicated from the Scaffolder plugin for backwards compatibility\n// Remove it when the the legacy frontend system support is dropped.\nfunction useScaffolderTemplateIconLinkProps(): IconLinkVerticalProps {\n const app = useApp();\n const { entity } = useEntity();\n const templateRoute = useRouteRef(createFromTemplateRouteRef);\n const { t } = useTranslationRef(catalogTranslationRef);\n const Icon = app.getSystemIcon('scaffolder') ?? CreateComponentIcon;\n const { allowed: canCreateTemplateTask } = usePermission({\n permission: taskCreatePermission,\n });\n\n return {\n label: t('aboutCard.launchTemplate'),\n icon: <Icon />,\n disabled: !templateRoute || !canCreateTemplateTask,\n href:\n templateRoute &&\n templateRoute({\n templateName: entity.metadata.name,\n namespace: entity.metadata.namespace || DEFAULT_NAMESPACE,\n }),\n };\n}\n\nfunction DefaultAboutCardSubheader() {\n const { entity } = useEntity();\n const catalogSourceIconLink = useCatalogSourceIconLinkProps();\n const techdocsreaderIconLink = useTechdocsReaderIconLinkProps();\n const scaffolderTemplateIconLink = useScaffolderTemplateIconLinkProps();\n\n const links = [catalogSourceIconLink, techdocsreaderIconLink];\n if (isTemplateEntityV1beta3(entity)) {\n links.push(scaffolderTemplateIconLink);\n }\n\n return <HeaderIconLinkRow links={links} />;\n}\n\nexport interface InternalAboutCardProps {\n /** Icon link row rendered at the top of the card body. */\n iconLinks?: JSX.Element;\n}\n\nexport function InternalAboutCard(props: InternalAboutCardProps) {\n const { iconLinks } = props;\n const classes = useStyles();\n const { entity } = useEntity();\n const catalogApi = useApi(catalogApiRef);\n const alertApi = useApi(alertApiRef);\n const errorApi = useApi(errorApiRef);\n const templateRoute = useRouteRef(createFromTemplateRouteRef);\n const sourceTemplateRef = useSourceTemplateCompoundEntityRef(entity);\n const { allowed: canRefresh } = useEntityPermission(\n catalogEntityRefreshPermission,\n );\n const { t } = useTranslationRef(catalogTranslationRef);\n\n const entityMetadataEditUrl =\n entity.metadata.annotations?.[ANNOTATION_EDIT_URL];\n\n const entityLocation = entity.metadata.annotations?.[ANNOTATION_LOCATION];\n // Limiting the ability to manually refresh to the less expensive locations\n const allowRefresh =\n entityLocation?.startsWith('url:') || entityLocation?.startsWith('file:');\n const refreshEntity = useCallback(async () => {\n try {\n await catalogApi.refreshEntity(stringifyEntityRef(entity));\n alertApi.post({\n message: t('aboutCard.refreshScheduledMessage'),\n severity: 'info',\n display: 'transient',\n });\n } catch (e) {\n errorApi.post(e);\n }\n }, [catalogApi, entity, alertApi, t, errorApi]);\n\n return (\n <EntityInfoCard\n title={t('aboutCard.title')}\n headerActions={\n <>\n {allowRefresh && canRefresh && (\n <IconButton\n aria-label={t('aboutCard.refreshButtonAriaLabel')}\n title={t('aboutCard.refreshButtonTitle')}\n onClick={refreshEntity}\n >\n <CachedIcon />\n </IconButton>\n )}\n <IconButton\n component={Link}\n aria-label={t('aboutCard.editButtonAriaLabel')}\n disabled={!entityMetadataEditUrl}\n title={t('aboutCard.editButtonTitle')}\n to={entityMetadataEditUrl ?? '#'}\n >\n <EditIcon />\n </IconButton>\n {sourceTemplateRef && templateRoute && (\n <IconButton\n component={Link}\n title={t('aboutCard.createSimilarButtonTitle')}\n to={templateRoute({\n namespace: sourceTemplateRef.namespace,\n templateName: sourceTemplateRef.name,\n })}\n >\n <AppIcon id=\"scaffolder\" />\n </IconButton>\n )}\n </>\n }\n >\n <div className={classes.linkContainer}>\n {iconLinks ?? <DefaultAboutCardSubheader />}\n </div>\n <AboutContent entity={entity} />\n </EntityInfoCard>\n );\n}\n\n/**\n * Exported publicly via the EntityAboutCard\n *\n * NOTE: We generally do not accept pull requests to extend this class with props\n * and customizability. If you need to tweak it, consider making a bespoke card\n * in your own repository instead, that is perfect for your own needs.\n */\nexport function AboutCard() {\n return <InternalAboutCard />;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA4EA,MAAM,YAAY,UAAA,CAAW;AAAA,EAC3B,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ,+BAAA;AAAA,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BACA,GAAA,CAAC,gBAAa,MAAA,EAAgB;AAAA;AAAA;AAAA,GAChC;AAEJ;AASO,SAAS,SAAA,GAAY;AAC1B,EAAA,2BAAQ,iBAAA,EAAA,EAAkB,CAAA;AAC5B;;;;"}
1
+ {"version":3,"file":"AboutCard.esm.js","sources":["../../../src/components/AboutCard/AboutCard.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 { useCallback } from 'react';\n\nimport IconButton from '@material-ui/core/IconButton';\nimport CachedIcon from '@material-ui/icons/Cached';\nimport EditIcon from '@material-ui/icons/Edit';\nimport DocsIcon from '@material-ui/icons/Description';\nimport CreateComponentIcon from '@material-ui/icons/AddCircleOutline';\n\nimport {\n AppIcon,\n HeaderIconLinkRow,\n IconLinkVerticalProps,\n Link,\n} from '@backstage/core-components';\nimport { EntityInfoCard } from '@backstage/plugin-catalog-react';\nimport {\n alertApiRef,\n errorApiRef,\n useApp,\n useApi,\n useRouteRef,\n} from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nimport {\n DEFAULT_NAMESPACE,\n ANNOTATION_EDIT_URL,\n ANNOTATION_LOCATION,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { catalogApiRef, useEntity } from '@backstage/plugin-catalog-react';\nimport { useEntityPermission } from '@backstage/plugin-catalog-react/alpha';\nimport { catalogEntityRefreshPermission } from '@backstage/plugin-catalog-common/alpha';\n\nimport {\n TECHDOCS_ANNOTATION,\n TECHDOCS_EXTERNAL_ANNOTATION,\n} from '@backstage/plugin-techdocs-common';\nimport { buildTechDocsURL } from '@backstage/plugin-techdocs-react';\n\nimport { isTemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport { taskCreatePermission } from '@backstage/plugin-scaffolder-common/alpha';\n\nimport { usePermission } from '@backstage/plugin-permission-react';\n\nimport { createFromTemplateRouteRef, viewTechDocRouteRef } from '../../routes';\nimport { catalogTranslationRef } from '../../alpha/translation';\nimport { useSourceTemplateCompoundEntityRef } from './hooks';\nimport { AboutContent } from './AboutContent';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useCatalogSourceIconLinkProps } from './useCatalogSourceIconLinkProps';\n\nconst useStyles = makeStyles({\n linkContainer: {\n border: '1px solid var(--bui-border-1)',\n borderLeft: 'none',\n borderRight: 'none',\n marginBottom: 'var(--bui-space-6)',\n },\n});\n\n// TODO: This hook is duplicated from the TechDocs plugin for backwards compatibility\n// Remove it when the the legacy frontend system support is dropped.\nfunction useTechdocsReaderIconLinkProps(): IconLinkVerticalProps {\n const { entity } = useEntity();\n const viewTechdocLink = useRouteRef(viewTechDocRouteRef);\n const { t } = useTranslationRef(catalogTranslationRef);\n\n return {\n label: t('aboutCard.viewTechdocs'),\n disabled:\n !(\n entity.metadata.annotations?.[TECHDOCS_ANNOTATION] ||\n entity.metadata.annotations?.[TECHDOCS_EXTERNAL_ANNOTATION]\n ) || !viewTechdocLink,\n icon: <DocsIcon />,\n href: buildTechDocsURL(entity, viewTechdocLink),\n };\n}\n\n// TODO: This hook is duplicated from the Scaffolder plugin for backwards compatibility\n// Remove it when the the legacy frontend system support is dropped.\nfunction useScaffolderTemplateIconLinkProps(): IconLinkVerticalProps {\n const app = useApp();\n const { entity } = useEntity();\n const templateRoute = useRouteRef(createFromTemplateRouteRef);\n const { t } = useTranslationRef(catalogTranslationRef);\n const Icon = app.getSystemIcon('scaffolder') ?? CreateComponentIcon;\n const { allowed: canCreateTemplateTask } = usePermission({\n permission: taskCreatePermission,\n });\n\n return {\n label: t('aboutCard.launchTemplate'),\n icon: <Icon />,\n disabled: !templateRoute || !canCreateTemplateTask,\n href:\n templateRoute &&\n templateRoute({\n templateName: entity.metadata.name,\n namespace: entity.metadata.namespace || DEFAULT_NAMESPACE,\n }),\n };\n}\n\nfunction DefaultAboutCardSubheader() {\n const { entity } = useEntity();\n const catalogSourceIconLink = useCatalogSourceIconLinkProps();\n const techdocsreaderIconLink = useTechdocsReaderIconLinkProps();\n const scaffolderTemplateIconLink = useScaffolderTemplateIconLinkProps();\n\n const links = [catalogSourceIconLink, techdocsreaderIconLink];\n if (isTemplateEntityV1beta3(entity)) {\n links.push(scaffolderTemplateIconLink);\n }\n\n return <HeaderIconLinkRow links={links} />;\n}\n\nexport interface InternalAboutCardProps {\n /** Icon link row rendered at the top of the card body. */\n iconLinks?: JSX.Element;\n}\n\nexport function InternalAboutCard(props: InternalAboutCardProps) {\n const { iconLinks } = props;\n const classes = useStyles();\n const { entity } = useEntity();\n const catalogApi = useApi(catalogApiRef);\n const alertApi = useApi(alertApiRef);\n const errorApi = useApi(errorApiRef);\n const templateRoute = useRouteRef(createFromTemplateRouteRef);\n const sourceTemplateRef = useSourceTemplateCompoundEntityRef(entity);\n const { allowed: canRefresh } = useEntityPermission(\n catalogEntityRefreshPermission,\n );\n const { t } = useTranslationRef(catalogTranslationRef);\n\n const entityMetadataEditUrl =\n entity.metadata.annotations?.[ANNOTATION_EDIT_URL];\n\n const entityLocation = entity.metadata.annotations?.[ANNOTATION_LOCATION];\n // Limiting the ability to manually refresh to the less expensive locations\n const allowRefresh =\n entityLocation?.startsWith('url:') || entityLocation?.startsWith('file:');\n const refreshEntity = useCallback(async () => {\n try {\n await catalogApi.refreshEntity(stringifyEntityRef(entity));\n alertApi.post({\n message: t('aboutCard.refreshScheduledMessage'),\n severity: 'info',\n display: 'transient',\n });\n } catch (e) {\n errorApi.post(e);\n }\n }, [catalogApi, entity, alertApi, t, errorApi]);\n\n return (\n <EntityInfoCard\n title={t('aboutCard.title')}\n headerActions={\n <>\n {allowRefresh && canRefresh && (\n <IconButton\n aria-label={t('aboutCard.refreshButtonAriaLabel')}\n title={t('aboutCard.refreshButtonTitle')}\n onClick={refreshEntity}\n >\n <CachedIcon />\n </IconButton>\n )}\n <IconButton\n component={Link}\n aria-label={t('aboutCard.editButtonAriaLabel')}\n disabled={!entityMetadataEditUrl}\n title={t('aboutCard.editButtonTitle')}\n to={entityMetadataEditUrl ?? '#'}\n >\n <EditIcon />\n </IconButton>\n {sourceTemplateRef && templateRoute && (\n <IconButton\n component={Link}\n title={t('aboutCard.createSimilarButtonTitle')}\n to={templateRoute({\n namespace: sourceTemplateRef.namespace,\n templateName: sourceTemplateRef.name,\n })}\n >\n <AppIcon id=\"scaffolder\" />\n </IconButton>\n )}\n </>\n }\n >\n <div className={classes.linkContainer}>\n {iconLinks ?? <DefaultAboutCardSubheader />}\n </div>\n <AboutContent entity={entity} />\n </EntityInfoCard>\n );\n}\n\n/**\n * Exported publicly via the EntityAboutCard\n *\n * NOTE: We generally do not accept pull requests to extend this class with props\n * and customizability. If you need to tweak it, consider making a bespoke card\n * in your own repository instead, that is perfect for your own needs.\n */\nexport function AboutCard() {\n return <InternalAboutCard />;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAoEA,MAAM,YAAY,UAAA,CAAW;AAAA,EAC3B,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ,+BAAA;AAAA,IACR,UAAA,EAAY,MAAA;AAAA,IACZ,WAAA,EAAa,MAAA;AAAA,IACb,YAAA,EAAc;AAAA;AAElB,CAAC,CAAA;AAID,SAAS,8BAAA,GAAwD;AAC/D,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAU;AAC7B,EAAA,MAAM,eAAA,GAAkB,YAAY,mBAAmB,CAAA;AACvD,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,qBAAqB,CAAA;AAErD,EAAA,OAAO;AAAA,IACL,KAAA,EAAO,EAAE,wBAAwB,CAAA;AAAA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