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

Move stages and jobs to build sidebar

parent f80aa902
......@@ -18,7 +18,7 @@
this.bp = Breakpoints.get();
$('.js-build-sidebar').niceScroll();
this.populateJobDropdown(build_stage);
this.populateJobs(build_stage);
this.updateStageDropdownText(build_stage);
this.updateJobDropdownText(build_name);
this.hideSidebar();
......@@ -139,7 +139,7 @@
}
};
Build.prototype.populateJobDropdown = function(stage) {
Build.prototype.populateJobs = function(stage) {
$('.build-job').hide();
$('.build-job[data-stage="' + stage + '"]').show();
};
......@@ -157,7 +157,7 @@
e.preventDefault();
var stage = e.target.text;
this.updateStageDropdownText(stage);
this.populateJobDropdown(stage);
this.populateJobs(stage);
};
return Build;
......
......@@ -11,6 +11,42 @@
%p.build-detail-row
#{@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?)
.block{ class: ("block-first" if !@build.coverage) }
.title
......
......@@ -5,41 +5,6 @@
.build-page
= 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?
- unless @build.any_runners_online?
.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