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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
acd9cd09
Commit
acd9cd09
authored
May 04, 2017
by
James Edwards-Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hides pipeline ‘Failed Jobs’ tab when no jobs have failed
parent
4c0adb9e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
15 deletions
+37
-15
app/controllers/projects/pipelines_controller.rb
app/controllers/projects/pipelines_controller.rb
+5
-1
app/views/projects/pipelines/_with_tabs.html.haml
app/views/projects/pipelines/_with_tabs.html.haml
+17
-14
spec/features/projects/pipelines/pipeline_spec.rb
spec/features/projects/pipelines/pipeline_spec.rb
+15
-0
No files found.
app/controllers/projects/pipelines_controller.rb
View file @
acd9cd09
...
@@ -71,7 +71,11 @@ class Projects::PipelinesController < Projects::ApplicationController
...
@@ -71,7 +71,11 @@ class Projects::PipelinesController < Projects::ApplicationController
end
end
def
failures
def
failures
render_show
if
@pipeline
.
statuses
.
latest
.
failed
.
present?
render_show
else
redirect_to
pipeline_path
(
@pipeline
)
end
end
end
def
status
def
status
...
...
app/views/projects/pipelines/_with_tabs.html.haml
View file @
acd9cd09
-
failed_builds
=
@pipeline
.
statuses
.
latest
.
failed
.tabs-holder
.tabs-holder
%ul
.pipelines-tabs.nav-links.no-top.no-bottom
%ul
.pipelines-tabs.nav-links.no-top.no-bottom
%li
.js-pipeline-tab-link
%li
.js-pipeline-tab-link
...
@@ -7,10 +9,11 @@
...
@@ -7,10 +9,11 @@
=
link_to
builds_namespace_project_pipeline_path
(
@project
.
namespace
,
@project
,
@pipeline
),
data:
{
target:
'div#js-tab-builds'
,
action:
'builds'
,
toggle:
'tab'
},
class:
'builds-tab'
do
=
link_to
builds_namespace_project_pipeline_path
(
@project
.
namespace
,
@project
,
@pipeline
),
data:
{
target:
'div#js-tab-builds'
,
action:
'builds'
,
toggle:
'tab'
},
class:
'builds-tab'
do
Jobs
Jobs
%span
.badge.js-builds-counter
=
pipeline
.
statuses
.
count
%span
.badge.js-builds-counter
=
pipeline
.
statuses
.
count
%li
.js-failures-tab-link
-
if
failed_builds
.
present?
=
link_to
failures_namespace_project_pipeline_path
(
@project
.
namespace
,
@project
,
@pipeline
),
data:
{
target:
'div#js-tab-failures'
,
action:
'failures'
,
toggle:
'tab'
},
class:
'failures-tab'
do
%li
.js-failures-tab-link
Failures
=
link_to
failures_namespace_project_pipeline_path
(
@project
.
namespace
,
@project
,
@pipeline
),
data:
{
target:
'div#js-tab-failures'
,
action:
'failures'
,
toggle:
'tab'
},
class:
'failures-tab'
do
%span
.badge.js-failures-counter
=
pipeline
.
statuses
.
latest
.
failed
.
count
Failed Jobs
%span
.badge.js-failures-counter
=
failed_builds
.
count
.tab-content
.tab-content
#js-tab-pipeline
.tab-pane
#js-tab-pipeline
.tab-pane
...
@@ -41,13 +44,13 @@
...
@@ -41,13 +44,13 @@
%th
Coverage
%th
Coverage
%th
%th
=
render
partial:
"projects/stage/stage"
,
collection:
pipeline
.
stages
,
as: :stage
=
render
partial:
"projects/stage/stage"
,
collection:
pipeline
.
stages
,
as: :stage
#js-tab-failures
.build-failures.tab-pane
-
if
failed_builds
.
present?
-
failed
=
@pipeline
.
statuses
.
latest
.
failed
#js-tab-failures
.build-failures.tab-pane
-
failed
.
each
do
|
build
|
-
failed_builds
.
each
do
|
build
|
.build-state
.build-state
%span
.ci-status-icon-failed
=
custom_icon
(
'icon_status_failed'
)
%span
.ci-status-icon-failed
=
custom_icon
(
'icon_status_failed'
)
%span
.stage
%span
.stage
=
build
.
stage
.
titleize
=
build
.
stage
.
titleize
%span
.build-name
%span
.build-name
=
render
"notify/links/
#{
build
.
to_partial_path
}
"
,
pipeline:
@pipeline
,
build:
build
=
render
"notify/links/
#{
build
.
to_partial_path
}
"
,
pipeline:
@pipeline
,
build:
build
%pre
.build-log
=
build_summary
(
build
)
%pre
.build-log
=
build_summary
(
build
)
spec/features/projects/pipelines/pipeline_spec.rb
View file @
acd9cd09
...
@@ -269,6 +269,7 @@ describe 'Pipeline', :feature, :js do
...
@@ -269,6 +269,7 @@ describe 'Pipeline', :feature, :js do
end
end
it
'shows jobs tab pane as active'
do
it
'shows jobs tab pane as active'
do
expect
(
page
).
to
have_content
(
'Failed Jobs'
)
expect
(
page
).
to
have_css
(
'#js-tab-failures.active'
)
expect
(
page
).
to
have_css
(
'#js-tab-failures.active'
)
end
end
...
@@ -291,5 +292,19 @@ describe 'Pipeline', :feature, :js do
...
@@ -291,5 +292,19 @@ describe 'Pipeline', :feature, :js do
expect
(
page
).
to
have_content
(
'No job trace'
)
expect
(
page
).
to
have_content
(
'No job trace'
)
end
end
end
end
context
'without failures'
do
before
do
failed_build
.
update!
(
status: :success
)
visit
pipeline_failures_page
end
it
'displays the pipeline graph'
do
expect
(
current_path
).
to
eq
(
pipeline_path
(
pipeline
))
expect
(
page
).
not_to
have_content
(
'Failed Jobs'
)
expect
(
page
).
to
have_selector
(
'.pipeline-visualization'
)
end
end
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