From df0d2e7d97b9b2ba97e2f58512cdf32c98673f93 Mon Sep 17 00:00:00 2001 From: blam Date: Mon, 7 Feb 2022 17:17:21 +0100 Subject: [PATCH] feat: added some more steps towards rewriting the scaffodler-frontend Signed-off-by: blam --- app-config.yaml | 3 +++ packages/app/src/App.tsx | 4 ++-- .../EntitySearchBar/EntitySearchBar.tsx | 1 + plugins/scaffolder/src/index.ts | 1 + .../TemplateListPage.test.tsx | 21 +++++++++++++++++++ plugins/scaffolder/src/plugin.ts | 8 +++++++ 6 files changed, 36 insertions(+), 2 deletions(-) diff --git a/app-config.yaml b/app-config.yaml index b3ca3c7203..597073fede 100644 --- a/app-config.yaml +++ b/app-config.yaml @@ -283,6 +283,9 @@ catalog: # Backstage end-to-end tests of TechDocs - type: file target: ../../cypress/e2e-fixture.catalog.info.yaml + + - type: url + target: https://github.com/benjdlambert/software-templates/blob/main/scaffolder-templates/react-ssr-template/template.yaml scaffolder: # Use to customize default commit author info used when new components are created # defaultAuthor: diff --git a/packages/app/src/App.tsx b/packages/app/src/App.tsx index befd3274f3..e17e0e80a8 100644 --- a/packages/app/src/App.tsx +++ b/packages/app/src/App.tsx @@ -59,7 +59,7 @@ import { LighthousePage } from '@backstage/plugin-lighthouse'; import { NewRelicPage } from '@backstage/plugin-newrelic'; import { ScaffolderFieldExtensions, - ScaffolderPage, + NextScaffolderPage, scaffolderPlugin, } from '@backstage/plugin-scaffolder'; import { SearchPage } from '@backstage/plugin-search'; @@ -178,7 +178,7 @@ const routes = ( { { expect(getByRole('menuitem', { name: 'All' })).toBeInTheDocument(); expect(getByRole('menuitem', { name: 'Starred' })).toBeInTheDocument(); }); + + it('should render the category picker', () => { + const { getByText } = await renderInTestApp( + + + , + ); + + expect(getByText('Categories')).toBeInTheDocument(); + }); }); diff --git a/plugins/scaffolder/src/plugin.ts b/plugins/scaffolder/src/plugin.ts index ffa0efaaa0..9b79ea8381 100644 --- a/plugins/scaffolder/src/plugin.ts +++ b/plugins/scaffolder/src/plugin.ts @@ -150,3 +150,11 @@ export const EntityTagsPickerFieldExtension = scaffolderPlugin.provide( name: 'EntityTagsPicker', }), ); + +export const NextScaffolderPage = scaffolderPlugin.provide( + createRoutableExtension({ + name: 'NextScaffolderPage', + component: () => import('./next/Router').then(m => m.Router), + mountPoint: rootRouteRef, + }), +);