From 410e592552a46aa439fe81852bb957cd5bc3307b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Wed, 23 Feb 2022 11:14:03 +0100 Subject: [PATCH] stop using EntityRef in bazaar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .../HomePageBazaarInfoCard/HomePageBazaarInfoCard.tsx | 3 +-- plugins/bazaar/src/components/SortView/SortView.tsx | 2 +- plugins/bazaar/src/types.ts | 4 +--- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/plugins/bazaar/src/components/HomePageBazaarInfoCard/HomePageBazaarInfoCard.tsx b/plugins/bazaar/src/components/HomePageBazaarInfoCard/HomePageBazaarInfoCard.tsx index 5624f40765..ec29d1429b 100644 --- a/plugins/bazaar/src/components/HomePageBazaarInfoCard/HomePageBazaarInfoCard.tsx +++ b/plugins/bazaar/src/components/HomePageBazaarInfoCard/HomePageBazaarInfoCard.tsx @@ -47,7 +47,6 @@ import useAsyncFn from 'react-use/lib/useAsyncFn'; import { catalogApiRef, entityRouteRef } from '@backstage/plugin-catalog-react'; import { - parseEntityName, stringifyEntityRef, Entity, parseEntityRef, @@ -150,7 +149,7 @@ export const HomePageBazaarInfoCard = ({ const getEntityPageLink = () => { if (bazaarProject?.value?.entityRef) { - const { name, kind, namespace } = parseEntityName( + const { name, kind, namespace } = parseEntityRef( bazaarProject.value.entityRef, ); return entityLink({ kind, namespace, name }); diff --git a/plugins/bazaar/src/components/SortView/SortView.tsx b/plugins/bazaar/src/components/SortView/SortView.tsx index fa97ac69ee..f5bb6facd7 100644 --- a/plugins/bazaar/src/components/SortView/SortView.tsx +++ b/plugins/bazaar/src/components/SortView/SortView.tsx @@ -107,7 +107,7 @@ export const SortView = () => { if (catalogEntityRefs) { bazaarProjects.value?.forEach(async (project: BazaarProject) => { if (project.entityRef) { - if (!catalogEntityRefs?.includes(project.entityRef as string)) { + if (!catalogEntityRefs?.includes(project.entityRef)) { await bazaarApi.updateProject({ ...project, entityRef: null, diff --git a/plugins/bazaar/src/types.ts b/plugins/bazaar/src/types.ts index 30c07286ac..ec3996d1e2 100644 --- a/plugins/bazaar/src/types.ts +++ b/plugins/bazaar/src/types.ts @@ -14,8 +14,6 @@ * limitations under the License. */ -import { EntityRef } from '@backstage/catalog-model'; - export type Member = { itemId: number; userId: string; @@ -30,7 +28,7 @@ export type Size = 'small' | 'medium' | 'large'; export type BazaarProject = { name: string; id: number; - entityRef?: EntityRef; + entityRef?: string; community: string; status: Status; description: string;