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
3141fee4
Commit
3141fee4
authored
Apr 20, 2021
by
Yogi
Committed by
Enrique Alcántara
Apr 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add gl-badge for badges in MRs and issues nav
parent
9d9b902a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
+10
-5
app/helpers/issuables_helper.rb
app/helpers/issuables_helper.rb
+1
-1
changelogs/unreleased/gl-badge-mr.yml
changelogs/unreleased/gl-badge-mr.yml
+5
-0
spec/helpers/issuables_helper_spec.rb
spec/helpers/issuables_helper_spec.rb
+4
-4
No files found.
app/helpers/issuables_helper.rb
View file @
3141fee4
...
...
@@ -199,7 +199,7 @@ module IssuablesHelper
count
=
issuables_count_for_state
(
issuable_type
,
state
)
if
count
!=
-
1
html
<<
" "
<<
content_tag
(
:span
,
number_with_delimiter
(
count
),
class:
'badge badge-
pill
'
)
html
<<
" "
<<
content_tag
(
:span
,
number_with_delimiter
(
count
),
class:
'badge badge-
muted badge-pill gl-badge gl-tab-counter-badge sm
'
)
end
html
.
html_safe
...
...
changelogs/unreleased/gl-badge-mr.yml
0 → 100644
View file @
3141fee4
---
title
:
Add gl-badge for badges in MRs and issues nav
merge_request
:
57942
author
:
Yogi (@yo)
type
:
changed
spec/helpers/issuables_helper_spec.rb
View file @
3141fee4
...
...
@@ -133,13 +133,13 @@ RSpec.describe IssuablesHelper do
it
'returns navigation with badges'
do
expect
(
helper
.
issuables_state_counter_text
(
:issues
,
:opened
,
true
))
.
to
eq
(
'<span>Open</span> <span class="badge badge-
pill
">42</span>'
)
.
to
eq
(
'<span>Open</span> <span class="badge badge-
muted badge-pill gl-badge gl-tab-counter-badge sm
">42</span>'
)
expect
(
helper
.
issuables_state_counter_text
(
:issues
,
:closed
,
true
))
.
to
eq
(
'<span>Closed</span> <span class="badge badge-
pill
">42</span>'
)
.
to
eq
(
'<span>Closed</span> <span class="badge badge-
muted badge-pill gl-badge gl-tab-counter-badge sm
">42</span>'
)
expect
(
helper
.
issuables_state_counter_text
(
:merge_requests
,
:merged
,
true
))
.
to
eq
(
'<span>Merged</span> <span class="badge badge-
pill
">42</span>'
)
.
to
eq
(
'<span>Merged</span> <span class="badge badge-
muted badge-pill gl-badge gl-tab-counter-badge sm
">42</span>'
)
expect
(
helper
.
issuables_state_counter_text
(
:merge_requests
,
:all
,
true
))
.
to
eq
(
'<span>All</span> <span class="badge badge-
pill
">42</span>'
)
.
to
eq
(
'<span>All</span> <span class="badge badge-
muted badge-pill gl-badge gl-tab-counter-badge sm
">42</span>'
)
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