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/07/06 05:02:50 UTC

incubator-kylin git commit: KYLIN-873, fix cancel button does not work when [resume][discard] job

Repository: incubator-kylin
Updated Branches:
  refs/heads/0.8 0470d0a1d -> 6de11d36f


KYLIN-873, fix cancel button does not work when [resume][discard] job


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

Branch: refs/heads/0.8
Commit: 6de11d36f2270e9a35c14877345394eed301d1c7
Parents: 0470d0a
Author: jiazhong <ji...@ebay.com>
Authored: Mon Jul 6 11:01:42 2015 +0800
Committer: jiazhong <ji...@ebay.com>
Committed: Mon Jul 6 11:01:42 2015 +0800

----------------------------------------------------------------------
 webapp/app/js/controllers/access.js |  5 +++--
 webapp/app/js/controllers/job.js    | 38 ++++++++++++++++++--------------
 2 files changed, 24 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/6de11d36/webapp/app/js/controllers/access.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/access.js b/webapp/app/js/controllers/access.js
index 4cfd833..0e0664a 100644
--- a/webapp/app/js/controllers/access.js
+++ b/webapp/app/js/controllers/access.js
@@ -102,7 +102,8 @@ KylinApp.controller('AccessCtrl', function ($scope, AccessService, MessageServic
       confirmButtonColor: '#DD6B55',
       confirmButtonText: "Yes",
       closeOnConfirm: true
-    }, function () {
+    }, function (isConfirm) {
+      if(isConfirm){
       var revokeRequst = {
         type: type,
         uuid: entity.uuid,
@@ -120,7 +121,7 @@ KylinApp.controller('AccessCtrl', function ($scope, AccessService, MessageServic
           SweetAlert.swal('Oops...', "Failed to take action.", 'error');
         }
       });
-
+      }
     });
 
   }

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/6de11d36/webapp/app/js/controllers/job.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/job.js b/webapp/app/js/controllers/job.js
index 364bf92..90a20ed 100644
--- a/webapp/app/js/controllers/job.js
+++ b/webapp/app/js/controllers/job.js
@@ -104,25 +104,27 @@ KylinApp
                 confirmButtonColor: '#DD6B55',
                 confirmButtonText: "Yes",
                 closeOnConfirm: true
-            }, function() {
+            }, function(isConfirm) {
+              if(isConfirm) {
                 loadingRequest.show();
                 JobService.resume({jobId: job.uuid}, {}, function (job) {
-                    loadingRequest.hide();
-                    JobList.jobs[job.uuid] = job;
-                    if (angular.isDefined($scope.state.selectedJob)) {
-                        $scope.state.selectedJob = JobList.jobs[ $scope.state.selectedJob.uuid];
-                    }
-                    SweetAlert.swal('Success!', 'Job has been resumed successfully!', 'success');
-                },function(e){
-                    loadingRequest.hide();
-                    if(e.data&& e.data.exception){
-                        var message =e.data.exception;
-                        var msg = !!(message) ? message : 'Failed to take action.';
-                        SweetAlert.swal('Oops...', msg, 'error');
-                    }else{
-                        SweetAlert.swal('Oops...', "Failed to take action.", 'error');
-                    }
+                  loadingRequest.hide();
+                  JobList.jobs[job.uuid] = job;
+                  if (angular.isDefined($scope.state.selectedJob)) {
+                    $scope.state.selectedJob = JobList.jobs[$scope.state.selectedJob.uuid];
+                  }
+                  SweetAlert.swal('Success!', 'Job has been resumed successfully!', 'success');
+                }, function (e) {
+                  loadingRequest.hide();
+                  if (e.data && e.data.exception) {
+                    var message = e.data.exception;
+                    var msg = !!(message) ? message : 'Failed to take action.';
+                    SweetAlert.swal('Oops...', msg, 'error');
+                  } else {
+                    SweetAlert.swal('Oops...', "Failed to take action.", 'error');
+                  }
                 });
+              }
             });
         }
 
@@ -136,7 +138,8 @@ KylinApp
                 confirmButtonColor: '#DD6B55',
                 confirmButtonText: "Yes",
                 closeOnConfirm: true
-            }, function() {
+            }, function(isConfirm) {
+              if(isConfirm) {
                 loadingRequest.show();
                 JobService.cancel({jobId: job.uuid}, {}, function (job) {
                     loadingRequest.hide();
@@ -158,6 +161,7 @@ KylinApp
                         SweetAlert.swal('Oops...', "Failed to take action.", 'error');
                     }
                 });
+              }
             });
         }