Repository: kylin
Updated Branches:
  refs/heads/master d851c51d2 -> a8627e8a9


KYLIN-2688 When the model has a ready cube, should not allow user to edit model 
JSON in web.


Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/a8627e8a
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/a8627e8a
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/a8627e8a

Branch: refs/heads/master
Commit: a8627e8a9f264cc138124f3825d490463fa58480
Parents: d851c51
Author: 10069681 <peng.jian...@zte.com.cn>
Authored: Tue Jun 27 15:09:56 2017 +0800
Committer: chenzhx <346839...@qq.com>
Committed: Thu Jun 29 19:16:02 2017 +0800

----------------------------------------------------------------------
 webapp/app/js/controllers/models.js         | 13 ++++++++-----
 webapp/app/partials/models/models_tree.html |  4 ++--
 2 files changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/a8627e8a/webapp/app/js/controllers/models.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/models.js 
b/webapp/app/js/controllers/models.js
index fd21845..1cc0c84 100644
--- a/webapp/app/js/controllers/models.js
+++ b/webapp/app/js/controllers/models.js
@@ -127,7 +127,7 @@ KylinApp.controller('ModelsCtrl', function ($scope, $q, 
$routeParams, $location,
     });
   };
 
-  $scope.editModel = function(model){
+  $scope.editModel = function(model, isEditJson){
     var cubename = [];
     var modelstate=false;
     var i=0;
@@ -145,10 +145,13 @@ KylinApp.controller('ModelsCtrl', function ($scope, $q, 
$routeParams, $location,
         })
       }
 
-      if(modelstate==false){
-        $location.path("/models/edit/"+model.name);
-      }
-      else{
+      if (modelstate==false){
+         if (isEditJson) {
+                 $location.path("/models/edit/" + model.name + 
"/descriptionjson");
+         } else {
+                 $location.path("/models/edit/" + model.name);
+         }
+      } else {
         SweetAlert.swal('Sorry','This model is still used by '+ 
cubename.join(','));
       }
     })

http://git-wip-us.apache.org/repos/asf/kylin/blob/a8627e8a/webapp/app/partials/models/models_tree.html
----------------------------------------------------------------------
diff --git a/webapp/app/partials/models/models_tree.html 
b/webapp/app/partials/models/models_tree.html
index c7b55a3..399f839 100644
--- a/webapp/app/partials/models/models_tree.html
+++ b/webapp/app/partials/models/models_tree.html
@@ -53,11 +53,11 @@
                   Action <span class="ace-icon fa fa-caret-down 
icon-on-right"></span>
                 </button>
                 <ul class="dropdown-menu" role="menu" 
ng-if="(userService.hasRole('ROLE_ADMIN') || hasPermission(model, 
permissions.ADMINISTRATION.mask, permissions.MANAGEMENT.mask, 
permissions.OPERATION.mask))">
-                  <li><a ng-click="editModel(model)"  title="Edit Model" 
style="cursor:pointer;margin-right: 8px;" >Edit</a></li>
+                  <li><a ng-click="editModel(model, false)"  title="Edit 
Model" style="cursor:pointer;margin-right: 8px;" >Edit</a></li>
                   <li><a ng-click="cloneModel(model)" title="Clone Model"  
style="cursor:pointer;margin-right: 8px;" >Clone </a></li>
                   <li><a ng-click="dropModel(model)" title="Drop Model"  
style="cursor:pointer;margin-right: 8px;">Drop</a></li>
                   <li ng-if="userService.hasRole('ROLE_ADMIN')">
-                    <a 
href="models/edit/{{model.name}}/descriptionjson">Edit(JSON)</a></li>
+                    <a ng-click="editModel(model, true)">Edit(JSON)</a></li>
                 </ul>
               </div>
             </div>

Reply via email to