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
Léo-Paul Géneau
gitlab-ce
Commits
ddabac46
Commit
ddabac46
authored
Mar 29, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move action button titles to respective statuses
parent
490d1869
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
35 additions
and
5 deletions
+35
-5
app/views/projects/jobs/_empty_states.html.haml
app/views/projects/jobs/_empty_states.html.haml
+1
-1
lib/gitlab/ci/status/build/cancelable.rb
lib/gitlab/ci/status/build/cancelable.rb
+4
-0
lib/gitlab/ci/status/build/manual.rb
lib/gitlab/ci/status/build/manual.rb
+1
-3
lib/gitlab/ci/status/build/play.rb
lib/gitlab/ci/status/build/play.rb
+4
-0
lib/gitlab/ci/status/build/retryable.rb
lib/gitlab/ci/status/build/retryable.rb
+4
-0
lib/gitlab/ci/status/build/stop.rb
lib/gitlab/ci/status/build/stop.rb
+4
-0
spec/lib/gitlab/ci/status/build/cancelable_spec.rb
spec/lib/gitlab/ci/status/build/cancelable_spec.rb
+4
-0
spec/lib/gitlab/ci/status/build/manual_spec.rb
spec/lib/gitlab/ci/status/build/manual_spec.rb
+1
-1
spec/lib/gitlab/ci/status/build/play_spec.rb
spec/lib/gitlab/ci/status/build/play_spec.rb
+4
-0
spec/lib/gitlab/ci/status/build/retryable_spec.rb
spec/lib/gitlab/ci/status/build/retryable_spec.rb
+4
-0
spec/lib/gitlab/ci/status/build/stop_spec.rb
spec/lib/gitlab/ci/status/build/stop_spec.rb
+4
-0
No files found.
app/views/projects/jobs/_empty_states.html.haml
View file @
ddabac46
...
...
@@ -6,4 +6,4 @@
illustration_size:
illustration
[
:size
],
title:
illustration
[
:title
],
content:
illustration
[
:content
],
action:
illustration
[
:action_path
]
?
link_to
(
_
(
"Trigger this manual action"
),
illustration
[
:action_path
],
method:
illustration
[
:action_method
],
class:
'btn btn-primary'
,
title:
_
(
"Trigger this manual action"
)
)
:
nil
action:
detailed_status
.
has_action?
?
link_to
(
detailed_status
.
action_button_title
,
detailed_status
.
action_path
,
method:
detailed_status
.
action_method
,
class:
'btn btn-primary'
,
title:
detailed_status
.
action_button_title
)
:
nil
lib/gitlab/ci/status/build/cancelable.rb
View file @
ddabac46
...
...
@@ -23,6 +23,10 @@ module Gitlab
'Cancel'
end
def
action_button_title
_
(
'Cancel this job'
)
end
def
self
.
matches?
(
build
,
user
)
build
.
cancelable?
end
...
...
lib/gitlab/ci/status/build/manual.rb
View file @
ddabac46
...
...
@@ -8,9 +8,7 @@ module Gitlab
image:
'illustrations/manual_action.svg'
,
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_path:
play_project_job_path
(
subject
.
project
,
subject
),
action_method: :post
content:
_
(
'This job depends on a user to trigger its process. Often they are used to deploy code to production environments'
)
}
end
...
...
lib/gitlab/ci/status/build/play.rb
View file @
ddabac46
...
...
@@ -19,6 +19,10 @@ module Gitlab
'Play'
end
def
action_button_title
_
(
'Trigger this manual action'
)
end
def
action_path
play_project_job_path
(
subject
.
project
,
subject
)
end
...
...
lib/gitlab/ci/status/build/retryable.rb
View file @
ddabac46
...
...
@@ -15,6 +15,10 @@ module Gitlab
'Retry'
end
def
action_button_title
_
(
'Retry this job'
)
end
def
action_path
retry_project_job_path
(
subject
.
project
,
subject
)
end
...
...
lib/gitlab/ci/status/build/stop.rb
View file @
ddabac46
...
...
@@ -19,6 +19,10 @@ module Gitlab
'Stop'
end
def
action_button_title
_
(
'Stop this environment'
)
end
def
action_path
play_project_job_path
(
subject
.
project
,
subject
)
end
...
...
spec/lib/gitlab/ci/status/build/cancelable_spec.rb
View file @
ddabac46
...
...
@@ -72,6 +72,10 @@ describe Gitlab::Ci::Status::Build::Cancelable do
describe
'#action_title'
do
it
{
expect
(
subject
.
action_title
).
to
eq
'Cancel'
}
end
describe
'#action_button_title'
do
it
{
expect
(
subject
.
action_button_title
).
to
eq
'Cancel this job'
}
end
end
describe
'.matches?'
do
...
...
spec/lib/gitlab/ci/status/build/manual_spec.rb
View file @
ddabac46
...
...
@@ -8,6 +8,6 @@ describe Gitlab::Ci::Status::Build::Manual do
end
describe
'#illustration'
do
it
{
expect
(
subject
.
illustration
).
to
include
(
:image
,
:size
,
:title
,
:content
,
:action_path
,
:action_method
)
}
it
{
expect
(
subject
.
illustration
).
to
include
(
:image
,
:size
,
:title
,
:content
)
}
end
end
spec/lib/gitlab/ci/status/build/play_spec.rb
View file @
ddabac46
...
...
@@ -53,6 +53,10 @@ describe Gitlab::Ci::Status::Build::Play do
it
{
expect
(
subject
.
action_title
).
to
eq
'Play'
}
end
describe
'#action_button_title'
do
it
{
expect
(
subject
.
action_button_title
).
to
eq
'Trigger this manual action'
}
end
describe
'.matches?'
do
subject
{
described_class
.
matches?
(
build
,
user
)
}
...
...
spec/lib/gitlab/ci/status/build/retryable_spec.rb
View file @
ddabac46
...
...
@@ -72,6 +72,10 @@ describe Gitlab::Ci::Status::Build::Retryable do
describe
'#action_title'
do
it
{
expect
(
subject
.
action_title
).
to
eq
'Retry'
}
end
describe
'#action_button_title'
do
it
{
expect
(
subject
.
action_button_title
).
to
eq
'Retry this job'
}
end
end
describe
'.matches?'
do
...
...
spec/lib/gitlab/ci/status/build/stop_spec.rb
View file @
ddabac46
...
...
@@ -44,6 +44,10 @@ describe Gitlab::Ci::Status::Build::Stop do
describe
'#action_title'
do
it
{
expect
(
subject
.
action_title
).
to
eq
'Stop'
}
end
describe
'#action_button_title'
do
it
{
expect
(
subject
.
action_button_title
).
to
eq
'Stop this environment'
}
end
end
describe
'.matches?'
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