diff --git a/.changeset/catalog-import-nfs-page.md b/.changeset/catalog-import-nfs-page.md new file mode 100644 index 0000000000..362f74c12f --- /dev/null +++ b/.changeset/catalog-import-nfs-page.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-import': patch +--- + +Updated the catalog import plugin for the new frontend system with plugin title and icon metadata, and a page layout that uses Backstage UI header instead of legacy page chrome. diff --git a/plugins/catalog-import/package.json b/plugins/catalog-import/package.json index de96cd1f8d..dcac78437c 100644 --- a/plugins/catalog-import/package.json +++ b/plugins/catalog-import/package.json @@ -66,10 +66,12 @@ "@backstage/plugin-catalog-common": "workspace:^", "@backstage/plugin-catalog-react": "workspace:^", "@backstage/plugin-permission-react": "workspace:^", + "@backstage/ui": "workspace:^", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.61", "@octokit/rest": "^19.0.3", + "@remixicon/react": "^4.6.0", "git-url-parse": "^15.0.0", "js-base64": "^3.6.0", "lodash": "^4.17.21", diff --git a/plugins/catalog-import/src/alpha.tsx b/plugins/catalog-import/src/alpha.tsx index d0c671fe5a..af076e8317 100644 --- a/plugins/catalog-import/src/alpha.tsx +++ b/plugins/catalog-import/src/alpha.tsx @@ -14,6 +14,8 @@ * limitations under the License. */ +import { RiAddCircleLine } from '@remixicon/react'; + import { configApiRef, discoveryApiRef, @@ -49,9 +51,9 @@ const catalogImportPage = PageBlueprint.make({ path: '/catalog-import', routeRef: rootRouteRef, loader: () => - import('./components/ImportPage').then(m => ( + import('./components/DefaultImportPage').then(m => ( - + )), }, @@ -91,6 +93,8 @@ const catalogImportApi = ApiBlueprint.make({ /** @alpha */ export default createFrontendPlugin({ pluginId: 'catalog-import', + title: 'Register Existing Component', + icon: , info: { packageJson: () => import('../package.json') }, extensions: [catalogImportApi, catalogImportPage], routes: { diff --git a/plugins/catalog-import/src/components/DefaultImportPage/DefaultImportPage.tsx b/plugins/catalog-import/src/components/DefaultImportPage/DefaultImportPage.tsx index 24a79866b3..b34ed7d640 100644 --- a/plugins/catalog-import/src/components/DefaultImportPage/DefaultImportPage.tsx +++ b/plugins/catalog-import/src/components/DefaultImportPage/DefaultImportPage.tsx @@ -23,6 +23,7 @@ import { } from '@backstage/core-components'; import { configApiRef, useApi } from '@backstage/core-plugin-api'; import { useTranslationRef } from '@backstage/frontend-plugin-api'; +import { Header as BuiHeader } from '@backstage/ui'; import Grid from '@material-ui/core/Grid'; import { useTheme } from '@material-ui/core/styles'; import useMediaQuery from '@material-ui/core/useMediaQuery'; @@ -31,17 +32,9 @@ import { catalogImportTranslationRef } from '../../translation'; import { ImportInfoCard } from '../ImportInfoCard'; import { ImportStepper } from '../ImportStepper'; -/** - * The default catalog import page. - * - * @public - */ -export const DefaultImportPage = () => { - const { t } = useTranslationRef(catalogImportTranslationRef); +const DefaultImportPageGrid = () => { const theme = useTheme(); - const configApi = useApi(configApiRef); const isMobile = useMediaQuery(theme.breakpoints.down('sm')); - const appTitle = configApi.getOptionalString('app.title') || 'Backstage'; const contentItems = [ @@ -53,6 +46,23 @@ export const DefaultImportPage = () => { , ]; + return ( + + {isMobile ? contentItems : [...contentItems].reverse()} + + ); +}; + +/** + * The default catalog import page. + * + * @public + */ +export const DefaultImportPage = () => { + const { t } = useTranslationRef(catalogImportTranslationRef); + const configApi = useApi(configApiRef); + const appTitle = configApi.getOptionalString('app.title') || 'Backstage'; + return (
@@ -65,10 +75,33 @@ export const DefaultImportPage = () => { - - {isMobile ? contentItems : contentItems.reverse()} - + ); }; + +/** + * @public + */ +export const NfsDefaultImportPage = () => { + const { t } = useTranslationRef(catalogImportTranslationRef); + const configApi = useApi(configApiRef); + const appTitle = configApi.getOptionalString('app.title') || 'Backstage'; + + return ( + <> + + {t('defaultImportPage.supportTitle', { appTitle })} + + } + /> + + + + + ); +}; diff --git a/plugins/catalog-import/src/components/DefaultImportPage/index.ts b/plugins/catalog-import/src/components/DefaultImportPage/index.ts index 5a4d4907e3..590d032c9b 100644 --- a/plugins/catalog-import/src/components/DefaultImportPage/index.ts +++ b/plugins/catalog-import/src/components/DefaultImportPage/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export { DefaultImportPage } from './DefaultImportPage'; +export { DefaultImportPage, NfsDefaultImportPage } from './DefaultImportPage'; diff --git a/yarn.lock b/yarn.lock index 921a0c575c..cb5f247af1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5245,10 +5245,12 @@ __metadata: "@backstage/plugin-catalog-react": "workspace:^" "@backstage/plugin-permission-react": "workspace:^" "@backstage/test-utils": "workspace:^" + "@backstage/ui": "workspace:^" "@material-ui/core": "npm:^4.12.2" "@material-ui/icons": "npm:^4.9.1" "@material-ui/lab": "npm:4.0.0-alpha.61" "@octokit/rest": "npm:^19.0.3" + "@remixicon/react": "npm:^4.6.0" "@testing-library/dom": "npm:^10.0.0" "@testing-library/jest-dom": "npm:^6.0.0" "@testing-library/react": "npm:^16.0.0"