diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-03-28 15:57:09 +0300 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-03-28 15:57:17 +0300 |
commit | b57fcbe6162a17b02fc0516af2487ddd57c251bb (patch) | |
tree | fb5397b62ab10f200c053ccb836acda8732c9f81 /lib | |
parent | c48f33c5bec02e8fd49326514023f6b6af66d693 (diff) |
Separate the manual empty state from the action empty state
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ci/status/build/action.rb | 11 | ||||
-rw-r--r-- | lib/gitlab/ci/status/build/factory.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/status/build/manual.rb | 24 |
3 files changed, 25 insertions, 12 deletions
diff --git a/lib/gitlab/ci/status/build/action.rb b/lib/gitlab/ci/status/build/action.rb index f7f3d47c098..6c9125647ad 100644 --- a/lib/gitlab/ci/status/build/action.rb +++ b/lib/gitlab/ci/status/build/action.rb @@ -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 diff --git a/lib/gitlab/ci/status/build/factory.rb b/lib/gitlab/ci/status/build/factory.rb index ae4b2bd79bc..004a9b305b7 100644 --- a/lib/gitlab/ci/status/build/factory.rb +++ b/lib/gitlab/ci/status/build/factory.rb @@ -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, diff --git a/lib/gitlab/ci/status/build/manual.rb b/lib/gitlab/ci/status/build/manual.rb new file mode 100644 index 00000000000..01e94e159a1 --- /dev/null +++ b/lib/gitlab/ci/status/build/manual.rb @@ -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 |