Commit 19336cf9 by Jason Song Committed by GitHub

Merge pull request #437 from lepdou/bugfix_lock

bugfix: text modal lock check
parents be970582 ec0c9dc8
......@@ -162,6 +162,7 @@
<div ng-repeat="namespace in namespaces">
<apollonspanel namespace="namespace" app-id="pageContext.appId"
env="pageContext.env" cluster="pageContext.clusterName"
lock-check="lockCheck"
pre-release-ns="prepareReleaseNamespace"
create-item="createItem" edit-item="editItem"
pre-delete-item="preDeleteItem" commit-change="commitChange"
......
......@@ -48,6 +48,8 @@ application_module.controller("ConfigNamespaceController",
$scope.showText = showText;
$scope.showNoModifyPermissionDialog = showNoModifyPermissionDialog;
$scope.lockCheck = lockCheck;
$scope.releaseBtnDisabled = false;
$scope.rollbackBtnDisabled = false;
......
......@@ -11,6 +11,7 @@ directive_module.directive('apollonspanel',
appId: '=',
env: '=',
cluster: '=',
lockCheck: '=',
preReleaseNs: '=',
preRollback: '=',
createItem: '=',
......@@ -315,7 +316,7 @@ directive_module.directive('apollonspanel',
}
function toggleTextEditStatus(namespace) {
if (!lockCheck(namespace)) {
if (!scope.lockCheck(namespace)) {
return;
}
namespace.isTextEditing = !namespace.isTextEditing;
......@@ -332,7 +333,7 @@ directive_module.directive('apollonspanel',
}
function goToSyncPage(namespace) {
if (!lockCheck(namespace)) {
if (!scope.lockCheck(namespace)) {
return false;
}
$window.location.href =
......@@ -417,15 +418,6 @@ directive_module.directive('apollonspanel',
namespace.viewItems = items;
}
function lockCheck(namespace) {
if (namespace.lockOwner && scope.currentUser != namespace.lockOwner) {
scope.lockOwner = namespace.lockOwner;
$('#namespaceLockedDialog').modal('show');
return false;
}
return true;
}
}
}
});
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