diff --git a/cypress/views/block-pool.ts b/cypress/views/block-pool.ts index 180b4e9a5..1dd3f2220 100644 --- a/cypress/views/block-pool.ts +++ b/cypress/views/block-pool.ts @@ -33,10 +33,6 @@ export const populateBlockPoolForm = () => { cy.byLegacyTestID('replica-dropdown-item') .contains(`${replicaCount}-way Replication`) .click(); - cy.byTestID('volume-type-dropdown').click(); - cy.byTestID('volume-type-dropdown-item') - .contains(volumeType.toLocaleUpperCase()) - .click(); cy.byTestID('compression-checkbox').check(); }; diff --git a/locales/en/plugin__odf-console.json b/locales/en/plugin__odf-console.json index 0707fe6bf..c3ed176c0 100644 --- a/locales/en/plugin__odf-console.json +++ b/locales/en/plugin__odf-console.json @@ -324,8 +324,6 @@ "my-block-pool": "my-block-pool", "Data protection policy": "Data protection policy", "Select replication": "Select replication", - "Volume type": "Volume type", - "Select volume type": "Select volume type", "Compression": "Compression", "Enable compression": "Enable compression", "Enabling compression may result in little or no space savings for encrypted or random data. Also, enabling compression may have an impact on I/O performance.": "Enabling compression may result in little or no space savings for encrypted or random data. Also, enabling compression may have an impact on I/O performance.", @@ -347,6 +345,7 @@ "{{capacityRatio, number}}:1": "{{capacityRatio, number}}:1", "Compression ratio indicates the achieved compression on eligible data for this pool": "Compression ratio indicates the achieved compression on eligible data for this pool", "Storage efficiency": "Storage efficiency", + "Volume type": "Volume type", "Not available": "Not available", "Image states info": "Image states info", "What does each state mean?": "What does each state mean?", diff --git a/packages/ocs/block-pool/body.scss b/packages/ocs/block-pool/body.scss index 9738faf6e..dce468efc 100644 --- a/packages/ocs/block-pool/body.scss +++ b/packages/ocs/block-pool/body.scss @@ -18,3 +18,7 @@ .ceph-block-pool__alert { --pf-global--FontSize--md: 0.8rem; } + +.ceph-block-pool__dropdown-description > div { + white-space: pre-line; +} diff --git a/packages/ocs/block-pool/body.tsx b/packages/ocs/block-pool/body.tsx index 92b028b7b..2e150e3e3 100644 --- a/packages/ocs/block-pool/body.tsx +++ b/packages/ocs/block-pool/body.tsx @@ -15,7 +15,6 @@ import { } from '@odf/shared/types'; import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook'; import { useYupValidationResolver } from '@odf/shared/yup-validation-resolver'; -import { useFlag } from '@openshift-console/dynamic-plugin-sdk'; import * as _ from 'lodash-es'; import { useForm } from 'react-hook-form'; import * as Yup from 'yup'; @@ -33,7 +32,6 @@ import validationRegEx from '../../odf/utils/validation'; import { CEPH_NS, OCS_DEVICE_REPLICA, - OCS_POOL_MANAGEMENT, POOL_PROGRESS, POOL_STATE, } from '../constants'; @@ -80,15 +78,10 @@ export const BlockPoolBody = (props: BlockPoolBodyPros) => { const { cephCluster, state, dispatch, showPoolStatus, isUpdate } = props; const { t } = useCustomTranslation(); - const isPoolManagementSupported = useFlag(OCS_POOL_MANAGEMENT); const [storageCluster, storageClusterLoaded, storageClusterLoadError] = useK8sGet>(StorageClusterModel, null, CEPH_NS); const [isReplicaOpen, setReplicaOpen] = React.useState(false); - const [isVolumeTypeOpen, setVolumeTypeOpen] = React.useState(false); - const [availableDeviceClasses, setAvailableDeviceClasses] = React.useState( - [] - ); const [data, loaded, loadError] = useK8sList(CephBlockPoolModel, CEPH_NS); @@ -152,57 +145,6 @@ export const BlockPoolBody = (props: BlockPoolBodyPros) => { }); }, [storageCluster, storageClusterLoaded, storageClusterLoadError, dispatch]); - // Volume Type - const deviceClasses = React.useMemo( - () => cephCluster?.status?.storage?.deviceClasses ?? [], - [cephCluster?.status?.storage?.deviceClasses] - ); - - const setVolumeType = React.useCallback( - (volumeType: string) => - dispatch({ - type: BlockPoolActionType.SET_POOL_VOLUME_TYPE, - payload: volumeType, - }), - [dispatch] - ); - - React.useEffect(() => { - if (deviceClasses.length && isPoolManagementSupported) { - if (state.volumeType === '') { - // Set default value - const ssdDeviceClass = - deviceClasses.find((deviceClass) => deviceClass.name === 'ssd') || {}; - Object.keys(ssdDeviceClass).length - ? setVolumeType('ssd') - : setVolumeType(deviceClasses[0].name); - } - - // Volume Type dropdown - setAvailableDeviceClasses( - deviceClasses.map((device) => { - return ( - setVolumeType(e.currentTarget.id)} - > - {device?.name.toUpperCase()} - - ); - }) - ); - } - }, [ - deviceClasses, - dispatch, - isPoolManagementSupported, - setVolumeType, - state.volumeType, - ]); - // Check storage cluster is in ready state const isClusterReady: boolean = cephCluster?.status?.phase === POOL_STATE.READY; @@ -249,6 +191,7 @@ export const BlockPoolBody = (props: BlockPoolBodyPros) => { component="button" id={replica} data-test-id="replica-dropdown-item" + className="ceph-block-pool__dropdown-description" description={warning} onClick={(e) => dispatch({ @@ -321,34 +264,6 @@ export const BlockPoolBody = (props: BlockPoolBodyPros) => { id="pool-replica-size" /> - {isPoolManagementSupported && ( -
- - setVolumeTypeOpen(!isVolumeTypeOpen)} - toggleIndicator={CaretDownIcon} - isDisabled={isUpdate} - > - {state.volumeType.toUpperCase() || t('Select volume type')} - - } - isOpen={isVolumeTypeOpen} - dropdownItems={availableDeviceClasses} - onSelect={() => setVolumeTypeOpen(false)} - id="pool-volume-type" - /> -
- )}