summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnnabel Dunstone Gray <annabel.dunstone@gmail.com>2016-10-17 12:15:57 -0500
committerAnnabel Dunstone Gray <annabel.dunstone@gmail.com>2016-10-18 08:29:29 -0500
commitd61f8a18e0f7e9d0ed162827f4e8ae2de3756f5c (patch)
tree35d9a782b1e7b17cb2947e8fed09fe770be0d975
parent2115c360d0e096ca945bb2a39862ae8d14abfa4f (diff)
downloadgitlab-ce-21192-retried-builds.tar.gz
Move build order array to HasStatus module21192-retried-builds
-rw-r--r--app/models/concerns/has_status.rb1
-rw-r--r--app/views/projects/builds/_sidebar.html.haml3
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/concerns/has_status.rb b/app/models/concerns/has_status.rb
index 9f64f76721d..ef3e73a4072 100644
--- a/app/models/concerns/has_status.rb
+++ b/app/models/concerns/has_status.rb
@@ -5,6 +5,7 @@ module HasStatus
STARTED_STATUSES = %w[running success failed skipped]
ACTIVE_STATUSES = %w[pending running]
COMPLETED_STATUSES = %w[success failed canceled]
+ ORDERED_STATUSES = %w[failed pending running canceled success skipped]
class_methods do
def status_sql
diff --git a/app/views/projects/builds/_sidebar.html.haml b/app/views/projects/builds/_sidebar.html.haml
index 839abd82bba..b1053028279 100644
--- a/app/views/projects/builds/_sidebar.html.haml
+++ b/app/views/projects/builds/_sidebar.html.haml
@@ -1,5 +1,4 @@
- builds = @build.pipeline.builds.to_a
-- statuses = ["failed", "pending", "running", "canceled", "success", "skipped"]
%aside.right-sidebar.right-sidebar-expanded.build-sidebar.js-build-sidebar
.block.build-sidebar-header.visible-xs-block.visible-sm-block.append-bottom-default
@@ -124,7 +123,7 @@
%a.stage-item= stage
.builds-container
- - statuses.each do |build_status|
+ - HasStatus::ORDERED_STATUSES.each do |build_status|
- builds.select{|build| build.status == build_status}.each do |build|
.build-job{class: sidebar_build_class(build, @build), data: {stage: build.stage}}
= link_to namespace_project_build_path(@project.namespace, @project, build) do