From a8b340feb61466c1e448f09581411debfe9a3445 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Tue, 27 Jun 2017 14:15:33 +0300 Subject: [PATCH] Have tag ops dialog set the expiration date to the current date for the tag, by default --- static/directives/tag-operations-dialog.html | 3 ++- static/js/directives/ui/tag-operations-dialog.js | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/static/directives/tag-operations-dialog.html b/static/directives/tag-operations-dialog.html index e6a4ef480..12e1b7d21 100644 --- a/static/directives/tag-operations-dialog.html +++ b/static/directives/tag-operations-dialog.html @@ -126,7 +126,8 @@ - + If specified, the date and time that the key expires. If set to none, the tag(s) will not expire. diff --git a/static/js/directives/ui/tag-operations-dialog.js b/static/js/directives/ui/tag-operations-dialog.js index 9880c4747..65ebb988d 100644 --- a/static/js/directives/ui/tag-operations-dialog.js +++ b/static/js/directives/ui/tag-operations-dialog.js @@ -18,6 +18,7 @@ angular.module('quay').directive('tagOperationsDialog', function () { }, controller: function($scope, $element, $timeout, ApiService) { $scope.addingTag = false; + $scope.changeTagsExpirationInfo = null; var markChanged = function(added, removed) { // Reload the repository. @@ -346,9 +347,11 @@ angular.module('quay').directive('tagOperationsDialog', function () { return; } - $scope.changeTagsExpirationInfo ={ + var expiration_date = null; + expiration_date = tags[0].expiration_date ? tags[0].expiration_date / 1000 : null; + $scope.changeTagsExpirationInfo = { 'tags': tags, - 'expiration_date': null + 'expiration_date': expiration_date }; },