Commit 12d6bbfc authored by Brandon Labuschagne's avatar Brandon Labuschagne

Merge branch 'mw-use-sprite-icon-in-audit-icon-helper' into 'master'

Use GitLab SVGs in audit_icon helper

See merge request gitlab-org/gitlab!45562
parents 522478de dc811467
......@@ -76,17 +76,17 @@ module IconsHelper
content_tag(:span, "", class: "gl-snippet-icon gl-snippet-icon-#{name}")
end
def audit_icon(names, options = {})
case names
def audit_icon(name, css_class: nil)
case name
when "standard"
names = "key"
name = "key"
when "two-factor"
names = "key"
name = "key"
when "google_oauth2"
names = "google"
name = "google"
end
options.include?(:base) ? fa_stacked_icon(names, options) : fa_icon(names, options)
sprite_icon(name, css_class: css_class)
end
def spinner(text = nil, visible = false)
......
......@@ -5,7 +5,7 @@
- events.each do |event|
%li
%span.description
= audit_icon(event.details[:with], class: "gl-mr-2")
= audit_icon(event.details[:with], css_class: 'gl-mr-2')
= _('Signed in with %{authentication} authentication') % { authentication: event.details[:with]}
%span.float-right= time_ago_with_tooltip(event.created_at)
......
---
title: Use GitLab SVGs in audit_icon helper
merge_request: 45562
author:
type: changed
......@@ -97,19 +97,19 @@ RSpec.describe IconsHelper do
it 'returns right icon name for standard auth' do
icon_name = 'standard'
expect(audit_icon(icon_name).to_s)
.to eq '<i class="fa fa-key"></i>'
.to eq sprite_icon('key')
end
it 'returns right icon name for two-factor auth' do
icon_name = 'two-factor'
expect(audit_icon(icon_name).to_s)
.to eq '<i class="fa fa-key"></i>'
.to eq sprite_icon('key')
end
it 'returns right icon name for google_oauth2 auth' do
icon_name = 'google_oauth2'
expect(audit_icon(icon_name).to_s)
.to eq '<i class="fa fa-google"></i>'
.to eq sprite_icon('google')
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