Skip to content

Commit

Permalink
KYLIN 2768 wrong UI for count distinct measure
Browse files Browse the repository at this point in the history
  • Loading branch information
chenzhx committed Jul 30, 2017
1 parent a536e7a commit d2982dc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
18 changes: 11 additions & 7 deletions webapp/app/js/controllers/cubeMeasures.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ KylinApp.controller('CubeMeasuresCtrl', function ($scope, $modal,MetaModel,cubes
$scope.newMeasure.function.configuration[versionKey]=version;
});
}
if ($scope.newMeasure.function.expression === 'COUNT_DISTINCT' ) {
if ($scope.newMeasure.function.expression === 'COUNT_DISTINCT' && $scope.newMeasure.function.returntype!=='bitmap') {

var hasExisted = [];

Expand Down Expand Up @@ -344,16 +344,20 @@ KylinApp.controller('CubeMeasuresCtrl', function ($scope, $modal,MetaModel,cubes
}

//map right return type for param
$scope.measureReturnTypeUpdate = function(){
$scope.measureReturnTypeUpdate = function() {

if($scope.newMeasure.function.expression == 'TOP_N'){
if($scope.newMeasure.function.parameter.type==""||!$scope.newMeasure.function.parameter.type){
$scope.newMeasure.function.parameter.type= 'column';
if ($scope.newMeasure.function.expression == 'TOP_N') {
if ($scope.newMeasure.function.parameter.type == "" || !$scope.newMeasure.function.parameter.type) {
$scope.newMeasure.function.parameter.type = 'column';
}
$scope.convertedColumns=[];
$scope.convertedColumns = [];
$scope.newMeasure.function.returntype = "topn(100)";
return;
}else if($scope.newMeasure.function.expression == 'EXTENDED_COLUMN'){
} else if ($scope.newMeasure.function.expression == 'COUNT_DISTINCT') {
$scope.newMeasure.function.parameter.type= 'column';
$scope.newMeasure.function.returntype = "hllc(10)";
$scope.convertedColumns = [];
} else if($scope.newMeasure.function.expression == 'EXTENDED_COLUMN'){
$scope.newMeasure.function.parameter.type= 'column';
$scope.newMeasure.function.returntype = "extendedcolumn(100)";
return;
Expand Down
5 changes: 2 additions & 3 deletions webapp/app/partials/cubeDesigner/measures.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
</table>
</div>
</ng-form>

<!--Add Measures Button-->
<div class="form-group">
<button class="btn btn-sm btn-info" ng-click="addNewMeasure()" ng-show="state.mode=='edit' && !newMeasure" ng-disabled="instance.status=='READY'">
Expand Down Expand Up @@ -218,10 +217,10 @@ <h4 class="box-title text-info">Edit Measure</h4>
</div>

<!--Group by Column-->
<div class="form-group" ng-if="newMeasure.function.expression === 'TOP_N'||newMeasure.function.expression === 'COUNT_DISTINCT'" >
<div class="form-group" ng-if="newMeasure.function.expression === 'TOP_N'||(newMeasure.function.expression === 'COUNT_DISTINCT' && newMeasure.function.returntype!=='bitmap')" >
<div class="row">
<label class="col-xs-12 col-sm-3 control-label no-padding-right font-color-default">
<b>Group by Column</b>
<b ng-if="newMeasure.function.expression === 'TOP_N'">Group by Column</b>
</label>
<div class="form-group large-popover" >
<div class="box-body">
Expand Down

0 comments on commit d2982dc

Please sign in to comment.