diff --git a/src/Components/CreateImageWizard/steps/Users/component/UserInfo.tsx b/src/Components/CreateImageWizard/steps/Users/component/UserInfo.tsx index ba02c27ad..e10fd87b6 100644 --- a/src/Components/CreateImageWizard/steps/Users/component/UserInfo.tsx +++ b/src/Components/CreateImageWizard/steps/Users/component/UserInfo.tsx @@ -92,8 +92,7 @@ const UserInfo = () => { }; const toggleConfirmPasswordVisibility = () => setIsConfirmPasswordVisible((prevState) => !prevState); - const isPasswordDisabled = Boolean(userSshKey); - const isSshKeyDisabled = Boolean(userPassword || confirmUserPassword); + const stepValidation = useUserValidation(); return (
@@ -120,7 +119,6 @@ const UserInfo = () => { placeholder="Enter password" stepValidation={stepValidation} fieldName="userPassword" - isDisabled={isPasswordDisabled} togglePasswordVisibility={togglePasswordVisibility} isPasswordVisible={isPasswordVisible} /> @@ -152,7 +150,6 @@ const UserInfo = () => { placeholder="Enter confirm password" stepValidation={stepValidation} fieldName="userConfirmPassword" - isDisabled={isPasswordDisabled} togglePasswordVisibility={toggleConfirmPasswordVisibility} isPasswordVisible={isConfirmPasswordVisible} /> @@ -165,14 +162,11 @@ const UserInfo = () => { onChange={(event, ssh_key) => handleFieldChange('ssh_key', ssh_key, setUserSshKey, () => { // Additional logic for SSH key - dispatch(setUserPassword('')); - dispatch(setConfirmUserPassword('')); }) } placeholder="Paste your public SSH key" stepValidation={stepValidation} fieldName="userSshKey" - isDisabled={isSshKeyDisabled} />