Add confirmation for deleting a robot
This commit is contained in:
parent
6581a024bc
commit
4834dbd7c9
2 changed files with 10 additions and 1 deletions
|
@ -96,7 +96,7 @@
|
||||||
<span class="cor-option" option-click="showRobot(robotInfo)">
|
<span class="cor-option" option-click="showRobot(robotInfo)">
|
||||||
<i class="fa fa-key"></i> View Credentials
|
<i class="fa fa-key"></i> View Credentials
|
||||||
</span>
|
</span>
|
||||||
<span class="cor-option" option-click="deleteRobot(robotInfo)">
|
<span class="cor-option" option-click="askDeleteRobot(robotInfo)">
|
||||||
<i class="fa fa-times"></i> Delete Robot {{ robotInfo.name }}
|
<i class="fa fa-times"></i> Delete Robot {{ robotInfo.name }}
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -128,6 +128,15 @@ angular.module('quay').directive('robotsManager', function () {
|
||||||
}, ApiService.errorDisplay('Cannot delete robot account'));
|
}, 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() {
|
var update = function() {
|
||||||
if (!$scope.user && !$scope.organization) { return; }
|
if (!$scope.user && !$scope.organization) { return; }
|
||||||
if ($scope.loading || !$scope.isEnabled) { return; }
|
if ($scope.loading || !$scope.isEnabled) { return; }
|
||||||
|
|
Reference in a new issue