11import { badgesPlugin } from './plugins';
22
3- import {
4- AlertDisplay,
5- OAuthRequestDialog,
6- ProxiedSignInPage,
7- } from '@backstage/core-components';
8- import { AppRouter, FlatRoutes } from '@backstage/core-app-api';
9- import {
10- CatalogEntityPage,
11- CatalogIndexPage,
12- catalogPlugin,
13- } from '@backstage/plugin-catalog';
14- import {
15- CatalogGraphPage,
16- catalogGraphPlugin,
17- } from '@backstage/plugin-catalog-graph';
3+ import { ProxiedSignInPage } from '@backstage/core-components';
4+ import { FlatRoutes } from '@backstage/core-app-api';
5+ import { CatalogIndexPage, catalogPlugin } from '@backstage/plugin-catalog';
6+ import { default as alphaCatalogPlugin } from '@backstage/plugin-catalog/alpha';
7+ import { catalogGraphPlugin } from '@backstage/plugin-catalog-graph';
188import {
199 CostInsightsLabelDataflowInstructionsPage,
2010 CostInsightsPage,
@@ -29,27 +19,21 @@ import {
2919} from '@backstage/plugin-techdocs';
3020import { UnifiedThemeProvider, themes } from '@backstage/theme';
3121
32- import { ApiExplorerPage } from '@backstage/plugin-api-docs';
3322import { GraphiQLPage } from '@backstage-community/plugin-graphiql';
3423
35- import { Root } from './components/Root';
36- import { SearchPage } from '@backstage/plugin-search';
37- import { TechRadarPage } from '@backstage-community/plugin-tech-radar';
3824import {
3925 SettingsLayout,
4026 UserSettingsPage,
4127} from '@backstage/plugin-user-settings';
4228import { apertureTheme } from './theme/aperture';
4329import { apis } from './apis';
4430
45- import { entityPage } from './components/catalog/EntityPage';
4631import { orgPlugin } from '@backstage/plugin-org';
47- import { searchPage } from './components/search/SearchPage';
32+
4833import { CssBaseline } from '@material-ui/core';
4934import { HomepageCompositionRoot, VisitListener } from '@backstage/plugin-home';
5035import { CustomizableHomePage } from './components/home/CustomizableHomePage';
51- import { ScaffolderPage, scaffolderPlugin } from '@backstage/plugin-scaffolder';
52- import { NotificationsPage } from '@backstage/plugin-notifications';
36+ import { scaffolderPlugin } from '@backstage/plugin-scaffolder';
5337import { TechDocsAddons } from '@backstage/plugin-techdocs-react';
5438import {
5539 ExpandableNavigation,
@@ -64,50 +48,36 @@ import { NotificationSettings } from './components/settings/NotificationSettings
6448// New Frontend System Imports
6549import { createApp } from '@backstage/frontend-defaults';
6650import {
51+ compatWrapper,
6752 convertLegacyApp,
6853 convertLegacyAppOptions,
6954 convertLegacyRouteRef,
7055 convertLegacyRouteRefs,
7156} from '@backstage/core-compat-api';
7257import {
58+ AppRootElementBlueprint,
7359 createFrontendModule,
7460 SignInPageBlueprint,
7561 ThemeBlueprint,
7662} from '@backstage/frontend-plugin-api';
63+ import { rootNav } from './components/Root';
64+ import {
65+ EntityKindPicker,
66+ EntityTypePicker,
67+ UserListPicker,
68+ EntityOwnerPicker,
69+ EntityLifecyclePicker,
70+ EntityTagPicker,
71+ EntityProcessingStatusPicker,
72+ EntityNamespacePicker,
73+ } from '@backstage/plugin-catalog-react';
7774
7875const routes = (
7976 <FlatRoutes>
8077 <Route path="/" element={<Navigate to="catalog" />} />
8178 <Route path="/home" element={<HomepageCompositionRoot />}>
8279 <CustomizableHomePage />
8380 </Route>
84- {/* <FeatureFlagged with="customizable-home-page-preview">
85- <Route path="/home" element={<HomepageCompositionRoot />}>
86- <CustomizableHomePage />
87- </Route>
88- </FeatureFlagged>
89- <FeatureFlagged without="customizable-home-page-preview">
90- <Route path="/home" element={<HomepageCompositionRoot />}>
91- <HomePage />
92- </Route>
93- </FeatureFlagged> */}
94- <Route path="/create" element={<ScaffolderPage />} />
95- <Route path="/api-docs" element={<ApiExplorerPage />} />
96- <Route
97- path="/catalog"
98- element={
99- <CatalogIndexPage
100- initiallySelectedFilter="all"
101- initiallySelectedNamespaces={['default']}
102- />
103- }
104- />
105- <Route
106- path="/catalog/:namespace/:kind/:name"
107- element={<CatalogEntityPage />}
108- >
109- {entityPage}
110- </Route>
11181 <Route path="/cost-insights" element={<CostInsightsPage />} />
11282 <Route
11383 path="/cost-insights/investigating-growth"
@@ -133,31 +103,30 @@ const routes = (
133103
134104 <Route path="/explore" element={<ExplorePage />} />
135105 <Route path="/graphiql" element={<GraphiQLPage />} />
136- <Route path="/search" element={<SearchPage />}>
137- {searchPage}
138- </Route>
106+
139107 <Route path="/settings" element={<UserSettingsPage />}>
140108 <SettingsLayout.Route path="/notifications" title="Notifications">
141109 <NotificationSettings />
142110 </SettingsLayout.Route>
143111 </Route>
144- <Route path="/tech-radar" element={<TechRadarPage />} />
145- <Route path="/catalog-graph" element={<CatalogGraphPage />} />
146- <Route path="/notifications" element={<NotificationsPage />} />
147112 </FlatRoutes>
148113);
149114
150- const legacyFeatures = convertLegacyApp(
151- <>
152- <AlertDisplay />
153- <OAuthRequestDialog />
154- <SignalsDisplay />
155- <AppRouter>
156- <VisitListener />
157- <Root>{routes}</Root>
158- </AppRouter>
159- </>,
160- );
115+ const legacyFeatures = convertLegacyApp(routes);
116+
117+ const signalsDisplayExtension = AppRootElementBlueprint.make({
118+ name: 'signals-display-extension',
119+ params: {
120+ element: compatWrapper(<SignalsDisplay />),
121+ },
122+ });
123+
124+ const visitListenerExtension = AppRootElementBlueprint.make({
125+ name: 'visit-listener-extension',
126+ params: {
127+ element: <VisitListener />,
128+ },
129+ });
161130
162131const optionsModule = convertLegacyAppOptions({
163132 // TODO:(awanlin) the badges plugin doesn't support the new frontend system yet
@@ -217,6 +186,34 @@ const apertureThemeExtension = ThemeBlueprint.make({
217186 },
218187});
219188
189+ const catalogPluginOverride = alphaCatalogPlugin.withOverrides({
190+ extensions: [
191+ alphaCatalogPlugin.getExtension('page:catalog').override({
192+ params: {
193+ loader: async () =>
194+ compatWrapper(
195+ <CatalogIndexPage
196+ filters={
197+ <>
198+ <EntityKindPicker />
199+ <EntityTypePicker />
200+ <UserListPicker initialFilter="all" />
201+ <EntityOwnerPicker />
202+ <EntityLifecyclePicker
203+ initialFilter={['production', 'experimental']}
204+ />
205+ <EntityTagPicker />
206+ <EntityProcessingStatusPicker />
207+ <EntityNamespacePicker />
208+ </>
209+ }
210+ />,
211+ ),
212+ },
213+ }),
214+ ],
215+ });
216+
220217const app = createApp({
221218 features: [
222219 optionsModule,
@@ -229,8 +226,12 @@ const app = createApp({
229226 lightThemeExtension,
230227 darkThemeExtension,
231228 apertureThemeExtension,
229+ rootNav,
230+ signalsDisplayExtension,
231+ visitListenerExtension,
232232 ],
233233 }),
234+ catalogPluginOverride,
234235 ],
235236 bindRoutes({ bind }) {
236237 bind(convertLegacyRouteRefs(catalogPlugin.externalRoutes), {
0 commit comments