2018-02-28 21:12:32 -05:00
|
|
|
module Ci
|
|
|
|
class BuildMetadataPresenter < Gitlab::View::Presenter::Delegated
|
|
|
|
TIMEOUT_SOURCES = {
|
|
|
|
unknown_timeout_source: nil,
|
|
|
|
project_timeout_source: 'project',
|
|
|
|
runner_timeout_source: 'runner'
|
|
|
|
}.freeze
|
|
|
|
|
|
|
|
presents :metadata
|
|
|
|
|
|
|
|
def timeout_source
|
|
|
|
return unless metadata.timeout_source?
|
|
|
|
|
|
|
|
TIMEOUT_SOURCES[metadata.timeout_source.to_sym] ||
|
2018-03-01 13:43:10 -05:00
|
|
|
metadata.timeout_source
|
2018-02-28 21:12:32 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|