Add import component button to the create page

This commit is contained in:
Marek Calus
2020-10-29 10:00:16 +01:00
parent babbd50ddb
commit 29a3a074c6
8 changed files with 43 additions and 7 deletions
+1
View File
@@ -22,6 +22,7 @@
"@backstage/plugin-lighthouse": "^0.1.1-alpha.26",
"@backstage/plugin-newrelic": "^0.1.1-alpha.26",
"@backstage/plugin-register-component": "^0.1.1-alpha.26",
"@backstage/plugin-import-component": "^0.1.1-alpha.26",
"@backstage/plugin-rollbar": "^0.1.1-alpha.26",
"@backstage/plugin-scaffolder": "^0.1.1-alpha.26",
"@backstage/plugin-sentry": "^0.1.1-alpha.26",
+2 -2
View File
@@ -27,7 +27,6 @@ import * as plugins from './plugins';
import { apis } from './apis';
import { hot } from 'react-hot-loader/root';
import { providers } from './identityProviders';
import { Router as CatalogImportRouter } from '@roadiehq/backstage-plugin-catalog-import';
import { Router as CatalogRouter } from '@backstage/plugin-catalog';
import { Router as DocsRouter } from '@backstage/plugin-techdocs';
import { Router as GraphiQLRouter } from '@backstage/plugin-graphiql';
@@ -35,6 +34,7 @@ import { Router as TechRadarRouter } from '@backstage/plugin-tech-radar';
import { Router as LighthouseRouter } from '@backstage/plugin-lighthouse';
import { Router as RegisterComponentRouter } from '@backstage/plugin-register-component';
import { Router as SettingsRouter } from '@backstage/plugin-user-settings';
import { Router as ImportComponentRouter } from '@backstage/plugin-import-component';
import { Route, Routes, Navigate } from 'react-router';
import { EntityPage } from './components/catalog/EntityPage';
@@ -83,8 +83,8 @@ const AppRoutes = () => (
path="/register-component"
element={<RegisterComponentRouter catalogRouteRef={catalogRouteRef} />}
/>
<Route path="/import-component/*" element={<ImportComponentRouter />} />
<Route path="/settings" element={<SettingsRouter />} />
<Route path="/import-catalog/*" element={<CatalogImportRouter />} />
{...deprecatedAppRoutes}
</Routes>
);
+1 -1
View File
@@ -37,5 +37,5 @@ export { plugin as Kubernetes } from '@backstage/plugin-kubernetes';
export { plugin as Cloudbuild } from '@backstage/plugin-cloudbuild';
export { plugin as CostInsights } from '@backstage/plugin-cost-insights';
export { plugin as GitHubInsights } from '@roadiehq/backstage-plugin-github-insights';
export { plugin as CatalogImport } from '@roadiehq/backstage-plugin-catalog-import';
export { plugin as CatalogImport } from '@backstage/plugin-import-component';
export { plugin as UserSettings } from '@backstage/plugin-user-settings';
@@ -41,6 +41,7 @@ export class LocationAnalyzerClient implements LocationAnalyzer {
spec: { type: 'service', owner: ownerName, lifecycle: 'experimental' },
};
this.logger.silly(`entity created for ${request.location.target}`);
return {
existingEntityFiles: [],
generateEntities: [{ entity, fields: [] }],
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import type {
import {
Entity,
EntityRelationSpec,
Location,
@@ -68,7 +68,7 @@ export type ReadLocationError = {
};
//
// ConfigGenerator
// LocationAnalyzer
//
export type LocationAnalyzer = {
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React from 'react';
import { Route, Routes } from 'react-router';
import { Route, Routes } from 'react-router-dom';
import { ImportComponentPage } from './ImportComponentPage';
// As we don't know which path the catalog's router mounted on
@@ -77,6 +77,15 @@ export const ScaffolderPage = () => {
/>
<Content>
<ContentHeader title="Available Templates">
<Button
variant="contained"
color="primary"
component={RouterLink}
to="/import-component"
style={{ marginRight: '8px' }}
>
Import Repository
</Button>
<Button
variant="contained"
color="primary"
+26 -1
View File
@@ -3478,6 +3478,14 @@
"@octokit/types" "^5.4.1"
deprecation "^2.3.1"
"@octokit/plugin-rest-endpoint-methods@4.2.0":
version "4.2.0"
resolved "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.2.0.tgz#c5a0691b3aba5d8b4ef5dffd6af3649608f167ba"
integrity sha512-1/qn1q1C1hGz6W/iEDm9DoyNoG/xdFDt78E3eZ5hHeUfJTLJgyAMdj9chL/cNBHjcjd+FH5aO1x0VCqR2RE0mw==
dependencies:
"@octokit/types" "^5.5.0"
deprecation "^2.3.1"
"@octokit/request-error@^1.0.2":
version "1.2.1"
resolved "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.2.1.tgz#ede0714c773f32347576c25649dc013ae6b31801"
@@ -3542,6 +3550,16 @@
"@octokit/plugin-request-log" "^1.0.0"
"@octokit/plugin-rest-endpoint-methods" "4.1.4"
"@octokit/rest@^18.0.6":
version "18.0.6"
resolved "https://registry.npmjs.org/@octokit/rest/-/rest-18.0.6.tgz#76c274f1a68f40741a131768ef483f041e7b98b6"
integrity sha512-ES4lZBKPJMX/yUoQjAZiyFjei9pJ4lTTfb9k7OtYoUzKPDLl/M8jiHqt6qeSauyU4eZGLw0sgP1WiQl9FYeM5w==
dependencies:
"@octokit/core" "^3.0.0"
"@octokit/plugin-paginate-rest" "^2.2.0"
"@octokit/plugin-request-log" "^1.0.0"
"@octokit/plugin-rest-endpoint-methods" "4.2.0"
"@octokit/types@^2.0.0", "@octokit/types@^2.0.1":
version "2.5.0"
resolved "https://registry.npmjs.org/@octokit/types/-/types-2.5.0.tgz#f1bbd147e662ae2c79717d518aac686e58257773"
@@ -3563,6 +3581,13 @@
dependencies:
"@types/node" ">= 8"
"@octokit/types@^5.5.0":
version "5.5.0"
resolved "https://registry.npmjs.org/@octokit/types/-/types-5.5.0.tgz#e5f06e8db21246ca102aa28444cdb13ae17a139b"
integrity sha512-UZ1pErDue6bZNjYOotCNveTXArOMZQFG6hKJfOnGnulVCMcVVi7YIIuuR4WfBhjo7zgpmzn/BkPDnUXtNx+PcQ==
dependencies:
"@types/node" ">= 8"
"@open-draft/until@^1.0.0", "@open-draft/until@^1.0.3":
version "1.0.3"
resolved "https://registry.npmjs.org/@open-draft/until/-/until-1.0.3.tgz#db9cc719191a62e7d9200f6e7bab21c5b848adca"
@@ -19883,7 +19908,7 @@ react-router-dom@^5.2.0:
tiny-invariant "^1.0.2"
tiny-warning "^1.0.0"
react-router@5.2.0:
react-router@5.2.0, react-router@^5.2.0:
version "5.2.0"
resolved "https://registry.npmjs.org/react-router/-/react-router-5.2.0.tgz#424e75641ca8747fbf76e5ecca69781aa37ea293"
integrity sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw==