Class: Gitlab::Ci::Status::Build::WaitingForApproval

Inherits:
Extended
  • Object
show all
Defined in:
lib/gitlab/ci/status/build/waiting_for_approval.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Extended

#initialize

Constructor Details

This class inherits a constructor from Gitlab::Ci::Status::Extended

Class Method Details

.matches?(build, user) ⇒ Boolean

Returns:

  • (Boolean)

41
42
43
# File 'lib/gitlab/ci/status/build/waiting_for_approval.rb', line 41

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

Instance Method Details

#action_button_titleObject


29
30
31
# File 'lib/gitlab/ci/status/build/waiting_for_approval.rb', line 29

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

#action_iconObject


21
22
23
# File 'lib/gitlab/ci/status/build/waiting_for_approval.rb', line 21

def action_icon
  nil
end

#action_methodObject


37
38
39
# File 'lib/gitlab/ci/status/build/waiting_for_approval.rb', line 37

def action_method
  :get
end

#action_pathObject


33
34
35
# File 'lib/gitlab/ci/status/build/waiting_for_approval.rb', line 33

def action_path
  project_environments_path(subject.project)
end

#action_titleObject


25
26
27
# File 'lib/gitlab/ci/status/build/waiting_for_approval.rb', line 25

def action_title
  nil
end

#has_action?Boolean

Returns:

  • (Boolean)

17
18
19
# File 'lib/gitlab/ci/status/build/waiting_for_approval.rb', line 17

def has_action?
  true
end

#illustrationObject


8
9
10
11
12
13
14
15
# File 'lib/gitlab/ci/status/build/waiting_for_approval.rb', line 8

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