Commit ddc94734 authored by Annabel Dunstone Gray's avatar Annabel Dunstone Gray

Fix rubocop and jslint errors

parent 7e9b8872
...@@ -4,7 +4,7 @@ import './smart_interval'; ...@@ -4,7 +4,7 @@ import './smart_interval';
const healthyClass = 'geo-node-healthy'; const healthyClass = 'geo-node-healthy';
const unhealthyClass = 'geo-node-unhealthy'; const unhealthyClass = 'geo-node-unhealthy';
const healthyIcon = 'fa-check'; const healthyIcon = 'fa-check';
const unhealthyIcon = 'fa-close' const unhealthyIcon = 'fa-close';
class GeoNodeStatus { class GeoNodeStatus {
constructor(el) { constructor(el) {
...@@ -38,7 +38,7 @@ class GeoNodeStatus { ...@@ -38,7 +38,7 @@ class GeoNodeStatus {
this.$lfsObjectsSynced.html(`${status.lfs_objects_synced_count}/${status.lfs_objects_count} (${status.lfs_objects_synced_in_percentage})`); this.$lfsObjectsSynced.html(`${status.lfs_objects_synced_count}/${status.lfs_objects_count} (${status.lfs_objects_synced_in_percentage})`);
this.$attachmentsSynced.html(`${status.attachments_synced_count}/${status.attachments_count} (${status.attachments_synced_in_percentage})`); this.$attachmentsSynced.html(`${status.attachments_synced_count}/${status.attachments_count} (${status.attachments_synced_in_percentage})`);
if (status.health !== 'Healthy') { if (status.health !== 'Healthy') {
this.$health.html('<code class="geo-health">' + status.health + '</code>'); this.$health.html(`<code class="geo-health">${status.health}</code>`);
} }
this.$status.show(); this.$status.show();
...@@ -47,12 +47,12 @@ class GeoNodeStatus { ...@@ -47,12 +47,12 @@ class GeoNodeStatus {
setStatusIcon(healthy) { setStatusIcon(healthy) {
if (healthy) { if (healthy) {
this.$icon.removeClass(unhealthyClass + ' ' + unhealthyIcon) this.$icon.removeClass(`${unhealthyClass} ${unhealthyIcon}`)
.addClass(healthyClass + ' ' + healthyIcon) .addClass(`${healthyClass} ${healthyIcon}`)
.attr('title', 'Healthy'); .attr('title', 'Healthy');
} else { } else {
this.$icon.removeClass(healthyClass + ' ' + healthyIcon) this.$icon.removeClass(`${healthyClass} ${healthyIcon}`)
.addClass(unhealthyClass + ' ' + unhealthyIcon) .addClass(`${unhealthyClass} ${unhealthyIcon}`)
.attr('title', 'Unhealthy'); .attr('title', 'Unhealthy');
} }
} }
......
...@@ -3,12 +3,7 @@ module EE ...@@ -3,12 +3,7 @@ module EE
def node_status_icon(node) def node_status_icon(node)
unless node.primary? unless node.primary?
status = node.enabled? ? 'healthy' : 'disabled' status = node.enabled? ? 'healthy' : 'disabled'
icon = status == 'healthy' ? 'check' : 'times'
if status == 'healthy'
icon = 'check'
else
icon = 'times'
end
icon "#{icon} fw", icon "#{icon} fw",
class: "js-geo-node-icon geo-node-#{status}", class: "js-geo-node-icon geo-node-#{status}",
...@@ -28,7 +23,7 @@ module EE ...@@ -28,7 +23,7 @@ module EE
if node.enabled? if node.enabled?
['warning', 'Disable', { confirm: 'Disabling a node stops the sync process. Are you sure?' }] ['warning', 'Disable', { confirm: 'Disabling a node stops the sync process. Are you sure?' }]
else else
['success', 'Enable'] %w[success Enable]
end end
link_to title, link_to title,
......
...@@ -61,7 +61,7 @@ describe GeoNodeStatusEntity do ...@@ -61,7 +61,7 @@ describe GeoNodeStatusEntity do
describe '#health' do describe '#health' do
context 'when node is healthy' do context 'when node is healthy' do
it 'exposes the health message' do it 'exposes the health message' do
expect(subject[:health]).to eq 'No Health Problems Detected' expect(subject[:health]).to eq 'Healthy'
end end
end end
......
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