Commit dc811467 authored by Martin Wortschack's avatar Martin Wortschack Committed by Brandon Labuschagne

Use GitLab SVGs in audit_icon helper

parent e76788ac
......@@ -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