From caa678ebebc7726b502e61d6847f9fc5fbf7d413 Mon Sep 17 00:00:00 2001 From: regexowl Date: Wed, 2 Jul 2025 15:44:48 +0200 Subject: [PATCH] Wizard: Replace VMware radios with checkboxes This replaces previously used VMware radios with checkboxes, allowing the user to select both VMware vSphere targets at the same time. --- .../components/TargetEnvironment.tsx | 204 +++++++----------- .../steps/ImageOutput/ImageOutput.test.tsx | 80 +++---- 2 files changed, 107 insertions(+), 177 deletions(-) diff --git a/src/Components/CreateImageWizard/steps/ImageOutput/components/TargetEnvironment.tsx b/src/Components/CreateImageWizard/steps/ImageOutput/components/TargetEnvironment.tsx index 0200c55c..2e53b517 100644 --- a/src/Components/CreateImageWizard/steps/ImageOutput/components/TargetEnvironment.tsx +++ b/src/Components/CreateImageWizard/steps/ImageOutput/components/TargetEnvironment.tsx @@ -6,7 +6,6 @@ import { Checkbox, FormGroup, Popover, - Radio, Content, CardHeader, Gallery, @@ -98,9 +97,6 @@ const TargetEnvironment = () => { // TODO: Handle isFetching state (add skeletons) // TODO: Handle isError state (very unlikely...) - const hasVsphere = - environments.includes('vsphere') || environments.includes('vsphere-ova'); - const dispatch = useAppDispatch(); const prefetchSources = provisioningApi.usePrefetch('getSourceList'); const prefetchActivationKeys = rhsmApi.usePrefetch('listActivationKeys'); @@ -201,131 +197,93 @@ const TargetEnvironment = () => { )} - {supportedEnvironments?.includes('vsphere') && ( - <> - Private cloud} - className="pf-v6-u-mt-sm" - > + {(supportedEnvironments?.includes('vsphere') || + supportedEnvironments?.includes('vsphere-ova')) && ( + Private cloud} + className="pf-v6-u-mt-sm" + > + {supportedEnvironments?.includes('vsphere-ova') && ( { - if (!hasVsphere) { - dispatch(addImageType('vsphere-ova')); - } else { - if (environments.includes('vsphere')) { - dispatch(removeImageType('vsphere')); - } - if (environments.includes('vsphere-ova')) { - dispatch(removeImageType('vsphere-ova')); - } - } - }} - aria-label="VMware checkbox" - id="checkbox-vmware" - name="VMware" - data-testid="checkbox-vmware" - body={ + name="vsphere-checkbox-ova" + aria-label="VMware vSphere checkbox OVA" + id="vsphere-checkbox-ova" + data-testid="checkbox-vsphere-ova" + label={ <> - {supportedEnvironments?.includes('vsphere-ova') && ( - - Open virtualization format (.ova) - - - An OVA file is a virtual appliance used by - virtualization platforms such as VMware - vSphere. It is a package that contains files - used to describe a virtual machine, which - includes a VMDK image, OVF descriptor file and - a manifest file. - - - } - > -