Fix tag reversion UI (#3295)

* Remove unused check

The tags returned from the tag history endpoint did not have
an image_id field until https://github.com/quay/quay/pull/3238 (tags pagination), so the
condition was never met. After #3238, the tags returned from the tag
history endpoints have an image_id field, which is equal to its
docker_image_id field, to allow the same behavior from consumers
getting tags from the repository endpoint (e.g repo-view).

* watch repositoryTags instead of repository in repo-tag-history
This commit is contained in:
Kenny Lee Sin Cheong 2019-01-14 14:40:09 -05:00 committed by GitHub
parent defd4b3b20
commit df639750f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 8 deletions

View file

@ -111,7 +111,7 @@
</table>
</div>
<div class="tag-operations-dialog" repository="repository"
<div class="tag-operations-dialog" repository="repository" repository-tags="repositoryTags"
image-loader="imageLoader"
action-handler="tagActionHandler"></div>

View file

@ -10,6 +10,7 @@ angular.module('quay').directive('repoTagHistory', function () {
restrict: 'C',
scope: {
'repository': '=repository',
'repositoryTags': '=repositoryTags',
'filter': '=filter',
'isEnabled': '=isEnabled',
'imageLoader': '=imageLoader'
@ -34,7 +35,7 @@ angular.module('quay').directive('repoTagHistory', function () {
};
$scope.$watch('isEnabled', loadTimeline);
$scope.$watch('repository', loadTimeline);
$scope.$watch('repositoryTags', loadTimeline);
var processTags = function(tags) {
var entries = [];
@ -176,4 +177,4 @@ angular.module('quay').directive('repoTagHistory', function () {
}
};
return directiveDefinitionObject;
});
});

View file

@ -389,11 +389,6 @@ angular.module('quay').directive('tagOperationsDialog', function () {
return;
}
if (tag.image_id == image_id) {
bootbox.alert('This is the current image for the tag');
return;
}
$scope.restoreTagInfo = {
'tag': tag,
'image_id': image_id,

View file

@ -89,6 +89,7 @@
<h3 class="tab-header">Tag History</h3>
<div class="repo-tag-history"
repository="viewScope.repository"
repository-tags="viewScope.repositoryTags"
filter="viewScope.historyFilter"
image-loader="viewScope.imageLoader"
is-enabled="historyShown"></div>