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
Jérome Perrin
gitlab-ce
Commits
6df1eb14
Commit
6df1eb14
authored
Mar 26, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Gitlab::Ci::Status#illustration in job empty_states partial
parent
4b0cbf63
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
29 deletions
+27
-29
app/views/projects/jobs/_empty_states.html.haml
app/views/projects/jobs/_empty_states.html.haml
+9
-29
spec/features/projects/jobs_spec.rb
spec/features/projects/jobs_spec.rb
+18
-0
No files found.
app/views/projects/jobs/_empty_states.html.haml
View file @
6df1eb14
-
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/skipped-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'
)
-
detailed_status
=
@build
.
detailed_status
(
current_user
)
-
illustration
=
detailed_status
.
illustration
=
render
'empty_state'
,
illustration:
illustration
[
:image
],
illustration_size:
illustration
[
:size
],
title:
illustration
[
:title
],
content:
illustration
[
:content
],
action:
@build
.
playable?
?
link_to
(
_
(
"Trigger this manual action"
),
detailed_status
.
action_path
,
method:
detailed_status
.
action_method
,
class:
'btn btn-primary'
,
title:
_
(
"Trigger this manual action"
))
:
nil
spec/features/projects/jobs_spec.rb
View file @
6df1eb14
...
...
@@ -379,6 +379,7 @@ feature 'Jobs' do
end
it
'shows manual action empty state'
do
expect
(
page
).
to
have_content
(
job
.
detailed_status
(
user
).
illustration
[
:title
])
expect
(
page
).
to
have_content
(
'This job requires a manual action'
)
expect
(
page
).
to
have_content
(
'This job depends on a user to trigger its process. Often they are used to deploy code to production environments'
)
expect
(
page
).
to
have_link
(
'Trigger this manual action'
)
...
...
@@ -402,6 +403,7 @@ feature 'Jobs' do
end
it
'shows empty state'
do
expect
(
page
).
to
have_content
(
job
.
detailed_status
(
user
).
illustration
[
:title
])
expect
(
page
).
to
have_content
(
'This job has not been triggered yet'
)
expect
(
page
).
to
have_content
(
'This job depends on upstream jobs that need to succeed in order for this job to be triggered'
)
end
...
...
@@ -415,6 +417,7 @@ feature 'Jobs' do
end
it
'shows pending empty state'
do
expect
(
page
).
to
have_content
(
job
.
detailed_status
(
user
).
illustration
[
:title
])
expect
(
page
).
to
have_content
(
'This job has not started yet'
)
expect
(
page
).
to
have_content
(
'This job is in pending state and is waiting to be picked by a runner'
)
end
...
...
@@ -441,11 +444,26 @@ feature 'Jobs' do
end
it
'renders empty state'
do
expect
(
page
).
to
have_content
(
job
.
detailed_status
(
user
).
illustration
[
:title
])
expect
(
page
).
not_to
have_selector
(
'.js-build-output'
)
expect
(
page
).
to
have_content
(
'This job has been canceled'
)
end
end
end
context
'Skipped job'
do
let
(
:job
)
{
create
(
:ci_build
,
:skipped
,
pipeline:
pipeline
)
}
before
do
visit
project_job_path
(
project
,
job
)
end
it
'renders empty state'
do
expect
(
page
).
to
have_content
(
job
.
detailed_status
(
user
).
illustration
[
:title
])
expect
(
page
).
not_to
have_selector
(
'.js-build-output'
)
expect
(
page
).
to
have_content
(
'This job has been skipped'
)
end
end
end
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