From 8a6950b82221cf62e0e5e229bd64d447d6c98f4f Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Fri, 14 Jan 2022 11:27:03 +0100 Subject: [PATCH] bazaar: stop using catalogRouteRef Signed-off-by: Patrik Oldsberg --- .changeset/shaggy-days-film.md | 5 +++++ .../HomePageBazaarInfoCard/HomePageBazaarInfoCard.tsx | 9 +++------ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 .changeset/shaggy-days-film.md diff --git a/.changeset/shaggy-days-film.md b/.changeset/shaggy-days-film.md new file mode 100644 index 0000000000..ae9c47c318 --- /dev/null +++ b/.changeset/shaggy-days-film.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-bazaar': patch +--- + +Switched out internal usage of the `catalogRouteRef` from `@backstage/plugin-catalog-react`. diff --git a/plugins/bazaar/src/components/HomePageBazaarInfoCard/HomePageBazaarInfoCard.tsx b/plugins/bazaar/src/components/HomePageBazaarInfoCard/HomePageBazaarInfoCard.tsx index 3f9da083bb..5624f40765 100644 --- a/plugins/bazaar/src/components/HomePageBazaarInfoCard/HomePageBazaarInfoCard.tsx +++ b/plugins/bazaar/src/components/HomePageBazaarInfoCard/HomePageBazaarInfoCard.tsx @@ -44,10 +44,7 @@ import { Member, BazaarProject } from '../../types'; import { bazaarApiRef } from '../../api'; import { Alert } from '@material-ui/lab'; import useAsyncFn from 'react-use/lib/useAsyncFn'; -import { - catalogApiRef, - catalogRouteRef, -} from '@backstage/plugin-catalog-react'; +import { catalogApiRef, entityRouteRef } from '@backstage/plugin-catalog-react'; import { parseEntityName, @@ -85,7 +82,7 @@ export const HomePageBazaarInfoCard = ({ initEntity, }: Props) => { const classes = useStyles(); - const catalogLink = useRouteRef(catalogRouteRef); + const entityLink = useRouteRef(entityRouteRef); const bazaarApi = useApi(bazaarApiRef); const identity = useApi(identityApiRef); const catalogApi = useApi(catalogApiRef); @@ -156,7 +153,7 @@ export const HomePageBazaarInfoCard = ({ const { name, kind, namespace } = parseEntityName( bazaarProject.value.entityRef, ); - return `${catalogLink()}/${namespace}/${kind}/${name}`; + return entityLink({ kind, namespace, name }); } return ''; };