diff --git a/.changeset/eight-days-sin.md b/.changeset/eight-days-sin.md new file mode 100644 index 0000000000..71b87ee93d --- /dev/null +++ b/.changeset/eight-days-sin.md @@ -0,0 +1,5 @@ +--- +'@backstage/frontend-plugin-api': patch +--- + +Deprecated `inputs` and `configSchema` options for `createComponentExtenion`, these will be removed in a future release diff --git a/.changeset/swift-dragons-know.md b/.changeset/swift-dragons-know.md new file mode 100644 index 0000000000..7e82994eca --- /dev/null +++ b/.changeset/swift-dragons-know.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-app-visualizer': patch +--- + +Fixing issue with the visualizer crashing when clicking on the detailed view because of `routeRef` parameters diff --git a/packages/frontend-plugin-api/src/extensions/createComponentExtension.tsx b/packages/frontend-plugin-api/src/extensions/createComponentExtension.tsx index a40ee3b069..b83b2586ba 100644 --- a/packages/frontend-plugin-api/src/extensions/createComponentExtension.tsx +++ b/packages/frontend-plugin-api/src/extensions/createComponentExtension.tsx @@ -34,7 +34,9 @@ export function createComponentExtension< ref: ComponentRef; name?: string; disabled?: boolean; + /** @deprecated these will be removed in the future */ inputs?: TInputs; + /** @deprecated these will be removed in the future */ configSchema?: PortableSchema; loader: | { diff --git a/plugins/app-visualizer/src/components/AppVisualizerPage/DetailedVisualizer.tsx b/plugins/app-visualizer/src/components/AppVisualizerPage/DetailedVisualizer.tsx index d22c2d94db..fe255b2ab1 100644 --- a/plugins/app-visualizer/src/components/AppVisualizerPage/DetailedVisualizer.tsx +++ b/plugins/app-visualizer/src/components/AppVisualizerPage/DetailedVisualizer.tsx @@ -189,15 +189,26 @@ function OutputLink(props: { }) { const routeRef = props.node?.instance?.getData(coreExtensionData.routeRef); - const link = useRouteRef(routeRef as RouteRef); + try { + const link = useRouteRef(routeRef as RouteRef); - return ( - {props.dataRef.id}}> - - {link ? link : null} - - - ); + return ( + {props.dataRef.id}}> + + {link ? link : null} + + + ); + } catch (ex) { + // eslint-disable-next-line no-console + console.warn( + props.node?.spec.id + ? `Unable to generate output link for ${props.node.spec.id}` + : 'Unable to generate output link', + ex, + ); + return null; + } } function Output(props: { dataRef: ExtensionDataRef; node?: AppNode }) { diff --git a/plugins/kubernetes/src/alpha/entityContents.tsx b/plugins/kubernetes/src/alpha/entityContents.tsx index de11310981..26730e76d4 100644 --- a/plugins/kubernetes/src/alpha/entityContents.tsx +++ b/plugins/kubernetes/src/alpha/entityContents.tsx @@ -15,19 +15,14 @@ */ import React from 'react'; -import { - compatWrapper, - convertLegacyRouteRef, -} from '@backstage/core-compat-api'; -import { rootCatalogKubernetesRouteRef } from '../plugin'; +import { compatWrapper } from '@backstage/core-compat-api'; import { EntityContentBlueprint } from '@backstage/plugin-catalog-react/alpha'; export const entityKubernetesContent = EntityContentBlueprint.make({ name: 'kubernetes', params: { - defaultPath: 'kubernetes', + defaultPath: '/kubernetes', defaultTitle: 'Kubernetes', - routeRef: convertLegacyRouteRef(rootCatalogKubernetesRouteRef), loader: () => import('./KubernetesContentPage').then(m => compatWrapper(),