From 61bde6bb9070a7c296c9258aec60e897dc37dd23 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Wed, 13 Aug 2014 18:47:07 -0400 Subject: [PATCH] Fix tag-specific-image-view when moving a tag within its own ancestor path --- static/js/app.js | 13 +++++++++---- static/partials/view-repo.html | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/static/js/app.js b/static/js/app.js index 1af812f5b..97b750ba5 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -5416,7 +5416,8 @@ quayApp.directive('tagSpecificImagesView', function () { scope: { 'repository': '=repository', 'tag': '=tag', - 'images': '=images' + 'images': '=images', + 'imageCutoff': '=imageCutoff' }, controller: function($scope, $element) { $scope.getFirstTextLine = getFirstTextLine; @@ -5438,7 +5439,7 @@ quayApp.directive('tagSpecificImagesView', function () { return classes; }; - var forAllTagImages = function(tag, callback) { + var forAllTagImages = function(tag, callback, opt_cutoff) { if (!tag) { return; } if (!$scope.imageByDBID) { @@ -5456,10 +5457,14 @@ quayApp.directive('tagSpecificImagesView', function () { callback(tag_image); - var ancestors = tag_image.ancestors.split('/'); + var ancestors = tag_image.ancestors.split('/').reverse(); for (var i = 0; i < ancestors.length; ++i) { var image = $scope.imageByDBID[ancestors[i]]; if (image) { + if (image == opt_cutoff) { + return; + } + callback(image); } } @@ -5481,7 +5486,7 @@ quayApp.directive('tagSpecificImagesView', function () { var ids = {}; forAllTagImages(currentTag, function(image) { ids[image.dbid] = true; - }); + }, $scope.imageCutoff); return ids; }; diff --git a/static/partials/view-repo.html b/static/partials/view-repo.html index 7df865add..9e9e83702 100644 --- a/static/partials/view-repo.html +++ b/static/partials/view-repo.html @@ -367,7 +367,7 @@
Note: {{ tagToCreate }} is already applied to another image. This will move the tag.
-
This will also delete any unattach images and delete the following images: