@backstage/plugin-catalog-react 2.0.1-next.0 → 2.1.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,49 @@
1
1
  # @backstage/plugin-catalog-react
2
2
 
3
+ ## 2.1.0-next.2
4
+
5
+ ### Minor Changes
6
+
7
+ - d14b6e0: Exported `useEntityRefLink` hook that returns a function for generating entity page URLs from entity references.
8
+ - c6080eb: Added `EntityInfoCard` component to `@backstage/plugin-catalog-react` as a BUI-based card wrapper for entity page cards.
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+ - @backstage/core-compat-api@0.5.9-next.2
14
+ - @backstage/ui@0.13.0-next.2
15
+ - @backstage/frontend-test-utils@0.5.1-next.2
16
+ - @backstage/frontend-plugin-api@0.15.0-next.1
17
+ - @backstage/core-plugin-api@1.12.4-next.1
18
+ - @backstage/catalog-client@1.14.0-next.2
19
+ - @backstage/core-components@0.18.8-next.1
20
+
21
+ ## 2.1.0-next.1
22
+
23
+ ### Minor Changes
24
+
25
+ - 4d58894: Added `aliases` and `contentOrder` fields to `EntityContentGroupDefinition`, allowing groups to declare alias IDs and control the sort order of their content items.
26
+
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies
30
+ - @backstage/ui@0.13.0-next.1
31
+ - @backstage/catalog-client@1.14.0-next.1
32
+ - @backstage/frontend-test-utils@0.5.1-next.1
33
+ - @backstage/catalog-model@1.7.6
34
+ - @backstage/core-compat-api@0.5.9-next.1
35
+ - @backstage/core-components@0.18.8-next.0
36
+ - @backstage/core-plugin-api@1.12.4-next.0
37
+ - @backstage/errors@1.2.7
38
+ - @backstage/filter-predicates@0.1.0
39
+ - @backstage/frontend-plugin-api@0.14.2-next.0
40
+ - @backstage/integration-react@1.2.16-next.1
41
+ - @backstage/types@1.2.2
42
+ - @backstage/version-bridge@1.0.12
43
+ - @backstage/plugin-catalog-common@1.1.8
44
+ - @backstage/plugin-permission-common@0.9.6
45
+ - @backstage/plugin-permission-react@0.4.41-next.0
46
+
3
47
  ## 2.0.1-next.0
4
48
 
