Skip to content

Commit

Permalink
GDB-8801 Change cluster recovery status icons (#1032)
Browse files Browse the repository at this point in the history
## What
Changed the icons for the recovery options

## Why
After discussion it was decided to be changed

## How
- changed icons
- changed null checks for recoveryStatus as it now comes as an empty object if there is no status
- changed RECORDING_SNAPSHOT to RECEIVING_SNAPSHOT
  • Loading branch information
yordanalexandrov authored Sep 21, 2023
1 parent 07a728c commit f6aaf90
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/i18n/locale-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"building_snapshot": "Building a snapshot for {{node}}",
"waiting_for_snapshot": "Waiting for snapshot from node {{node}}",
"sending_snapshot": "Sending a snapshot to node {{node}}",
"recording_snapshot": "Recording a snapshot from node {{node}}"
"receiving_snapshot": "Receiving a snapshot from node {{node}}"
}
},
"cluster_configuration": {
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/locale-fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"building_snapshot": "Créer un instantané pour {{node}}",
"waiting_for_snapshot": "En attente d'un instantané du nœud {{node}}",
"sending_snapshot": "Envoi d'un instantané au nœud {{node}}",
"recording_snapshot": "Enregistrement d'un instantané du nœud {{node}}"
"receiving_snapshot": "Réception d'un instantané du nœud {{node}}"
}
},
"cluster_configuration": {
Expand Down
18 changes: 9 additions & 9 deletions src/js/angular/clustermanagement/cluster-drawing.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,27 +161,27 @@ function updateNodesIcon(nodes) {
}

function hasRecoveryState(node) {
return !!node.recoveryStatus;
return !_.isEmpty(node.recoveryStatus);
}

function getNodeInfoIconType(node) {
if (!node.recoveryStatus) {
if (_.isEmpty(node.recoveryStatus)) {
return '';
}

switch (node.recoveryStatus.state) {
case RecoveryState.SEARCHING_FOR_NODE:
return '\uf002';
return '\uf29c';
case RecoveryState.WAITING_FOR_SNAPSHOT:
return '\uf017';
case RecoveryState.RECORDING_SNAPSHOT:
return '\uf0c7';
case RecoveryState.RECEIVING_SNAPSHOT:
return '\uf0ed';
case RecoveryState.APPLYING_SNAPSHOT:
return '\uf110';
return '\uf050';
case RecoveryState.BUILDING_SNAPSHOT:
return '\uf085';
return '\uf187';
case RecoveryState.SENDING_SNAPSHOT:
return '\uf093';
return '\uf0ee';
default:
return '';
}
Expand Down Expand Up @@ -232,7 +232,7 @@ function updateNodesInfoText(nodes) {
return d3.select(d.infoNode).node().getBBox().y - 5;
})
.classed('hidden', function (d) {
return !d.recoveryStatus;
return _.isEmpty(d.recoveryStatus);
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/js/angular/clustermanagement/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const NodeState = {
export const RecoveryState = {
SEARCHING_FOR_NODE: 'SEARCHING_FOR_NODE',
WAITING_FOR_SNAPSHOT: 'WAITING_FOR_SNAPSHOT',
RECORDING_SNAPSHOT: 'RECORDING_SNAPSHOT',
RECEIVING_SNAPSHOT: 'RECEIVING_SNAPSHOT',
APPLYING_SNAPSHOT: 'APPLYING_SNAPSHOT',
BUILDING_SNAPSHOT: 'BUILDING_SNAPSHOT',
SENDING_SNAPSHOT: 'SENDING_SNAPSHOT'
Expand Down
6 changes: 3 additions & 3 deletions src/js/angular/clustermanagement/directives.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const translationsMap = {
recovery_state: {
searching_for_node: "Searching for node",
waiting_for_snapshot: "Waiting for snapshot from node",
recording_snapshot: "Recording a snapshot from node",
receiving_snapshot: "Receiving a snapshot from node",
applying_snapshot: "Applying a snapshot",
building_snapshot: "Building a snapshot for node",
sending_snapshot: "Sending a snapshot to node"
Expand Down Expand Up @@ -337,7 +337,7 @@ clusterManagementDirectives.directive('clusterGraphicalView', ['$window', 'Local
function createNodes(nodes) {
nodes.forEach((node) => {
node.hostname = UriUtils.shortenIri(node.endpoint);
if (node.recoveryStatus) {
if (!_.isEmpty(node.recoveryStatus)) {
const messageLabelKey = 'cluster_management.cluster_graphical_view.recovery_state.' + node.recoveryStatus.state.toLowerCase();
node.recoveryStatus.message = $translate.instant(messageLabelKey, {node: node.recoveryStatus.affectedNodes.join(', ')});
}
Expand Down Expand Up @@ -447,7 +447,7 @@ const getLegendNodes = function () {
legendNodes.push({nodeState: NodeState.RESTRICTED, customText: 'node_state_restricted'});
legendNodes.push({nodeState: NodeState.OUT_OF_SYNC, customText: 'recovery_state.searching_for_node', recoveryStatus: {state: RecoveryState.SEARCHING_FOR_NODE}});
legendNodes.push({nodeState: NodeState.OUT_OF_SYNC, customText: 'recovery_state.waiting_for_snapshot', recoveryStatus: {state: RecoveryState.WAITING_FOR_SNAPSHOT}});
legendNodes.push({nodeState: NodeState.OUT_OF_SYNC, customText: 'recovery_state.recording_snapshot', recoveryStatus: {state: RecoveryState.RECORDING_SNAPSHOT}});
legendNodes.push({nodeState: NodeState.OUT_OF_SYNC, customText: 'recovery_state.receiving_snapshot', recoveryStatus: {state: RecoveryState.RECEIVING_SNAPSHOT}});
legendNodes.push({nodeState: NodeState.OUT_OF_SYNC, customText: 'recovery_state.applying_snapshot', recoveryStatus: {state: RecoveryState.APPLYING_SNAPSHOT}});
legendNodes.push({nodeState: NodeState.OUT_OF_SYNC, customText: 'recovery_state.building_snapshot', recoveryStatus: {state: RecoveryState.BUILDING_SNAPSHOT}});
legendNodes.push({nodeState: NodeState.OUT_OF_SYNC, customText: 'recovery_state.sending_snapshot', recoveryStatus: {state: RecoveryState.SENDING_SNAPSHOT}});
Expand Down
2 changes: 1 addition & 1 deletion test-cypress/fixtures/locale-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"building_snapshot": "Building a snapshot for {{node}}",
"waiting_for_snapshot": "Waiting for snapshot from node {{node}}",
"sending_snapshot": "Sending a snapshot to node {{node}}",
"recording_snapshot": "Recording a snapshot from node {{node}}"
"receiving_snapshot": "Receiving a snapshot from node {{node}}"
}
},
"cluster_configuration": {
Expand Down

0 comments on commit f6aaf90

Please sign in to comment.