kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject kylin git commit: KYLIN-3062 Hide RAW measure by default in cube designer
Date Fri, 08 Dec 2017 10:38:00 GMT
Repository: kylin
Updated Branches:
  refs/heads/master c6cfa6984 -> d0c015b82


KYLIN-3062 Hide RAW measure by default in cube designer


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

Branch: refs/heads/master
Commit: d0c015b8219e7d23e4446d4efd4a53c161afd9a4
Parents: c6cfa69
Author: nichunen <chunen.ni@kyligence.io>
Authored: Fri Dec 8 15:32:24 2017 +0800
Committer: chenzhx <chen@apache.org>
Committed: Fri Dec 8 18:37:47 2017 +0800

----------------------------------------------------------------------
 examples/test_case_data/sandbox/kylin.properties |  2 ++
 webapp/app/js/controllers/cubeMeasures.js        | 10 +++++++++-
 webapp/app/js/services/kylinProperties.js        |  4 ++++
 webapp/app/partials/cubeDesigner/measures.html   |  3 ++-
 4 files changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/d0c015b8/examples/test_case_data/sandbox/kylin.properties
----------------------------------------------------------------------
diff --git a/examples/test_case_data/sandbox/kylin.properties b/examples/test_case_data/sandbox/kylin.properties
index 55eb719..90c0b95 100644
--- a/examples/test_case_data/sandbox/kylin.properties
+++ b/examples/test_case_data/sandbox/kylin.properties
@@ -158,6 +158,8 @@ kylin.web.help.1=odbc|ODBC Driver|
 kylin.web.help.2=tableau|Tableau Guide|
 kylin.web.help.3=onboard|Cube Design Tutorial|
 
+# Hide measures in measure list of cube designer, separate by comma
+kylin.web.hide-measures=RAW
 
 ### OTHER ###
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/d0c015b8/webapp/app/js/controllers/cubeMeasures.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/cubeMeasures.js b/webapp/app/js/controllers/cubeMeasures.js
index 347f3b7..6f70e25 100644
--- a/webapp/app/js/controllers/cubeMeasures.js
+++ b/webapp/app/js/controllers/cubeMeasures.js
@@ -18,7 +18,7 @@
 
 'use strict';
 
-KylinApp.controller('CubeMeasuresCtrl', function ($scope, $modal,MetaModel,cubesManager,CubeDescModel,SweetAlert,VdmUtil,TableModel,cubeConfig,modelsManager)
{
+KylinApp.controller('CubeMeasuresCtrl', function ($scope, $modal,MetaModel,cubesManager,CubeDescModel,SweetAlert,VdmUtil,TableModel,cubeConfig,modelsManager,kylinConfig)
{
   $scope.num=0;
   $scope.convertedColumns=[];
   $scope.groupby=[];
@@ -433,6 +433,14 @@ KylinApp.controller('CubeMeasuresCtrl', function ($scope, $modal,MetaModel,cubes
     });
   }
 
+  $scope.isMeasureUnHidden = function(measure) {
+    if (kylinConfig.getHiddenMeasures().indexOf(measure) == -1) {
+      return true;
+    } else {
+      return false;
+    }
+  }
+
 });
 
 var NextParameterModalCtrl = function ($scope, scope,para,$modalInstance,cubeConfig, CubeService,
MessageService, $location, SweetAlert,ProjectModel, loadingRequest,ModelService) {

http://git-wip-us.apache.org/repos/asf/kylin/blob/d0c015b8/webapp/app/js/services/kylinProperties.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/services/kylinProperties.js b/webapp/app/js/services/kylinProperties.js
index a2af4ed..fa92e53 100644
--- a/webapp/app/js/services/kylinProperties.js
+++ b/webapp/app/js/services/kylinProperties.js
@@ -115,5 +115,9 @@ KylinApp.service('kylinConfig', function (AdminService, $log) {
     return true;
   }
 
+  this.getHiddenMeasures = function() {
+    var hide_measures = this.getProperty("kylin.web.hide-measures").replace(/\s/g,"").toUpperCase();
+    return hide_measures.split(",")
+  }
 });
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/d0c015b8/webapp/app/partials/cubeDesigner/measures.html
----------------------------------------------------------------------
diff --git a/webapp/app/partials/cubeDesigner/measures.html b/webapp/app/partials/cubeDesigner/measures.html
index 7d4a606..12d1af3 100755
--- a/webapp/app/partials/cubeDesigner/measures.html
+++ b/webapp/app/partials/cubeDesigner/measures.html
@@ -104,7 +104,8 @@
                                   <select class="form-control"
                                       ng-init="newMeasure.function.expression = (!!newMeasure.function.expression)?newMeasure.function.expression:cubeConfig.dftSelections.measureExpression"
chosen ng-model="newMeasure.function.expression" required
                                       ng-change="measureReturnTypeUpdate();measureParamValueUpdate();"
-                                      ng-options="me as me for me in cubeConfig.measureExpressions">
+                                      ng-options="me as me for me in cubeConfig.measureExpressions
| filter: isMeasureUnHidden">
+
                                       <option value=""></option>
                                   </select>
                               </div>


Mime
View raw message