2016-12-08 04:40:56 -05:00
|
|
|
module Gitlab
|
|
|
|
module Ci
|
|
|
|
module Status
|
2016-12-08 11:52:24 -05:00
|
|
|
module Build
|
|
|
|
class Stop < SimpleDelegator
|
2016-12-08 08:28:49 -05:00
|
|
|
include Status::Extended
|
2016-12-08 04:40:56 -05:00
|
|
|
|
|
|
|
def text
|
2016-12-13 05:53:36 -05:00
|
|
|
'manual'
|
2016-12-08 04:40:56 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def label
|
2016-12-13 05:53:36 -05:00
|
|
|
'manual stop action'
|
|
|
|
end
|
|
|
|
|
|
|
|
def icon
|
|
|
|
'icon_status_manual'
|
2016-12-08 04:40:56 -05:00
|
|
|
end
|
|
|
|
|
2016-12-15 06:55:20 -05:00
|
|
|
def group
|
|
|
|
'manual'
|
|
|
|
end
|
|
|
|
|
2016-12-08 08:28:49 -05:00
|
|
|
def has_action?
|
|
|
|
can?(user, :update_build, subject)
|
2016-12-08 04:40:56 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def action_icon
|
2016-12-08 12:18:30 -05:00
|
|
|
'stop'
|
|
|
|
end
|
|
|
|
|
|
|
|
def action_title
|
|
|
|
'Stop'
|
2016-12-08 04:40:56 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def action_path
|
2016-12-08 08:28:49 -05:00
|
|
|
play_namespace_project_build_path(subject.project.namespace,
|
|
|
|
subject.project,
|
|
|
|
subject)
|
2016-12-08 04:40:56 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def action_method
|
|
|
|
:post
|
|
|
|
end
|
|
|
|
|
2016-12-08 08:28:49 -05:00
|
|
|
def self.matches?(build, user)
|
2016-12-08 04:40:56 -05:00
|
|
|
build.playable? && build.stops_environment?
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|