From 4c82ae8749292a512e36cc607b02bc7cea84ec84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anna=20V=C3=ADtov=C3=A1?= Date: Wed, 14 May 2025 10:36:51 +0200 Subject: [PATCH] Wizard: make Satellite CA cert optional Users do not need to fill in the satellite certificate, omitting parts of code that require it. --- .../steps/Registration/SatelliteRegistration.tsx | 3 +-- .../CreateImageWizard/utilities/useValidation.tsx | 11 +---------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/Components/CreateImageWizard/steps/Registration/SatelliteRegistration.tsx b/src/Components/CreateImageWizard/steps/Registration/SatelliteRegistration.tsx index 279a2596..522a36eb 100644 --- a/src/Components/CreateImageWizard/steps/Registration/SatelliteRegistration.tsx +++ b/src/Components/CreateImageWizard/steps/Registration/SatelliteRegistration.tsx @@ -50,7 +50,7 @@ const SatelliteRegistration = () => { return ( <> - + { onDataChange={handleDataChange} onTextChange={handleTextChange} onClearClick={handleClear} - isRequired={true} dropzoneProps={{ accept: { 'application/x-pem-file': ['.pem'], diff --git a/src/Components/CreateImageWizard/utilities/useValidation.tsx b/src/Components/CreateImageWizard/utilities/useValidation.tsx index 68cfa8f5..05efeebf 100644 --- a/src/Components/CreateImageWizard/utilities/useValidation.tsx +++ b/src/Components/CreateImageWizard/utilities/useValidation.tsx @@ -28,7 +28,6 @@ import { selectLanguages, selectKeyboard, selectTimezone, - selectSatelliteCaCertificate, selectSatelliteRegistrationCommand, selectImageTypes, UserWithAdditionalInfo, @@ -177,7 +176,6 @@ export function useRegistrationValidation(): StepValidation { const registrationCommand = useAppSelector( selectSatelliteRegistrationCommand ); - const caCertificate = useAppSelector(selectSatelliteCaCertificate); const { isFetching: isFetchingKeyInfo, isError: isErrorKeyInfo } = useShowActivationKeyQuery( @@ -212,20 +210,13 @@ export function useRegistrationValidation(): StepValidation { if (registrationType === 'register-satellite') { const errors = {}; - if (caCertificate === '') { - Object.assign(errors, { - certificate: - 'Valid certificate must be present if you are registering Satellite.', - }); - } const tokenErrors = validateSatelliteToken(registrationCommand); Object.assign(errors, tokenErrors); return { errors: errors, disabledNext: - Object.keys(errors).some((key) => key !== 'expired') || - !caCertificate || + Object.keys(errors).some((key) => key !== 'expired') || !registrationCommand, }; }