summaryrefslogtreecommitdiff
path: root/lib/gitlab/ci/status/stage/play_manual.rb
blob: ac3fc0912fa96c54b1e755dfc6e378509a3f99a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# frozen_string_literal: true

module Gitlab
  module Ci
    module Status
      module Stage
        class PlayManual < Status::Extended
          include Gitlab::Routing

          def action_icon
            'play'
          end

          def action_title
            'Play all manual'
          end

          def action_path
            pipeline = subject.pipeline

            project_stage_play_manual_path(pipeline.project, pipeline, subject.name)
          end

          def action_method
            :post
          end

          def action_button_title
            _('Play all manual')
          end

          def self.matches?(stage, user)
            stage.manual_playable?
          end

          def has_action?
            true
          end
        end
      end
    end
  end
end