Skip to content

Commit

Permalink
Merge pull request #2044 from pcbailey/bug-incorrect-volume-access-mo…
Browse files Browse the repository at this point in the history
…des-hotplug-disk

CNV-41832: Hide Access/Volume Mode radio buttons when optimized storage profile …
  • Loading branch information
openshift-merge-bot[bot] authored Jun 18, 2024
2 parents 786e8f5 + 3ae144a commit db840c7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ const AccessMode: FC = () => {

const { control, setValue, watch } = useFormContext<DiskFormState>();

const { accessMode, storageClassProvisioner, storageProfileSettingsApplied, volumeMode } =
watch();
const { accessMode, storageClassProvisioner, volumeMode } = watch();

const allowedAccessModes = useMemo(() => {
return getAccessModeForProvisioner(storageClassProvisioner, volumeMode as VOLUME_MODES);
Expand All @@ -30,10 +29,6 @@ const AccessMode: FC = () => {
}
}, [accessMode, allowedAccessModes, setValue]);

if (storageProfileSettingsApplied) {
return null;
}

return (
<FormGroup fieldId={accessModeFieldID} label={t('Access Mode')}>
{ACCESS_MODE_RADIO_OPTIONS.map(({ label, value }) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,19 @@ const ApplyStorageProfileSettings: FC = () => {
handleChange={handleApplyOptimizedSettingsChange}
isChecked={storageProfileSettingsApplied}
/>
<Flex
className="ApplyStorageProfileSettings--volume-access-section"
spaceItems={{ default: 'spaceItems3xl' }}
>
<FlexItem>
<AccessMode />
</FlexItem>
<FlexItem>
<VolumeMode />
</FlexItem>
</Flex>
{!storageProfileSettingsApplied && (
<Flex
className="ApplyStorageProfileSettings--volume-access-section"
spaceItems={{ default: 'spaceItems3xl' }}
>
<FlexItem>
<AccessMode />
</FlexItem>
<FlexItem>
<VolumeMode />
</FlexItem>
</Flex>
)}
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ const VolumeMode: FC = () => {

const { control, setValue, watch } = useFormContext<DiskFormState>();

const { accessMode, storageClassProvisioner, storageProfileSettingsApplied, volumeMode } =
watch();
const { accessMode, storageClassProvisioner, volumeMode } = watch();

const allowedVolumeModes = useMemo(
() => getVolumeModeForProvisioner(storageClassProvisioner, accessMode as ACCESS_MODES),
Expand All @@ -32,10 +31,6 @@ const VolumeMode: FC = () => {
}
}, [allowedVolumeModes, volumeMode, setValue]);

if (storageProfileSettingsApplied) {
return null;
}

return (
<FormGroup fieldId={volumeModeFieldID} label={t('Volume Mode')}>
{VOLUME_MODE_RADIO_OPTIONS.map(({ label, value }) => (
Expand Down

0 comments on commit db840c7

Please sign in to comment.