Commit 8dbb1b2f authored by Annabel Dunstone's avatar Annabel Dunstone

Move stages and jobs to build sidebar

parent f80aa902
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
this.bp = Breakpoints.get(); this.bp = Breakpoints.get();
$('.js-build-sidebar').niceScroll(); $('.js-build-sidebar').niceScroll();
this.populateJobDropdown(build_stage); this.populateJobs(build_stage);
this.updateStageDropdownText(build_stage); this.updateStageDropdownText(build_stage);
this.updateJobDropdownText(build_name); this.updateJobDropdownText(build_name);
this.hideSidebar(); this.hideSidebar();
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
} }
}; };
Build.prototype.populateJobDropdown = function(stage) { Build.prototype.populateJobs = function(stage) {
$('.build-job').hide(); $('.build-job').hide();
$('.build-job[data-stage="' + stage + '"]').show(); $('.build-job[data-stage="' + stage + '"]').show();
}; };
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
e.preventDefault(); e.preventDefault();
var stage = e.target.text; var stage = e.target.text;
this.updateStageDropdownText(stage); this.updateStageDropdownText(stage);
this.populateJobDropdown(stage); this.populateJobs(stage);
}; };
return Build; return Build;
......
...@@ -11,6 +11,42 @@ ...@@ -11,6 +11,42 @@
%p.build-detail-row %p.build-detail-row
#{@build.coverage}% #{@build.coverage}%
- builds = @build.pipeline.builds.latest.to_a
- statuses = ["failed", "pending", "running", "canceled", "success", "skipped"]
- if builds.size > 1
.dropdown.build-dropdown
%button.dropdown-menu-toggle{type: 'button', 'data-toggle' => 'dropdown'}
%span.stage-selection More
= icon('caret-down')
%ul.dropdown-menu
- builds.map(&:stage).uniq.each do |stage|
%li
%a.stage-item= stage
.dropdown.build-dropdown
%button.dropdown-menu-toggle{type: 'button', 'data-toggle' => 'dropdown'}
%span.build-selection More
= icon('caret-down')
%ul.dropdown-menu
- statuses.each do |build_status|
- builds.select{|build| build.status == build_status}.each do |build|
%li.build-job{class: ('active' if build == @build), data: {stage: build.stage}}
= link_to namespace_project_build_path(@project.namespace, @project, build) do
= ci_icon_for_status(build.status)
%span
- if build.name
= build.name
- else
= build.id
- if @build.retried?
%li.active
%a
Build ##{@build.id}
·
%i.fa.fa-warning
This build was retried.
- if can?(current_user, :read_build, @project) && (@build.artifacts? || @build.artifacts_expired?) - if can?(current_user, :read_build, @project) && (@build.artifacts? || @build.artifacts_expired?)
.block{ class: ("block-first" if !@build.coverage) } .block{ class: ("block-first" if !@build.coverage) }
.title .title
......
...@@ -5,41 +5,6 @@ ...@@ -5,41 +5,6 @@
.build-page .build-page
= render "header" = render "header"
- builds = @build.pipeline.builds.latest.to_a
- statuses = ["failed", "pending", "running", "canceled", "success", "skipped"]
- if builds.size > 1
.dropdown.build-dropdown
%button.dropdown-menu-toggle{type: 'button', 'data-toggle' => 'dropdown'}
%span.stage-selection More
= icon('caret-down')
%ul.dropdown-menu
- builds.map(&:stage).uniq.each do |stage|
%li
%a.stage-item= stage
.dropdown.build-dropdown
%button.dropdown-menu-toggle{type: 'button', 'data-toggle' => 'dropdown'}
%span.build-selection More
= icon('caret-down')
%ul.dropdown-menu
- statuses.each do |build_status|
- builds.select{|build| build.status == build_status}.each do |build|
%li.build-job{class: ('active' if build == @build), data: {stage: build.stage}}
= link_to namespace_project_build_path(@project.namespace, @project, build) do
= ci_icon_for_status(build.status)
%span
- if build.name
= build.name
- else
= build.id
- if @build.retried?
%li.active
%a
Build ##{@build.id}
·
%i.fa.fa-warning
This build was retried.
- if @build.stuck? - if @build.stuck?
- unless @build.any_runners_online? - unless @build.any_runners_online?
.bs-callout.bs-callout-warning .bs-callout.bs-callout-warning
......
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