5
49
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"extensionData.esm.js","sources":["../../../src/alpha/blueprints/extensionData.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 { Entity } from '@backstage/catalog-model';\nimport { createExtensionDataRef } from '@backstage/frontend-plugin-api';\nimport { ReactElement } from 'react';\n\n/** @internal */\nexport const entityContentTitleDataRef = createExtensionDataRef<string>().with({\n id: 'catalog.entity-content-title',\n});\n\n/** @internal */\nexport const entityContentIconDataRef = createExtensionDataRef<\n string | ReactElement\n>().with({\n id: 'catalog.entity-content-icon',\n});\n\n/** @internal */\nexport const entityFilterFunctionDataRef = createExtensionDataRef<\n (entity: Entity) => boolean\n>().with({ id: 'catalog.entity-filter-function' });\n\n/** @internal */\nexport const entityFilterExpressionDataRef =\n createExtensionDataRef<string>().with({\n id: 'catalog.entity-filter-expression',\n });\n\n/** @alpha */\nexport type EntityContentGroupDefinitions = Record<\n string,\n {\n title: string;\n icon?: string | ReactElement;\n }\n>;\n\n/**\n * @alpha\n * Default entity content groups.\n */\nexport const defaultEntityContentGroupDefinitions = {\n overview: {\n title: 'Overview',\n },\n documentation: {\n title: 'Documentation',\n },\n development: {\n title: 'Development',\n },\n deployment: {\n title: 'Deployment',\n },\n operation: {\n title: 'Operation',\n },\n observability: {\n title: 'Observability',\n },\n} satisfies EntityContentGroupDefinitions;\n\n/**\n * @alpha\n * Default entity content groups.\n * @deprecated use defaultEntityContentGroupDefinitions\n */\nexport const defaultEntityContentGroups = Object.fromEntries(\n Object.entries(defaultEntityContentGroupDefinitions).map(\n ([key, { title }]) => [key, title],\n ),\n) as Record<keyof typeof defaultEntityContentGroupDefinitions, string>;\n\n/** @internal */\nexport const entityContentGroupDataRef = createExtensionDataRef<string>().with({\n id: 'catalog.entity-content-group',\n});\n\n/**\n * @internal\n * Available entity card types\n */\nexport const entityCardTypes = [\n 'info',\n 'content',\n] as const satisfies readonly EntityCardType[];\n\n/** @alpha */\nexport type EntityCardType = 'info' | 'content';\n\n/** @internal */\nexport const entityCardTypeDataRef =\n createExtensionDataRef<EntityCardType>().with({\n id: 'catalog.entity-card-type',\n });\n"],"names":[],"mappings":";;AAqBO,MAAM,yBAAA,GAA4B,sBAAA,EAA+B,CAAE,IAAA,CAAK;AAAA,EAC7E,EAAA,EAAI;AACN,CAAC;AAGM,MAAM,wBAAA,GAA2B,sBAAA,EAEtC,CAAE,IAAA,CAAK;AAAA,EACP,EAAA,EAAI;AACN,CAAC;AAGM,MAAM,8BAA8B,sBAAA,EAEzC,CAAE,KAAK,EAAE,EAAA,EAAI,kCAAkC;AAG1C,MAAM,6BAAA,GACX,sBAAA,EAA+B,CAAE,IAAA,CAAK;AAAA,EACpC,EAAA,EAAI;AACN,CAAC;AAeI,MAAM,oCAAA,GAAuC;AAAA,EAClD,QAAA,EAAU;AAAA,IACR,KAAA,EAAO;AAAA,GACT;AAAA,EACA,aAAA,EAAe;AAAA,IACb,KAAA,EAAO;AAAA,GACT;AAAA,EACA,WAAA,EAAa;AAAA,IACX,KAAA,EAAO;AAAA,GACT;AAAA,EACA,UAAA,EAAY;AAAA,IACV,KAAA,EAAO;AAAA,GACT;AAAA,EACA,SAAA,EAAW;AAAA,IACT,KAAA,EAAO;AAAA,GACT;AAAA,EACA,aAAA,EAAe;AAAA,IACb,KAAA,EAAO;AAAA;AAEX;AAOO,MAAM,6BAA6B,MAAA,CAAO,WAAA;AAAA,EAC/C,MAAA,CAAO,OAAA,CAAQ,oCAAoC,CAAA,CAAE,GAAA;AAAA,IACnD,CAAC,CAAC,GAAA,EAAK,EAAE,OAAO,CAAA,KAAM,CAAC,GAAA,EAAK,KAAK;AAAA;AAErC;AAGO,MAAM,yBAAA,GAA4B,sBAAA,EAA+B,CAAE,IAAA,CAAK;AAAA,EAC7E,EAAA,EAAI;AACN,CAAC;AAMM,MAAM,eAAA,GAAkB;AAAA,EAC7B,MAAA;AAAA,EACA;AACF;AAMO,MAAM,qBAAA,GACX,sBAAA,EAAuC,CAAE,IAAA,CAAK;AAAA,EAC5C,EAAA,EAAI;AACN,CAAC;;;;"}
1
+ {"version":3,"file":"extensionData.esm.js","sources":["../../../src/alpha/blueprints/extensionData.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 { Entity } from '@backstage/catalog-model';\nimport { createExtensionDataRef } from '@backstage/frontend-plugin-api';\nimport { ReactElement } from 'react';\n\n/** @internal */\nexport const entityContentTitleDataRef = createExtensionDataRef<string>().with({\n id: 'catalog.entity-content-title',\n});\n\n/** @internal */\nexport const entityContentIconDataRef = createExtensionDataRef<\n string | ReactElement\n>().with({\n id: 'catalog.entity-content-icon',\n});\n\n/** @internal */\nexport const entityFilterFunctionDataRef = createExtensionDataRef<\n (entity: Entity) => boolean\n>().with({ id: 'catalog.entity-filter-function' });\n\n/** @internal */\nexport const entityFilterExpressionDataRef =\n createExtensionDataRef<string>().with({\n id: 'catalog.entity-filter-expression',\n });\n\n/** @alpha */\nexport type EntityContentGroupDefinitions = Record<\n string,\n {\n title: string;\n icon?: string | ReactElement;\n /** Other group IDs that should be treated as aliases for this group. */\n aliases?: string[];\n /** How to sort the content items within this group. Overrides the page-level default. */\n contentOrder?: 'title' | 'natural';\n }\n>;\n\n/**\n * @alpha\n * Default entity content groups.\n */\nexport const defaultEntityContentGroupDefinitions = {\n overview: {\n title: 'Overview',\n },\n documentation: {\n title: 'Documentation',\n },\n development: {\n title: 'Development',\n },\n deployment: {\n title: 'Deployment',\n },\n operation: {\n title: 'Operation',\n },\n observability: {\n title: 'Observability',\n },\n} satisfies EntityContentGroupDefinitions;\n\n/**\n * @alpha\n * Default entity content groups.\n * @deprecated use defaultEntityContentGroupDefinitions\n */\nexport const defaultEntityContentGroups = Object.fromEntries(\n Object.entries(defaultEntityContentGroupDefinitions).map(\n ([key, { title }]) => [key, title],\n ),\n) as Record<keyof typeof defaultEntityContentGroupDefinitions, string>;\n\n/** @internal */\nexport const entityContentGroupDataRef = createExtensionDataRef<string>().with({\n id: 'catalog.entity-content-group',\n});\n\n/**\n * @internal\n * Available entity card types\n */\nexport const entityCardTypes = [\n 'info',\n 'content',\n] as const satisfies readonly EntityCardType[];\n\n/** @alpha */\nexport type EntityCardType = 'info' | 'content';\n\n/** @internal */\nexport const entityCardTypeDataRef =\n createExtensionDataRef<EntityCardType>().with({\n id: 'catalog.entity-card-type',\n });\n"],"names":[],"mappings":";;AAqBO,MAAM,yBAAA,GAA4B,sBAAA,EAA+B,CAAE,IAAA,CAAK;AAAA,EAC7E,EAAA,EAAI;AACN,CAAC;AAGM,MAAM,wBAAA,GAA2B,sBAAA,EAEtC,CAAE,IAAA,CAAK;AAAA,EACP,EAAA,EAAI;AACN,CAAC;AAGM,MAAM,8BAA8B,sBAAA,EAEzC,CAAE,KAAK,EAAE,EAAA,EAAI,kCAAkC;AAG1C,MAAM,6BAAA,GACX,sBAAA,EAA+B,CAAE,IAAA,CAAK;AAAA,EACpC,EAAA,EAAI;AACN,CAAC;AAmBI,MAAM,oCAAA,GAAuC;AAAA,EAClD,QAAA,EAAU;AAAA,IACR,KAAA,EAAO;AAAA,GACT;AAAA,EACA,aAAA,EAAe;AAAA,IACb,KAAA,EAAO;AAAA,GACT;AAAA,EACA,WAAA,EAAa;AAAA,IACX,KAAA,EAAO;AAAA,GACT;AAAA,EACA,UAAA,EAAY;AAAA,IACV,KAAA,EAAO;AAAA,GACT;AAAA,EACA,SAAA,EAAW;AAAA,IACT,KAAA,EAAO;AAAA,GACT;AAAA,EACA,aAAA,EAAe;AAAA,IACb,KAAA,EAAO;AAAA;AAEX;AAOO,MAAM,6BAA6B,MAAA,CAAO,WAAA;AAAA,EAC/C,MAAA,CAAO,OAAA,CAAQ,oCAAoC,CAAA,CAAE,GAAA;AAAA,IACnD,CAAC,CAAC,GAAA,EAAK,EAAE,OAAO,CAAA,KAAM,CAAC,GAAA,EAAK,KAAK;AAAA;AAErC;AAGO,MAAM,yBAAA,GAA4B,sBAAA,EAA+B,CAAE,IAAA,CAAK;AAAA,EAC7E,EAAA,EAAI;AACN,CAAC;AAMM,MAAM,eAAA,GAAkB;AAAA,EAC7B,MAAA;AAAA,EACA;AACF;AAMO,MAAM,qBAAA,GACX,sBAAA,EAAuC,CAAE,IAAA,CAAK;AAAA,EAC5C,EAAA,EAAI;AACN,CAAC;;;;"}
package/dist/alpha.d.ts CHANGED
@@ -38,6 +38,10 @@ declare const CatalogFilterBlueprint: _backstage_frontend_plugin_api.ExtensionBl
38
38
  type EntityContentGroupDefinitions = Record<string, {
39
39
  title: string;
40
40
  icon?: string | ReactElement;
41
+ /** Other group IDs that should be treated as aliases for this group. */
42
+ aliases?: string[];
43
+ /** How to sort the content items within this group. Overrides the page-level default. */
44
+ contentOrder?: 'title' | 'natural';
41
45
  }>;
