2019-12-06 00:07:48 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Ci
|
|
|
|
class LegacyStagePresenter < Gitlab::View::Presenter::Delegated
|
2021-09-21 09:12:21 +00:00
|
|
|
presents ::Ci::LegacyStage, as: :legacy_stage
|
2019-12-06 00:07:48 +00:00
|
|
|
|
|
|
|
def latest_ordered_statuses
|
|
|
|
preload_statuses(legacy_stage.statuses.latest_ordered)
|
|
|
|
end
|
|
|
|
|
|
|
|
def retried_ordered_statuses
|
|
|
|
preload_statuses(legacy_stage.statuses.retried_ordered)
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def preload_statuses(statuses)
|
2021-09-07 01:02:14 +00:00
|
|
|
Preloaders::CommitStatusPreloader.new(statuses).execute(Ci::StagePresenter::PRELOADED_RELATIONS)
|
2019-12-06 00:07:48 +00:00
|
|
|
|
2021-09-07 01:02:14 +00:00
|
|
|
statuses
|
2019-12-06 00:07:48 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|