You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by sh...@apache.org on 2015/12/22 09:44:42 UTC
[44/50] kylin git commit: KYLIN-1148 fix update project issue,
from nichunen
KYLIN-1148 fix update project issue, from nichunen <ni...@mininglamp.com>
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/d5f3d6ce
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/d5f3d6ce
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/d5f3d6ce
Branch: refs/heads/master
Commit: d5f3d6ce82756c00028a1c48f343137617fe370b
Parents: a39fb27
Author: jian <ji...@apache.org>
Authored: Tue Dec 8 21:44:06 2015 +0800
Committer: jian <ji...@apache.org>
Committed: Tue Dec 8 21:44:28 2015 +0800
----------------------------------------------------------------------
webapp/app/js/controllers/page.js | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/d5f3d6ce/webapp/app/js/controllers/page.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/page.js b/webapp/app/js/controllers/page.js
index 7453d48..8382032 100644
--- a/webapp/app/js/controllers/page.js
+++ b/webapp/app/js/controllers/page.js
@@ -208,7 +208,8 @@ KylinApp.controller('PageCtrl', function ($scope, $q, AccessService, $modal, $lo
var projCtrl = function ($scope, $location, $modalInstance, ProjectService, MessageService, projects, project, SweetAlert, ProjectModel, $cookieStore, $route) {
$scope.state = {
isEdit: false,
- oldProjName: null
+ oldProjName: null,
+ projectIdx: -1
};
$scope.isEdit = false;
$scope.proj = {name: '', description: ''};
@@ -217,6 +218,12 @@ var projCtrl = function ($scope, $location, $modalInstance, ProjectService, Mess
$scope.state.isEdit = true;
$scope.state.oldProjName = project.name;
$scope.proj = project;
+ for (var i = 0; i < projects.length; i++){
+ if (projects[i].name === $scope.state.oldProjName){
+ $scope.state.projectIdx = i;
+ break;
+ }
+ }
}
$scope.createOrUpdate = function () {
@@ -268,6 +275,9 @@ var projCtrl = function ($scope, $location, $modalInstance, ProjectService, Mess
};
$scope.cancel = function () {
+ if($scope.state.isEdit){
+ projects[$scope.state.projectIdx].name = $scope.state.oldProjName;
+ }
$modalInstance.dismiss('cancel');
};