chore: use code snippet for signal debugging

Signed-off-by: Heikki Hellgren <heikki.hellgren@op.fi>
This commit is contained in:
Heikki Hellgren
2024-03-08 08:11:56 +02:00
parent 9a41a7bfa8
commit 282f62f490
5 changed files with 19 additions and 39 deletions
+1 -3
View File
@@ -14,7 +14,6 @@ import { GridProps } from '@material-ui/core/Grid';
import { IconComponent } from '@backstage/core-plugin-api';
import { PropsWithChildren } from 'react';
import { ReactNode } from 'react';
import { RouteRef } from '@backstage/core-plugin-api';
// @public
export function createDevApp(): DevAppBuilder;
@@ -43,8 +42,7 @@ export type DevAppPageOptions = {
children?: JSX.Element;
title?: string;
icon?: IconComponent;
sideBarItem?: JSX.Element;
routeRef?: RouteRef;
sidebarItem?: JSX.Element;
};
// @public (undocumented)
+11 -27
View File
@@ -80,9 +80,7 @@ export type DevAppPageOptions = {
children?: JSX.Element;
title?: string;
icon?: IconComponent;
sideBarItem?: JSX.Element;
routeRef?: RouteRef;
sidebarItem?: JSX.Element;
};
/**
@@ -144,8 +142,8 @@ export class DevAppBuilder {
this.defaultPage = path;
}
if (opts.sideBarItem) {
this.sidebarItems.push(opts.sideBarItem);
if (opts.sidebarItem) {
this.sidebarItems.push(opts.sidebarItem);
} else if (opts.title) {
this.sidebarItems.push(
<SidebarItem
@@ -157,28 +155,14 @@ export class DevAppBuilder {
);
}
if (opts.routeRef) {
const Elem = () => <>{opts.element}</>;
attachComponentData(Elem, 'core.mountPoint', opts.routeRef);
this.routes.push(
<MaybeGatheringRoute
key={path}
path={path}
element={<Elem />}
children={opts.children}
/>,
);
} else {
this.routes.push(
<MaybeGatheringRoute
key={path}
path={path}
element={opts.element}
children={opts.children}
/>,
);
}
this.routes.push(
<MaybeGatheringRoute
key={path}
path={path}
element={opts.element}
children={opts.children}
/>,
);
return this;
}