1
1
import { badgesPlugin } from './plugins' ;
2
2
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' ;
18
8
import {
19
9
CostInsightsLabelDataflowInstructionsPage ,
20
10
CostInsightsPage ,
@@ -29,27 +19,21 @@ import {
29
19
} from '@backstage/plugin-techdocs' ;
30
20
import { UnifiedThemeProvider , themes } from '@backstage/theme' ;
31
21
32
- import { ApiExplorerPage } from '@backstage/plugin-api-docs' ;
33
22
import { GraphiQLPage } from '@backstage-community/plugin-graphiql' ;
34
23
35
- import { Root } from './components/Root' ;
36
- import { SearchPage } from '@backstage/plugin-search' ;
37
- import { TechRadarPage } from '@backstage-community/plugin-tech-radar' ;
38
24
import {
39
25
SettingsLayout ,
40
26
UserSettingsPage ,
41
27
} from '@backstage/plugin-user-settings' ;
42
28
import { apertureTheme } from './theme/aperture' ;
43
29
import { apis } from './apis' ;
44
30
45
- import { entityPage } from './components/catalog/EntityPage' ;
46
31
import { orgPlugin } from '@backstage/plugin-org' ;
47
- import { searchPage } from './components/search/SearchPage' ;
32
+
48
33
import { CssBaseline } from '@material-ui/core' ;
49
34
import { HomepageCompositionRoot , VisitListener } from '@backstage/plugin-home' ;
50
35
import { 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' ;
53
37
import { TechDocsAddons } from '@backstage/plugin-techdocs-react' ;
54
38
import {
55
39
ExpandableNavigation ,
@@ -64,50 +48,36 @@ import { NotificationSettings } from './components/settings/NotificationSettings
64
48
// New Frontend System Imports
65
49
import { createApp } from '@backstage/frontend-defaults' ;
66
50
import {
51
+ compatWrapper ,
67
52
convertLegacyApp ,
68
53
convertLegacyAppOptions ,
69
54
convertLegacyRouteRef ,
70
55
convertLegacyRouteRefs ,
71
56
} from '@backstage/core-compat-api' ;
72
57
import {
58
+ AppRootElementBlueprint ,
73
59
createFrontendModule ,
74
60
SignInPageBlueprint ,
75
61
ThemeBlueprint ,
76
62
} 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' ;
77
74
78
75
const routes = (
79
76
< FlatRoutes >
80
77
< Route path = "/" element = { < Navigate to = "catalog" /> } />
81
78
< Route path = "/home" element = { < HomepageCompositionRoot /> } >
82
79
< CustomizableHomePage />
83
80
</ 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 >
111
81
< Route path = "/cost-insights" element = { < CostInsightsPage /> } />
112
82
< Route
113
83
path = "/cost-insights/investigating-growth"
@@ -133,31 +103,30 @@ const routes = (
133
103
134
104
< Route path = "/explore" element = { < ExplorePage /> } />
135
105
< Route path = "/graphiql" element = { < GraphiQLPage /> } />
136
- < Route path = "/search" element = { < SearchPage /> } >
137
- { searchPage }
138
- </ Route >
106
+
139
107
< Route path = "/settings" element = { < UserSettingsPage /> } >
140
108
< SettingsLayout . Route path = "/notifications" title = "Notifications" >
141
109
< NotificationSettings />
142
110
</ SettingsLayout . Route >
143
111
</ Route >
144
- < Route path = "/tech-radar" element = { < TechRadarPage /> } />
145
- < Route path = "/catalog-graph" element = { < CatalogGraphPage /> } />
146
- < Route path = "/notifications" element = { < NotificationsPage /> } />
147
112
</ FlatRoutes >
148
113
) ;
149
114
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
+ } ) ;
161
130
162
131
const optionsModule = convertLegacyAppOptions ( {
163
132
// TODO:(awanlin) the badges plugin doesn't support the new frontend system yet
@@ -217,6 +186,34 @@ const apertureThemeExtension = ThemeBlueprint.make({
217
186
} ,
218
187
} ) ;
219
188
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
+
220
217
const app = createApp ( {
221
218
features : [
222
219
optionsModule ,
@@ -229,8 +226,12 @@ const app = createApp({
229
226
lightThemeExtension ,
230
227
darkThemeExtension ,
231
228
apertureThemeExtension ,
229
+ rootNav ,
230
+ signalsDisplayExtension ,
231
+ visitListenerExtension ,
232
232
] ,
233
233
} ) ,
234
+ catalogPluginOverride ,
234
235
] ,
235
236
bindRoutes ( { bind } ) {
236
237
bind ( convertLegacyRouteRefs ( catalogPlugin . externalRoutes ) , {
0 commit comments