diff --git a/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/AmdGpuCheckbox.tsx b/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/AmdGpuCheckbox.tsx index 300d110852..55effbd6a3 100644 --- a/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/AmdGpuCheckbox.tsx +++ b/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/AmdGpuCheckbox.tsx @@ -1,8 +1,7 @@ -import React, { useState } from 'react'; +import React from 'react'; import { FormGroup, HelperText, HelperTextItem, Tooltip } from '@patternfly/react-core'; import { getFieldId, PopoverIcon } from '../../../../common'; import { OcmCheckboxField } from '../../ui/OcmFormFields'; -import { useNewFeatureSupportLevel } from '../../../../common/components/newFeatureSupportLevels'; import NewFeatureSupportLevelBadge from '../../../../common/components/newFeatureSupportLevels/NewFeatureSupportLevelBadge'; import { SupportLevel } from '@openshift-assisted/types/./assisted-installer-service'; @@ -40,28 +39,22 @@ const AmdGpuHelperText = () => { ); }; -const AmdGpuCheckbox = ({ disabledReason }: { disabledReason?: string }) => { +const AmdGpuCheckbox = ({ + disabledReason, + supportLevel, +}: { + disabledReason?: string; + supportLevel?: SupportLevel | undefined; +}) => { const fieldId = getFieldId(AMDGPU_FIELD_NAME, 'input'); - const featureSupportLevel = useNewFeatureSupportLevel(); - const [disabledReasonAmdGpu, setDisabledReason] = useState(); - - React.useEffect(() => { - const reason = featureSupportLevel.getFeatureDisabledReason('AMD_GPU'); - setDisabledReason(reason); - }, [featureSupportLevel]); return ( - } + label={} helperText={} - isDisabled={!!disabledReason || !!disabledReasonAmdGpu} + isDisabled={!!disabledReason} /> ); diff --git a/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/SupportedOperators.tsx b/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/SupportedOperators.tsx index 25ffb28ff2..a41606f0a6 100644 --- a/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/SupportedOperators.tsx +++ b/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/SupportedOperators.tsx @@ -110,4 +110,6 @@ export const mapOperatorIdToFeatureId: { [key: string]: FeatureId } = { [OPERATOR_NAME_PIPELINES]: 'PIPELINES', [OPERATOR_NAME_SERVICEMESH]: 'SERVICEMESH', [OPERATOR_NAME_NVIDIA_GPU]: 'NVIDIA_GPU', + [OPERATOR_NAME_AMD_GPU]: 'AMD_GPU', + [OPERATOR_NAME_KMM]: 'KMM', }; diff --git a/libs/ui-lib/lib/ocm/components/featureSupportLevels/featureStateUtils.ts b/libs/ui-lib/lib/ocm/components/featureSupportLevels/featureStateUtils.ts index 0058aefc37..4878c44e5f 100644 --- a/libs/ui-lib/lib/ocm/components/featureSupportLevels/featureStateUtils.ts +++ b/libs/ui-lib/lib/ocm/components/featureSupportLevels/featureStateUtils.ts @@ -289,6 +289,11 @@ export const getNewFeatureDisabledReason = ( return `Service mesh is not available with the selected CPU architecture.`; } } + case 'AMD_GPU': { + if (!isSupported) { + return `AMD GPU is not available with the selected CPU architecture.`; + } + } default: { return undefined; }