diff --git a/ui/src/config/section/infra/clusters.js b/ui/src/config/section/infra/clusters.js index b1d99971d4ba..726ac09af323 100644 --- a/ui/src/config/section/infra/clusters.js +++ b/ui/src/config/section/infra/clusters.js @@ -114,8 +114,7 @@ export default { message: 'label.outofbandmanagement.enable', dataView: true, show: (record) => { - return record.resourcedetails && record.resourcedetails.outOfBandManagementEnabled && - record.resourcedetails.outOfBandManagementEnabled === 'false' + return record?.resourcedetails?.outOfBandManagementEnabled === 'false' }, args: ['clusterid'], mapping: { @@ -131,8 +130,7 @@ export default { message: 'label.outofbandmanagement.disable', dataView: true, show: (record) => { - return !(record.resourcedetails && record.resourcedetails.outOfBandManagementEnabled && - record.resourcedetails.outOfBandManagementEnabled === 'false') + return !(record?.resourcedetails?.outOfBandManagementEnabled === 'false') }, args: ['clusterid'], mapping: { @@ -148,8 +146,7 @@ export default { message: 'label.ha.enable', dataView: true, show: (record) => { - return record.resourcedetails && record.resourcedetails.resourceHAEnabled && - record.resourcedetails.resourceHAEnabled === 'false' + return record?.resourcedetails?.resourceHAEnabled === 'false' }, args: ['clusterid'], mapping: { @@ -165,8 +162,7 @@ export default { message: 'label.ha.disable', dataView: true, show: (record) => { - return !(record.resourcedetails && record.resourcedetails.resourceHAEnabled && - record.resourcedetails.resourceHAEnabled === 'false') + return !(record?.resourcedetails?.resourceHAEnabled === 'false') }, args: ['clusterid'], mapping: { diff --git a/ui/src/config/section/infra/hosts.js b/ui/src/config/section/infra/hosts.js index 6ab3c29c43bf..cd14880bcabf 100644 --- a/ui/src/config/section/infra/hosts.js +++ b/ui/src/config/section/infra/hosts.js @@ -152,8 +152,7 @@ export default { docHelp: 'adminguide/hosts.html#out-of-band-management', dataView: true, show: (record) => { - return !(record.outofbandmanagement && record.outofbandmanagement.enabled && - record.outofbandmanagement.enabled === true) + return !(record?.outofbandmanagement?.enabled === true) }, args: ['hostid'], mapping: { @@ -170,8 +169,7 @@ export default { docHelp: 'adminguide/hosts.html#out-of-band-management', dataView: true, show: (record) => { - return record.outofbandmanagement && record.outofbandmanagement.enabled && - record.outofbandmanagement.enabled === true + return record?.outofbandmanagement?.enabled === true }, args: ['hostid'], mapping: { @@ -188,8 +186,7 @@ export default { docHelp: 'adminguide/hosts.html#out-of-band-management', dataView: true, show: (record) => { - return record.outofbandmanagement && record.outofbandmanagement.enabled && - record.outofbandmanagement.enabled === true + return record?.outofbandmanagement?.enabled === true }, args: ['hostid', 'action'], mapping: { @@ -209,8 +206,7 @@ export default { docHelp: 'adminguide/hosts.html#out-of-band-management', dataView: true, show: (record) => { - return record.outofbandmanagement && record.outofbandmanagement.enabled && - record.outofbandmanagement.enabled === true + return record?.outofbandmanagement?.enabled === true }, args: ['hostid', 'password'], mapping: { @@ -245,8 +241,7 @@ export default { docHelp: 'adminguide/reliability.html#ha-for-hosts', dataView: true, show: (record) => { - return !(record.hostha && record.hostha.haenable && - record.hostha.haenable === true) + return !(record?.hostha?.haenable === true) }, args: ['hostid'], mapping: { diff --git a/ui/src/config/section/infra/zones.js b/ui/src/config/section/infra/zones.js index 4df57a540564..cfea2d3058ec 100644 --- a/ui/src/config/section/infra/zones.js +++ b/ui/src/config/section/infra/zones.js @@ -126,8 +126,7 @@ export default { message: 'label.outofbandmanagement.enable', dataView: true, show: (record) => { - return record.resourcedetails && record.resourcedetails.outOfBandManagementEnabled && - record.resourcedetails.outOfBandManagementEnabled === 'false' + return record?.resourcedetails?.outOfBandManagementEnabled === 'false' }, args: ['zoneid'], mapping: { @@ -143,8 +142,7 @@ export default { message: 'label.outofbandmanagement.disable', dataView: true, show: (record) => { - return !(record.resourcedetails && record.resourcedetails.outOfBandManagementEnabled && - record.resourcedetails.outOfBandManagementEnabled === 'false') + return !(record?.resourcedetails?.outOfBandManagementEnabled === 'false') }, args: ['zoneid'], mapping: { @@ -160,8 +158,7 @@ export default { message: 'label.ha.enable', dataView: true, show: (record) => { - return record.resourcedetails && record.resourcedetails.resourceHAEnabled && - record.resourcedetails.resourceHAEnabled === 'false' + return record?.resourcedetails?.resourceHAEnabled === 'false' }, args: ['zoneid'], mapping: { @@ -177,8 +174,7 @@ export default { message: 'label.ha.disable', dataView: true, show: (record) => { - return !(record.resourcedetails && record.resourcedetails.resourceHAEnabled && - record.resourcedetails.resourceHAEnabled === 'false') + return !(record?.resourcedetails?.resourceHAEnabled === 'false') }, args: ['zoneid'], mapping: {