From b817ce2d7e6b46fa924838674875b381486344b8 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 7 Mar 2017 11:48:01 +0100 Subject: Sort builds in stage dropdown Order: failed pending running manual canceled success skipped created --- app/views/projects/pipelines/_stage.html.haml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'app/views/projects/pipelines') diff --git a/app/views/projects/pipelines/_stage.html.haml b/app/views/projects/pipelines/_stage.html.haml index a0b14a7274a..3feb99cfcd7 100644 --- a/app/views/projects/pipelines/_stage.html.haml +++ b/app/views/projects/pipelines/_stage.html.haml @@ -1,3 +1,5 @@ -- @stage.statuses.latest.each do |status| - %li - = render 'ci/status/dropdown_graph_badge', subject: status +- grouped_statuses = @stage.statuses.latest_ordered.group_by(&:status) +- HasStatus::ORDERED_STATUSES.each do |ordered_status| + - grouped_statuses.fetch(ordered_status, []).each do |status| + %li + = render 'ci/status/dropdown_graph_badge', subject: status -- cgit v1.2.1