app-next: add home plugin
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
This commit is contained in:
@@ -20,13 +20,18 @@ import { pagesPlugin } from './examples/pagesPlugin';
|
||||
import graphiqlPlugin from '@backstage/plugin-graphiql/alpha';
|
||||
import techRadarPlugin from '@backstage/plugin-tech-radar/alpha';
|
||||
import userSettingsPlugin from '@backstage/plugin-user-settings/alpha';
|
||||
import homePlugin from '@backstage/plugin-home/alpha';
|
||||
|
||||
import {
|
||||
coreExtensionData,
|
||||
createExtension,
|
||||
createExtensionOverrides,
|
||||
createPageExtension,
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
import { entityRouteRef } from '@backstage/plugin-catalog-react';
|
||||
import techdocsPlugin from '@backstage/plugin-techdocs/alpha';
|
||||
import { convertLegacyRouteRef } from '@backstage/core-plugin-api/alpha';
|
||||
import { homePage } from './HomePage';
|
||||
|
||||
/*
|
||||
|
||||
@@ -64,6 +69,17 @@ const entityPageExtension = createPageExtension({
|
||||
loader: async () => <div>Just a temporary mocked entity page</div>,
|
||||
});
|
||||
|
||||
const homePageExtension = createExtension({
|
||||
id: 'myhomepage',
|
||||
attachTo: { id: 'home', input: 'props' },
|
||||
output: {
|
||||
children: coreExtensionData.reactElement,
|
||||
},
|
||||
factory({ bind }) {
|
||||
bind({ children: homePage });
|
||||
},
|
||||
});
|
||||
|
||||
const app = createApp({
|
||||
features: [
|
||||
graphiqlPlugin,
|
||||
@@ -71,8 +87,9 @@ const app = createApp({
|
||||
techRadarPlugin,
|
||||
techdocsPlugin,
|
||||
userSettingsPlugin,
|
||||
homePlugin,
|
||||
createExtensionOverrides({
|
||||
extensions: [entityPageExtension],
|
||||
extensions: [entityPageExtension, homePageExtension],
|
||||
}),
|
||||
],
|
||||
/* Handled through config instead */
|
||||
|
||||
@@ -48,6 +48,9 @@ const IndexPage = createPageExtension({
|
||||
<div>
|
||||
<Link to={page1Link()}>Page 1</Link>
|
||||
</div>
|
||||
<div>
|
||||
<Link to="/home">Home</Link>
|
||||
</div>
|
||||
<div>
|
||||
<Link to="/graphiql">GraphiQL</Link>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user