Make messaging around the connected user invoking builds better
This commit is contained in:
parent
99c56b7f98
commit
c1d58bdd6c
2 changed files with 11 additions and 2 deletions
|
@ -137,7 +137,8 @@
|
|||
</td>
|
||||
<td>
|
||||
<span class="cor-options-menu">
|
||||
<span class="cor-option" option-click="askRunTrigger(trigger)">
|
||||
<span class="cor-option" option-click="askRunTrigger(trigger)"
|
||||
ng-class="trigger.connected_user == user.username ? '' : 'disabled'">
|
||||
<i class="fa fa-chevron-right"></i> Run Trigger Now
|
||||
</span>
|
||||
<span class="cor-option" option-click="askDeleteTrigger(trigger)">
|
||||
|
|
|
@ -12,11 +12,13 @@ angular.module('quay').directive('repoPanelBuilds', function () {
|
|||
'repository': '=repository',
|
||||
'builds': '=builds'
|
||||
},
|
||||
controller: function($scope, $element, $filter, $routeParams, ApiService, TriggerService) {
|
||||
controller: function($scope, $element, $filter, $routeParams, ApiService, TriggerService, UserService) {
|
||||
var orderBy = $filter('orderBy');
|
||||
|
||||
$scope.TriggerService = TriggerService;
|
||||
|
||||
UserService.updateUserIn($scope);
|
||||
|
||||
$scope.options = {
|
||||
'filter': 'recent',
|
||||
'reverse': false,
|
||||
|
@ -165,6 +167,12 @@ angular.module('quay').directive('repoPanelBuilds', function () {
|
|||
};
|
||||
|
||||
$scope.askRunTrigger = function(trigger) {
|
||||
if ($scope.user.username != trigger.connected_user) {
|
||||
bootbox.alert('For security reasons, only user "' + trigger.connected_user +
|
||||
'" can manually invoke this trigger');
|
||||
return;
|
||||
}
|
||||
|
||||
$scope.currentStartTrigger = trigger;
|
||||
$scope.showTriggerStartDialogCounter++;
|
||||
};
|
||||
|
|
Reference in a new issue