-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathApp.tsx
More file actions
61 lines (56 loc) · 1.68 KB
/
Copy pathApp.tsx
File metadata and controls
61 lines (56 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { createApp } from '@backstage/frontend-defaults';
import {
configApiRef,
ApiBlueprint,
createApiFactory,
createFrontendModule,
PageBlueprint,
} from '@backstage/frontend-plugin-api';
import {
ScmAuth,
ScmIntegrationsApi,
scmIntegrationsApiRef,
} from '@backstage/integration-react';
import catalogPlugin from '@backstage/plugin-catalog/alpha';
import catalogImportPlugin from '@backstage/plugin-catalog-import/alpha';
import userSettingsPlugin from '@backstage/plugin-user-settings/alpha';
import { Navigate } from 'react-router';
// if app.experimental is not set in the app config, could manually add features like this
// See documentation for details: https://backstage.io/docs/frontend-system/architecture/app#feature-discovery
// import jiraPlugin from '@axis-backstage/plugin-jira-dashboard/alpha';
const homePageExtension = PageBlueprint.make({
name: 'homePage',
params: {
defaultPath: '/',
loader: () => Promise.resolve(<Navigate to="catalog" />),
},
});
const scmAuthApi = ApiBlueprint.make({
name: 'scm-auth',
params: {
factory: ScmAuth.createDefaultApiFactory(),
},
});
const scmIntegrationsApi = ApiBlueprint.make({
name: 'scm-integrations',
params: {
factory: createApiFactory({
api: scmIntegrationsApiRef,
deps: { configApi: configApiRef },
factory: ({ configApi }) => ScmIntegrationsApi.fromConfig(configApi),
}),
},
});
export const app = createApp({
features: [
catalogPlugin,
catalogImportPlugin,
userSettingsPlugin,
// jiraPlugin,
createFrontendModule({
pluginId: 'app',
extensions: [homePageExtension, scmAuthApi, scmIntegrationsApi],
}),
],
});
export default app.createRoot();