Skip to content

Commit 761f443

Browse files
authored
Resolves: MTV-3476 | Change type to warm when switching on the plan details page edit modal (#2176)
Signed-off-by: Aviv Turgeman <[email protected]>
1 parent 1e29b6e commit 761f443

File tree

1 file changed

+8
-0
lines changed
  • src/plans/details/tabs/Details/components/DetailsSection/components/PlanWarm/utils

1 file changed

+8
-0
lines changed

src/plans/details/tabs/Details/components/DetailsSection/components/PlanWarm/utils/utils.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { MigrationTypeValue } from 'src/plans/create/steps/migration-type/constants';
2+
13
import { ADD, REPLACE } from '@components/ModalForm/utils/constants';
24
import { PlanModel, type V1beta1Plan } from '@kubev2v/types';
35
import { k8sPatch } from '@openshift-console/dynamic-plugin-sdk';
@@ -12,6 +14,7 @@ type OnConfirmWarm = (param: OnConfirmWarmParams) => Promise<V1beta1Plan>;
1214

1315
export const onConfirmWarm: OnConfirmWarm = async ({ newValue, resource }) => {
1416
const op = getPlanIsWarm(resource) === undefined ? ADD : REPLACE;
17+
const type = newValue ? MigrationTypeValue.Warm : MigrationTypeValue.Cold;
1518

1619
const obj = await k8sPatch({
1720
data: [
@@ -20,6 +23,11 @@ export const onConfirmWarm: OnConfirmWarm = async ({ newValue, resource }) => {
2023
path: '/spec/warm',
2124
value: newValue,
2225
},
26+
{
27+
op: REPLACE,
28+
path: '/spec/type',
29+
value: type,
30+
},
2331
],
2432
model: PlanModel,
2533
resource,

0 commit comments

Comments
 (0)