Merge pull request #31201 from backstage/api
Fix API error in catalog graph plugin
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-catalog-graph': patch
|
||||
---
|
||||
|
||||
Add missing API implementation for catalog graph plugin in NFS apps.
|
||||
@@ -3,11 +3,14 @@
|
||||
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
||||
|
||||
```ts
|
||||
import { AnyApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { AnyRouteRefParams } from '@backstage/frontend-plugin-api';
|
||||
import { ApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { Direction } from '@backstage/plugin-catalog-graph';
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import { EntityCardType } from '@backstage/plugin-catalog-react/alpha';
|
||||
import { EntityPredicate } from '@backstage/plugin-catalog-react/alpha';
|
||||
import { ExtensionBlueprintParams } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionDefinition } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionInput } from '@backstage/frontend-plugin-api';
|
||||
@@ -58,6 +61,21 @@ const _default: OverridableFrontendPlugin<
|
||||
}>;
|
||||
},
|
||||
{
|
||||
'api:catalog-graph': ExtensionDefinition<{
|
||||
kind: 'api';
|
||||
name: undefined;
|
||||
config: {};
|
||||
configInput: {};
|
||||
output: ExtensionDataRef<AnyApiFactory, 'core.api.factory', {}>;
|
||||
inputs: {};
|
||||
params: <
|
||||
TApi,
|
||||
TImpl extends TApi,
|
||||
TDeps extends { [name in string]: unknown },
|
||||
>(
|
||||
params: ApiFactory<TApi, TImpl, TDeps>,
|
||||
) => ExtensionBlueprintParams<AnyApiFactory>;
|
||||
}>;
|
||||
'entity-card:catalog-graph/relations': ExtensionDefinition<{
|
||||
config: {
|
||||
kinds: string[] | undefined;
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiBlueprint,
|
||||
createFrontendPlugin,
|
||||
PageBlueprint,
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
@@ -24,7 +25,11 @@ import {
|
||||
} from '@backstage/core-compat-api';
|
||||
import { EntityCardBlueprint } from '@backstage/plugin-catalog-react/alpha';
|
||||
import { catalogGraphRouteRef, catalogEntityRouteRef } from './routes';
|
||||
import { Direction } from '@backstage/plugin-catalog-graph';
|
||||
import {
|
||||
catalogGraphApiRef,
|
||||
DefaultCatalogGraphApi,
|
||||
Direction,
|
||||
} from '@backstage/plugin-catalog-graph';
|
||||
|
||||
const CatalogGraphEntityCard = EntityCardBlueprint.makeWithOverrides({
|
||||
name: 'relations',
|
||||
@@ -85,6 +90,15 @@ const CatalogGraphPage = PageBlueprint.makeWithOverrides({
|
||||
},
|
||||
});
|
||||
|
||||
const CatalogGraphApi = ApiBlueprint.make({
|
||||
params: defineParams =>
|
||||
defineParams({
|
||||
api: catalogGraphApiRef,
|
||||
deps: {},
|
||||
factory: () => new DefaultCatalogGraphApi(),
|
||||
}),
|
||||
});
|
||||
|
||||
export default createFrontendPlugin({
|
||||
pluginId: 'catalog-graph',
|
||||
info: { packageJson: () => import('../package.json') },
|
||||
@@ -94,7 +108,7 @@ export default createFrontendPlugin({
|
||||
externalRoutes: {
|
||||
catalogEntity: convertLegacyRouteRef(catalogEntityRouteRef),
|
||||
},
|
||||
extensions: [CatalogGraphPage, CatalogGraphEntityCard],
|
||||
extensions: [CatalogGraphPage, CatalogGraphEntityCard, CatalogGraphApi],
|
||||
});
|
||||
|
||||
export { catalogGraphTranslationRef } from './translation';
|
||||
|
||||
Reference in New Issue
Block a user