Rename ImportComponentPage to ImportPage as it can import all kinds of entities
Signed-off-by: Oliver Sand <oliver.sand@sda-se.com>
This commit is contained in:
@@ -145,10 +145,10 @@ export function defaultGenerateStepper(
|
||||
defaults: StepperProvider,
|
||||
): StepperProvider;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "DefaultImportComponentPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
// Warning: (ae-missing-release-tag) "DefaultImportPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const DefaultImportComponentPage: () => JSX.Element;
|
||||
export const DefaultImportPage: () => JSX.Element;
|
||||
|
||||
// Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts
|
||||
// Warning: (ae-missing-release-tag) "EntityListComponent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
|
||||
@@ -29,7 +29,7 @@ import {
|
||||
EntityListComponent,
|
||||
ImportStepper,
|
||||
} from '../src';
|
||||
import { ImportComponentPage } from '../src/components/ImportComponentPage';
|
||||
import { ImportPage } from '../src/components/ImportPage';
|
||||
import { Content, Header, InfoCard, Page } from '@backstage/core-components';
|
||||
|
||||
const getEntityNames = (url: string): EntityName[] => [
|
||||
@@ -252,7 +252,7 @@ createDevApp()
|
||||
})
|
||||
.addPage({
|
||||
title: 'Catalog Import',
|
||||
element: <ImportComponentPage />,
|
||||
element: <ImportPage />,
|
||||
})
|
||||
.addPage({
|
||||
title: 'Catalog Import 2',
|
||||
|
||||
+8
-9
@@ -15,21 +15,20 @@
|
||||
*/
|
||||
|
||||
import { CatalogClient } from '@backstage/catalog-client';
|
||||
import { catalogApiRef } from '@backstage/plugin-catalog-react';
|
||||
import { wrapInTestApp } from '@backstage/test-utils';
|
||||
import { act, render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { catalogImportApiRef, CatalogImportClient } from '../../api';
|
||||
import { ImportComponentPage } from './ImportComponentPage';
|
||||
|
||||
import {
|
||||
ApiProvider,
|
||||
ApiRegistry,
|
||||
ConfigReader,
|
||||
} from '@backstage/core-app-api';
|
||||
import { configApiRef } from '@backstage/core-plugin-api';
|
||||
import { catalogApiRef } from '@backstage/plugin-catalog-react';
|
||||
import { wrapInTestApp } from '@backstage/test-utils';
|
||||
import { act, render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { catalogImportApiRef, CatalogImportClient } from '../../api';
|
||||
import { DefaultImportPage } from './DefaultImportPage';
|
||||
|
||||
describe('<ImportComponentPage />', () => {
|
||||
describe('<DefaultImportPage />', () => {
|
||||
const identityApi = {
|
||||
getUserId: () => {
|
||||
return 'user';
|
||||
@@ -72,7 +71,7 @@ describe('<ImportComponentPage />', () => {
|
||||
const { getByText } = render(
|
||||
wrapInTestApp(
|
||||
<ApiProvider apis={apis}>
|
||||
<ImportComponentPage />
|
||||
<DefaultImportPage />
|
||||
</ApiProvider>,
|
||||
),
|
||||
);
|
||||
+1
-1
@@ -27,7 +27,7 @@ import React from 'react';
|
||||
import { ImportInfoCard } from '../ImportInfoCard';
|
||||
import { ImportStepper } from '../ImportStepper';
|
||||
|
||||
export const DefaultImportComponentPage = () => {
|
||||
export const DefaultImportPage = () => {
|
||||
const configApi = useApi(configApiRef);
|
||||
const appTitle = configApi.getOptional('app.title') || 'Backstage';
|
||||
|
||||
+1
-1
@@ -14,4 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { ImportComponentPage } from './ImportComponentPage';
|
||||
export { DefaultImportPage } from './DefaultImportPage';
|
||||
+3
-3
@@ -26,9 +26,9 @@ import { wrapInTestApp } from '@backstage/test-utils';
|
||||
import { act, render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { catalogImportApiRef, CatalogImportClient } from '../../api';
|
||||
import { DefaultImportComponentPage } from './DefaultImportComponentPage';
|
||||
import { ImportPage } from './ImportPage';
|
||||
|
||||
describe('<DefaultImportComponentPage />', () => {
|
||||
describe('<ImportPage />', () => {
|
||||
const identityApi = {
|
||||
getUserId: () => {
|
||||
return 'user';
|
||||
@@ -71,7 +71,7 @@ describe('<DefaultImportComponentPage />', () => {
|
||||
const { getByText } = render(
|
||||
wrapInTestApp(
|
||||
<ApiProvider apis={apis}>
|
||||
<DefaultImportComponentPage />
|
||||
<ImportPage />
|
||||
</ApiProvider>,
|
||||
),
|
||||
);
|
||||
+3
-3
@@ -16,16 +16,16 @@
|
||||
|
||||
import React from 'react';
|
||||
import { useOutlet } from 'react-router';
|
||||
import { DefaultImportComponentPage } from '../DefaultImportComponentPage';
|
||||
import { DefaultImportPage } from '../DefaultImportPage';
|
||||
import { ImportOptionsContext } from '../ImportOptionsContext';
|
||||
import { ImportOptions } from '../types';
|
||||
|
||||
export const ImportComponentPage = (opts: ImportOptions) => {
|
||||
export const ImportPage = (opts: ImportOptions) => {
|
||||
const outlet = useOutlet();
|
||||
|
||||
return (
|
||||
<ImportOptionsContext.Provider value={opts}>
|
||||
{outlet || <DefaultImportComponentPage />}
|
||||
{outlet || <DefaultImportPage />}
|
||||
</ImportOptionsContext.Provider>
|
||||
);
|
||||
};
|
||||
+1
-1
@@ -14,4 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { DefaultImportComponentPage } from './DefaultImportComponentPage';
|
||||
export { ImportPage } from './ImportPage';
|
||||
@@ -16,12 +16,12 @@
|
||||
|
||||
import React from 'react';
|
||||
import { Route, Routes } from 'react-router-dom';
|
||||
import { ImportComponentPage } from './ImportComponentPage';
|
||||
import { ImportPage } from './ImportPage';
|
||||
import { ImportOptions } from './types';
|
||||
|
||||
/// @deprecated, use ImportComponentPage instead.
|
||||
/// @deprecated, use ImportPage instead.
|
||||
export const Router = (opts: ImportOptions) => (
|
||||
<Routes>
|
||||
<Route element={<ImportComponentPage {...opts} />} />
|
||||
<Route element={<ImportPage {...opts} />} />
|
||||
</Routes>
|
||||
);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './DefaultImportComponentPage';
|
||||
export * from './DefaultImportPage';
|
||||
export * from './EntityListComponent';
|
||||
export * from './ImportInfoCard';
|
||||
export * from './ImportOptionsContext';
|
||||
|
||||
@@ -67,10 +67,7 @@ export const catalogImportPlugin = createPlugin({
|
||||
|
||||
export const CatalogImportPage = catalogImportPlugin.provide(
|
||||
createRoutableExtension({
|
||||
component: () =>
|
||||
import('./components/ImportComponentPage').then(
|
||||
m => m.ImportComponentPage,
|
||||
),
|
||||
component: () => import('./components/ImportPage').then(m => m.ImportPage),
|
||||
mountPoint: rootRouteRef,
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user