Add an icon for build triggers and properly handle build trigger activation errors
This commit is contained in:
parent
eca525e18c
commit
39eaca346d
3 changed files with 4 additions and 4 deletions
|
@ -1434,8 +1434,7 @@ def activate_build_trigger(namespace, repository, trigger_uuid):
|
|||
trigger.auth_token, new_config_dict)
|
||||
except TriggerActivationException as e:
|
||||
token.delete_instance()
|
||||
abort(400, message = e.msg)
|
||||
return
|
||||
return request_error(message=e.message)
|
||||
|
||||
# Save the updated config.
|
||||
trigger.config = json.dumps(final_config)
|
||||
|
|
|
@ -1449,8 +1449,9 @@ function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, $routeParams
|
|||
ApiService.activateBuildTrigger(trigger['config'], params).then(function(resp) {
|
||||
trigger['is_active'] = true;
|
||||
}, function(resp) {
|
||||
$scope.triggers.splice($scope.triggers.indexOf(trigger), 1);
|
||||
bootbox.dialog({
|
||||
"message": resp['message'] || 'The build trigger setup could not be completed',
|
||||
"message": resp['data']['message'] || 'The build trigger setup could not be completed',
|
||||
"title": "Could not activate build trigger",
|
||||
"buttons": {
|
||||
"close": {
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
</li>
|
||||
<li ng-show="repo.can_admin">
|
||||
<a href="/repository/{{ repo.namespace }}/{{ repo.name }}/admin?tab=trigger">
|
||||
<span style="display: inline-block; width: 20px;"></span>Build Triggers
|
||||
<i class="fa fa-bolt" style="margin-left: 3px; margin-right: 10px;"></i>Build Triggers
|
||||
</a>
|
||||
</li>
|
||||
<li role="presentation" class="divider" ng-show="buildsInfo && repo.can_write"></li>
|
||||
|
|
Reference in a new issue