Add better messaging and UI around repos and images that are currently being pushed

This commit is contained in:
Joseph Schorr 2014-08-13 17:54:15 -04:00
parent 27c2680380
commit e7daca5d95
4 changed files with 63 additions and 19 deletions

View file

@ -431,6 +431,27 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi
$location.search('current', buildInfo.id);
};
$scope.isPushing = function(images) {
if (!images) { return false; }
var cached = images.__isPushing;
if (cached !== undefined) {
return cached;
}
return images.__isPushing = $scope.isPushingInternal(images);
};
$scope.isPushingInternal = function(images) {
if (!images) { return false; }
for (var i = 0; i < images.length; ++i) {
if (images[i].uploading) { return true; }
}
return false;
};
$scope.getTooltipCommand = function(image) {
var sanitized = ImageMetadataService.getEscapedFormattedCommand(image);
return '<span class=\'codetooltip\'>' + sanitized + '</span>';

View file

@ -402,6 +402,10 @@ ImageHistoryTree.prototype.buildRoot_ = function() {
var roots = [];
for (var i = 0; i < this.images_.length; ++i) {
var image = this.images_[i];
// Skip images that are currently uploading.
if (image.uploading) { continue; }
var imageNode = imageByDBID[image.dbid];
var ancestors = this.getAncestors_(image);
var immediateParent = ancestors[ancestors.length - 1] * 1;
@ -432,6 +436,10 @@ ImageHistoryTree.prototype.buildRoot_ = function() {
var maxChildCount = roots.length;
for (var i = 0; i < this.images_.length; ++i) {
var image = this.images_[i];
// Skip images that are currently uploading.
if (image.uploading) { continue; }
var imageNode = imageByDBID[image.dbid];
maxChildCount = Math.max(maxChildCount, this.determineMaximumChildCount_(imageNode));
}
@ -582,6 +590,10 @@ ImageHistoryTree.prototype.setTag_ = function(tagName) {
// Ensure that the children are in the correct order.
for (var i = 0; i < this.images_.length; ++i) {
var image = this.images_[i];
// Skip images that are currently uploading.
if (image.uploading) { continue; }
var imageNode = this.imageByDBID_[image.dbid];
var ancestors = this.getAncestors_(image);
var immediateParent = ancestors[ancestors.length - 1] * 1;