2018-10-30 15:05:07 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-05-05 09:13:58 -04:00
|
|
|
module Gitlab
|
|
|
|
module Ci
|
|
|
|
module Status
|
|
|
|
module Build
|
2018-01-16 06:22:09 -05:00
|
|
|
##
|
|
|
|
# Extended status for playable manual actions.
|
|
|
|
#
|
2017-05-05 09:21:06 -04:00
|
|
|
class Action < Status::Extended
|
2017-05-05 09:13:58 -04:00
|
|
|
def label
|
|
|
|
if has_action?
|
2017-05-05 09:21:06 -04:00
|
|
|
@status.label
|
2017-05-05 09:13:58 -04:00
|
|
|
else
|
2017-05-05 09:21:06 -04:00
|
|
|
"#{@status.label} (not allowed)"
|
2017-05-05 09:13:58 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.matches?(build, user)
|
2018-01-16 06:22:09 -05:00
|
|
|
build.playable?
|
2017-05-05 09:13:58 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|