Repository: kylin
Updated Branches:
  refs/heads/yang-m1 cacadd1d5 -> 927a23859


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/927a2385
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/927a2385
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/927a2385

Branch: refs/heads/yang-m1
Commit: 927a23859c1653be8ac6083b1bf75658f4fd0f66
Parents: cacadd1
Author: Jason <jiat...@163.com>
Authored: Mon May 9 20:49:19 2016 +0800
Committer: Jason <jiat...@163.com>
Committed: Mon May 9 20:49:19 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/927a2385/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.';

Reply via email to