Commit ab03323f authored by Zack Cuddy's avatar Zack Cuddy Committed by Martin Wortschack

Geo - Update Fontawesome icons

Replaces some usages
of old fontawesome icons
with GitLab SVGs.

Some of the icons had
already been removed
from our icon library
causes an untracked bug
in the code.
parent e09933bf
...@@ -4,9 +4,9 @@ module EE ...@@ -4,9 +4,9 @@ module EE
module GeoHelper module GeoHelper
STATUS_ICON_NAMES_BY_STATE = { STATUS_ICON_NAMES_BY_STATE = {
synced: 'check', synced: 'check',
pending: 'clock-o', pending: 'clock',
failed: 'exclamation-triangle', failed: 'warning-solid',
never: 'circle-o' never: 'status_notfound'
}.freeze }.freeze
def self.current_node_human_status def self.current_node_human_status
...@@ -44,17 +44,6 @@ module EE ...@@ -44,17 +44,6 @@ module EE
node.namespaces.map(&:human_name).sort.join(', ') node.namespaces.map(&:human_name).sort.join(', ')
end end
def node_status_icon(node)
unless node.primary?
status = node.enabled? ? 'unknown' : 'disabled'
icon = status == 'healthy' ? 'check' : 'times'
icon "#{icon} fw",
class: "js-geo-node-icon geo-node-#{status}",
title: status.capitalize
end
end
def selective_sync_types_json def selective_sync_types_json
options = { options = {
ALL: { ALL: {
...@@ -74,10 +63,6 @@ module EE ...@@ -74,10 +63,6 @@ module EE
options.to_json options.to_json
end end
def status_loading_icon
icon "spinner spin fw", class: 'js-geo-node-loading'
end
def node_class(node) def node_class(node)
klass = [] klass = []
klass << 'js-geo-secondary-node' if node.secondary? klass << 'js-geo-secondary-node' if node.secondary?
...@@ -118,7 +103,7 @@ module EE ...@@ -118,7 +103,7 @@ module EE
end end
def geo_registry_status_icon(registry) def geo_registry_status_icon(registry)
icon STATUS_ICON_NAMES_BY_STATE.fetch(registry.synchronization_state, 'exclamation-triangle') sprite_icon(STATUS_ICON_NAMES_BY_STATE.fetch(registry.synchronization_state, 'warning-solid'))
end end
def geo_registry_status_text(registry) def geo_registry_status_text(registry)
......
%h4 %h4
= icon('exclamation-triangle') = sprite_icon('warning-solid')
Merge requests are read-only in a secondary Geo node Merge requests are read-only in a secondary Geo node
---
title: Geo - Update Legacy Icons
merge_request: 48058
author:
type: changed
...@@ -142,6 +142,8 @@ RSpec.describe 'admin Geo Projects', :js, :geo do ...@@ -142,6 +142,8 @@ RSpec.describe 'admin Geo Projects', :js, :geo do
labels.each do |label| labels.each do |label|
expect(page).to have_content(label) expect(page).to have_content(label)
end end
expect(page).to have_css("svg[data-testid=\"#{icon}-icon\"")
end end
end end
end end
...@@ -151,6 +153,7 @@ RSpec.describe 'admin Geo Projects', :js, :geo do ...@@ -151,6 +153,7 @@ RSpec.describe 'admin Geo Projects', :js, :geo do
let(:expected_registries) { [synced_registry] } let(:expected_registries) { [synced_registry] }
let(:unexpected_registries) { [sync_pending_registry, sync_failed_registry, never_synced_registry] } let(:unexpected_registries) { [sync_pending_registry, sync_failed_registry, never_synced_registry] }
let(:labels) { ['Status', 'Last successful sync', 'Last time verified', 'Last repository check run'] } let(:labels) { ['Status', 'Last successful sync', 'Last time verified', 'Last repository check run'] }
let(:icon) { 'check' }
it_behaves_like 'shows filter specific projects and correct labels' it_behaves_like 'shows filter specific projects and correct labels'
end end
...@@ -160,6 +163,7 @@ RSpec.describe 'admin Geo Projects', :js, :geo do ...@@ -160,6 +163,7 @@ RSpec.describe 'admin Geo Projects', :js, :geo do
let(:expected_registries) { [sync_pending_registry] } let(:expected_registries) { [sync_pending_registry] }
let(:unexpected_registries) { [synced_registry, sync_failed_registry, never_synced_registry] } let(:unexpected_registries) { [synced_registry, sync_failed_registry, never_synced_registry] }
let(:labels) { ['Status', 'Next sync scheduled at', 'Last sync attempt'] } let(:labels) { ['Status', 'Next sync scheduled at', 'Last sync attempt'] }
let(:icon) { 'clock' }
it_behaves_like 'shows filter specific projects and correct labels' it_behaves_like 'shows filter specific projects and correct labels'
end end
...@@ -169,6 +173,7 @@ RSpec.describe 'admin Geo Projects', :js, :geo do ...@@ -169,6 +173,7 @@ RSpec.describe 'admin Geo Projects', :js, :geo do
let(:expected_registries) { [sync_failed_registry] } let(:expected_registries) { [sync_failed_registry] }
let(:unexpected_registries) { [synced_registry, sync_pending_registry, never_synced_registry] } let(:unexpected_registries) { [synced_registry, sync_pending_registry, never_synced_registry] }
let(:labels) { ['Status', 'Next sync scheduled at', 'Last sync attempt'] } let(:labels) { ['Status', 'Next sync scheduled at', 'Last sync attempt'] }
let(:icon) { 'warning-solid' }
it_behaves_like 'shows filter specific projects and correct labels' it_behaves_like 'shows filter specific projects and correct labels'
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