Skip to content

Commit 1b64712

Browse files
authored
fix: handle undefined scheduled status (#896)
Signed-off-by: Yi-Ya Chen <[email protected]>
1 parent 82a424c commit 1b64712

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/routes/volume/VolumeActions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ function actions({
248248
})
249249

250250
availableActions.push({ key: 'cloneVolume', name: 'Clone Volume', disabled: selected.standby || isRestoring(selected) })
251-
availableActions.push({ key: 'expandVolume', name: 'Expand Volume', disabled: selected?.conditions?.Scheduled?.status?.toLowerCase() === 'false' })
251+
availableActions.push({ key: 'expandVolume', name: 'Expand Volume', disabled: selected?.conditions?.Scheduled?.status?.toLowerCase() !== 'true' })
252252
if (selected.controllers && selected.controllers[0] && !selected.controllers[0].isExpanding && selected.controllers[0].size !== 0 && selected.controllers[0].size !== selected.size && selected.controllers[0].size !== '0') {
253253
availableActions.push({ key: 'cancelExpansion', name: 'Cancel Expansion', disabled: false })
254254
}

src/routes/volume/VolumeBulkActions.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ function bulkActions({
181181
return false
182182
})
183183
}
184-
const conditionsScheduled = () => selectedRows.some(item => item.conditions && item.conditions.Scheduled && item.conditions.Scheduled.status && item.conditions.Scheduled.status.toLowerCase() === 'true')
184+
const disableExpandVolume = () => selectedRows.some(item => item.conditions?.Scheduled?.status?.toLowerCase() !== 'true')
185185
const upgradingEngine = () => selectedRows.some((item) => item.currentImage !== item.image)
186186
const notAttached = () => selectedRows.some(item => item.state !== 'attached')
187187
/*
@@ -199,7 +199,7 @@ function bulkActions({
199199

200200
const allDropDownActions = [
201201
{ key: 'upgrade', name: 'Upgrade Engine', disabled() { return selectedRows.length === 0 || isAutomaticallyUpgradeEngine() || !hasAction('engineUpgrade') || hasDoingState() || hasMoreOptions() || hasVolumeRestoring() || canUpgradeEngine() } },
202-
{ key: 'expandVolume', name: 'Expand Volume', disabled() { return selectedRows.length === 0 || !conditionsScheduled() } },
202+
{ key: 'expandVolume', name: 'Expand Volume', disabled() { return selectedRows.length === 0 || disableExpandVolume() } },
203203
{ key: 'updateBulkReplicaCount', name: 'Update Replicas Count', disabled() { return selectedRows.length === 0 || isHasStandy() || disableUpdateBulkReplicaCount() || upgradingEngine() } },
204204
{ key: 'updateBulkDataLocality', name: 'Update Data Locality', disabled() { return selectedRows.length === 0 || isHasStandy() || disableUpdateBulkDataLocality() || upgradingEngine() } },
205205
{ key: 'updateSnapshotDataIntegrity', name: 'Snapshot Data Integrity', disabled() { return selectedRows.length === 0 } },

0 commit comments

Comments
 (0)