Commit 63dbdb9f authored by Maxim Rydkin's avatar Maxim Rydkin

add presenter for status badge

parent 4f748f74
......@@ -123,6 +123,6 @@ module CiStatusHelper
end
def status_title(pipeline)
"This pipeline is redundant as a newer pipeline exists (canceled by ##{pipeline.auto_canceled_by_id} pipeline)" if pipeline.auto_canceled_by_id? && pipeline.canceled?
Ci::PipelineStatusBadgePresenter.new(pipeline).status_title
end
end
module Ci
class PipelineStatusBadgePresenter < Gitlab::View::Presenter::Delegated
presents :pipeline
def auto_canceled?
canceled? && auto_canceled_by_id?
end
def status_title
"Pipeline is redundant and is auto-canceled by Pipeline ##{pipeline.auto_canceled_by_id}" if auto_canceled?
end
end
end
......@@ -84,6 +84,6 @@ class PipelineEntity < Grape::Entity
end
def status_tooltip
"This pipeline is redundant as a newer pipeline exists (canceled by ##{pipeline.auto_canceled_by_id} pipeline)" if pipeline.auto_canceled_by_id? && pipeline.canceled?
Ci::PipelineStatusBadgePresenter.new(pipeline).status_title
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment