diff --git a/libs/ui-lib/lib/cim/components/ClusterDeployment/clusterDetails/ClusterDeploymentDetailsForm.tsx b/libs/ui-lib/lib/cim/components/ClusterDeployment/clusterDetails/ClusterDeploymentDetailsForm.tsx index 18b0a2bb50..a99bd56dfa 100644 --- a/libs/ui-lib/lib/cim/components/ClusterDeployment/clusterDetails/ClusterDeploymentDetailsForm.tsx +++ b/libs/ui-lib/lib/cim/components/ClusterDeployment/clusterDetails/ClusterDeploymentDetailsForm.tsx @@ -14,7 +14,7 @@ import { OsImage, } from '../../../types'; import { ClusterImageSetK8sResource } from '../../../types/k8s/cluster-image-set'; -import { getOCPVersions, getSelectedVersion } from '../../helpers'; +import { getOCPVersions } from '../../helpers'; import { useTranslation } from '../../../../common/hooks/use-translation-wrapper'; import { ClusterDetailsFormFields, @@ -46,17 +46,14 @@ export const ClusterDeploymentDetailsFormWrapper = ({ }) => { const { activeStep, goToPrevStep, goToNextStep, close } = useWizardContext(); const { syncError } = React.useContext(ClusterDeploymentWizardContext); - const { submitForm, isSubmitting, isValid, isValidating, dirty } = - useFormikContext(); + const { isSubmitting, isValid, isValidating } = useFormikContext(); const { t } = useTranslation(); + // ClusterDeploymentDetailsFormWrapper is exclusively used by ClusterDeploymentWizard (edit flow). + // No form submission needed here—just navigate to the next step. const handleOnNext = React.useCallback(() => { - if (dirty) { - void submitForm(); - } else { - void goToNextStep(); - } - }, [dirty, goToNextStep, submitForm]); + void goToNextStep(); + }, [goToNextStep]); const footer = React.useMemo( () => ( @@ -93,7 +90,6 @@ export const ClusterDeploymentDetailsFormWrapper = ({ }; export const ClusterDeploymentDetailsForm: React.FC = ({ - agentClusterInstall, clusterDeployment, clusterImages, extensionAfter, @@ -111,18 +107,13 @@ export const ClusterDeploymentDetailsForm: React.FC(); const [cpuArchitectures, allowHighlyAvailable] = React.useMemo(() => { const cpuArchitectures = [CpuArchitecture.x86, CpuArchitecture.ARM, CpuArchitecture.s390x]; - const version = allVersions.find( - (ver) => ver.value === values.openshiftVersion || ver.version === forceOpenshiftVersion, - ); + const version = allVersions.find((ver) => ver.value === values.openshiftVersion); const isMulti = version?.cpuArchitectures?.[0] === CpuArchitecture.MULTI; const highlyAvailableSupported = toNumber(version?.version?.split('.')?.[1]) >= 18; @@ -130,7 +121,7 @@ export const ClusterDeploymentDetailsForm: React.FC @@ -148,7 +139,6 @@ export const ClusterDeploymentDetailsForm: React.FC = isEditFlow, versions, allVersions, - forceOpenshiftVersion, extensionAfter, isNutanix, cpuArchitectures, @@ -65,7 +63,7 @@ export const ClusterDetailsFormFields: React.FC = const { name, baseDnsDomain } = values; React.useEffect(() => { - if (!versions.length && !values.openshiftVersion) { + if (!versions.length && !values.openshiftVersion && !isEditFlow) { const fallbackOpenShiftVersion = allVersions.find((version) => version.default); setFieldValue('customOpenshiftSelect', fallbackOpenShiftVersion?.value); setFieldValue('openshiftVersion', fallbackOpenShiftVersion?.value); @@ -140,9 +138,11 @@ export const ClusterDetailsFormFields: React.FC = isRequired /> )} - {forceOpenshiftVersion ? ( + {isEditFlow ? ( - {t('ai:OpenShift')} {forceOpenshiftVersion} + {t('ai:OpenShift')}{' '} + {allVersions.find((v) => v.value === values.openshiftVersion)?.version || + values.openshiftVersion} ) : ( <>