diff options
-rw-r--r-- | app/assets/javascripts/build.js | 18 | ||||
-rw-r--r-- | app/views/projects/builds/show.html.haml | 2 |
2 files changed, 17 insertions, 3 deletions
diff --git a/app/assets/javascripts/build.js b/app/assets/javascripts/build.js index baa91e221e8..2725ddcf465 100644 --- a/app/assets/javascripts/build.js +++ b/app/assets/javascripts/build.js @@ -6,7 +6,7 @@ Build.state = null; - function Build(page_url, build_url, build_status, state1) { + function Build(page_url, build_url, build_status, build_stage, build_name, state1) { this.page_url = page_url; this.build_url = build_url; this.build_status = build_status; @@ -17,7 +17,12 @@ clearInterval(Build.interval); this.bp = Breakpoints.get(); $('.js-build-sidebar').niceScroll(); + + this.populateJobDropdown(build_stage); + this.updateStageDropdownText(build_stage); + this.updateJobDropdownText(build_name); this.hideSidebar(); + $(document).off('click', '.js-sidebar-build-toggle').on('click', '.js-sidebar-build-toggle', this.toggleSidebar); $(window).off('resize.build').on('resize.build', this.hideSidebar); $(document).on('click', '.stage-item', this.updateDropdown); @@ -139,10 +144,19 @@ $('.build-job[data-stage="' + stage + '"]').show(); }; + Build.prototype.updateStageDropdownText = function(stage) { + $('.stage-selection').text(stage); + this.updateJobDropdownText('-'); + }; + + Build.prototype.updateJobDropdownText = function(name) { + $('.build-selection').text(name); + }; + Build.prototype.updateDropdown = function(e) { e.preventDefault(); var stage = e.target.text; - $('.stage-selection').text(stage); + this.updateStageDropdownText(stage); this.populateJobDropdown(stage); }; diff --git a/app/views/projects/builds/show.html.haml b/app/views/projects/builds/show.html.haml index 2302aa2d1e7..5f7c66e4dd2 100644 --- a/app/views/projects/builds/show.html.haml +++ b/app/views/projects/builds/show.html.haml @@ -82,4 +82,4 @@ = render "sidebar" :javascript - new Build("#{namespace_project_build_url(@project.namespace, @project, @build)}", "#{namespace_project_build_url(@project.namespace, @project, @build, :json)}", "#{@build.status}", "#{trace_with_state[:state]}") + new Build("#{namespace_project_build_url(@project.namespace, @project, @build)}", "#{namespace_project_build_url(@project.namespace, @project, @build, :json)}", "#{@build.status}", "#{@build.stage}", "#{@build.name}", "#{trace_with_state[:state]}") |