Skip to content

Commit

Permalink
Merge pull request #874 from yaacov/use-regulat-route-instead-of-crea…
Browse files Browse the repository at this point in the history
…te-route-for-fast-create

🧼 Use regular route instead of new route for the fast create form
  • Loading branch information
yaacov authored Jan 31, 2024
2 parents 6d001b9 + f6af1f0 commit dc3d358
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
PlanModel,
PlanModelGroupVersionKind,
ProviderModel,
ProviderModelGroupVersionKind,
} from '@kubev2v/types';
import { ProviderModel, ProviderModelGroupVersionKind } from '@kubev2v/types';
import { EncodedExtension } from '@openshift/dynamic-plugin-sdk';
import {
ContextProvider,
Expand All @@ -12,6 +7,7 @@ import {
ResourceDetailsPage,
ResourceListPage,
ResourceNSNavItem,
RoutePage,
} from '@openshift-console/dynamic-plugin-sdk';
import type { ConsolePluginMetadata } from '@openshift-console/dynamic-plugin-sdk-webpack/lib/schema/plugin-package';

Expand All @@ -25,6 +21,9 @@ export const exposedModules: ConsolePluginMetadata['exposedModules'] = {
'./modules/Providers/views/migrate/ProvidersCreateVmMigrationPage',
};

const plansListURL = '/k8s/ns/:ns/forklift.konveyor.io~v1beta1~Plan';
const plansListURLAllNamespaces = '/k8s/all-namespaces/forklift.konveyor.io~v1beta1~Plan';

export const extensions: EncodedExtension[] = [
{
type: 'console.navigation/resource-ns',
Expand Down Expand Up @@ -90,14 +89,15 @@ export const extensions: EncodedExtension[] = [
},
},
} as EncodedExtension<ContextProvider>,

{
type: 'console.resource/create',
type: 'console.page/route',
properties: {
component: {
$codeRef: 'ProvidersCreateVmMigrationPage',
},
model: PlanModelGroupVersionKind,
...PlanModel,
path: [`${plansListURL}/fast-create`, `${plansListURLAllNamespaces}/fast-create`],
exact: false,
},
} as EncodedExtension<CreateResource>,
} as EncodedExtension<RoutePage>,
];
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const MigrationAction: FC<{
variant="secondary"
onClick={() => {
setData({ selectedVms, provider });
history.push(`${planListURL}/~new`);
history.push(`${planListURL}/fast-create`);
}}
isDisabled={!selectedVms?.length}
>
Expand Down

0 comments on commit dc3d358

Please sign in to comment.