diff --git a/apollo-portal/src/main/resources/static/config.html b/apollo-portal/src/main/resources/static/config.html index 56826d9f060e9800b1baaf32dcc81dd96c154b8e..d8fe7bd1a1e84009d7e0ce41e656d4980f2e9fb7 100644 --- a/apollo-portal/src/main/resources/static/config.html +++ b/apollo-portal/src/main/resources/static/config.html @@ -229,7 +229,7 @@ cluster="pageContext.clusterName"> - + + + diff --git a/apollo-portal/src/main/resources/static/scripts/controller/config/ConfigNamespaceController.js b/apollo-portal/src/main/resources/static/scripts/controller/config/ConfigNamespaceController.js index 269d59745619087aabc8ed31dc937a2faf17ff12..540c782dfe8385fa1e4dca17fd94194dc90ebcd7 100644 --- a/apollo-portal/src/main/resources/static/scripts/controller/config/ConfigNamespaceController.js +++ b/apollo-portal/src/main/resources/static/scripts/controller/config/ConfigNamespaceController.js @@ -19,6 +19,7 @@ function controller($rootScope, $scope, toastr, AppUtil, EventManager, ConfigSer $scope.deleteBranch = deleteBranch; $scope.showNoModifyPermissionDialog = showNoModifyPermissionDialog; $scope.lockCheck = lockCheck; + $scope.emergencyPublish = emergencyPublish; init(); @@ -312,6 +313,30 @@ function controller($rootScope, $scope, toastr, AppUtil, EventManager, ConfigSer } + EventManager.subscribe(EventManager.EventType.EMERGENCY_PUBLISH, + function (context) { + AppUtil.showModal("#emergencyPublishAlertDialog"); + $scope.emergencyPublishContext = context; + }); + + function emergencyPublish() { + if ($scope.emergencyPublishContext.mergeAndPublish) { + + EventManager.emit(EventManager.EventType.MERGE_AND_PUBLISH_NAMESPACE, + { + branch: $scope.emergencyPublishContext.namespace, + isEmergencyPublish: true + }); + } else { + EventManager.emit(EventManager.EventType.PUBLISH_NAMESPACE, + { + namespace: $scope.emergencyPublishContext.namespace, + isEmergencyPublish: true + }); + } + + } + new Clipboard('.clipboard'); } diff --git a/apollo-portal/src/main/resources/static/scripts/directive/publish-deny-modal-directive.js b/apollo-portal/src/main/resources/static/scripts/directive/publish-deny-modal-directive.js index 3f27b4ecdd9aaddaa5025d702886364484cf6b25..557e6c4c9737550ae2cedea7fd55d85e91aa166b 100644 --- a/apollo-portal/src/main/resources/static/scripts/directive/publish-deny-modal-directive.js +++ b/apollo-portal/src/main/resources/static/scripts/directive/publish-deny-modal-directive.js @@ -7,6 +7,7 @@ function publishDenyDirective(AppUtil, EventManager) { transclude: true, replace: true, scope: { + env: "=" }, link: function (scope) { var MODAL_ID = "#publishDenyModal"; @@ -21,20 +22,12 @@ function publishDenyDirective(AppUtil, EventManager) { function emergencyPublish() { AppUtil.hideModal(MODAL_ID); - - if (scope.mergeAndPublish) { - EventManager.emit(EventManager.EventType.MERGE_AND_PUBLISH_NAMESPACE, - { - branch: scope.toReleaseNamespace, - isEmergencyPublish: true - }); - } else { - EventManager.emit(EventManager.EventType.PUBLISH_NAMESPACE, - { - namespace: scope.toReleaseNamespace, - isEmergencyPublish: true - }); - } + + EventManager.emit(EventManager.EventType.EMERGENCY_PUBLISH, + { + mergeAndPublish: scope.mergeAndPublish, + namespace: scope.toReleaseNamespace + }); } } diff --git a/apollo-portal/src/main/resources/static/scripts/services/EventManager.js b/apollo-portal/src/main/resources/static/scripts/services/EventManager.js index 99a2c3395ede992c1a8b48716fcb0631dad109e4..a7474ea300960475f5d3e06f0fbd7017c17c2523 100644 --- a/apollo-portal/src/main/resources/static/scripts/services/EventManager.js +++ b/apollo-portal/src/main/resources/static/scripts/services/EventManager.js @@ -132,7 +132,8 @@ appService.service('EventManager', [function () { ROLLBACK_NAMESPACE: 'rollback_namespace', EDIT_GRAY_RELEASE_RULES: 'edit_gray_release_rules', UPDATE_GRAY_RELEASE_RULES: 'update_gray_release_rules', - PUBLISH_DENY: 'publish_deny' + PUBLISH_DENY: 'publish_deny', + EMERGENCY_PUBLISH: 'emergency_publish' } }