introduce @backstage/integration-react and its scmIntegrationsApiRef
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
"dependencies": {
|
||||
"@backstage/core": "^0.7.0",
|
||||
"@backstage/catalog-model": "^0.7.3",
|
||||
"@backstage/integration-react": "^0.1.1",
|
||||
"@backstage/plugin-catalog-react": "^0.1.1",
|
||||
"@backstage/test-utils": "^0.1.8",
|
||||
"@backstage/theme": "^0.2.3",
|
||||
|
||||
@@ -19,6 +19,8 @@ import {
|
||||
AnyApiFactory,
|
||||
ApiFactory,
|
||||
attachComponentData,
|
||||
configApiRef,
|
||||
createApiFactory,
|
||||
createApp,
|
||||
createPlugin,
|
||||
createRouteRef,
|
||||
@@ -31,6 +33,10 @@ import {
|
||||
SidebarPage,
|
||||
SidebarSpacer,
|
||||
} from '@backstage/core';
|
||||
import {
|
||||
ScmIntegrationsApi,
|
||||
scmIntegrationsApiRef,
|
||||
} from '@backstage/integration-react';
|
||||
import { Box } from '@material-ui/core';
|
||||
import BookmarkIcon from '@material-ui/icons/Bookmark';
|
||||
import SentimentDissatisfiedIcon from '@material-ui/icons/SentimentDissatisfied';
|
||||
@@ -136,6 +142,17 @@ class DevAppBuilder {
|
||||
const DummyPage = () => <Box p={3}>Page belonging to another plugin.</Box>;
|
||||
attachComponentData(DummyPage, 'core.mountPoint', dummyRouteRef);
|
||||
|
||||
const apis = [...this.apis];
|
||||
if (!apis.some(api => api.api.id === scmIntegrationsApiRef.id)) {
|
||||
apis.push(
|
||||
createApiFactory({
|
||||
api: scmIntegrationsApiRef,
|
||||
deps: { configApi: configApiRef },
|
||||
factory: ({ configApi }) => ScmIntegrationsApi.fromConfig(configApi),
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
const app = createApp({
|
||||
apis: this.apis,
|
||||
plugins: this.plugins,
|
||||
|
||||
Reference in New Issue
Block a user