Commit 7e55ac02 authored by Winnie Hellmann's avatar Winnie Hellmann Committed by Phil Hughes

Fix timing in geo_nodes/components/app_spec.js

parent 8f693d3c
...@@ -83,7 +83,7 @@ export default { ...@@ -83,7 +83,7 @@ export default {
}); });
}, },
fetchGeoNodes() { fetchGeoNodes() {
this.service return this.service
.getGeoNodes() .getGeoNodes()
.then(res => res.data) .then(res => res.data)
.then(nodes => { .then(nodes => {
...@@ -92,9 +92,7 @@ export default { ...@@ -92,9 +92,7 @@ export default {
}) })
.catch(() => { .catch(() => {
this.isLoading = false; this.isLoading = false;
Flash( Flash(s__('GeoNodes|Something went wrong while fetching nodes'));
s__('GeoNodes|Something went wrong while fetching nodes'),
);
}); });
}, },
fetchNodeDetails(node) { fetchNodeDetails(node) {
...@@ -109,10 +107,7 @@ export default { ...@@ -109,10 +107,7 @@ export default {
primaryRevision: primaryNodeVersion.revision, primaryRevision: primaryNodeVersion.revision,
}); });
this.store.setNodeDetails(nodeId, updatedNodeDetails); this.store.setNodeDetails(nodeId, updatedNodeDetails);
eventHub.$emit( eventHub.$emit('nodeDetailsLoaded', this.store.getNodeDetails(nodeId));
'nodeDetailsLoaded',
this.store.getNodeDetails(nodeId),
);
}) })
.catch(err => { .catch(err => {
if (err.response && err.response.data) { if (err.response && err.response.data) {
...@@ -124,10 +119,7 @@ export default { ...@@ -124,10 +119,7 @@ export default {
sync_status_unavailable: true, sync_status_unavailable: true,
storage_shards_match: null, storage_shards_match: null,
}); });
eventHub.$emit( eventHub.$emit('nodeDetailsLoaded', this.store.getNodeDetails(nodeId));
'nodeDetailsLoaded',
this.store.getNodeDetails(nodeId),
);
} else { } else {
eventHub.$emit('nodeDetailsLoadFailed', nodeId, err); eventHub.$emit('nodeDetailsLoadFailed', nodeId, err);
} }
...@@ -135,14 +127,11 @@ export default { ...@@ -135,14 +127,11 @@ export default {
}, },
repairNode(targetNode) { repairNode(targetNode) {
this.setNodeActionStatus(targetNode, true); this.setNodeActionStatus(targetNode, true);
this.service return this.service
.repairNode(targetNode) .repairNode(targetNode)
.then(() => { .then(() => {
this.setNodeActionStatus(targetNode, false); this.setNodeActionStatus(targetNode, false);
Flash( Flash(s__('GeoNodes|Node Authentication was successfully repaired.'), 'notice');
s__('GeoNodes|Node Authentication was successfully repaired.'),
'notice',
);
}) })
.catch(() => { .catch(() => {
this.setNodeActionStatus(targetNode, false); this.setNodeActionStatus(targetNode, false);
...@@ -151,7 +140,7 @@ export default { ...@@ -151,7 +140,7 @@ export default {
}, },
toggleNode(targetNode) { toggleNode(targetNode) {
this.setNodeActionStatus(targetNode, true); this.setNodeActionStatus(targetNode, true);
this.service return this.service
.toggleNode(targetNode) .toggleNode(targetNode)
.then(res => res.data) .then(res => res.data)
.then(node => { .then(node => {
...@@ -162,14 +151,12 @@ export default { ...@@ -162,14 +151,12 @@ export default {
}) })
.catch(() => { .catch(() => {
this.setNodeActionStatus(targetNode, false); this.setNodeActionStatus(targetNode, false);
Flash( Flash(s__('GeoNodes|Something went wrong while changing node status'));
s__('GeoNodes|Something went wrong while changing node status'),
);
}); });
}, },
removeNode(targetNode) { removeNode(targetNode) {
this.setNodeActionStatus(targetNode, true); this.setNodeActionStatus(targetNode, true);
this.service return this.service
.removeNode(targetNode) .removeNode(targetNode)
.then(() => { .then(() => {
this.store.removeNode(targetNode); this.store.removeNode(targetNode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment