[k8s] async formatClusterLink (#21535)

This is a refactor PR for formatClusterLink.
It rewrites it to be an API and allows async creation of cluster link.

Signed-off-by: Tomasz Szuba <tszuba@box.com>
This commit is contained in:
Tomasz Szuba
2023-11-30 20:37:14 +01:00
committed by GitHub
parent 950f8f5378
commit 899d71a37c
40 changed files with 882 additions and 768 deletions
+15
View File
@@ -20,6 +20,10 @@ import {
kubernetesAuthProvidersApiRef,
KubernetesAuthProviders,
KubernetesProxyClient,
kubernetesClusterLinkFormatterApiRef,
getDefaultFormatters,
KubernetesClusterLinkFormatter,
DEFAULT_FORMATTER_NAME,
} from '@backstage/plugin-kubernetes-react';
import {
createApiFactory,
@@ -97,6 +101,17 @@ export const kubernetesPlugin = createPlugin({
});
},
}),
createApiFactory({
api: kubernetesClusterLinkFormatterApiRef,
deps: {},
factory: deps => {
const formatters = getDefaultFormatters(deps);
return new KubernetesClusterLinkFormatter({
formatters,
defaultFormatterName: DEFAULT_FORMATTER_NAME,
});
},
}),
],
routes: {
entityContent: rootCatalogKubernetesRouteRef,