Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
dc811467
Commit
dc811467
authored
Oct 20, 2020
by
Martin Wortschack
Committed by
Brandon Labuschagne
Oct 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use GitLab SVGs in audit_icon helper
parent
e76788ac
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
10 deletions
+15
-10
app/helpers/icons_helper.rb
app/helpers/icons_helper.rb
+6
-6
app/views/profiles/_event_table.html.haml
app/views/profiles/_event_table.html.haml
+1
-1
changelogs/unreleased/mw-use-sprite-icon-in-audit-icon-helper.yml
...gs/unreleased/mw-use-sprite-icon-in-audit-icon-helper.yml
+5
-0
spec/helpers/icons_helper_spec.rb
spec/helpers/icons_helper_spec.rb
+3
-3
No files found.
app/helpers/icons_helper.rb
View file @
dc811467
...
...
@@ -76,17 +76,17 @@ module IconsHelper
content_tag
(
:span
,
""
,
class:
"gl-snippet-icon gl-snippet-icon-
#{
name
}
"
)
end
def
audit_icon
(
name
s
,
options
=
{}
)
case
name
s
def
audit_icon
(
name
,
css_class:
nil
)
case
name
when
"standard"
name
s
=
"key"
name
=
"key"
when
"two-factor"
name
s
=
"key"
name
=
"key"
when
"google_oauth2"
name
s
=
"google"
name
=
"google"
end
options
.
include?
(
:base
)
?
fa_stacked_icon
(
names
,
options
)
:
fa_icon
(
names
,
option
s
)
sprite_icon
(
name
,
css_class:
css_clas
s
)
end
def
spinner
(
text
=
nil
,
visible
=
false
)
...
...
app/views/profiles/_event_table.html.haml
View file @
dc811467
...
...
@@ -5,7 +5,7 @@
-
events
.
each
do
|
event
|
%li
%span
.description
=
audit_icon
(
event
.
details
[
:with
],
c
lass:
"gl-mr-2"
)
=
audit_icon
(
event
.
details
[
:with
],
c
ss_class:
'gl-mr-2'
)
=
_
(
'Signed in with %{authentication} authentication'
)
%
{
authentication:
event
.
details
[
:with
]}
%span
.float-right
=
time_ago_with_tooltip
(
event
.
created_at
)
...
...
changelogs/unreleased/mw-use-sprite-icon-in-audit-icon-helper.yml
0 → 100644
View file @
dc811467
---
title
:
Use GitLab SVGs in audit_icon helper
merge_request
:
45562
author
:
type
:
changed
spec/helpers/icons_helper_spec.rb
View file @
dc811467
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment