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
c6d00c85
Commit
c6d00c85
authored
Aug 28, 2020
by
Martin Wortschack
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace notification icons with Gitlab SVGs
parent
3a32924c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
13 deletions
+18
-13
app/helpers/notifications_helper.rb
app/helpers/notifications_helper.rb
+5
-5
app/views/profiles/notifications/_group_settings.html.haml
app/views/profiles/notifications/_group_settings.html.haml
+1
-1
app/views/profiles/notifications/_project_settings.html.haml
app/views/profiles/notifications/_project_settings.html.haml
+1
-1
changelogs/unreleased/mw-notification-icons.yml
changelogs/unreleased/mw-notification-icons.yml
+5
-0
spec/helpers/notifications_helper_spec.rb
spec/helpers/notifications_helper_spec.rb
+6
-6
No files found.
app/helpers/notifications_helper.rb
View file @
c6d00c85
...
...
@@ -6,15 +6,15 @@ module NotificationsHelper
def
notification_icon_class
(
level
)
case
level
.
to_sym
when
:disabled
,
:owner_disabled
'
microphone-slash
'
'
notifications-off
'
when
:participating
'
volume-up
'
'
notifications
'
when
:watch
'eye'
when
:mention
'at'
when
:global
'
globe
'
'
earth
'
end
end
...
...
@@ -28,8 +28,8 @@ module NotificationsHelper
end
end
def
notification_icon
(
level
,
text
=
nil
)
icon
(
"
#{
notification_icon_class
(
level
)
}
fw"
,
text:
text
)
def
notification_icon
(
level
)
sprite_icon
(
"
#{
notification_icon_class
(
level
)
}
"
)
end
def
notification_title
(
level
)
...
...
app/views/profiles/notifications/_group_settings.html.haml
View file @
c6d00c85
...
...
@@ -2,7 +2,7 @@
.gl-responsive-table-row.notification-list-item
.table-section.section-40
%span
.notification.
fa.fa-holder.
gl-mr-2
%span
.notification.gl-mr-2
=
notification_icon
(
notification_icon_level
(
setting
,
emails_disabled
))
%span
.str-truncated
...
...
app/views/profiles/notifications/_project_settings.html.haml
View file @
c6d00c85
-
emails_disabled
=
project
.
emails_disabled?
%li
.notification-list-item
%span
.notification.
fa.fa-holder.
gl-mr-2
%span
.notification.gl-mr-2
=
notification_icon
(
notification_icon_level
(
setting
,
emails_disabled
))
%span
.str-truncated
...
...
changelogs/unreleased/mw-notification-icons.yml
0 → 100644
View file @
c6d00c85
---
title
:
Replace notification icons with Gitlab SVGs
merge_request
:
40709
author
:
type
:
changed
spec/helpers/notifications_helper_spec.rb
View file @
c6d00c85
...
...
@@ -4,12 +4,12 @@ require 'spec_helper'
RSpec
.
describe
NotificationsHelper
do
describe
'notification_icon'
do
it
{
expect
(
notification_icon
(
:disabled
)).
to
match
(
'
class="fa fa-microphone-slash fa-fw
"'
)
}
it
{
expect
(
notification_icon
(
:owner_disabled
)).
to
match
(
'
class="fa fa-microphone-slash fa-fw
"'
)
}
it
{
expect
(
notification_icon
(
:participating
)).
to
match
(
'
class="fa fa-volume-up fa-fw
"'
)
}
it
{
expect
(
notification_icon
(
:mention
)).
to
match
(
'
class="fa fa-at fa-fw
"'
)
}
it
{
expect
(
notification_icon
(
:global
)).
to
match
(
'
class="fa fa-globe fa-fw"
'
)
}
it
{
expect
(
notification_icon
(
:watch
)).
to
match
(
'
class="fa fa-eye fa-fw
"'
)
}
it
{
expect
(
notification_icon
(
:disabled
)).
to
match
(
'
data-testid="notifications-off-icon
"'
)
}
it
{
expect
(
notification_icon
(
:owner_disabled
)).
to
match
(
'
data-testid="notifications-off-icon
"'
)
}
it
{
expect
(
notification_icon
(
:participating
)).
to
match
(
'
data-testid="notifications-icon
"'
)
}
it
{
expect
(
notification_icon
(
:mention
)).
to
match
(
'
data-testid="at-icon
"'
)
}
it
{
expect
(
notification_icon
(
:global
)).
to
match
(
'
data-testid="earth-icon
'
)
}
it
{
expect
(
notification_icon
(
:watch
)).
to
match
(
'
data-testid="eye-icon
"'
)
}
end
describe
'notification_title'
do
...
...
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