Repository: kylin
Updated Branches:
  refs/heads/master 2dca5546c -> f65113319


KYLIN-1551: Should check and ensure TopN measure has two parameters specified

Signed-off-by: Jason <jiat...@163.com>


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

Branch: refs/heads/master
Commit: f6511331929f944a762815d4ace3ea60da4ea0f1
Parents: 2dca554
Author: Roger Shi <ro...@kyligence.io>
Authored: Wed May 11 17:03:58 2016 +0800
Committer: Jason <jiat...@163.com>
Committed: Wed May 11 17:30:32 2016 +0800

----------------------------------------------------------------------
 webapp/app/js/controllers/cubeMeasures.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/f6511331/webapp/app/js/controllers/cubeMeasures.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/cubeMeasures.js 
b/webapp/app/js/controllers/cubeMeasures.js
index 8693bd1..fb9d292 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) {
+KylinApp.controller('CubeMeasuresCtrl', function ($scope, 
$modal,MetaModel,cubesManager,CubeDescModel,SweetAlert) {
 
 
   $scope.addNewMeasure = function (measure) {
@@ -98,10 +98,15 @@ KylinApp.controller('CubeMeasuresCtrl', function ($scope, 
$modal,MetaModel,cubes
   };
 
   $scope.saveNewMeasure = function () {
+    if ($scope.newMeasure.function.expression === 'TOP_N' && 
$scope.nextParameters.length == 0) {
+      SweetAlert.swal('', '[TOP_N] Group by Column is required', 'warning');
+      return false;
+    }
     if ($scope.cubeMetaFrame.measures.indexOf($scope.newMeasure) === -1) {
       $scope.cubeMetaFrame.measures.push($scope.newMeasure);
     }
     $scope.newMeasure = null;
+    return true;
   };
 
   //map right return type for param

Reply via email to