Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Gitlab-External-Templates
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Adri
Gitlab-External-Templates
Commits
bee29dc0
Commit
bee29dc0
authored
2 years ago
by
Deepika Guliani
Browse files
Options
Downloads
Patches
Plain Diff
Rubocop and specs
parent
e4cbd47b
Branches
366207-surface-work-item-type-in-popovers-work-item-detail-view-and-issue-lists
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/helpers/issuables_helper.rb
+7
-3
7 additions, 3 deletions
app/helpers/issuables_helper.rb
spec/helpers/issuables_helper_spec.rb
+3
-2
3 additions, 2 deletions
spec/helpers/issuables_helper_spec.rb
with
10 additions
and
5 deletions
app/helpers/issuables_helper.rb
+
7
−
3
View file @
bee29dc0
...
...
@@ -155,15 +155,19 @@ def issuable_meta_author_status(author)
def
issuable_meta
(
issuable
,
project
)
icon_name
=
if
WorkItems
::
Type
.
base_types
.
key?
(
I
ssu
e
.
last
.
issue_type
)
if
issuable
.
is_a?
(
Issue
)
&&
WorkItems
::
Type
.
base_types
.
key?
(
i
ssu
able
&
.
issue_type
.
downcase
)
"issue-type-
#{
issuable
.
issue_type
.
downcase
}
"
else
'issue-type-issue'
end
output
=
[]
output
<<
content_tag
(
:span
,
sprite_icon
(
"
#{
icon_name
}
"
,
css_class:
'gl-icon gl-vertical-align-middle'
),
class:
'gl-mr-2'
)
output
<<
"
#{
issuable
.
issue_type
.
capitalize
}
created
#{
time_ago_with_tooltip
(
issuable
.
created_at
)
}
by "
.
html_safe
if
issuable
.
is_a?
(
Issue
)
output
<<
content_tag
(
:span
,
sprite_icon
(
"
#{
icon_name
}
"
,
css_class:
'gl-icon gl-vertical-align-middle'
),
class:
'gl-mr-2'
)
output
<<
"
#{
issuable
.
issue_type
.
capitalize
}
created
#{
time_ago_with_tooltip
(
issuable
.
created_at
)
}
by "
.
html_safe
elsif
output
<<
"Created
#{
time_ago_with_tooltip
(
issuable
.
created_at
)
}
by "
.
html_safe
end
if
issuable
.
is_a?
(
Issue
)
&&
issuable
.
service_desk_reply_to
output
<<
"
#{
html_escape
(
issuable
.
service_desk_reply_to
)
}
via "
...
...
This diff is collapsed.
Click to expand it.
spec/helpers/issuables_helper_spec.rb
+
3
−
2
View file @
bee29dc0
...
...
@@ -104,11 +104,12 @@
let_it_be
(
:project
)
{
create
(
:project
)
}
describe
'Issue type'
do
let
(
:issuable
)
{
build
(
:merge_request
,
source_project:
project
,
author:
user
,
created_at:
'2022-07-27'
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:issuable
)
{
create
(
:issue
)
}
it
'displays the icon of Issue Type'
do
content
=
helper
.
issuable_meta
(
issuable
,
project
)
expect
(
content
).
to
matc
h
(
'<span class="gl-mr-2"><svg class="s16 gl-icon gl-vertical-align-middle"
>
'
)
expect
(
content
).
to
start_wit
h
(
'<span class="gl-mr-2"><svg class="s16 gl-icon gl-vertical-align-middle"'
)
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment