[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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user