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)
|
trigger.auth_token, new_config_dict)
|
||||||
except TriggerActivationException as e:
|
except TriggerActivationException as e:
|
||||||
token.delete_instance()
|
token.delete_instance()
|
||||||
abort(400, message = e.msg)
|
return request_error(message=e.message)
|
||||||
return
|
|
||||||
|
|
||||||
# Save the updated config.
|
# Save the updated config.
|
||||||
trigger.config = json.dumps(final_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) {
|
ApiService.activateBuildTrigger(trigger['config'], params).then(function(resp) {
|
||||||
trigger['is_active'] = true;
|
trigger['is_active'] = true;
|
||||||
}, function(resp) {
|
}, function(resp) {
|
||||||
|
$scope.triggers.splice($scope.triggers.indexOf(trigger), 1);
|
||||||
bootbox.dialog({
|
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",
|
"title": "Could not activate build trigger",
|
||||||
"buttons": {
|
"buttons": {
|
||||||
"close": {
|
"close": {
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
</li>
|
</li>
|
||||||
<li ng-show="repo.can_admin">
|
<li ng-show="repo.can_admin">
|
||||||
<a href="/repository/{{ repo.namespace }}/{{ repo.name }}/admin?tab=trigger">
|
<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>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li role="presentation" class="divider" ng-show="buildsInfo && repo.can_write"></li>
|
<li role="presentation" class="divider" ng-show="buildsInfo && repo.can_write"></li>
|
||||||
|
|
Reference in a new issue