Skip to content

Commit

Permalink
fix: lowercase options name in volume page
Browse files Browse the repository at this point in the history
Signed-off-by: andy.lee <[email protected]>
(cherry picked from commit b982e53)
  • Loading branch information
a110605 committed Sep 12, 2024
1 parent 207ed3d commit 9ebcbb7
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 34 deletions.
30 changes: 15 additions & 15 deletions src/routes/volume/CreateVolume.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,45 +487,45 @@ const modal = ({
{getFieldDecorator('unmapMarkSnapChainRemoved', {
initialValue: 'ignored',
})(<Select>
<Option key={'enabled'} value={'enabled'}>Enabled</Option>
<Option key={'disabled'} value={'disabled'}>Disabled</Option>
<Option key={'ignored'} value={'ignored'}>Ignored (Follow the global setting)</Option>
<Option key={'enabled'} value={'enabled'}>enabled</Option>
<Option key={'disabled'} value={'disabled'}>disabled</Option>
<Option key={'ignored'} value={'ignored'}>ignored (follow the global setting)</Option>
</Select>)}
</FormItem>
<FormItem label="Replica Soft Anti Affinity" hasFeedback {...formItemLayoutForAdvanced}>
{getFieldDecorator('replicaSoftAntiAffinity', {
initialValue: 'ignored',
})(<Select>
<Option key={'enabled'} value={'enabled'}>Enabled</Option>
<Option key={'disabled'} value={'disabled'}>Disabled</Option>
<Option key={'ignored'} value={'ignored'}>Ignored (Follow the global setting)</Option>
<Option key={'enabled'} value={'enabled'}>enabled</Option>
<Option key={'disabled'} value={'disabled'}>disabled</Option>
<Option key={'ignored'} value={'ignored'}>ignored (follow the global setting)</Option>
</Select>)}
</FormItem>
<FormItem label="Replica Zone Soft Anti Affinity" hasFeedback {...formItemLayoutForAdvanced}>
{getFieldDecorator('replicaZoneSoftAntiAffinity', {
initialValue: 'ignored',
})(<Select>
<Option key={'enabled'} value={'enabled'}>Enabled</Option>
<Option key={'disabled'} value={'disabled'}>Disabled</Option>
<Option key={'ignored'} value={'ignored'}>Ignored (Follow the global setting)</Option>
<Option key={'enabled'} value={'enabled'}>enabled</Option>
<Option key={'disabled'} value={'disabled'}>disabled</Option>
<Option key={'ignored'} value={'ignored'}>ignored (follow the global setting)</Option>
</Select>)}
</FormItem>
<FormItem label="Replica Disk Soft Anti Affinity" hasFeedback {...formItemLayoutForAdvanced}>
{getFieldDecorator('replicaDiskSoftAntiAffinity', {
initialValue: 'ignored',
})(<Select>
<Option key={'enabled'} value={'enabled'}>Enabled</Option>
<Option key={'disabled'} value={'disabled'}>Disabled</Option>
<Option key={'ignored'} value={'ignored'}>Ignored (Follow the global setting)</Option>
<Option key={'enabled'} value={'enabled'}>enabled</Option>
<Option key={'disabled'} value={'disabled'}>disabled</Option>
<Option key={'ignored'} value={'ignored'}>ignored (follow the global setting)</Option>
</Select>)}
</FormItem>
<FormItem label="Freeze Filesystem For Snapshot" hasFeedback {...formItemLayoutForAdvanced}>
{getFieldDecorator('freezeFilesystemForSnapshot', {
initialValue: 'ignored',
})(<Select>
<Option key={'enabled'} value={'enabled'}>Enabled</Option>
<Option key={'disabled'} value={'disabled'}>Disabled</Option>
<Option key={'ignored'} value={'ignored'}>Ignored (Follow the global setting)</Option>
<Option key={'enabled'} value={'enabled'}>enabled</Option>
<Option key={'disabled'} value={'disabled'}>disabled</Option>
<Option key={'ignored'} value={'ignored'}>ignored (follow the global setting)</Option>
</Select>)}
</FormItem>
<FormItem label="Disable Revision Counter" {...formItemLayoutForAdvanced}>
Expand Down
4 changes: 2 additions & 2 deletions src/routes/volume/detail/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
30 changes: 15 additions & 15 deletions src/routes/volume/helper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
}
Expand Down
4 changes: 2 additions & 2 deletions src/routes/volume/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) || []
Expand Down

0 comments on commit 9ebcbb7

Please sign in to comment.