From ca47e1b2d0f562b742203744715874e4736ff11c Mon Sep 17 00:00:00 2001 From: 10069681 Date: Tue, 27 Jun 2017 15:09:56 +0800 Subject: [PATCH 1/1] KYLIN-2688 When the model has a ready cube, should not allow user to edit model JSON in web. --- webapp/app/js/controllers/models.js | 13 ++++++++----- webapp/app/partials/models/models_tree.html | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/webapp/app/js/controllers/models.js b/webapp/app/js/controllers/models.js index fd218459d..1cc0c84b9 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(',')); } }) diff --git a/webapp/app/partials/models/models_tree.html b/webapp/app/partials/models/models_tree.html index c7b55a31e..399f839f8 100644 --- a/webapp/app/partials/models/models_tree.html +++ b/webapp/app/partials/models/models_tree.html @@ -53,11 +53,11 @@ Action -- 2.11.0.windows.1