summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-07-18 10:00:48 +0000
committerRémy Coutable <remy@rymai.me>2016-07-18 10:00:48 +0000
commit08e21230b139a0041f2e76808e64549be4abf9df (patch)
treefe037c45a34618502530f44867695c1da1b21ddb /app
parentc7569fb61fc9fe12e89c1486312eae0c7438779d (diff)
parentc958305409dbec64852a88fb91ecd55da7bd79d3 (diff)
downloadgitlab-ce-08e21230b139a0041f2e76808e64549be4abf9df.tar.gz
Merge branch 'pending-tab' into 'master'
Add Pending Tab to Builds ## What does this MR do? Add Pending Tab to Builds and separate "running" and "pending" jobs in UI. ## Why was this MR needed? Increase visibility to "pending" . ## What are the relevant issue numbers? Closes #19408 ## Screenshots Before: ![Zrzut_ekranu_2016-07-05_o_11.52.48](/uploads/01dc1f3664f5aacb2ec09d52d19c521e/Zrzut_ekranu_2016-07-05_o_11.52.48.png) After: ![Zrzut_ekranu_2016-07-05_o_11.51.34](/uploads/f3be02427996fecf50c65dd51ce1b9fb/Zrzut_ekranu_2016-07-05_o_11.51.34.png) ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - Tests - [x] All builds are passing - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) cc @ubudzisz @yorickpeterse @grzesiek @tmaczukin @zj [@chastell](https://github.com/chastell) [@tomash](https://github.com/tomash) See merge request !5084
Diffstat (limited to 'app')
-rw-r--r--app/controllers/admin/builds_controller.rb4
-rw-r--r--app/controllers/projects/builds_controller.rb4
-rw-r--r--app/views/admin/builds/index.html.haml9
-rw-r--r--app/views/projects/builds/index.html.haml11
4 files changed, 21 insertions, 7 deletions
diff --git a/app/controllers/admin/builds_controller.rb b/app/controllers/admin/builds_controller.rb
index 0db91eaaf2e..88f3c0e2fd4 100644
--- a/app/controllers/admin/builds_controller.rb
+++ b/app/controllers/admin/builds_controller.rb
@@ -5,8 +5,10 @@ class Admin::BuildsController < Admin::ApplicationController
@builds = @all_builds.order('created_at DESC')
@builds =
case @scope
+ when 'pending'
+ @builds.pending.reverse_order
when 'running'
- @builds.running_or_pending.reverse_order
+ @builds.running.reverse_order
when 'finished'
@builds.finished
else
diff --git a/app/controllers/projects/builds_controller.rb b/app/controllers/projects/builds_controller.rb
index ef3051d7519..d7513d75f01 100644
--- a/app/controllers/projects/builds_controller.rb
+++ b/app/controllers/projects/builds_controller.rb
@@ -10,8 +10,10 @@ class Projects::BuildsController < Projects::ApplicationController
@builds = @all_builds.order('created_at DESC')
@builds =
case @scope
+ when 'pending'
+ @builds.pending.reverse_order
when 'running'
- @builds.running_or_pending.reverse_order
+ @builds.running.reverse_order
when 'finished'
@builds.finished
else
diff --git a/app/views/admin/builds/index.html.haml b/app/views/admin/builds/index.html.haml
index 9ea3cca0ecb..3d77634d8fa 100644
--- a/app/views/admin/builds/index.html.haml
+++ b/app/views/admin/builds/index.html.haml
@@ -10,15 +10,20 @@
All
%span.badge.js-totalbuilds-count= @all_builds.count(:id)
+ %li{class: ('active' if @scope == 'pending')}
+ = link_to admin_builds_path(scope: :pending) do
+ Pending
+ %span.badge= number_with_delimiter(@all_builds.pending.count(:id))
+
%li{class: ('active' if @scope == 'running')}
= link_to admin_builds_path(scope: :running) do
Running
- %span.badge.js-running-count= number_with_delimiter(@all_builds.running_or_pending.count(:id))
+ %span.badge= number_with_delimiter(@all_builds.running.count(:id))
%li{class: ('active' if @scope == 'finished')}
= link_to admin_builds_path(scope: :finished) do
Finished
- %span.badge.js-running-count= number_with_delimiter(@all_builds.finished.count(:id))
+ %span.badge= number_with_delimiter(@all_builds.finished.count(:id))
.nav-controls
- if @all_builds.running_or_pending.any?
diff --git a/app/views/projects/builds/index.html.haml b/app/views/projects/builds/index.html.haml
index 85c31dfd918..2af625f69cd 100644
--- a/app/views/projects/builds/index.html.haml
+++ b/app/views/projects/builds/index.html.haml
@@ -11,17 +11,22 @@
%span.badge.js-totalbuilds-count
= number_with_delimiter(@all_builds.count(:id))
+ %li{class: ('active' if @scope == 'pending')}
+ = link_to project_builds_path(@project, scope: :pending) do
+ Pending
+ %span.badge
+ = number_with_delimiter(@all_builds.pending.count(:id))
%li{class: ('active' if @scope == 'running')}
= link_to project_builds_path(@project, scope: :running) do
Running
- %span.badge.js-running-count
- = number_with_delimiter(@all_builds.running_or_pending.count(:id))
+ %span.badge
+ = number_with_delimiter(@all_builds.running.count(:id))
%li{class: ('active' if @scope == 'finished')}
= link_to project_builds_path(@project, scope: :finished) do
Finished
- %span.badge.js-running-count
+ %span.badge
= number_with_delimiter(@all_builds.finished.count(:id))
.nav-controls