42
46
  /**
43
47
  * @alpha
@@ -0,0 +1,29 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { Card, CardHeader, Flex, Text, CardBody, CardFooter } from '@backstage/ui';
3
+ import { makeStyles } from '@material-ui/core/styles';
4
+ import classNames from 'classnames';
5
+
6
+ const useStyles = makeStyles({
7
+ root: {
8
+ height: "100%"
9
+ },
10
+ footer: {
11
+ display: "flex",
12
+ justifyContent: "flex-end"
13
+ }
14
+ });
15
+ function EntityInfoCard(props) {
16
+ const { title, headerActions, footerActions, children, className } = props;
17
+ const classes = useStyles();
18
+ return /* @__PURE__ */ jsxs(Card, { className: classNames(classes.root, className), children: [
19
+ title && /* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(Flex, { justify: "between", align: "center", children: [
20
+ /* @__PURE__ */ jsx(Text, { as: "h3", variant: "title-x-small", weight: "bold", children: title }),
21
+ headerActions && /* @__PURE__ */ jsx(Flex, { align: "center", gap: "1", children: headerActions })
22
+ ] }) }),
23
+ /* @__PURE__ */ jsx(CardBody, { children }),
24
+ footerActions && /* @__PURE__ */ jsx(CardFooter, { className: classes.footer, children: footerActions })
25
+ ] });
26
+ }
27
+
28
+ export { EntityInfoCard };
29
+ //# sourceMappingURL=EntityInfoCard.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntityInfoCard.esm.js","sources":["../../../src/components/EntityInfoCard/EntityInfoCard.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 { ReactNode } from 'react';\nimport {\n Card,\n CardHeader,\n CardBody,\n CardFooter,\n Text,\n Flex,\n} from '@backstage/ui';\nimport { makeStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\n\nconst useStyles = makeStyles({\n root: {\n height: '100%',\n },\n footer: {\n display: 'flex',\n justifyContent: 'flex-end',\n },\n});\n\n/** @public */\nexport interface EntityInfoCardProps {\n title?: ReactNode;\n headerActions?: ReactNode;\n footerActions?: ReactNode;\n children?: ReactNode;\n className?: string;\n}\n\n/** @public */\nexport function EntityInfoCard(props: EntityInfoCardProps) {\n const { title, headerActions, footerActions, children, className } = props;\n const classes = useStyles();\n\n return (\n <Card className={classNames(classes.root, className)}>\n {title && (\n <CardHeader>\n <Flex justify=\"between\" align=\"center\">\n <Text as=\"h3\" variant=\"title-x-small\" weight=\"bold\">\n {title}\n </Text>\n {headerActions && (\n <Flex align=\"center\" gap=\"1\">\n {headerActions}\n </Flex>\n )}\n </Flex>\n </CardHeader>\n )}\n <CardBody>{children}</CardBody>\n {footerActions && (\n <CardFooter className={classes.footer}>{footerActions}</CardFooter>\n )}\n </Card>\n );\n}\n"],"names":[],"mappings":";;;;;AA4BA,MAAM,YAAY,UAAA,CAAW;AAAA,EAC3B,IAAA,EAAM;AAAA,IACJ,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,OAAA,EAAS,MAAA;AAAA,IACT,cAAA,EAAgB;AAAA;AAEpB,CAAC,CAAA;AAYM,SAAS,eAAe,KAAA,EAA4B;AACzD,EAAA,MAAM,EAAE,KAAA,EAAO,aAAA,EAAe,aAAA,EAAe,QAAA,EAAU,WAAU,GAAI,KAAA;AACrE,EAAA,MAAM,UAAU,SAAA,EAAU;AAE1B,EAAA,4BACG,IAAA,EAAA,EAAK,SAAA,EAAW,WAAW,OAAA,CAAQ,IAAA,EAAM,SAAS,CAAA,EAChD,QAAA,EAAA;AAAA,IAAA,KAAA,wBACE,UAAA,EAAA,EACC,QAAA,kBAAA,IAAA,CAAC,QAAK,OAAA,EAAQ,SAAA,EAAU,OAAM,QAAA,EAC5B,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,QAAK,EAAA,EAAG,IAAA,EAAK,SAAQ,eAAA,EAAgB,MAAA,EAAO,QAC1C,QAAA,EAAA,KAAA,EACH,CAAA;AAAA,MACC,iCACC,GAAA,CAAC,IAAA,EAAA,EAAK,OAAM,QAAA,EAAS,GAAA,EAAI,KACtB,QAAA,EAAA,aAAA,EACH;AAAA,KAAA,EAEJ,CAAA,EACF,CAAA;AAAA,oBAEF,GAAA,CAAC,YAAU,QAAA,EAAS,CAAA;AAAA,IACnB,iCACC,GAAA,CAAC,UAAA,EAAA,EAAW,SAAA,EAAW,OAAA,CAAQ,QAAS,QAAA,EAAA,aAAA,EAAc;AAAA,GAAA,EAE1D,CAAA;AAEJ;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { Link } from '@backstage/core-components';
3
3
  import { useRouteRef } from '@backstage/core-plugin-api';
