kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From billy...@apache.org
Subject kylin git commit: KYLIN-1875
Date Wed, 22 Feb 2017 08:53:58 GMT
Repository: kylin
Updated Branches:
  refs/heads/master 4c512f00f -> 859605fb3


KYLIN-1875

Signed-off-by: Billy Liu <billyliu@apache.org>


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

Branch: refs/heads/master
Commit: 859605fb35dcfb318a562691cb0ba7a0563db0f1
Parents: 4c512f0
Author: luguosheng <550175214@qq.com>
Authored: Wed Feb 22 16:39:06 2017 +0800
Committer: Billy Liu <billyliu@apache.org>
Committed: Wed Feb 22 16:53:43 2017 +0800

----------------------------------------------------------------------
 webapp/app/js/controllers/cubeEdit.js       | 49 ++++--------------------
 webapp/app/js/controllers/cubeSchema.js     |  6 +--
 webapp/app/js/controllers/modelDataModel.js |  9 +++++
 webapp/app/js/model/cubeDescModel.js        |  4 +-
 4 files changed, 22 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/859605fb/webapp/app/js/controllers/cubeEdit.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/cubeEdit.js b/webapp/app/js/controllers/cubeEdit.js
index 92d8305..2b2d97f 100755
--- a/webapp/app/js/controllers/cubeEdit.js
+++ b/webapp/app/js/controllers/cubeEdit.js
@@ -40,47 +40,7 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams,
$locatio
     supportedEncoding:[],
     encodingMaps:{}
   }
-  TableModel.getColumnTypeEncodingMap().then(function(data){
-    $scope.store.encodingMaps=data;
-  });
-  CubeService.getValidEncodings({}, function (encodings) {
-    if(encodings){
-      for(var i in encodings)
-        if(VdmUtil.isNotExtraKey(encodings,i)){
-          var value = i
-          var name = value;
-          var typeVersion=+encodings[i]||1;
-          var suggest=false,selecttips='';
-          if(/\d+/.test(""+typeVersion)&&typeVersion>=1){
-            for(var s=1;s<=typeVersion;s++){
-              if(s==typeVersion){
-                suggest=true;
-              }
-              if(value=="int"){
-                name = "int (deprecated)";
-                suggest=false;
-              }
-              if(typeVersion>1){
-                selecttips="(v"+s;
-                if(s==typeVersion){
-                  selecttips=",suggest)"
-                }
-                selecttips=')';
-              }
-              $scope.store.supportedEncoding.push({
-                "name":name+selecttips,
-                "value":value+"[v"+s+"]",
-                "version":typeVersion,
-                "baseValue":value,
-                "suggest":suggest
-              });
-            }
-          }
-        }
-    }
-  },function(e){
-    $scope.store.supportedEncoding = $scope.cubeConfig.encodings;
-  })
+
 
   $scope.getColumnsByAlias = function (alias) {
     var temp = [];
@@ -742,6 +702,13 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams,
$locatio
       return;
     }
     $scope.metaModel.model = modelsManager.getModel(newValue);
+    if($scope.metaModel.model){
+      $scope.modelsManager.initAliasMapByModelSchema($scope.metaModel);
+      cubesManager.init();
+      $scope.cubeMetaFrame=CubeDescModel.createNew({
+        model_name:newValue
+      })
+    }
     if(!$scope.metaModel.model){
       return;
     }

http://git-wip-us.apache.org/repos/asf/kylin/blob/859605fb/webapp/app/js/controllers/cubeSchema.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/cubeSchema.js b/webapp/app/js/controllers/cubeSchema.js
index 91a1567..a912c72 100755
--- a/webapp/app/js/controllers/cubeSchema.js
+++ b/webapp/app/js/controllers/cubeSchema.js
@@ -78,11 +78,11 @@ KylinApp.controller('CubeSchemaCtrl', function ($scope, QueryService,
UserServic
                 suggest=false;
               }
               if(typeVersion>1){
-                selecttips="(v"+s;
+                selecttips=" (v"+s;
                 if(s==typeVersion){
-                  selecttips=",suggest)"
+                  selecttips+=",suggest"
                 }
-                selecttips=')';
+                selecttips+=')';
               }
               $scope.store.supportedEncoding.push({
                 "name":name+selecttips,

http://git-wip-us.apache.org/repos/asf/kylin/blob/859605fb/webapp/app/js/controllers/modelDataModel.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/modelDataModel.js b/webapp/app/js/controllers/modelDataModel.js
index 02c44ea..cb3305a 100644
--- a/webapp/app/js/controllers/modelDataModel.js
+++ b/webapp/app/js/controllers/modelDataModel.js
@@ -94,6 +94,15 @@ KylinApp.controller('ModelDataModelCtrl', function ($location,$scope, $modal,cub
         };
     };
 
+    $scope.$watch('newLookup.alias',function(newValue,oldValue){
+      if(!newValue){
+        return;
+      }else{
+        for(var i=0;i<$scope.newLookup.join.primary_key.length;i++){
+          $scope.newLookup.join.primary_key[i] = $scope.newLookup.join.primary_key[i].replace(oldValue+'.',newValue+'.');
+        }
+      }
+    });
     $scope.editLookup = function (lookup) {
         $scope.lookupState.editingIndex = lookupList.indexOf(lookup);
         $scope.lookupState.editing = true;

http://git-wip-us.apache.org/repos/asf/kylin/blob/859605fb/webapp/app/js/model/cubeDescModel.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/model/cubeDescModel.js b/webapp/app/js/model/cubeDescModel.js
index 95a0b13..d0f5250 100644
--- a/webapp/app/js/model/cubeDescModel.js
+++ b/webapp/app/js/model/cubeDescModel.js
@@ -21,7 +21,7 @@ KylinApp.service('CubeDescModel', function (kylinConfig) {
   this.cubeMetaFrame = {};
 
   //
-  this.createNew = function () {
+  this.createNew = function (defaultPara) {
     var cubeMeta = {
       "name": "",
       "model_name": "",
@@ -62,7 +62,7 @@ KylinApp.service('CubeDescModel', function (kylinConfig) {
       "override_kylin_properties":{}
     };
 
-    return cubeMeta;
+    return angular.extend(cubeMeta,defaultPara) ;
   };
 
   this.createMeasure = function () {


Mime
View raw message