catalog-unprocessed-entities - Added alpha support for the New Frontend System

Signed-off-by: Andre Wanlin <awanlin@spotify.com>
This commit is contained in:
Andre Wanlin
2025-02-13 11:53:18 -06:00
parent 09152f42fe
commit e09d3e8399
8 changed files with 248 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-unprocessed-entities': patch
---
Added alpha support for the New Frontend System
@@ -44,6 +44,26 @@ import { CatalogUnprocessedEntitiesPage } from '@backstage/plugin-catalog-unproc
/>;
```
### Integrating with the New Frontend System
Follow this section if you are using Backstage's [new frontend system](https://backstage.io/docs/frontend-system/).
Import `catalogUnprocessedEntitiesPlugin` in your `App.tsx` and add it to your app's `features` array:
```typescript
import catalogUnprocessedEntitiesPlugin from '@backstage/plugin-catalog-unprocessed-entities';
// ...
export const app = createApp({
features: [
// ...
catalogUnprocessedEntitiesPlugin,
// ...
],
});
```
## Customization
If you want to use the provided endpoints in a different way, you can use the ApiRef doing the following:
@@ -22,6 +22,11 @@
},
"license": "Apache-2.0",
"sideEffects": false,
"exports": {
".": "./src/index.ts",
"./alpha": "./src/alpha.ts",
"./package.json": "./package.json"
},
"main": "src/index.ts",
"types": "src/index.ts",
"files": [
@@ -38,9 +43,11 @@
},
"dependencies": {
"@backstage/catalog-model": "workspace:^",
"@backstage/core-compat-api": "workspace:^",
"@backstage/core-components": "workspace:^",
"@backstage/core-plugin-api": "workspace:^",
"@backstage/errors": "workspace:^",
"@backstage/frontend-plugin-api": "workspace:^",
"@material-ui/core": "^4.9.13",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.60",
@@ -0,0 +1,93 @@
## API Report File for "@backstage/plugin-catalog-unprocessed-entities"
> 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 { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api';
import { ExtensionDefinition } from '@backstage/frontend-plugin-api';
import { FrontendPlugin } from '@backstage/frontend-plugin-api';
import { IconComponent } from '@backstage/core-plugin-api';
import { default as React_2 } from 'react';
import { RouteRef } from '@backstage/frontend-plugin-api';
// @alpha (undocumented)
const _default: FrontendPlugin<
{
root: RouteRef<undefined>;
},
{},
{
'page:catalog-unprocessed-entities': ExtensionDefinition<{
kind: 'page';
name: undefined;
config: {
path: string | undefined;
};
configInput: {
path?: string | undefined;
};
output:
| ConfigurableExtensionDataRef<
React_2.JSX.Element,
'core.reactElement',
{}
>
| ConfigurableExtensionDataRef<string, 'core.routing.path', {}>
| ConfigurableExtensionDataRef<
RouteRef<AnyRouteRefParams>,
'core.routing.ref',
{
optional: true;
}
>;
inputs: {};
params: {
defaultPath: string;
loader: () => Promise<JSX.Element>;
routeRef?: RouteRef<AnyRouteRefParams> | undefined;
};
}>;
'nav-item:catalog-unprocessed-entities': ExtensionDefinition<{
kind: 'nav-item';
name: undefined;
config: {};
configInput: {};
output: ConfigurableExtensionDataRef<
{
title: string;
icon: IconComponent;
routeRef: RouteRef<undefined>;
},
'core.nav-item.target',
{}
>;
inputs: {};
params: {
title: string;
icon: IconComponent;
routeRef: RouteRef<undefined>;
};
}>;
'api:catalog-unprocessed-entities': ExtensionDefinition<{
kind: 'api';
name: undefined;
config: {};
configInput: {};
output: ConfigurableExtensionDataRef<
AnyApiFactory,
'core.api.factory',
{}
>;
inputs: {};
params: {
factory: AnyApiFactory;
};
}>;
}
>;
export default _default;
// (No @packageDocumentation comment for this package)
```
@@ -0,0 +1,18 @@
/*
* Copyright 2023 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './alpha/index';
export { default } from './alpha/index';
@@ -0,0 +1,17 @@
/*
* Copyright 2023 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { default } from './plugin';
@@ -0,0 +1,86 @@
/*
* Copyright 2023 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import {
createApiFactory,
createFrontendPlugin,
discoveryApiRef,
fetchApiRef,
ApiBlueprint,
PageBlueprint,
NavItemBlueprint,
} from '@backstage/frontend-plugin-api';
import {
catalogUnprocessedEntitiesApiRef,
CatalogUnprocessedEntitiesClient,
} from '../api';
import {
compatWrapper,
convertLegacyRouteRef,
} from '@backstage/core-compat-api';
import QueueIcon from '@material-ui/icons/Queue';
import { rootRouteRef } from '../routes';
/** @alpha */
export const catalogUnprocessedEntitiesApi = ApiBlueprint.make({
params: {
factory: createApiFactory({
api: catalogUnprocessedEntitiesApiRef,
deps: {
discoveryApi: discoveryApiRef,
fetchApi: fetchApiRef,
},
factory: ({ discoveryApi, fetchApi }) =>
new CatalogUnprocessedEntitiesClient(discoveryApi, fetchApi),
}),
},
});
/** @alpha */
export const catalogUnprocessedEntitiesPage = PageBlueprint.make({
params: {
defaultPath: '/catalog-unprocessed-entities',
routeRef: convertLegacyRouteRef(rootRouteRef),
loader: () =>
import('../components/UnprocessedEntities').then(m =>
compatWrapper(<m.UnprocessedEntities />),
),
},
});
/** @alpha */
export const catalogUnprocessedEntitiesNavItem = NavItemBlueprint.make({
params: {
title: 'Unprocessed Entities',
routeRef: convertLegacyRouteRef(rootRouteRef),
icon: QueueIcon,
},
});
/** @alpha */
export default createFrontendPlugin({
id: 'catalog-unprocessed-entities',
routes: {
root: convertLegacyRouteRef(rootRouteRef),
},
extensions: [
catalogUnprocessedEntitiesApi,
catalogUnprocessedEntitiesPage,
catalogUnprocessedEntitiesNavItem,
],
});
+2
View File
@@ -6405,10 +6405,12 @@ __metadata:
dependencies:
"@backstage/catalog-model": "workspace:^"
"@backstage/cli": "workspace:^"
"@backstage/core-compat-api": "workspace:^"
"@backstage/core-components": "workspace:^"
"@backstage/core-plugin-api": "workspace:^"
"@backstage/dev-utils": "workspace:^"
"@backstage/errors": "workspace:^"
"@backstage/frontend-plugin-api": "workspace:^"
"@material-ui/core": ^4.9.13
"@material-ui/icons": ^4.9.1
"@material-ui/lab": ^4.0.0-alpha.60