Merge branch 'master' of https://github.com/spotify/backstage into lintMod
This commit is contained in:
@@ -14,6 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { plugin } from './plugin';
|
||||
export {
|
||||
scaffolderPlugin,
|
||||
scaffolderPlugin as plugin,
|
||||
TemplateIndexPage,
|
||||
TemplatePage,
|
||||
} from './plugin';
|
||||
export { ScaffolderApi, scaffolderApiRef } from './api';
|
||||
export { rootRoute, templateRoute } from './routes';
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { plugin } from './plugin';
|
||||
import { scaffolderPlugin } from './plugin';
|
||||
|
||||
describe('scaffolder', () => {
|
||||
it('should export plugin', () => {
|
||||
expect(plugin).toBeDefined();
|
||||
expect(scaffolderPlugin).toBeDefined();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -18,13 +18,14 @@ import {
|
||||
createPlugin,
|
||||
createApiFactory,
|
||||
discoveryApiRef,
|
||||
createRoutableExtension,
|
||||
} from '@backstage/core';
|
||||
import { ScaffolderPage } from './components/ScaffolderPage';
|
||||
import { TemplatePage } from './components/TemplatePage';
|
||||
import { ScaffolderPage as ScaffolderPageComponent } from './components/ScaffolderPage';
|
||||
import { TemplatePage as TemplatePageComponent } from './components/TemplatePage';
|
||||
import { rootRoute, templateRoute } from './routes';
|
||||
import { scaffolderApiRef, ScaffolderApi } from './api';
|
||||
|
||||
export const plugin = createPlugin({
|
||||
export const scaffolderPlugin = createPlugin({
|
||||
id: 'scaffolder',
|
||||
apis: [
|
||||
createApiFactory({
|
||||
@@ -34,7 +35,27 @@ export const plugin = createPlugin({
|
||||
}),
|
||||
],
|
||||
register({ router }) {
|
||||
router.addRoute(rootRoute, ScaffolderPage);
|
||||
router.addRoute(templateRoute, TemplatePage);
|
||||
router.addRoute(rootRoute, ScaffolderPageComponent);
|
||||
router.addRoute(templateRoute, TemplatePageComponent);
|
||||
},
|
||||
routes: {
|
||||
templateIndex: rootRoute,
|
||||
template: templateRoute,
|
||||
},
|
||||
});
|
||||
|
||||
export const TemplateIndexPage = scaffolderPlugin.provide(
|
||||
createRoutableExtension({
|
||||
component: () =>
|
||||
import('./components/ScaffolderPage').then(m => m.ScaffolderPage),
|
||||
mountPoint: rootRoute,
|
||||
}),
|
||||
);
|
||||
|
||||
export const TemplatePage = scaffolderPlugin.provide(
|
||||
createRoutableExtension({
|
||||
component: () =>
|
||||
import('./components/TemplatePage').then(m => m.TemplatePage),
|
||||
mountPoint: templateRoute,
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -16,12 +16,11 @@
|
||||
import { createRouteRef } from '@backstage/core';
|
||||
|
||||
export const rootRoute = createRouteRef({
|
||||
icon: () => null,
|
||||
path: '/create',
|
||||
title: 'Create new entity',
|
||||
});
|
||||
|
||||
export const templateRoute = createRouteRef({
|
||||
icon: () => null,
|
||||
path: '/create/:templateName',
|
||||
title: 'Entity creation',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user