From d077307f1c1a02b0cafecf49b200dac4d964d80f Mon Sep 17 00:00:00 2001 From: gaurav061 <60691495+gaurav061@users.noreply.github.com> Date: Sun, 21 Feb 2021 11:44:55 +0530 Subject: [PATCH] Revert "[#7024] Platform: Fixed edit number of nodes in AZ section (#7029)" This reverts commit bccf91f20b6541b6e6411b0812e8e052372e1a5b. --- .../universes/UniverseForm/AZSelectorTable.js | 20 +++---------------- .../universes/UniverseForm/ClusterFields.js | 2 +- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/managed/ui/src/components/universes/UniverseForm/AZSelectorTable.js b/managed/ui/src/components/universes/UniverseForm/AZSelectorTable.js index 586e3d34aa12..dc1f17bf32ac 100644 --- a/managed/ui/src/components/universes/UniverseForm/AZSelectorTable.js +++ b/managed/ui/src/components/universes/UniverseForm/AZSelectorTable.js @@ -113,7 +113,7 @@ export default class AZSelectorTable extends Component { } = this.props; const universeTemplate = _.clone(universeConfigTemplate.data); const currentAZState = [...this.state.azItemState]; - const replicationFactor = currentPlacementStatus?.replicationFactor; + const replicationFactor = currentPlacementStatus.replicationFactor; const item = currentAZState.find(item => item.value === zoneId); const originalValue = item.count; let totalNumNodes = 0; @@ -403,24 +403,10 @@ export default class AZSelectorTable extends Component { UNSAFE_componentWillMount() { const { - universe: { currentUniverse, universeConfigTemplate, currentPlacementStatus}, + universe: { currentUniverse, universeConfigTemplate }, type, clusterType } = this.props; - - // If currentPlacementStatus is null the fetch it. - if(!currentPlacementStatus) { - const configTemplateCurrentCluster = isNonEmptyObject(universeConfigTemplate.data) - ? getClusterByType(universeConfigTemplate.data.clusters, clusterType) - : null; - const placementInfo = this.getGroupWithCounts(universeConfigTemplate.data); - const placementStatusObject = { - numUniqueRegions: placementInfo.uniqueRegions, - numUniqueAzs: placementInfo.uniqueAzs, - replicationFactor: configTemplateCurrentCluster.userIntent.replicationFactor - }; - this.props.setPlacementStatus(placementStatusObject); - } const currentCluster = getPromiseState(universeConfigTemplate).isSuccess() ? getClusterByType(universeConfigTemplate.data.clusters, clusterType) : {}; @@ -448,7 +434,7 @@ export default class AZSelectorTable extends Component { const placementInfo = this.getGroupWithCounts(universeConfigTemplate.data); const azGroups = placementInfo.groups; if ( - !areUniverseConfigsEqual( + !areUniverseConfigsEqual( this.props.universe.universeConfigTemplate.data, universeConfigTemplate.data ) diff --git a/managed/ui/src/components/universes/UniverseForm/ClusterFields.js b/managed/ui/src/components/universes/UniverseForm/ClusterFields.js index 1535f5ab6d92..cf80f3665a51 100644 --- a/managed/ui/src/components/universes/UniverseForm/ClusterFields.js +++ b/managed/ui/src/components/universes/UniverseForm/ClusterFields.js @@ -1591,7 +1591,7 @@ export default class ClusterFields extends Component { ); } else if (currentProvider?.code === 'onprem'