From 143a3f008902dddf849a0e6712696ac7b4cf3138 Mon Sep 17 00:00:00 2001 From: "andy.lee" Date: Wed, 11 Sep 2024 11:30:14 +0800 Subject: [PATCH] fix: lowercase options name in volume page Signed-off-by: andy.lee --- src/routes/volume/CreateVolume.js | 30 +++++++++++++++--------------- src/routes/volume/detail/index.js | 4 ++-- src/routes/volume/helper/index.js | 30 +++++++++++++++--------------- src/routes/volume/index.js | 4 ++-- 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/routes/volume/CreateVolume.js b/src/routes/volume/CreateVolume.js index 120af04a..4c7e807c 100644 --- a/src/routes/volume/CreateVolume.js +++ b/src/routes/volume/CreateVolume.js @@ -487,45 +487,45 @@ const modal = ({ {getFieldDecorator('unmapMarkSnapChainRemoved', { initialValue: 'ignored', })()} {getFieldDecorator('replicaSoftAntiAffinity', { initialValue: 'ignored', })()} {getFieldDecorator('replicaZoneSoftAntiAffinity', { initialValue: 'ignored', })()} {getFieldDecorator('replicaDiskSoftAntiAffinity', { initialValue: 'ignored', })()} {getFieldDecorator('freezeFilesystemForSnapshot', { initialValue: 'ignored', })()} diff --git a/src/routes/volume/detail/index.js b/src/routes/volume/detail/index.js index 1ba95f5d..e83ef4ca 100644 --- a/src/routes/volume/detail/index.js +++ b/src/routes/volume/detail/index.js @@ -172,10 +172,10 @@ function VolumeDetail({ snapshotModal, dispatch, backup, engineimage, eventlog, const defaultDataLocalityOption = defaultDataLocalitySetting?.definition?.options || [] const defaultDataLocalityValue = defaultDataLocalitySetting?.value || 'disabled' - const defaultSnapshotDataIntegrityOption = defaultSnapshotDataIntegritySetting?.definition?.options.map((item) => ({ key: item.firstUpperCase(), value: item })) || [] + const defaultSnapshotDataIntegrityOption = defaultSnapshotDataIntegritySetting?.definition?.options.map((item) => ({ key: item.toLowerCase(), value: item })) || [] if (defaultSnapshotDataIntegrityOption.length > 0) { - defaultSnapshotDataIntegrityOption.unshift({ key: 'Ignored (Follow the global setting)', value: 'ignored' }) + defaultSnapshotDataIntegrityOption.unshift({ key: 'ignored (follow the global setting)', value: 'ignored' }) } const v1DataEngineEnabledSetting = settings.find(s => s.id === 'v1-data-engine') diff --git a/src/routes/volume/helper/index.js b/src/routes/volume/helper/index.js index 8c331b2c..2ee15777 100644 --- a/src/routes/volume/helper/index.js +++ b/src/routes/volume/helper/index.js @@ -241,9 +241,9 @@ export function getUpdateDataLocalityModalProps(volume, visible, defaultDataLoca export function getUnmapMarkSnapChainRemovedModalProps(volume, visible, dispatch) { let option = [ - { key: 'Enabled', value: 'enabled' }, - { key: 'Disabled', value: 'disabled' }, - { key: 'Ignored (Follow the global setting)', value: 'ignored' }, + { key: 'enabled', value: 'enabled' }, + { key: 'disabled', value: 'disabled' }, + { key: 'ignored (follow the global setting)', value: 'ignored' }, ] return { @@ -305,9 +305,9 @@ export function getUpdateSnapshotDataIntegrityProps(volume, visible, defaultSnap export function getBulkUnmapMarkSnapChainRemovedModalProps(volumes, visible, dispatch) { let option = [ - { key: 'Enabled', value: 'enabled' }, - { key: 'Disabled', value: 'disabled' }, - { key: 'Ignored (Follow the global setting)', value: 'ignored' }, + { key: 'enabled', value: 'enabled' }, + { key: 'disabled', value: 'disabled' }, + { key: 'ignored (follow the global setting)', value: 'ignored' }, ] return { @@ -401,9 +401,9 @@ export function getUpdateBulkDataLocalityModalProps(volumes, visible, defaultDat export function getUpdateFreezeFilesystemForSnapshotModalProps(volume, visible, dispatch) { let option = [ - { key: 'Enabled', value: 'enabled' }, - { key: 'Disabled', value: 'disabled' }, - { key: 'Ignored (Follow the global setting)', value: 'ignored' }, + { key: 'enabled', value: 'enabled' }, + { key: 'disabled', value: 'disabled' }, + { key: 'ignored (follow the global setting)', value: 'ignored' }, ] return { @@ -433,9 +433,9 @@ export function getUpdateFreezeFilesystemForSnapshotModalProps(volume, visible, export function getUpdateBulkFreezeFilesystemForSnapshotModalProps(volumes, visible, dispatch) { const option = [ - { key: 'Enabled', value: 'enabled' }, - { key: 'Disabled', value: 'disabled' }, - { key: 'Ignored (Follow the global setting)', value: 'ignored' }, + { key: 'enabled', value: 'enabled' }, + { key: 'disabled', value: 'disabled' }, + { key: 'ignored (follow the global setting)', value: 'ignored' }, ] return { @@ -613,9 +613,9 @@ export function getUpdateReplicaSoftAntiAffinityModalProps(volume, volumes, upda }) }, options: [ - { value: 'enabled', label: 'Enabled' }, - { value: 'disabled', label: 'Disabled' }, - { value: 'ignored', label: 'Ignored (Follow the global setting)' }, + { value: 'enabled', label: 'enabled' }, + { value: 'disabled', label: 'disabled' }, + { value: 'ignored', label: 'ignored (follow the global setting)' }, ], fields, } diff --git a/src/routes/volume/index.js b/src/routes/volume/index.js index afd7bfb3..bdb98700 100644 --- a/src/routes/volume/index.js +++ b/src/routes/volume/index.js @@ -231,9 +231,9 @@ class Volume extends React.Component { const defaultDataLocalityOption = defaultDataLocalitySetting?.definition?.options || [] const defaultDataLocalityValue = defaultDataLocalitySetting?.value || 'disabled' const defaultRevisionCounterValue = defaultRevisionCounterSetting?.value === 'true' - const defaultSnapshotDataIntegrityOption = defaultSnapshotDataIntegritySetting?.definition?.options.map((item) => ({ key: item.firstUpperCase(), value: item })) || [] + const defaultSnapshotDataIntegrityOption = defaultSnapshotDataIntegritySetting?.definition?.options.map((item) => ({ key: item.toLowerCase(), value: item })) || [] if (defaultSnapshotDataIntegrityOption.length > 0) { - defaultSnapshotDataIntegrityOption.push({ key: 'Ignored (Follow the global setting)', value: 'ignored' }) + defaultSnapshotDataIntegrityOption.push({ key: 'ignored (follow the global setting)', value: 'ignored' }) } const backingImageOptions = backingImages?.filter(image => hasReadyBackingDisk(image)) || []