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
572c050b
Commit
572c050b
authored
Dec 09, 2020
by
Ezekiel Kigbo
Committed by
Heinrich Lee Yu
Dec 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Default emoji icon persists in issues and mrs header
parent
cac2115c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
4 deletions
+36
-4
app/helpers/issuables_helper.rb
app/helpers/issuables_helper.rb
+7
-4
changelogs/unreleased/284601-clear-emoji-status-in-issue-and-mr-header.yml
...ased/284601-clear-emoji-status-in-issue-and-mr-header.yml
+5
-0
spec/helpers/issuables_helper_spec.rb
spec/helpers/issuables_helper_spec.rb
+24
-0
No files found.
app/helpers/issuables_helper.rb
View file @
572c050b
...
...
@@ -164,6 +164,12 @@ module IssuablesHelper
h
(
title
||
default_label
)
end
def
issuable_meta_author_status
(
author
)
return
""
unless
show_status_emoji?
(
author
&
.
status
)
&&
status
=
user_status
(
author
)
"
#{
status
}
"
.
html_safe
end
def
issuable_meta
(
issuable
,
project
)
output
=
[]
output
<<
"Opened
#{
time_ago_with_tooltip
(
issuable
.
created_at
)
}
by "
.
html_safe
...
...
@@ -177,10 +183,7 @@ module IssuablesHelper
author_output
<<
link_to_member
(
project
,
issuable
.
author
,
size:
24
,
by_username:
true
,
avatar:
false
,
mobile_classes:
"d-inline d-sm-none"
)
author_output
<<
issuable_meta_author_slot
(
issuable
.
author
,
css_class:
'ml-1'
)
if
status
=
user_status
(
issuable
.
author
)
author_output
<<
"
#{
status
}
"
.
html_safe
end
author_output
<<
issuable_meta_author_status
(
issuable
.
author
)
author_output
end
...
...
changelogs/unreleased/284601-clear-emoji-status-in-issue-and-mr-header.yml
0 → 100644
View file @
572c050b
---
title
:
Clear emoji status in issue/mr header
merge_request
:
49439
author
:
type
:
fixed
spec/helpers/issuables_helper_spec.rb
View file @
572c050b
...
...
@@ -44,6 +44,30 @@ RSpec.describe IssuablesHelper do
end
end
describe
'#issuable_meta'
do
let
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
describe
'author status'
do
let
(
:issuable
)
{
build
(
:merge_request
,
source_project:
project
,
author:
user
,
created_at:
'2020-01-30'
)
}
it
'displays an emoji if the user status is set'
do
user
.
status
=
UserStatus
.
new
(
message:
'lol'
)
content
=
helper
.
issuable_meta
(
issuable
,
project
)
expect
(
content
).
to
match
(
'<span class="user-status-emoji has-tooltip" title="lol" data-html="true" data-placement="top">'
)
expect
(
content
).
to
match
(
'<gl-emoji title="speech balloon" data-name="speech_balloon" data-unicode-version="6.0">'
)
end
it
'does not displays an emoji if the user status is not set'
do
user
.
status
=
UserStatus
.
new
content
=
helper
.
issuable_meta
(
issuable
,
project
)
expect
(
content
).
not_to
match
(
'class="user-status-emoji has-tooltip"'
)
expect
(
content
).
not_to
match
(
'gl-emoji'
)
end
end
end
describe
'#issuables_state_counter_text'
do
let
(
:user
)
{
create
(
:user
)
}
...
...
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