kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liy...@apache.org
Subject [14/23] incubator-kylin git commit: adpt join from model to cubedesc, temp solution for staging
Date Tue, 03 Mar 2015 09:59:18 GMT
adpt join from model to cubedesc,temp solution for staging


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

Branch: refs/heads/master
Commit: b35c850f6ae6ba96e6b81f6d2bf2b132b3718ede
Parents: f3e5d4d
Author: jiazhong <jiazhong@ebay.com>
Authored: Wed Feb 11 15:57:26 2015 +0800
Committer: jiazhong <jiazhong@ebay.com>
Committed: Wed Feb 11 15:57:26 2015 +0800

----------------------------------------------------------------------
 webapp/app/js/controllers/cubeEdit.js | 26 +++++++-------------------
 1 file changed, 7 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/b35c850f/webapp/app/js/controllers/cubeEdit.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/cubeEdit.js b/webapp/app/js/controllers/cubeEdit.js
index 2875107..451ed3c 100644
--- a/webapp/app/js/controllers/cubeEdit.js
+++ b/webapp/app/js/controllers/cubeEdit.js
@@ -155,6 +155,13 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams,
$locatio
 
         // Clean up objects used in cube creation
         angular.forEach($scope.cubeMetaFrame.dimensions, function (dimension, index) {
+            // adpt join
+            angular.forEach($scope.cubeMetaFrame.model.lookups, function (lookup, index)
{
+                if(lookup.table==dimension.table){
+                    dimension.join = lookup.join;
+                }
+            });
+
             delete dimension.status;
 
             for (var key in dimension) {
@@ -222,7 +229,6 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams,
$locatio
                         }
                         //end loading
                         loadingRequest.hide();
-                        recoveryCubeStatus();
                     }, function (e) {
                         if(e.data&& e.data.exception){
                             var message =e.data.exception;
@@ -232,7 +238,6 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams,
$locatio
                             MessageService.sendMsg($scope.cubeResultTmpl({'text':'Failed
to take action.','schema':$scope.state.cubeSchema}), 'error', {}, true, 'top_center');
                         }
                         loadingRequest.hide();
-                        recoveryCubeStatus();
                     });
                 } else {
                     CubeService.save({}, {cubeDescData: $scope.state.cubeSchema, project:
$scope.state.project}, function (request) {
@@ -249,7 +254,6 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams,
$locatio
 
                         //end loading
                         loadingRequest.hide();
-                        recoveryCubeStatus();
                     }, function (e) {
                         if (e.data && e.data.exception) {
                             var message =e.data.exception;
@@ -260,7 +264,6 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams,
$locatio
                         }
                         //end loading
                         loadingRequest.hide();
-                        recoveryCubeStatus();
                     });
                 }
             }
@@ -498,21 +501,6 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams,
$locatio
     }
 
 
-    function recoveryCubeStatus() {
-        $scope.cubeMetaFrame.project = $scope.state.project;
-        angular.forEach($scope.cubeMetaFrame.dimensions, function (dimension, index) {
-            dimension.status = {};
-            if (dimension.hierarchy&&dimension.hierarchy.length) {
-                dimension.status.useHierarchy = true;
-                dimension.status.joinCount = (!!dimension.join.primary_key) ? dimension.join.primary_key.length
: 0;
-                dimension.status.hierarchyCount = (!!dimension.hierarchy) ? dimension.hierarchy.length
: 0;
-            }
-            if(dimension.join&&dimension.join.type) {
-                dimension.status.useJoin = true;
-            }
-        });
-    }
-
     $scope.$watch('project.selectedProject', function (newValue, oldValue) {
         if(!newValue){
             return;


Mime
View raw message