Separate the manual empty state from the action empty state

This commit is contained in:
Matija Čupić 2018-03-28 14:57:09 +02:00
parent c48f33c5be
commit b57fcbe616
No known key found for this signature in database
GPG Key ID: 4BAF84FFACD2E5DE
3 changed files with 25 additions and 12 deletions

View File

@ -14,17 +14,6 @@ module Gitlab
end
end
def illustration
{
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: action_path,
action_method: action_method
}
end
def self.matches?(build, user)
build.playable?
end

View File

@ -10,7 +10,7 @@ module Gitlab
Status::Build::Play,
Status::Build::Stop],
[Status::Build::Action],
[Status::Build::Action,
[Status::Build::Manual,
Status::Build::Canceled,
Status::Build::Created,
Status::Build::Pending,

View File

@ -0,0 +1,24 @@
module Gitlab
module Ci
module Status
module Build
class Manual < Status::Extended
def illustration
{
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
}
end
def self.matches?(build, user)
build.playable?
end
end
end
end
end
end