Skip to content

Commit

Permalink
GDB-9232 improve replace cluster nodes dialog
Browse files Browse the repository at this point in the history
## What
Improve replace cluster nodes dialog.

## Why
The replace cluster nodes dialog needs some improvements for better UX like changing the cluster nodes list label and the selected nodes for adding label. Also changing the condition which is used to disable the OK button. Now it is allowed to only select nodes to be removed or added and not both.

## How
* Changed the labels of the two lists.
* Changed the condition that disables the OK button
  • Loading branch information
svilenvelikov committed Nov 30, 2023
1 parent 7dfa460 commit 6579226
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/i18n/locale-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@
},
"replace_nodes_dialog": {
"title": "Replace nodes in cluster",
"nodes_to_replace_label": "Replacement nodes list"
"nodes_to_replace_label": "Nodes to add to cluster",
"cluster_nodes_list": "Select nodes to be removed from existing cluster"
},
"add_nodes_dialog": {
"title": "Add nodes to cluster",
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/locale-fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@
},
"replace_nodes_dialog": {
"title": "Remplacer les nœuds dans le cluster",
"nodes_to_replace_label": "Liste des nœuds de remplacement"
"nodes_to_replace_label": "Nœuds à ajouter au cluster",
"cluster_nodes_list": "Sélectionnez les nœuds à supprimer du cluster existant"
},
"add_nodes_dialog": {
"title": "Ajouter des nœuds au cluster",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ function ReplaceNodesDialogCtrl($scope, $uibModalInstance, $timeout, toastr, $tr
};

$scope.permitNodesReplace = () => {
return !$scope.leftNodesMajority && $scope.nodesToReplace.length > 0 && $scope.replacementNodes.length > 0;
// Allow nodes to be only removed or added without real replacement.
return !$scope.leftNodesMajority && ($scope.nodesToReplace.length > 0 || $scope.replacementNodes.length > 0);
};

$scope.addNodeToList = (location) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ <h3 class="modal-title">{{'cluster_management.add_nodes_dialog.title' | translat
<form name="form" id="addNodesForm">
<div class="row">
<div class="col-lg-6">
<h4>{{'cluster_management.cluster_page.cluster_nodes_list' | translate}}</h4>
<h5>{{'cluster_management.cluster_page.cluster_nodes_list' | translate}}</h5>
<ul ng-if="clusterNodes && clusterNodes.length" class="list-group nodes-list">
<li ng-repeat="node in clusterNodes" class="list-group-item list-group-item-action d-flex justify-content-between align-items-center">
<div class="location-item">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ <h3 class="modal-title">{{'cluster_management.replace_nodes_dialog.title' | tran
<div class="modal-body replace-cluster-nodes-dialog">
<div class="row">
<div class="col-lg-6">
<h4>{{'cluster_management.cluster_page.cluster_nodes_list' | translate}}</h4>
<h5>{{'cluster_management.replace_nodes_dialog.cluster_nodes_list' | translate}}</h5>
<ul ng-if="clusterNodes && clusterNodes.length" class="list-group nodes-list">
<li ng-repeat="node in clusterNodes"
ng-class="{'list-group-item-danger': node.shouldReplace}"
Expand Down

0 comments on commit 6579226

Please sign in to comment.