From 61dd6c5749f30b7d6c447c4a62ca40594e9309ba Mon Sep 17 00:00:00 2001 From: Christian Marker / Intility AS Date: Tue, 13 Sep 2022 11:49:03 +0200 Subject: [PATCH] fix: invalid import Signed-off-by: Christian Marker / Intility AS --- plugins/scaffolder/package.json | 1 + .../components/TemplateCard/TemplateCard.tsx | 37 ++++++++----------- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/plugins/scaffolder/package.json b/plugins/scaffolder/package.json index 5416c0bb2c..c22892ec87 100644 --- a/plugins/scaffolder/package.json +++ b/plugins/scaffolder/package.json @@ -41,6 +41,7 @@ "@backstage/errors": "^1.1.0", "@backstage/integration": "^1.3.1-next.1", "@backstage/integration-react": "^1.1.4-next.1", + "@backstage/plugin-catalog": "^1.5.1-next.2", "@backstage/plugin-catalog-common": "^1.0.6-next.0", "@backstage/plugin-catalog-react": "^1.1.4-next.1", "@backstage/plugin-permission-react": "^0.4.5-next.1", diff --git a/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx b/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx index 3ca93cba3d..c4368a7319 100644 --- a/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx +++ b/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx @@ -21,18 +21,7 @@ import { RELATION_OWNED_BY, stringifyEntityRef, } from '@backstage/catalog-model'; -import { - Button, - ItemCardHeader, - MarkdownContent, -} from '@backstage/core-components'; -import { - createExternalRouteRef, - IconComponent, - useApi, - useApp, - useRouteRef, -} from '@backstage/core-plugin-api'; +import { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common'; import { ScmIntegrationIcon, scmIntegrationsApiRef, @@ -43,7 +32,6 @@ import { getEntityRelations, getEntitySourceLocation, } from '@backstage/plugin-catalog-react'; -import { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common'; import { BackstageTheme } from '@backstage/theme'; import { Box, @@ -59,11 +47,24 @@ import { Typography, useTheme, } from '@material-ui/core'; -import LanguageIcon from '@material-ui/icons/Language'; import WarningIcon from '@material-ui/icons/Warning'; +import LanguageIcon from '@material-ui/icons/Language'; import React from 'react'; import { selectedTemplateRouteRef } from '../../routes'; +import { + Button, + ItemCardHeader, + MarkdownContent, +} from '@backstage/core-components'; +import { + IconComponent, + useApi, + useApp, + useRouteRef, +} from '@backstage/core-plugin-api'; +import { viewTechDocRouteRef } from '@backstage/plugin-catalog'; + const useStyles = makeStyles(theme => ({ cardHeader: { position: 'relative', @@ -191,13 +192,7 @@ export const TemplateCard = ({ template, deprecated }: TemplateCardProps) => { const href = templateRoute({ templateName: name, namespace }); // TechDocs Links - const viewTechDocsRoute = useRouteRef( - createExternalRouteRef({ - id: 'view-techdoc', - optional: true, - params: ['namespace', 'kind', 'name'], - }), - ); + const viewTechDocsRoute = useRouteRef(viewTechDocRouteRef); const viewTechDocsAnnotation = template.metadata.annotations?.['backstage.io/techdocs-ref']; const viewTechDocsLink =