From 9e6e4b6a7cf0b2341221ca03b829ab56a5c82cd2 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Wed, 5 Mar 2014 15:53:00 -0500 Subject: [PATCH] Fix build UI in the repo view to only show the number of current builds --- static/js/controllers.js | 7 +++++-- static/partials/view-repo.html | 12 ++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/static/js/controllers.js b/static/js/controllers.js index ec3d43ae3..d9ba93c2d 100644 --- a/static/js/controllers.js +++ b/static/js/controllers.js @@ -689,15 +689,18 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi }; ApiService.getRepoBuilds(null, params, true).then(function(resp) { + // Build a filtered list of the builds that are currently running. var runningBuilds = []; for (var i = 0; i < resp.builds.length; ++i) { var build = resp.builds[i]; - if (build.status != 'complete') { + if (build['phase'] != 'complete' && build['phase'] != 'error') { runningBuilds.push(build); } } - $scope.buildsInfo = runningBuilds; + $scope.runningBuilds = runningBuilds; + $scope.buildHistory = resp.builds; + if (!runningBuilds.length) { // Cancel the build timer. cancelBuildInfoTimer(); diff --git a/static/partials/view-repo.html b/static/partials/view-repo.html index 7f306d634..3d379cf8c 100644 --- a/static/partials/view-repo.html +++ b/static/partials/view-repo.html @@ -16,11 +16,11 @@