From 4834dbd7c93a8d414a4999eefedcfc63b1b85abf Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 27 Apr 2015 14:19:50 -0400 Subject: [PATCH] Add confirmation for deleting a robot --- static/directives/robots-manager.html | 2 +- static/js/directives/ui/robots-manager.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/static/directives/robots-manager.html b/static/directives/robots-manager.html index 4f0e76670..345d28fc3 100644 --- a/static/directives/robots-manager.html +++ b/static/directives/robots-manager.html @@ -96,7 +96,7 @@ View Credentials - + Delete Robot {{ robotInfo.name }} diff --git a/static/js/directives/ui/robots-manager.js b/static/js/directives/ui/robots-manager.js index 8cacfa687..ca672c4be 100644 --- a/static/js/directives/ui/robots-manager.js +++ b/static/js/directives/ui/robots-manager.js @@ -128,6 +128,15 @@ angular.module('quay').directive('robotsManager', function () { }, ApiService.errorDisplay('Cannot delete robot account')); }; + + $scope.askDeleteRobot = function(info) { + bootbox.confirm('Are you sure you want to delete robot ' + info.name + '?', function(resp) { + if (resp) { + $scope.deleteRobot(info); + } + }); + }; + var update = function() { if (!$scope.user && !$scope.organization) { return; } if ($scope.loading || !$scope.isEnabled) { return; }