kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lid...@apache.org
Subject [29/50] [abbrv] kylin git commit: minor,cube measures add dimensions
Date Fri, 30 Dec 2016 08:57:18 GMT
minor,cube measures add dimensions

Signed-off-by: zhongjian <jiatuer@163.com>


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

Branch: refs/heads/master-cdh5.7
Commit: 73a7c25dfeb28764658af3e73065aa04cc1b92cd
Parents: 76e321b
Author: chenzhx <346839943@qq.com>
Authored: Wed Dec 28 16:18:01 2016 +0800
Committer: zhongjian <jiatuer@163.com>
Committed: Wed Dec 28 16:31:30 2016 +0800

----------------------------------------------------------------------
 webapp/app/js/controllers/cubeMeasures.js      | 11 ++++++++++-
 webapp/app/partials/cubeDesigner/measures.html |  6 ++++--
 2 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/73a7c25d/webapp/app/js/controllers/cubeMeasures.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/cubeMeasures.js b/webapp/app/js/controllers/cubeMeasures.js
index 15c330a..c8548ce 100644
--- a/webapp/app/js/controllers/cubeMeasures.js
+++ b/webapp/app/js/controllers/cubeMeasures.js
@@ -84,6 +84,15 @@ KylinApp.controller('CubeMeasuresCtrl', function ($scope, $modal,MetaModel,cubes
     if(!!measure && measure.function.parameter.next_parameter){
       $scope.nextPara.value = measure.function.parameter.next_parameter.value;
     }
+    if($scope.newMeasure.function.parameter.value){
+      if($scope.metaModel.model.metrics&&$scope.metaModel.model.metrics.indexOf($scope.newMeasure.function.parameter.value)!=-1){
+          $scope.newMeasure.showDim=false;
+      }else{
+          $scope.newMeasure.showDim=true;
+      }
+    }else{
+      $scope.newMeasure.showDim=false;
+    }
     if($scope.newMeasure.function.expression=="TOP_N"){
       $scope.convertedColumns=[];
       if($scope.newMeasure.function.configuration==null){
@@ -353,7 +362,7 @@ KylinApp.controller('CubeMeasuresCtrl', function ($scope, $modal,MetaModel,cubes
     if($scope.newMeasure.function.parameter.type=="column"&&$scope.newMeasure.function.expression!=="COUNT_DISTINCT"){
 
       var column = $scope.newMeasure.function.parameter.value;
-      if(column){
+      if(column&&(typeof column=="string")){
         var colType = $scope.getColumnType(VdmUtil.removeNameSpace(column), VdmUtil.getNameSpaceAliasName(column));
// $scope.getColumnType defined in cubeEdit.js
       }
       if(colType==""||!colType){

http://git-wip-us.apache.org/repos/asf/kylin/blob/73a7c25d/webapp/app/partials/cubeDesigner/measures.html
----------------------------------------------------------------------
diff --git a/webapp/app/partials/cubeDesigner/measures.html b/webapp/app/partials/cubeDesigner/measures.html
index 9eb04c3..4d2d8ab 100755
--- a/webapp/app/partials/cubeDesigner/measures.html
+++ b/webapp/app/partials/cubeDesigner/measures.html
@@ -150,14 +150,15 @@
                                 <!--!COUNT_DISTINCT-->
 
                                 <select class="form-control" chosen
-                                        ng-if="newMeasure.function.parameter.type == 'column'
&& (newMeasure.function.expression == 'COUNT_DISTINCT'||newMeasure.function.expression
== 'RAW')"
+                                        ng-if="newMeasure.function.parameter.type == 'column'
&& newMeasure.function.expression !== 'EXTENDED_COLUMN' && newMeasure.showDim==true
"
                                         ng-model="newMeasure.function.parameter.value" required
                                         ng-change="measureReturnTypeUpdate();"
                                         ng-options="column as column for column in getAllModelDimMeasureColumns(newMeasure)"
>
                                   <option value="">-- Select a Column --</option>
                                 </select>
+
                                 <select class="form-control" chosen
-                                        ng-if="newMeasure.function.parameter.type == 'column'
&& newMeasure.function.expression !== 'EXTENDED_COLUMN' && newMeasure.function.expression
!== 'COUNT_DISTINCT' && newMeasure.function.expression !== 'RAW'"
+                                        ng-if="newMeasure.function.parameter.type == 'column'
&& newMeasure.function.expression !== 'EXTENDED_COLUMN' && newMeasure.showDim==false
"
                                         ng-model="newMeasure.function.parameter.value" required
                                         ng-change="measureReturnTypeUpdate();"
                                         ng-options="column as column for column in getCommonMetricColumns(newMeasure)"
>
@@ -171,6 +172,7 @@
                                   <option value="">-- Select a Column --</option>
                                 </select>
                               </div>
+                              <label ng-if="newMeasure.function.parameter.type == 'column'&&
newMeasure.function.expression !== 'EXTENDED_COLUMN'"><input type="checkbox" ng-model="newMeasure.showDim"
/>&nbsp;Also Show Dimensions</label>
                           </div>
                       </div>
 


Mime
View raw message