gitlab-org--gitlab-foss/lib/gitlab/ci/status/build/stop.rb

44 lines
810 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2016-12-08 04:40:56 -05:00
module Gitlab
module Ci
module Status
module Build
class Stop < Status::Extended
2016-12-08 04:40:56 -05:00
def label
'manual stop action'
end
def has_action?
can?(user, :update_build, subject)
2016-12-08 04:40:56 -05:00
end
def action_icon
2017-10-09 08:16:21 -04:00
'stop'
2016-12-08 12:18:30 -05:00
end
def action_title
'Stop'
2016-12-08 04:40:56 -05:00
end
def action_button_title
_('Stop this environment')
end
2016-12-08 04:40:56 -05:00
def action_path
play_project_job_path(subject.project, subject)
2016-12-08 04:40:56 -05:00
end
def action_method
:post
end
def self.matches?(build, user)
2016-12-08 04:40:56 -05:00
build.playable? && build.stops_environment?
end
end
end
end
end
end