Fix tag-specific-image-view when moving a tag within its own ancestor path
This commit is contained in:
parent
e7daca5d95
commit
61bde6bb90
2 changed files with 10 additions and 5 deletions
|
@ -5416,7 +5416,8 @@ quayApp.directive('tagSpecificImagesView', function () {
|
||||||
scope: {
|
scope: {
|
||||||
'repository': '=repository',
|
'repository': '=repository',
|
||||||
'tag': '=tag',
|
'tag': '=tag',
|
||||||
'images': '=images'
|
'images': '=images',
|
||||||
|
'imageCutoff': '=imageCutoff'
|
||||||
},
|
},
|
||||||
controller: function($scope, $element) {
|
controller: function($scope, $element) {
|
||||||
$scope.getFirstTextLine = getFirstTextLine;
|
$scope.getFirstTextLine = getFirstTextLine;
|
||||||
|
@ -5438,7 +5439,7 @@ quayApp.directive('tagSpecificImagesView', function () {
|
||||||
return classes;
|
return classes;
|
||||||
};
|
};
|
||||||
|
|
||||||
var forAllTagImages = function(tag, callback) {
|
var forAllTagImages = function(tag, callback, opt_cutoff) {
|
||||||
if (!tag) { return; }
|
if (!tag) { return; }
|
||||||
|
|
||||||
if (!$scope.imageByDBID) {
|
if (!$scope.imageByDBID) {
|
||||||
|
@ -5456,10 +5457,14 @@ quayApp.directive('tagSpecificImagesView', function () {
|
||||||
|
|
||||||
callback(tag_image);
|
callback(tag_image);
|
||||||
|
|
||||||
var ancestors = tag_image.ancestors.split('/');
|
var ancestors = tag_image.ancestors.split('/').reverse();
|
||||||
for (var i = 0; i < ancestors.length; ++i) {
|
for (var i = 0; i < ancestors.length; ++i) {
|
||||||
var image = $scope.imageByDBID[ancestors[i]];
|
var image = $scope.imageByDBID[ancestors[i]];
|
||||||
if (image) {
|
if (image) {
|
||||||
|
if (image == opt_cutoff) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
callback(image);
|
callback(image);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5481,7 +5486,7 @@ quayApp.directive('tagSpecificImagesView', function () {
|
||||||
var ids = {};
|
var ids = {};
|
||||||
forAllTagImages(currentTag, function(image) {
|
forAllTagImages(currentTag, function(image) {
|
||||||
ids[image.dbid] = true;
|
ids[image.dbid] = true;
|
||||||
});
|
}, $scope.imageCutoff);
|
||||||
return ids;
|
return ids;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -367,7 +367,7 @@
|
||||||
<div style="margin: 10px; margin-top: 20px;" ng-show="isAnotherImageTag(toTagImage, tagToCreate)">
|
<div style="margin: 10px; margin-top: 20px;" ng-show="isAnotherImageTag(toTagImage, tagToCreate)">
|
||||||
Note: <span class="label tag label-default">{{ tagToCreate }}</span> is already applied to another image. This will <b>move</b> the tag.
|
Note: <span class="label tag label-default">{{ tagToCreate }}</span> is already applied to another image. This will <b>move</b> the tag.
|
||||||
</div>
|
</div>
|
||||||
<div class="tag-specific-images-view" tag="tagToCreate" repository="repo" images="images"
|
<div class="tag-specific-images-view" tag="tagToCreate" repository="repo" images="images" image-cutoff="toTagImage"
|
||||||
style="margin: 10px; margin-top: 20px; margin-bottom: -10px;" ng-show="isAnotherImageTag(toTagImage, tagToCreate)">
|
style="margin: 10px; margin-top: 20px; margin-bottom: -10px;" ng-show="isAnotherImageTag(toTagImage, tagToCreate)">
|
||||||
This will also delete any unattach images and delete the following images:
|
This will also delete any unattach images and delete the following images:
|
||||||
</div>
|
</div>
|
||||||
|
|
Reference in a new issue