From 08017c51116ca7cadb2269d3e703c159c767c879 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Fri, 8 Apr 2016 17:48:44 -0400 Subject: [PATCH] Further UI updates --- data/model/service_keys.py | 2 -- endpoints/api/superuser.py | 4 +-- static/directives/service-keys-manager.html | 2 +- .../js/directives/ui/service-keys-manager.js | 31 +++++++++++-------- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/data/model/service_keys.py b/data/model/service_keys.py index a02d49b9f..c323a71eb 100644 --- a/data/model/service_keys.py +++ b/data/model/service_keys.py @@ -102,8 +102,6 @@ def update_service_key(kid, name=None, metadata=None): except ServiceKey.DoesNotExist: raise ServiceKeyDoesNotExist - _gc_expired(key.service) - def delete_service_key(kid): try: diff --git a/endpoints/api/superuser.py b/endpoints/api/superuser.py index c0a1b787b..cf37fc88a 100644 --- a/endpoints/api/superuser.py +++ b/endpoints/api/superuser.py @@ -533,7 +533,7 @@ class SuperUserServiceKeyManagement(ApiResource): } @verify_not_prod - @nickname('getServiceKeys') + @nickname('listServiceKeys') @require_scope(scopes.SUPERUSER) def get(self): if SuperUserPermission().can(): @@ -655,8 +655,6 @@ class SuperUserServiceKey(ApiResource): except model.service_keys.ServiceKeyDoesNotExist: abort(404) - user = get_authenticated_user() - key_log_metadata = { 'kid': key.kid, 'service': key.service, diff --git a/static/directives/service-keys-manager.html b/static/directives/service-keys-manager.html index dfad5c032..2cb957b40 100644 --- a/static/directives/service-keys-manager.html +++ b/static/directives/service-keys-manager.html @@ -75,7 +75,7 @@ - Does not expire + Does not expire diff --git a/static/js/directives/ui/service-keys-manager.js b/static/js/directives/ui/service-keys-manager.js index 7e4e58ab7..d71a862ed 100644 --- a/static/js/directives/ui/service-keys-manager.js +++ b/static/js/directives/ui/service-keys-manager.js @@ -51,7 +51,7 @@ angular.module('quay').directive('serviceKeysManager', function () { var loadServiceKeys = function() { $scope.options.filter = null; $scope.now = new Date(); - $scope.keysResource = ApiService.getServiceKeysAsResource().get(function(resp) { + $scope.keysResource = ApiService.listServiceKeysAsResource().get(function(resp) { $scope.keys = resp['keys']; buildOrderedKeys(); }); @@ -91,23 +91,28 @@ angular.module('quay').directive('serviceKeysManager', function () { return {'className': 'warning', 'icon': 'fa-warning'}; } - return {'className': 'info', 'icon': 'fa-info-circle'}; + return {'className': 'info', 'icon': 'fa-check'}; }; $scope.showChangeName = function(key) { - bootbox.prompt('Enter a friendly name for key ' + $scope.getKeyTitle(key), function(value) { - if (value) { - var data = { - 'name': value - }; + bootbox.prompt({ + 'size': 'small', + 'title': 'Enter a friendly name for key ' + $scope.getKeyTitle(key), + 'value': key.name || '', + 'callback': function(value) { + if (value != null) { + var data = { + 'name': value + }; - var params = { - 'kid': key.kid - }; + var params = { + 'kid': key.kid + }; - ApiService.updateServiceKey(data, params).then(function(resp) { - loadServiceKeys(); - }, ApiService.errorDisplay('Could not update service key')); + ApiService.updateServiceKey(data, params).then(function(resp) { + loadServiceKeys(); + }, ApiService.errorDisplay('Could not update service key')); + } } }); };