implement change requests
Signed-off-by: secustor <sebastian@poxhofer.at>
This commit is contained in:
+14
-12
@@ -169,23 +169,25 @@ yarn --cwd plugins/<your-plugin> add @backstage/plugin-devtools-react
|
||||
```
|
||||
|
||||
```tsx
|
||||
import { DevToolsRouteBlueprint } from '@backstage/plugin-devtools-react';
|
||||
import { DevToolsContentBlueprint } from '@backstage/plugin-devtools-react';
|
||||
|
||||
export const unprocessedEntitiesDevToolsRoute = DevToolsRouteBlueprint.make({
|
||||
params: {
|
||||
path: 'unprocessed-entities',
|
||||
title: 'Unprocessed Entities',
|
||||
loader: () =>
|
||||
import('../components/UnprocessedEntities').then(
|
||||
({ UnprocessedEntitiesContent }) =>
|
||||
createElement(UnprocessedEntitiesContent),
|
||||
),
|
||||
export const unprocessedEntitiesDevToolsContent = DevToolsContentBlueprint.make(
|
||||
{
|
||||
params: {
|
||||
path: 'unprocessed-entities',
|
||||
title: 'Unprocessed Entities',
|
||||
loader: () =>
|
||||
import('../components/UnprocessedEntities').then(
|
||||
({ UnprocessedEntitiesContent }) =>
|
||||
createElement(UnprocessedEntitiesContent),
|
||||
),
|
||||
},
|
||||
},
|
||||
});
|
||||
);
|
||||
|
||||
const appFeature = createFrontendModule({
|
||||
pluginId: 'app',
|
||||
extensions: [unprocessedEntitiesDevToolsRoute],
|
||||
extensions: [unprocessedEntitiesDevToolsContent],
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@ const _default: OverridableFrontendPlugin<
|
||||
>;
|
||||
inputs: {
|
||||
contents: ExtensionInput<
|
||||
| ConfigurableExtensionDataRef<string, 'core.title', {}>
|
||||
| ConfigurableExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
|
||||
| ConfigurableExtensionDataRef<string, 'core.routing.path', {}>
|
||||
| ConfigurableExtensionDataRef<
|
||||
@@ -86,8 +87,7 @@ const _default: OverridableFrontendPlugin<
|
||||
{
|
||||
optional: true;
|
||||
}
|
||||
>
|
||||
| ConfigurableExtensionDataRef<string, 'devtools.content-title', {}>,
|
||||
>,
|
||||
{
|
||||
singleton: false;
|
||||
optional: true;
|
||||
@@ -99,7 +99,8 @@ const _default: OverridableFrontendPlugin<
|
||||
params: {
|
||||
defaultPath?: [Error: `Use the 'path' param instead`];
|
||||
path: string;
|
||||
loader: () => Promise<JSX.Element>;
|
||||
loader: () => Promise</** @alpha */
|
||||
JSX.Element>;
|
||||
routeRef?: RouteRef;
|
||||
};
|
||||
}>;
|
||||
|
||||
@@ -32,7 +32,6 @@ import {
|
||||
} from '@backstage/core-compat-api';
|
||||
import BuildIcon from '@material-ui/icons/Build';
|
||||
import { rootRouteRef } from '../routes';
|
||||
import { contentTitleDataRef } from '@backstage/plugin-devtools-react';
|
||||
|
||||
/** @alpha */
|
||||
export const devToolsApi = ApiBlueprint.make({
|
||||
@@ -56,7 +55,7 @@ export const devToolsPage = PageBlueprint.makeWithOverrides({
|
||||
coreExtensionData.reactElement,
|
||||
coreExtensionData.routePath,
|
||||
coreExtensionData.routeRef.optional(),
|
||||
contentTitleDataRef,
|
||||
coreExtensionData.title,
|
||||
],
|
||||
{
|
||||
optional: true,
|
||||
@@ -70,7 +69,7 @@ export const devToolsPage = PageBlueprint.makeWithOverrides({
|
||||
loader: () => {
|
||||
const extensions = inputs.contents.map(content => ({
|
||||
path: content.get(coreExtensionData.routePath),
|
||||
title: content.get(contentTitleDataRef),
|
||||
title: content.get(coreExtensionData.title),
|
||||
children: content.get(coreExtensionData.reactElement),
|
||||
}));
|
||||
return import('../components/DevToolsPage').then(m =>
|
||||
|
||||
Reference in New Issue
Block a user