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
bef25878
Commit
bef25878
authored
Oct 21, 2021
by
Payton Burdette
Committed by
James Fargher
Oct 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide badge row if there are no pipeline badges
parent
0b48a8a8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
39 deletions
+73
-39
app/helpers/ci/pipelines_helper.rb
app/helpers/ci/pipelines_helper.rb
+11
-0
app/views/projects/pipelines/_info.html.haml
app/views/projects/pipelines/_info.html.haml
+40
-39
spec/helpers/ci/pipelines_helper_spec.rb
spec/helpers/ci/pipelines_helper_spec.rb
+22
-0
No files found.
app/helpers/ci/pipelines_helper.rb
View file @
bef25878
...
...
@@ -67,6 +67,17 @@ module Ci
]
end
def
has_pipeline_badges?
(
pipeline
)
pipeline
.
child?
||
pipeline
.
latest?
||
pipeline
.
merge_train_pipeline?
||
pipeline
.
has_yaml_errors?
||
pipeline
.
failure_reason?
||
pipeline
.
auto_devops_source?
||
pipeline
.
detached_merge_request_pipeline?
||
pipeline
.
stuck?
end
private
def
warning_markdown
(
pipeline
)
...
...
app/views/projects/pipelines/_info.html.haml
View file @
bef25878
...
...
@@ -17,6 +17,7 @@
-
if
@pipeline
.
queued_duration
=
"(queued for
#{
time_interval_in_words
(
@pipeline
.
queued_duration
)
}
)"
-
if
has_pipeline_badges?
(
@pipeline
)
.well-segment.qa-pipeline-badges
.icon-container
=
sprite_icon
(
'flag'
)
...
...
spec/helpers/ci/pipelines_helper_spec.rb
View file @
bef25878
...
...
@@ -71,4 +71,26 @@ RSpec.describe Ci::PipelinesHelper do
it
{
expect
(
has_gitlab_ci?
).
to
eq
(
result
)
}
end
end
describe
'has_pipeline_badges?'
do
let
(
:pipeline
)
{
create
(
:ci_empty_pipeline
)
}
subject
{
helper
.
has_pipeline_badges?
(
pipeline
)
}
context
'when pipeline has a badge'
do
before
do
pipeline
.
drop!
(
:config_error
)
end
it
'shows pipeline badges'
do
expect
(
subject
).
to
eq
(
true
)
end
end
context
'when pipeline has no badges'
do
it
'shows pipeline badges'
do
expect
(
subject
).
to
eq
(
false
)
end
end
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