kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From luke...@apache.org
Subject [32/50] [abbrv] incubator-kylin git commit: KYLIN-873, fix cancel button does not work when [resume][discard] job
Date Tue, 21 Jul 2015 08:05:38 GMT
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/725bde52
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/725bde52
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/725bde52

Branch: refs/heads/master
Commit: 725bde52771e64688aa8ca54ee31c86609d8b45b
Parents: cc1ab7b
Author: jiazhong <jiazhong@ebay.com>
Authored: Mon Jul 6 11:23:30 2015 +0800
Committer: jiazhong <jiazhong@ebay.com>
Committed: Mon Jul 6 11:25:07 2015 +0800

----------------------------------------------------------------------
 webapp/app/js/controllers/access.js | 39 +++++++--------
 webapp/app/js/controllers/job.js    | 82 +++++++++++++++++---------------
 2 files changed, 63 insertions(+), 58 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/725bde52/webapp/app/js/controllers/access.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/access.js b/webapp/app/js/controllers/access.js
index 4cfd833..57dd0f9 100644
--- a/webapp/app/js/controllers/access.js
+++ b/webapp/app/js/controllers/access.js
@@ -102,25 +102,26 @@ KylinApp.controller('AccessCtrl', function ($scope, AccessService, MessageServic
       confirmButtonColor: '#DD6B55',
       confirmButtonText: "Yes",
       closeOnConfirm: true
-    }, function () {
-      var revokeRequst = {
-        type: type,
-        uuid: entity.uuid,
-        accessEntryId: access.id
-      };
-      AccessService.revoke(revokeRequst, function (accessEntities) {
-        entity.accessEntities = accessEntities.accessEntryResponseList;
-        SweetAlert.swal('Success!', 'The access has been revoked.', 'success');
-      }, function (e) {
-        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');
-        }
-      });
-
+    }, function (isConfirm) {
+      if (isConfirm) {
+        var revokeRequst = {
+          type: type,
+          uuid: entity.uuid,
+          accessEntryId: access.id
+        };
+        AccessService.revoke(revokeRequst, function (accessEntities) {
+          entity.accessEntities = accessEntities.accessEntryResponseList;
+          SweetAlert.swal('Success!', 'The access has been revoked.', 'success');
+        }, function (e) {
+          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');
+          }
+        });
+      }
     });
 
   }

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/725bde52/webapp/app/js/controllers/job.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/job.js b/webapp/app/js/controllers/job.js
index 45961b7..812316e 100644
--- a/webapp/app/js/controllers/job.js
+++ b/webapp/app/js/controllers/job.js
@@ -111,25 +111,27 @@ KylinApp
         confirmButtonColor: '#DD6B55',
         confirmButtonText: "Yes",
         closeOnConfirm: true
-      }, function () {
-        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');
-          }
-        });
+      }, 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');
+            }
+          });
+        }
       });
     }
 
@@ -143,28 +145,30 @@ KylinApp
         confirmButtonColor: '#DD6B55',
         confirmButtonText: "Yes",
         closeOnConfirm: true
-      }, function () {
-        loadingRequest.show();
-        JobService.cancel({jobId: job.uuid}, {}, function (job) {
-          loadingRequest.hide();
-          $scope.safeApply(function () {
-            JobList.jobs[job.uuid] = job;
-            if (angular.isDefined($scope.state.selectedJob)) {
-              $scope.state.selectedJob = JobList.jobs[$scope.state.selectedJob.uuid];
+      }, function (isConfirm) {
+        if (isConfirm) {
+          loadingRequest.show();
+          JobService.cancel({jobId: job.uuid}, {}, function (job) {
+            loadingRequest.hide();
+            $scope.safeApply(function () {
+              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 discarded 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');
             }
-
           });
-          SweetAlert.swal('Success!', 'Job has been discarded 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');
-          }
-        });
+        }
       });
     }
 


Mime
View raw message