You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by zh...@apache.org on 2015/10/22 12:06:57 UTC
[5/5] incubator-kylin git commit: KYLIN-966,
validate cube exists or not when create (patch from @nichunen)
KYLIN-966, validate cube exists or not when create (patch from @nichunen)
Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/aeac6337
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/aeac6337
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/aeac6337
Branch: refs/heads/2.x-staging
Commit: aeac6337b208426c6a6b84760c19503bdbe62cbf
Parents: 53b383d
Author: jiazhong <ji...@ebay.com>
Authored: Thu Oct 22 18:05:12 2015 +0800
Committer: jiazhong <ji...@ebay.com>
Committed: Thu Oct 22 18:06:02 2015 +0800
----------------------------------------------------------------------
webapp/app/js/controllers/cubeSchema.js | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/aeac6337/webapp/app/js/controllers/cubeSchema.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/cubeSchema.js b/webapp/app/js/controllers/cubeSchema.js
index b714c41..6d215ce 100755
--- a/webapp/app/js/controllers/cubeSchema.js
+++ b/webapp/app/js/controllers/cubeSchema.js
@@ -18,7 +18,7 @@
'use strict';
-KylinApp.controller('CubeSchemaCtrl', function ($scope, QueryService, UserService,modelsManager, ProjectService, AuthenticationService,$filter,ModelService,MetaModel,CubeDescModel,CubeList,TableModel,ProjectModel,ModelDescService,SweetAlert,cubesManager,StreamingService) {
+KylinApp.controller('CubeSchemaCtrl', function ($scope, QueryService, UserService,modelsManager, ProjectService, AuthenticationService,$filter,ModelService,MetaModel,CubeDescModel,CubeList,TableModel,ProjectModel,ModelDescService,SweetAlert,cubesManager,StreamingService,CubeService) {
$scope.modelsManager = modelsManager;
$scope.cubesManager = cubesManager;
$scope.projects = [];
@@ -38,6 +38,7 @@ KylinApp.controller('CubeSchemaCtrl', function ($scope, QueryService, UserServic
$scope.curStep = $scope.wizardSteps[0];
+ $scope.allCubes = [];
// ~ init
@@ -45,6 +46,18 @@ KylinApp.controller('CubeSchemaCtrl', function ($scope, QueryService, UserServic
$scope.state = {mode: "view"};
}
+ var queryParam = {offset: 0, limit: 65535};
+
+ CubeService.list(queryParam, function (all_cubes) {
+ if($scope.allCubes.length > 0){
+ $scope.allCubes.splice(0,$scope.allCubes.length);
+ }
+
+ for (var i = 0; i < all_cubes.length; i++) {
+ $scope.allCubes.push(all_cubes[i].name.toUpperCase());
+ }
+ });
+
$scope.$watch('cubeMetaFrame', function (newValue, oldValue) {
if(!newValue){
return;
@@ -191,7 +204,11 @@ KylinApp.controller('CubeSchemaCtrl', function ($scope, QueryService, UserServic
};
$scope.check_cube_info = function(){
-
+ if(($scope.state.mode === "edit") &&($scope.allCubes.indexOf($scope.cubeMetaFrame.name.toUpperCase()) >= 0)){
+ SweetAlert.swal('Oops...', "The cube named [" + $scope.cubeMetaFrame.name.toUpperCase() + "] already exists", 'warning');
+ return false;
+ }
+ return true;
}
$scope.check_cube_dimension = function(){