Commit 21492011 by Jason Song Committed by GitHub

Merge pull request #522 from lepdou/fix_0119

add emergency publish confirm dialog
parents 5b2072cd a9047e47
......@@ -229,7 +229,7 @@
cluster="pageContext.clusterName">
</mergeandpublishmodal>
<publishdenymodal></publishdenymodal>
<publishdenymodal env="pageContext.env"></publishdenymodal>
<apolloconfirmdialog apollo-dialog-id="'deleteConfirmDialog'" apollo-title="'删除配置'"
apollo-detail="'确定要删除配置吗?'"
......@@ -256,6 +256,10 @@
apollo-detail="'确定要回滚吗?'"
apollo-show-cancel-btn="true" apollo-confirm="rollback"></apolloconfirmdialog>
<apolloconfirmdialog apollo-dialog-id="'emergencyPublishAlertDialog'" apollo-title="'紧急发布'"
apollo-detail="'确定要紧急发布吗?'"
apollo-show-cancel-btn="true" apollo-confirm="emergencyPublish"></apolloconfirmdialog>
<apolloconfirmdialog apollo-dialog-id="'deleteBranchDialog'" apollo-title="'删除灰度'"
apollo-detail="'删除灰度会丢失灰度的配置,确定要删除吗?'"
apollo-show-cancel-btn="true" apollo-confirm="deleteBranch"></apolloconfirmdialog>
......
......@@ -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');
}
......
......@@ -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
});
}
}
......
......@@ -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'
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment