From 8fcdb32dbf8808ae8bb03485f9f1af1d302e914b Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Thu, 5 Oct 2023 22:42:59 +0200 Subject: [PATCH] app-next: hook up fake entityRoute Signed-off-by: Vincenzo Scamporlino --- packages/app-next/src/App.tsx | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/packages/app-next/src/App.tsx b/packages/app-next/src/App.tsx index 96a4de80eb..65d729bf92 100644 --- a/packages/app-next/src/App.tsx +++ b/packages/app-next/src/App.tsx @@ -14,11 +14,17 @@ * limitations under the License. */ +import React from 'react'; import { createApp } from '@backstage/frontend-app-api'; 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 { + createPageExtension, + createPlugin, +} from '@backstage/frontend-plugin-api'; +import { entityRouteRef } from '@backstage/plugin-catalog-react'; /* @@ -49,8 +55,26 @@ TODO: /* app.tsx */ +const fakePlugin = createPlugin({ + id: 'fake', + extensions: [ + createPageExtension({ + id: 'catalog:entity', + defaultPath: '/fakeentity', + routeRef: entityRouteRef, + loader: async () =>
hello 😅
, + }), + ], +}); + const app = createApp({ - features: [graphiqlPlugin, pagesPlugin, techRadarPlugin, userSettingsPlugin], + features: [ + graphiqlPlugin, + pagesPlugin, + techRadarPlugin, + userSettingsPlugin, + fakePlugin, + ], // bindRoutes({ bind }) { // bind(catalogPlugin.externalRoutes, { // createComponent: scaffolderPlugin.routes.root,