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
8bbaf266
Commit
8bbaf266
authored
Mar 08, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle empty states for job page
parent
92e11985
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
72 additions
and
21 deletions
+72
-21
app/views/projects/jobs/_empty_state.html.haml
app/views/projects/jobs/_empty_state.html.haml
+3
-2
app/views/projects/jobs/_empty_status.html.haml
app/views/projects/jobs/_empty_status.html.haml
+29
-0
app/views/projects/jobs/show.html.haml
app/views/projects/jobs/show.html.haml
+4
-19
changelogs/unreleased/42568-pipeline-empty-state.yml
changelogs/unreleased/42568-pipeline-empty-state.yml
+5
-0
db/fixtures/development/14_pipelines.rb
db/fixtures/development/14_pipelines.rb
+4
-0
spec/features/projects/jobs_spec.rb
spec/features/projects/jobs_spec.rb
+27
-0
No files found.
app/views/projects/jobs/_empty_state.html.haml
View file @
8bbaf266
-
illustration
=
local_assigns
.
fetch
(
:illustration
)
-
illustration
=
local_assigns
.
fetch
(
:illustration
)
-
illustration_size
=
local_assigns
.
fetch
(
:illustration_size
)
-
illustration_size
=
local_assigns
.
fetch
(
:illustration_size
)
-
title
=
local_assigns
.
fetch
(
:title
)
-
title
=
local_assigns
.
fetch
(
:title
)
-
content
=
local_assigns
.
fetch
(
:content
)
-
content
=
local_assigns
.
fetch
(
:content
,
nil
)
-
action
=
local_assigns
.
fetch
(
:action
,
nil
)
-
action
=
local_assigns
.
fetch
(
:action
,
nil
)
.row.empty-state
.row.empty-state
...
@@ -11,7 +11,8 @@
...
@@ -11,7 +11,8 @@
.col-xs-12
.col-xs-12
.text-content
.text-content
%h4
.text-center
=
title
%h4
.text-center
=
title
%p
=
content
-
if
content
%p
=
content
-
if
action
-
if
action
.text-center
.text-center
=
action
=
action
app/views/projects/jobs/_empty_status.html.haml
0 → 100644
View file @
8bbaf266
-
if
@build
.
playable?
=
render
'empty_state'
,
illustration:
'illustrations/manual_action.svg'
,
illustration_size:
'svg-394'
,
title:
_
(
'This job requires a manual action'
),
content:
_
(
'This job depends on a user to trigger its process. Often they are used to deploy code to production environments'
),
action:
(
link_to
_
(
'Trigger this manual action'
),
play_project_job_path
(
@project
,
@build
),
method: :post
,
class:
'btn btn-primary'
,
title:
_
(
'Trigger this manual action'
)
)
-
elsif
@build
.
created?
=
render
'empty_state'
,
illustration:
'illustrations/job_not_triggered.svg'
,
illustration_size:
'svg-306'
,
title:
_
(
'This job has not been triggered yet'
),
content:
_
(
'This job depends on upstream jobs that need to succeed in order for this job to be triggered'
)
-
elsif
@build
.
canceled?
=
render
'empty_state'
,
illustration:
'illustrations/canceled-job_empty.svg'
,
illustration_size:
'svg-430'
,
title:
_
(
'This job has been canceled'
)
-
elsif
@build
.
skipped?
=
render
'empty_state'
,
illustration:
'illustrations/canceled-job_empty.svg'
,
illustration_size:
'svg-430'
,
title:
_
(
'This job has been skipped'
)
-
else
=
render
'empty_state'
,
illustration:
'illustrations/pending_job_empty.svg'
,
illustration_size:
'svg-430'
,
title:
_
(
'This job has not started yet'
),
content:
_
(
'This job is in pending state and is waiting to be picked by a runner'
)
app/views/projects/jobs/show.html.haml
View file @
8bbaf266
...
@@ -54,7 +54,8 @@
...
@@ -54,7 +54,8 @@
Job has been erased by
#{
link_to
(
@build
.
erased_by_name
,
user_path
(
@build
.
erased_by
))
}
#{
time_ago_with_tooltip
(
@build
.
erased_at
)
}
Job has been erased by
#{
link_to
(
@build
.
erased_by_name
,
user_path
(
@build
.
erased_by
))
}
#{
time_ago_with_tooltip
(
@build
.
erased_at
)
}
-
else
-
else
Job has been erased
#{
time_ago_with_tooltip
(
@build
.
erased_at
)
}
Job has been erased
#{
time_ago_with_tooltip
(
@build
.
erased_at
)
}
-
if
@build
.
started?
-
if
@build
.
has_trace?
.build-trace-container.prepend-top-default
.build-trace-container.prepend-top-default
.top-bar.js-top-bar
.top-bar.js-top-bar
.js-truncated-info.truncated-info.hidden-xs.pull-left.hidden
<
.js-truncated-info.truncated-info.hidden-xs.pull-left.hidden
<
...
@@ -88,25 +89,9 @@
...
@@ -88,25 +89,9 @@
%pre
.build-trace
#build-trace
%pre
.build-trace
#build-trace
%code
.bash.js-build-output
%code
.bash.js-build-output
.build-loader-animation.js-build-refresh
.build-loader-animation.js-build-refresh
-
elsif
@build
.
playable?
=
render
'empty_state'
,
illustration:
'illustrations/manual_action.svg'
,
illustration_size:
'svg-394'
,
title:
_
(
'This job requires a manual action'
),
content:
_
(
'This job depends on a user to trigger its process. Often they are used to deploy code to production environments'
),
action:
(
link_to
_
(
'Trigger this manual action'
),
play_project_job_path
(
@project
,
@build
),
method: :post
,
class:
'btn btn-primary'
,
title:
_
(
'Trigger this manual action'
)
)
-
elsif
@build
.
created?
=
render
'empty_state'
,
illustration:
'illustrations/job_not_triggered.svg'
,
illustration_size:
'svg-306'
,
title:
_
(
'This job has not been triggered yet'
),
content:
_
(
'This job depends on upstream jobs that need to succeed in order for this job to be triggered'
)
-
else
-
else
=
render
'empty_state'
,
=
render
"empty_status"
illustration:
'illustrations/pending_job_empty.svg'
,
illustration_size:
'svg-430'
,
title:
_
(
'This job has not started yet'
),
content:
_
(
'This job is in pending state and is waiting to be picked by a runner'
)
=
render
"sidebar"
=
render
"sidebar"
.js-build-options
{
data:
javascript_build_options
}
.js-build-options
{
data:
javascript_build_options
}
...
...
changelogs/unreleased/42568-pipeline-empty-state.yml
0 → 100644
View file @
8bbaf266
---
title
:
Improve empty state for canceled job
merge_request
:
17646
author
:
type
:
fixed
db/fixtures/development/14_pipelines.rb
View file @
8bbaf266
...
@@ -30,6 +30,10 @@ class Gitlab::Seeder::Pipelines
...
@@ -30,6 +30,10 @@ class Gitlab::Seeder::Pipelines
queued_at:
8
.
hour
.
ago
,
started_at:
8
.
hour
.
ago
,
finished_at:
7
.
hour
.
ago
},
queued_at:
8
.
hour
.
ago
,
started_at:
8
.
hour
.
ago
,
finished_at:
7
.
hour
.
ago
},
{
name:
'spinach:osx'
,
stage:
'test'
,
status: :failed
,
allow_failure:
true
,
{
name:
'spinach:osx'
,
stage:
'test'
,
status: :failed
,
allow_failure:
true
,
queued_at:
8
.
hour
.
ago
,
started_at:
8
.
hour
.
ago
,
finished_at:
7
.
hour
.
ago
},
queued_at:
8
.
hour
.
ago
,
started_at:
8
.
hour
.
ago
,
finished_at:
7
.
hour
.
ago
},
{
name:
'spinach:osx1'
,
stage:
'test'
,
status: :canceled
,
queued_at:
8
.
hour
.
ago
,
started_at:
8
.
hour
.
ago
,
finished_at:
7
.
hour
.
ago
},
{
name:
'spinach:osx1'
,
stage:
'test'
,
status: :running
,
queued_at:
8
.
hour
.
ago
,
started_at:
8
.
hour
.
ago
,
finished_at:
7
.
hour
.
ago
},
# deploy stage
# deploy stage
{
name:
'staging'
,
stage:
'deploy'
,
environment:
'staging'
,
status_event: :success
,
{
name:
'staging'
,
stage:
'deploy'
,
environment:
'staging'
,
status_event: :success
,
...
...
spec/features/projects/jobs_spec.rb
View file @
8bbaf266
...
@@ -419,6 +419,33 @@ feature 'Jobs' do
...
@@ -419,6 +419,33 @@ feature 'Jobs' do
expect
(
page
).
to
have_content
(
'This job is in pending state and is waiting to be picked by a runner'
)
expect
(
page
).
to
have_content
(
'This job is in pending state and is waiting to be picked by a runner'
)
end
end
end
end
context
'Canceled job'
do
context
'with log'
do
let
(
:job
)
{
create
(
:ci_build
,
:canceled
,
:trace_artifact
,
pipeline:
pipeline
)
}
before
do
visit
project_job_path
(
project
,
job
)
end
it
'renders job log'
do
expect
(
page
).
to
have_selector
(
'.js-build-output'
)
end
end
context
'without log'
do
let
(
:job
)
{
create
(
:ci_build
,
:canceled
,
pipeline:
pipeline
)
}
before
do
visit
project_job_path
(
project
,
job
)
end
it
'renders empty state'
do
expect
(
page
).
not_to
have_selector
(
'.js-build-output'
)
expect
(
page
).
to
have_content
(
'This job has been canceled'
)
end
end
end
end
end
describe
"POST /:project/jobs/:id/cancel"
,
:js
do
describe
"POST /:project/jobs/:id/cancel"
,
:js
do
...
...
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