Skip to content

Commit

Permalink
Revert "[#7024] Platform: Fixed edit number of nodes in AZ section (#…
Browse files Browse the repository at this point in the history
…7029)" (#7329)

Description: This reverts commit bccf91f. This commit was causing page crash while region selection during create universe.
  • Loading branch information
gaurav061 authored Feb 22, 2021
1 parent 7e9c88f commit 9ee8ae6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
: {};
Expand Down Expand Up @@ -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
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1591,7 +1591,7 @@ export default class ClusterFields extends Component {
<AZPlacementInfo
placementInfo={self.props.universe.currentPlacementStatus}
placementCloud={placementCloud}
providerCode={currentProvider?.code}
providerCode={currentProvider.code}
/>
);
} else if (currentProvider?.code === 'onprem'
Expand Down

0 comments on commit 9ee8ae6

Please sign in to comment.