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