Welcome to mirror list, hosted at ThFree Co, Russian Federation.

waiting_for_approval.rb « build « status « ci « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ac3f5838d26bf5384255132eff8dd94905370b2e (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
44
45
46
47
48
# frozen_string_literal: true

module Gitlab
  module Ci
    module Status
      module Build
        class WaitingForApproval < Status::Extended
          def illustration
            {
              image: 'illustrations/manual_action.svg',
              size: 'svg-394',
              title: _('Waiting for approval'),
              content: _("This job deploys to the protected environment \"%{environment}\" which requires approvals.") % { environment: subject.deployment&.environment&.name }
            }
          end

          def has_action?
            true
          end

          def action_icon
            nil
          end

          def action_title
            nil
          end

          def action_button_title
            _('Go to environments page to approve or reject')
          end

          def action_path
            project_environments_path(subject.project)
          end

          def action_method
            :get
          end

          def self.matches?(build, user)
            build.waiting_for_deployment_approval?
          end
        end
      end
    end
  end
end