Repository: kylin Updated Branches: refs/heads/master bdffa9fbe -> 9e2572a30
KYLIN-1666 validate project selected before load table Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/9e2572a3 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/9e2572a3 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/9e2572a3 Branch: refs/heads/master Commit: 9e2572a30cfa74831eaab8c1504c6b7363ca1e17 Parents: bdffa9f Author: Jason <jiat...@163.com> Authored: Mon May 9 20:46:07 2016 +0800 Committer: Jason <jiat...@163.com> Committed: Mon May 9 20:47:16 2016 +0800 ---------------------------------------------------------------------- webapp/app/js/controllers/sourceMeta.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/9e2572a3/webapp/app/js/controllers/sourceMeta.js ---------------------------------------------------------------------- diff --git a/webapp/app/js/controllers/sourceMeta.js b/webapp/app/js/controllers/sourceMeta.js index 1466a5b..606d88a 100755 --- a/webapp/app/js/controllers/sourceMeta.js +++ b/webapp/app/js/controllers/sourceMeta.js @@ -82,6 +82,10 @@ KylinApp $scope.openModal = function () { + if(!$scope.projectModel.selectedProject){ + SweetAlert.swal('Oops...', "Please select a project.", 'info'); + return; + } $modal.open({ templateUrl: 'addHiveTable.html', controller: ModalInstanceCtrl, @@ -101,6 +105,10 @@ KylinApp }; $scope.openTreeModal = function () { + if(!$scope.projectModel.selectedProject){ + SweetAlert.swal('Oops...', "Please select a project.", 'info'); + return; + } $modal.open({ templateUrl: 'addHiveTableFromTree.html', controller: ModalInstanceCtrl, @@ -119,6 +127,10 @@ KylinApp }; $scope.openUnLoadModal = function () { + if(!$scope.projectModel.selectedProject){ + SweetAlert.swal('Oops...', "Please select a project.", 'info'); + return; + } $modal.open({ templateUrl: 'removeHiveTable.html', controller: ModalInstanceCtrl, @@ -404,6 +416,10 @@ KylinApp //streaming model $scope.openStreamingSourceModal = function () { + if(!$scope.projectModel.selectedProject){ + SweetAlert.swal('Oops...', "Please select a project.", 'info'); + return; + } $modal.open({ templateUrl: 'addStreamingSource.html', controller: StreamingSourceCtrl, @@ -705,7 +721,8 @@ KylinApp }, function (request) { if (request.successful) { SweetAlert.swal('', 'Created the streaming successfully.', 'success'); - location.reload(); + $scope.cancel(); + scope.aceSrcTbLoaded(true); } else { var message = request.message; var msg = !!(message) ? message : 'Failed to take action.';