File tree 4 files changed +17
-7
lines changed
libs/ui-lib/lib/ocm/components
clusterConfiguration/operators
4 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import { OcmCheckboxField } from '../../ui/OcmFormFields';
13
13
import NewFeatureSupportLevelBadge from '../../../../common/components/newFeatureSupportLevels/NewFeatureSupportLevelBadge' ;
14
14
import { SupportLevel } from '@openshift-assisted/types/assisted-installer-service' ;
15
15
import { useFormikContext } from 'formik' ;
16
+ import { useNewFeatureSupportLevel } from '../../../../common/components/newFeatureSupportLevels' ;
16
17
17
18
const CNV_FIELD_NAME = 'useContainerNativeVirtualization' ;
18
19
@@ -73,11 +74,13 @@ const CnvCheckbox = ({
73
74
disabledReason ?: string ;
74
75
supportLevel ?: SupportLevel | undefined ;
75
76
} ) => {
77
+ const featureSupportLevelData = useNewFeatureSupportLevel ( ) ;
76
78
const { setFieldValue } = useFormikContext < OperatorsValues > ( ) ;
77
79
const fieldId = getFieldId ( CNV_FIELD_NAME , 'input' ) ;
78
80
const selectOperatorsNeeded = ( checked : boolean ) => {
79
- setFieldValue ( 'useLso' , checked ) ;
80
- setFieldValue ( 'useMigrationToolkitforVirtualization' , checked ) ;
81
+ if ( featureSupportLevelData . isFeatureSupported ( 'LSO' ) ) setFieldValue ( 'useLso' , checked ) ;
82
+ if ( featureSupportLevelData . isFeatureSupported ( 'MTV' ) )
83
+ setFieldValue ( 'useMigrationToolkitforVirtualization' , checked ) ;
81
84
} ;
82
85
return (
83
86
< FormGroup isInline fieldId = { fieldId } >
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import { useFormikContext } from 'formik';
13
13
import MtvRequirements from './MtvRequirements' ;
14
14
import { SupportLevel } from '@openshift-assisted/types/./assisted-installer-service' ;
15
15
import NewFeatureSupportLevelBadge from '../../../../common/components/newFeatureSupportLevels/NewFeatureSupportLevelBadge' ;
16
+ import { useNewFeatureSupportLevel } from '../../../../common/components/newFeatureSupportLevels' ;
16
17
17
18
const Mtv_FIELD_NAME = 'useMigrationToolkitforVirtualization' ;
18
19
@@ -64,9 +65,11 @@ const MtvCheckbox = ({
64
65
} ) => {
65
66
const { setFieldValue } = useFormikContext < OperatorsValues > ( ) ;
66
67
const fieldId = getFieldId ( Mtv_FIELD_NAME , 'input' ) ;
68
+ const featureSupportLevelData = useNewFeatureSupportLevel ( ) ;
67
69
68
70
const selectCNVOperator = ( checked : boolean ) => {
69
- setFieldValue ( 'useContainerNativeVirtualization' , checked ) ;
71
+ if ( featureSupportLevelData . isFeatureSupported ( 'CNV' ) )
72
+ setFieldValue ( 'useContainerNativeVirtualization' , checked ) ;
70
73
} ;
71
74
72
75
return (
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import { OcmCheckboxField } from '../../ui/OcmFormFields';
12
12
import NewFeatureSupportLevelBadge from '../../../../common/components/newFeatureSupportLevels/NewFeatureSupportLevelBadge' ;
13
13
import { SupportLevel } from '@openshift-assisted/types/./assisted-installer-service' ;
14
14
import { useFormikContext } from 'formik' ;
15
+ import { useNewFeatureSupportLevel } from '../../../../common/components/newFeatureSupportLevels' ;
15
16
16
17
const ODF_FIELD_NAME = 'useOpenShiftDataFoundation' ;
17
18
@@ -60,9 +61,10 @@ const OdfCheckbox = ({
60
61
supportLevel ?: SupportLevel | undefined ;
61
62
} ) => {
62
63
const { setFieldValue } = useFormikContext < OperatorsValues > ( ) ;
64
+ const featureSupportLevelData = useNewFeatureSupportLevel ( ) ;
63
65
const fieldId = getFieldId ( ODF_FIELD_NAME , 'input' ) ;
64
66
const selectLsoOperator = ( checked : boolean ) => {
65
- setFieldValue ( 'useLso' , checked ) ;
67
+ if ( featureSupportLevelData . isFeatureSupported ( 'LSO' ) ) setFieldValue ( 'useLso' , checked ) ;
66
68
} ;
67
69
return (
68
70
< FormGroup isInline fieldId = { fieldId } >
Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ export const OperatorsStep = (props: ClusterOperatorProps) => {
164
164
const fieldId = mapOperatorsToFieldIds [ op ] ; // Obtener el ID del campo correspondiente
165
165
setFieldValue ( fieldId , checked ) ;
166
166
if ( op === OPERATOR_NAME_CNV || op === OPERATOR_NAME_ODF ) {
167
- setFieldValue ( 'useLso' , checked ) ;
167
+ if ( featureSupportLevelData . isFeatureSupported ( 'LSO' ) ) setFieldValue ( 'useLso' , checked ) ;
168
168
}
169
169
}
170
170
} ) ;
@@ -176,7 +176,7 @@ export const OperatorsStep = (props: ClusterOperatorProps) => {
176
176
const fieldId = mapOperatorsToFieldIds [ op ] ; // Obtener el ID del campo correspondiente
177
177
setFieldValue ( fieldId , checked ) ;
178
178
if ( op === OPERATOR_NAME_CNV || op === OPERATOR_NAME_ODF ) {
179
- setFieldValue ( 'useLso' , checked ) ;
179
+ if ( featureSupportLevelData . isFeatureSupported ( 'LSO' ) ) setFieldValue ( 'useLso' , checked ) ;
180
180
}
181
181
} ) ;
182
182
}
@@ -235,7 +235,9 @@ export const OperatorsStep = (props: ClusterOperatorProps) => {
235
235
disabledReason = getCnvIncompatibleWithLvmReason ( values , lvmSupport ) ;
236
236
}
237
237
if ( ! disabledReason ) {
238
- disabledReason = getCnvDisabledWithMtvReason ( values ) ;
238
+ if ( featureSupportLevelData . isFeatureSupported ( 'MTV' ) ) {
239
+ disabledReason = getCnvDisabledWithMtvReason ( values ) ;
240
+ }
239
241
}
240
242
}
241
243
if ( operatorKey === 'lvm' ) {
You can’t perform that action at this time.
0 commit comments