4
- import { forwardRef } from 'react';
4
+ import { forwardRef, useCallback } from 'react';
5
5
  import { entityRouteRef, entityRouteParams } from '../../routes.esm.js';
6
6
  import { EntityDisplayName } from '../EntityDisplayName/EntityDisplayName.esm.js';
7
7
 
@@ -17,7 +17,7 @@ const EntityRefLink = forwardRef(
17
17
  disableTooltip,
18
18
  ...linkProps
19
19
  } = props;
20
- const entityRoute = useEntityRoute(props.entityRef);
20
+ const entityLink = useEntityRefLink();
21
21
  const content = children ?? title ?? /* @__PURE__ */ jsx(
22
22
  EntityDisplayName,
23
23
  {
@@ -28,14 +28,19 @@ const EntityRefLink = forwardRef(
28
28
  disableTooltip
29
29
  }
30
30
  );
31
- return /* @__PURE__ */ jsx(Link, { ...linkProps, ref, to: entityRoute, children: content });
31
+ return /* @__PURE__ */ jsx(Link, { ...linkProps, ref, to: entityLink(props.entityRef), children: content });
32
32
  }
33
33
  );
34
- function useEntityRoute(entityRef) {
34
+ function useEntityRefLink() {
35
35
  const entityRoute = useRouteRef(entityRouteRef);
36
- const routeParams = entityRouteParams(entityRef, { encodeParams: true });
37
- return entityRoute(routeParams);
36
+ return useCallback(
37
+ (entityRef) => {
38
+ const routeParams = entityRouteParams(entityRef, { encodeParams: true });
39
+ return entityRoute(routeParams);
40
+ },
41
+ [entityRoute]
42
+ );
38
43
  }
39
44
 
40
- export { EntityRefLink };
45
+ export { EntityRefLink, useEntityRefLink };
41
46
  //# sourceMappingURL=EntityRefLink.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EntityRefLink.esm.js","sources":["../../../src/components/EntityRefLink/EntityRefLink.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 { CompoundEntityRef, Entity } from '@backstage/catalog-model';\nimport { Link, LinkProps } from '@backstage/core-components';\nimport { useRouteRef } from '@backstage/core-plugin-api';\nimport { ReactNode, forwardRef } from 'react';\nimport { entityRouteParams, entityRouteRef } from '../../routes';\nimport { EntityDisplayName } from '../EntityDisplayName';\n\n/**\n * Props for {@link EntityRefLink}.\n *\n * @public\n */\nexport type EntityRefLinkProps = {\n entityRef: Entity | CompoundEntityRef | string;\n defaultKind?: string;\n defaultNamespace?: string;\n /** @deprecated This option should no longer be used; presentation is requested through the {@link entityPresentationApiRef} instead */\n title?: string;\n children?: ReactNode;\n hideIcon?: boolean;\n disableTooltip?: boolean;\n} & Omit<LinkProps, 'to'>;\n\n/**\n * Shows a clickable link to an entity.\n *\n * @public\n */\nexport const EntityRefLink = forwardRef<any, EntityRefLinkProps>(\n (props, ref) => {\n const {\n entityRef,\n defaultKind,\n defaultNamespace,\n title,\n children,\n hideIcon,\n disableTooltip,\n ...linkProps\n } = props;\n const entityRoute = useEntityRoute(props.entityRef);\n\n const content = children ?? title ?? (\n <EntityDisplayName\n entityRef={entityRef}\n defaultKind={defaultKind}\n defaultNamespace={defaultNamespace}\n hideIcon={hideIcon}\n disableTooltip={disableTooltip}\n />\n );\n\n return (\n <Link {...linkProps} ref={ref} to={entityRoute}>\n {content}\n </Link>\n );\n },\n) as (props: EntityRefLinkProps) => JSX.Element;\n\n// Hook that computes the route to a given entity / ref. This is a bit\n// contrived, because it tries to retain the casing of the entity name if\n// present, but not of other parts. This is in an attempt to make slightly more\n// nice-looking URLs.\nfunction useEntityRoute(\n entityRef: Entity | CompoundEntityRef | string,\n): string {\n const entityRoute = useRouteRef(entityRouteRef);\n\n const routeParams = entityRouteParams(entityRef, { encodeParams: true });\n\n return entityRoute(routeParams);\n}\n"],"names":[],"mappings":";;;;;;;AA4CO,MAAM,aAAA,GAAgB,UAAA;AAAA,EAC3B,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM;AAAA,MACJ,SAAA;AAAA,MACA,WAAA;AAAA,MACA,gBAAA;AAAA,MACA,KAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,cAAA;AAAA,MACA,GAAG;AAAA,KACL,GAAI,KAAA;AACJ,IAAA,MAAM,WAAA,GAAc,cAAA,CAAe,KAAA,CAAM,SAAS,CAAA;AAElD,IAAA,MAAM,OAAA,GAAU,YAAY,KAAA,oBAC1B,GAAA;AAAA,MAAC,iBAAA;AAAA,MAAA;AAAA,QACC,SAAA;AAAA,QACA,WAAA;AAAA,QACA,gBAAA;AAAA,QACA,QAAA;AAAA,QACA;AAAA;AAAA,KACF;AAGF,IAAA,2BACG,IAAA,EAAA,EAAM,GAAG,WAAW,GAAA,EAAU,EAAA,EAAI,aAChC,QAAA,EAAA,OAAA,EACH,CAAA;AAAA,EAEJ;AACF;AAMA,SAAS,eACP,SAAA,EACQ;AACR,EAAA,MAAM,WAAA,GAAc,YAAY,cAAc,CAAA;AAE9C,EAAA,MAAM,cAAc,iBAAA,CAAkB,SAAA,EAAW,EAAE,YAAA,EAAc,MAAM,CAAA;AAEvE,EAAA,OAAO,YAAY,WAAW,CAAA;AAChC;;;;"}
1
+ {"version":3,"file":"EntityRefLink.esm.js","sources":["../../../src/components/EntityRefLink/EntityRefLink.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 { CompoundEntityRef, Entity } from '@backstage/catalog-model';\nimport { Link, LinkProps } from '@backstage/core-components';\nimport { useRouteRef } from '@backstage/core-plugin-api';\nimport { ReactNode, forwardRef, useCallback } from 'react';\nimport { entityRouteParams, entityRouteRef } from '../../routes';\nimport { EntityDisplayName } from '../EntityDisplayName';\n\n/**\n * Props for {@link EntityRefLink}.\n *\n * @public\n */\nexport type EntityRefLinkProps = {\n entityRef: Entity | CompoundEntityRef | string;\n defaultKind?: string;\n defaultNamespace?: string;\n /** @deprecated This option should no longer be used; presentation is requested through the {@link entityPresentationApiRef} instead */\n title?: string;\n children?: ReactNode;\n hideIcon?: boolean;\n disableTooltip?: boolean;\n} & Omit<LinkProps, 'to'>;\n\n/**\n * Shows a clickable link to an entity.\n *\n * @public\n */\nexport const EntityRefLink = forwardRef<any, EntityRefLinkProps>(\n (props, ref) => {\n const {\n entityRef,\n defaultKind,\n defaultNamespace,\n title,\n children,\n hideIcon,\n disableTooltip,\n ...linkProps\n } = props;\n const entityLink = useEntityRefLink();\n\n const content = children ?? title ?? (\n <EntityDisplayName\n entityRef={entityRef}\n defaultKind={defaultKind}\n defaultNamespace={defaultNamespace}\n hideIcon={hideIcon}\n disableTooltip={disableTooltip}\n />\n );\n\n return (\n <Link {...linkProps} ref={ref} to={entityLink(props.entityRef)}>\n {content}\n </Link>\n );\n },\n) as (props: EntityRefLinkProps) => JSX.Element;\n\n/**\n * Returns a function that generates a route path to the given entity.\n *\n * @public\n */\nexport function useEntityRefLink(): (\n entityRef: Entity | CompoundEntityRef | string,\n) => string {\n const entityRoute = useRouteRef(entityRouteRef);\n\n return useCallback(\n (entityRef: Entity | CompoundEntityRef | string) => {\n const routeParams = entityRouteParams(entityRef, { encodeParams: true });\n return entityRoute(routeParams);\n },\n [entityRoute],\n );\n}\n"],"names":[],"mappings":";;;;;;;AA4CO,MAAM,aAAA,GAAgB,UAAA;AAAA,EAC3B,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM;AAAA,MACJ,SAAA;AAAA,MACA,WAAA;AAAA,MACA,gBAAA;AAAA,MACA,KAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,cAAA;AAAA,MACA,GAAG;AAAA,KACL,GAAI,KAAA;AACJ,IAAA,MAAM,aAAa,gBAAA,EAAiB;AAEpC,IAAA,MAAM,OAAA,GAAU,YAAY,KAAA,oBAC1B,GAAA;AAAA,MAAC,iBAAA;AAAA,MAAA;AAAA,QACC,SAAA;AAAA,QACA,WAAA;AAAA,QACA,gBAAA;AAAA,QACA,QAAA;AAAA,QACA;AAAA;AAAA,KACF;AAGF,IAAA,uBACE,GAAA,CAAC,IAAA,EAAA,EAAM,GAAG,SAAA,EAAW,GAAA,EAAU,IAAI,UAAA,CAAW,KAAA,CAAM,SAAS,CAAA,EAC1D,QAAA,EAAA,OAAA,EACH,CAAA;AAAA,EAEJ;AACF;AAOO,SAAS,gBAAA,GAEJ;AACV,EAAA,MAAM,WAAA,GAAc,YAAY,cAAc,CAAA;AAE9C,EAAA,OAAO,WAAA;AAAA,IACL,CAAC,SAAA,KAAmD;AAClD,MAAA,MAAM,cAAc,iBAAA,CAAkB,SAAA,EAAW,EAAE,YAAA,EAAc,MAAM,CAAA;AACvE,MAAA,OAAO,YAAY,WAAW,CAAA;AAAA,IAChC,CAAA;AAAA,IACA,CAAC,WAAW;AAAA,GACd;AACF;;;;"}
package/dist/index.d.ts CHANGED
@@ -366,6 +366,12 @@ type EntityRefLinkProps = {
366
366
  * @public
367
367
  */
368
368
  declare const EntityRefLink: (props: EntityRefLinkProps) => JSX.Element;
369
+ /**
370
+ * Returns a function that generates a route path to the given entity.
371
+ *
372
+ * @public
373
+ */
374
+ declare function useEntityRefLink(): (entityRef: Entity | CompoundEntityRef | string) => string;
369
375
 
370
376
  /**
371
377
  * Props for {@link EntityRefLink}.
@@ -825,6 +831,17 @@ declare function MissingAnnotationEmptyState(props: {
825
831
  readMoreUrl?: string;
826
832
  }): react_jsx_runtime.JSX.Element;
827
833
 
834
+ /** @public */
835
+ interface EntityInfoCardProps {
836
+ title?: ReactNode;
837
+ headerActions?: ReactNode;
838
+ footerActions?: ReactNode;
839
+ children?: ReactNode;
840
+ className?: string;
841
+ }
842
+ /** @public */
843
+ declare function EntityInfoCard(props: EntityInfoCardProps): react_jsx_runtime.JSX.Element;
844
+
828
845
  /** @public */
829
846
  type EntityLoadingStatus<TEntity extends Entity = Entity> = {
830
847
  entity?: TEntity;
@@ -1023,5 +1040,5 @@ declare function MockEntityListContextProvider<T extends DefaultEntityFilters =
1023
1040
  */
1024
1041
  declare const EntityListContext: react.Context<EntityListContextProps<any> | undefined>;
1025
1042
 
1026
- export { AsyncEntityProvider, CatalogAutocomplete, CatalogFilterLayout, DefaultFilters, EntityAutocompletePicker, EntityDisplayName, EntityErrorFilter, EntityKindFilter, EntityKindPicker, EntityLifecycleFilter, EntityLifecyclePicker, EntityListContext, EntityListProvider, EntityNamespaceFilter, EntityNamespacePicker, EntityOrderFilter, EntityOrphanFilter, EntityOwnerFilter, EntityOwnerPicker, EntityPeekAheadPopover, EntityProcessingStatusPicker, EntityProvider, EntityRefLink, EntityRefLinks, EntitySearchBar, EntityTable, EntityTagFilter, EntityTagPicker, EntityTextFilter, EntityTypeFilter, EntityTypePicker, EntityUserFilter, FavoriteEntity, InspectEntityDialog, MissingAnnotationEmptyState, MockEntityListContextProvider, MockStarredEntitiesApi, UnregisterEntityDialog, UserListFilter, UserListPicker, catalogApiRef, columnFactories, defaultEntityPresentation, entityPresentationApiRef, entityRouteParams, entityRouteRef, getEntityRelations, getEntitySourceLocation, humanizeEntityRef, starredEntitiesApiRef, useAsyncEntity, useEntity, useEntityList, useEntityOwnership, useEntityPresentation, useEntityTypeFilter, useRelatedEntities, useStarredEntities, useStarredEntity };
1027
- export type { AllowedEntityFilters, AsyncEntityProviderProps, BackstageOverrides, CatalogAutocompleteProps, CatalogReactComponentsNameToClassKey, CatalogReactEntityAutocompletePickerClassKey, CatalogReactEntityDisplayNameClassKey, CatalogReactEntityLifecyclePickerClassKey, CatalogReactEntityNamespacePickerClassKey, CatalogReactEntityOwnerPickerClassKey, CatalogReactEntityProcessingStatusPickerClassKey, CatalogReactEntitySearchBarClassKey, CatalogReactEntityTagPickerClassKey, CatalogReactUserListPickerClassKey, DefaultEntityFilters, DefaultFiltersProps, EntityAutocompletePickerProps, EntityDisplayNameProps, EntityFilter, EntityKindPickerProps, EntityListContextProps, EntityListPagination, EntityListProviderProps, EntityLoadingStatus, EntityNamespacePickerProps, EntityOwnerPickerProps, EntityPeekAheadPopoverProps, EntityPresentationApi, EntityProviderProps, EntityRefLinkProps, EntityRefLinksProps, EntityRefPresentation, EntityRefPresentationSnapshot, EntityRouteParamsOptions, EntitySourceLocation, EntityTableProps, EntityTagPickerProps, EntityTypePickerProps, FavoriteEntityProps, FixedWidthFormControlLabelClassKey, MissingAnnotationEmptyStateClassKey, PaginationMode, StarredEntitiesApi, UnregisterEntityDialogProps, UserListFilterKind, UserListPickerProps };
1043
+ export { AsyncEntityProvider, CatalogAutocomplete, CatalogFilterLayout, DefaultFilters, EntityAutocompletePicker, EntityDisplayName, EntityErrorFilter, EntityInfoCard, EntityKindFilter, EntityKindPicker, EntityLifecycleFilter, EntityLifecyclePicker, EntityListContext, EntityListProvider, EntityNamespaceFilter, EntityNamespacePicker, EntityOrderFilter, EntityOrphanFilter, EntityOwnerFilter, EntityOwnerPicker, EntityPeekAheadPopover, EntityProcessingStatusPicker, EntityProvider, EntityRefLink, EntityRefLinks, EntitySearchBar, EntityTable, EntityTagFilter, EntityTagPicker, EntityTextFilter, EntityTypeFilter, EntityTypePicker, EntityUserFilter, FavoriteEntity, InspectEntityDialog, MissingAnnotationEmptyState, MockEntityListContextProvider, MockStarredEntitiesApi, UnregisterEntityDialog, UserListFilter, UserListPicker, catalogApiRef, columnFactories, defaultEntityPresentation, entityPresentationApiRef, entityRouteParams, entityRouteRef, getEntityRelations, getEntitySourceLocation, humanizeEntityRef, starredEntitiesApiRef, useAsyncEntity, useEntity, useEntityList, useEntityOwnership, useEntityPresentation, useEntityRefLink, useEntityTypeFilter, useRelatedEntities, useStarredEntities, useStarredEntity };
1044
+ export type { AllowedEntityFilters, AsyncEntityProviderProps, BackstageOverrides, CatalogAutocompleteProps, CatalogReactComponentsNameToClassKey, CatalogReactEntityAutocompletePickerClassKey, CatalogReactEntityDisplayNameClassKey, CatalogReactEntityLifecyclePickerClassKey, CatalogReactEntityNamespacePickerClassKey, CatalogReactEntityOwnerPickerClassKey, CatalogReactEntityProcessingStatusPickerClassKey, CatalogReactEntitySearchBarClassKey, CatalogReactEntityTagPickerClassKey, CatalogReactUserListPickerClassKey, DefaultEntityFilters, DefaultFiltersProps, EntityAutocompletePickerProps, EntityDisplayNameProps, EntityFilter, EntityInfoCardProps, EntityKindPickerProps, EntityListContextProps, EntityListPagination, EntityListProviderProps, EntityLoadingStatus, EntityNamespacePickerProps, EntityOwnerPickerProps, EntityPeekAheadPopoverProps, EntityPresentationApi, EntityProviderProps, EntityRefLinkProps, EntityRefLinksProps, EntityRefPresentation, EntityRefPresentationSnapshot, EntityRouteParamsOptions, EntitySourceLocation, EntityTableProps, EntityTagPickerProps, EntityTypePickerProps, FavoriteEntityProps, FixedWidthFormControlLabelClassKey, MissingAnnotationEmptyStateClassKey, PaginationMode, StarredEntitiesApi, UnregisterEntityDialogProps, UserListFilterKind, UserListPickerProps };
package/dist/index.esm.js CHANGED
@@ -12,7 +12,7 @@ export { EntityKindPicker } from './components/EntityKindPicker/EntityKindPicker
12
12
  export { EntityLifecyclePicker } from './components/EntityLifecyclePicker/EntityLifecyclePicker.esm.js';
13
13
  export { EntityOwnerPicker } from './components/EntityOwnerPicker/EntityOwnerPicker.esm.js';
14
14
  export { EntityDisplayName } from './components/EntityDisplayName/EntityDisplayName.esm.js';
15
- export { EntityRefLink } from './components/EntityRefLink/EntityRefLink.esm.js';
15
+ export { EntityRefLink, useEntityRefLink } from './components/EntityRefLink/EntityRefLink.esm.js';
16
16
  export { EntityRefLinks } from './components/EntityRefLink/EntityRefLinks.esm.js';
17
17
  export { humanizeEntityRef } from './components/EntityRefLink/humanize.esm.js';
18
18
  export { EntityPeekAheadPopover } from './components/EntityPeekAheadPopover/EntityPeekAheadPopover.esm.js';
@@ -29,6 +29,7 @@ export { EntityProcessingStatusPicker } from './components/EntityProcessingStatu
29
29
  export { EntityNamespacePicker } from './components/EntityNamespacePicker/EntityNamespacePicker.esm.js';
30
30
  export { EntityAutocompletePicker } from './components/EntityAutocompletePicker/EntityAutocompletePicker.esm.js';
31
31
  export { MissingAnnotationEmptyState } from './components/MissingAnnotationEmptyState/MissingAnnotationEmptyState.esm.js';
32
+ export { EntityInfoCard } from './components/EntityInfoCard/EntityInfoCard.esm.js';
32
33
  export { AsyncEntityProvider, EntityProvider, useAsyncEntity, useEntity } from './hooks/useEntity.esm.js';
33
34
  export { EntityListProvider, useEntityList } from './hooks/useEntityListProvider.esm.js';
34
35
  export { useEntityTypeFilter } from './hooks/useEntityTypeFilter.esm.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-react",
3
- "version": "2.0.1-next.0",
3
+ "version": "2.1.0-next.2",
4
4
  "description": "A frontend library that helps other Backstage plugins interact with the catalog",
5
5
  "backstage": {
6
6
  "role": "web-library",
@@ -73,20 +73,20 @@
73
73
  "test": "backstage-cli package test"
74
74
  },
75
75
  "dependencies": {
76
- "@backstage/catalog-client": "1.13.1-next.0",
76
+ "@backstage/catalog-client": "1.14.0-next.2",
77
77
  "@backstage/catalog-model": "1.7.6",
78
- "@backstage/core-compat-api": "0.5.9-next.0",
79
- "@backstage/core-components": "0.18.8-next.0",
80
- "@backstage/core-plugin-api": "1.12.4-next.0",
78
+ "@backstage/core-compat-api": "0.5.9-next.2",
79
+ "@backstage/core-components": "0.18.8-next.1",
80
+ "@backstage/core-plugin-api": "1.12.4-next.1",
81
81
  "@backstage/errors": "1.2.7",
82
82
  "@backstage/filter-predicates": "0.1.0",
83
- "@backstage/frontend-plugin-api": "0.14.2-next.0",
84
- "@backstage/integration-react": "1.2.16-next.0",
83
+ "@backstage/frontend-plugin-api": "0.15.0-next.1",
84
+ "@backstage/integration-react": "1.2.16-next.1",
85
85
  "@backstage/plugin-catalog-common": "1.1.8",
86
86
  "@backstage/plugin-permission-common": "0.9.6",
87
87
  "@backstage/plugin-permission-react": "0.4.41-next.0",
88
88
  "@backstage/types": "1.2.2",
89
- "@backstage/ui": "0.12.1-next.0",
89
+ "@backstage/ui": "0.13.0-next.2",
90
90
  "@backstage/version-bridge": "1.0.12",
91
91
  "@material-ui/core": "^4.12.2",
92
92
  "@material-ui/icons": "^4.9.1",
@@ -101,11 +101,11 @@
101
101
  "zen-observable": "^0.10.0"
102
102
  },
103
103
  "devDependencies": {
104
- "@backstage/cli": "0.35.5-next.0",
105
- "@backstage/core-app-api": "1.19.6-next.0",
106
- "@backstage/frontend-test-utils": "0.5.1-next.0",
104
+ "@backstage/cli": "0.36.0-next.2",
105
+ "@backstage/core-app-api": "1.19.6-next.1",
106
+ "@backstage/frontend-test-utils": "0.5.1-next.2",
107
107
  "@backstage/plugin-catalog-common": "1.1.8",
108
- "@backstage/plugin-scaffolder-common": "1.7.7-next.0",
108
+ "@backstage/plugin-scaffolder-common": "2.0.0-next.2",
109
109
  "@backstage/test-utils": "1.7.16-next.0",
110
110
  "@testing-library/dom": "^10.0.0",
111
111
  "@testing-library/jest-dom": "^6.0.0",
@@ -120,7 +120,7 @@
120
120
  "zod": "^3.25.76"
121
121
  },
122
122
  "peerDependencies": {
123
- "@backstage/frontend-test-utils": "0.5.1-next.0",
123
+ "@backstage/frontend-test-utils": "0.5.1-next.2",
124
124
  "@types/react": "^17.0.0 || ^18.0.0",
125
125
  "react": "^17.0.0 || ^18.0.0",
126
126
  "react-dom": "^17.0.0 || ^18.0.0",