From df639750f1300f1db8a40d00aa6fbb92828e4252 Mon Sep 17 00:00:00 2001 From: Kenny Lee Sin Cheong <2530351+kleesc@users.noreply.github.com> Date: Mon, 14 Jan 2019 14:40:09 -0500 Subject: [PATCH] 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 --- static/directives/repo-tag-history.html | 2 +- static/js/directives/ui/repo-tag-history.js | 5 +++-- static/js/directives/ui/tag-operations-dialog.js | 5 ----- static/partials/repo-view.html | 1 + 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/static/directives/repo-tag-history.html b/static/directives/repo-tag-history.html index 7e7d8fa31..2ee944426 100644 --- a/static/directives/repo-tag-history.html +++ b/static/directives/repo-tag-history.html @@ -111,7 +111,7 @@ -
diff --git a/static/js/directives/ui/repo-tag-history.js b/static/js/directives/ui/repo-tag-history.js index 7be799ccb..5ce56cf19 100644 --- a/static/js/directives/ui/repo-tag-history.js +++ b/static/js/directives/ui/repo-tag-history.js @@ -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; -}); \ No newline at end of file +}); diff --git a/static/js/directives/ui/tag-operations-dialog.js b/static/js/directives/ui/tag-operations-dialog.js index dfd51289e..48159cb4a 100644 --- a/static/js/directives/ui/tag-operations-dialog.js +++ b/static/js/directives/ui/tag-operations-dialog.js @@ -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, diff --git a/static/partials/repo-view.html b/static/partials/repo-view.html index 5db77ff84..391e57554 100644 --- a/static/partials/repo-view.html +++ b/static/partials/repo-view.html @@ -89,6 +89,7 @@

Tag History