2017-01-10 17:41:04 -05:00
|
|
|
module Ci
|
|
|
|
class BuildPresenter < Gitlab::View::Presenter::Delegated
|
|
|
|
presents :build
|
|
|
|
|
|
|
|
def erased_by_user?
|
|
|
|
# Build can be erased through API, therefore it does not have
|
|
|
|
# `erased_by` user assigned in that case.
|
|
|
|
erased? && erased_by
|
|
|
|
end
|
|
|
|
|
|
|
|
def erased_by_name
|
|
|
|
erased_by.name if erased_by_user?
|
|
|
|
end
|
2017-04-05 11:33:19 -04:00
|
|
|
|
|
|
|
def status_title
|
2017-04-06 09:32:56 -04:00
|
|
|
if auto_canceled?
|
|
|
|
"Job is redundant and is auto-canceled by Pipeline ##{auto_canceled_by_id}"
|
2017-04-05 11:33:19 -04:00
|
|
|
end
|
|
|
|
end
|
2017-01-10 17:41:04 -05:00
|
|
|
end
|
|
|
|
end
|