You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kylin.apache.org by GitBox <gi...@apache.org> on 2018/07/30 03:51:26 UTC

[GitHub] luguosheng1314 closed pull request #179: KYLIN-3464 Less user confirmation

luguosheng1314 closed pull request #179: KYLIN-3464 Less user confirmation
URL: https://github.com/apache/kylin/pull/179
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/webapp/app/index.html b/webapp/app/index.html
index 8f7e9540d2..5344d67f9f 100644
--- a/webapp/app/index.html
+++ b/webapp/app/index.html
@@ -147,6 +147,7 @@
 <script src="js/services/users.js"></script>
 <script src="js/services/ngLoading.js"></script>
 <script src="js/services/acl.js"></script>
+<script src="js/services/notify.js"></script>
 <!--New GUI-->
 <script src="js/services/models.js"></script>
 <script src="js/services/hybridInstance.js"></script>
diff --git a/webapp/app/js/controllers/acl.js b/webapp/app/js/controllers/acl.js
index 442e284e56..c374824e91 100644
--- a/webapp/app/js/controllers/acl.js
+++ b/webapp/app/js/controllers/acl.js
@@ -17,7 +17,7 @@
  */
 
 'use strict';
-KylinApp.controller('AclCtrl', function ($scope, AclService, TableModel,loadingRequest,SweetAlert,$modal, ProjectModel) {
+KylinApp.controller('AclCtrl', function ($scope, AclService, TableModel,loadingRequest,SweetAlert,$modal, ProjectModel, MessageBox) {
   $scope.tableModel = TableModel;
   $scope.tableUserAclList = [];
   $scope.tableGroupAclList = [];
@@ -72,7 +72,7 @@ KylinApp.controller('AclCtrl', function ($scope, AclService, TableModel,loadingR
         },function () {
           loadingRequest.hide();
           loadTableAclList(type);
-          SweetAlert.swal('Success!', 'Table acl drop is done successfully', 'success');
+          MessageBox.successNotify('Table acl drop is done successfully');
         },function (e) {
           if (e.data && e.data.exception) {
             var message = e.data.exception;
@@ -136,7 +136,7 @@ KylinApp.controller('AclCtrl', function ($scope, AclService, TableModel,loadingR
         username: $scope.newTableAcl.name
       },{},function () {
         loadingRequest.hide();
-        SweetAlert.swal('Success!', 'Table acl add successfully', 'success');
+        MessageBox.successNotify('Table acl add successfully');
         loadTableAclList()
         $scope.cancel()
       },function (e) {
diff --git a/webapp/app/js/controllers/admin.js b/webapp/app/js/controllers/admin.js
index 5687824c99..16efe047f3 100644
--- a/webapp/app/js/controllers/admin.js
+++ b/webapp/app/js/controllers/admin.js
@@ -18,7 +18,7 @@
 
 'use strict';
 
-KylinApp.controller('AdminCtrl', function ($scope, AdminService, CacheService, TableService, loadingRequest, MessageService, ProjectService, $modal, SweetAlert,kylinConfig,ProjectModel,$window) {
+KylinApp.controller('AdminCtrl', function ($scope, AdminService, CacheService, TableService, loadingRequest, MessageService, ProjectService, $modal, SweetAlert,kylinConfig,ProjectModel,$window, MessageBox) {
   $scope.configStr = "";
   $scope.envStr = "";
 
@@ -29,7 +29,7 @@ KylinApp.controller('AdminCtrl', function ($scope, AdminService, CacheService, T
   $scope.getEnv = function () {
     AdminService.env({}, function (env) {
       $scope.envStr = env.env;
-      MessageService.sendMsg('Server environment get successfully', 'success', {});
+      MessageBox.successNotify('Server environment get successfully');
 //            SweetAlert.swal('Success!', 'Server environment get successfully', 'success');
     }, function (e) {
       if (e.data && e.data.exception) {
@@ -45,7 +45,7 @@ KylinApp.controller('AdminCtrl', function ($scope, AdminService, CacheService, T
   $scope.getConfig = function () {
     AdminService.config({}, function (config) {
       $scope.configStr = config.config;
-      MessageService.sendMsg('Server config get successfully', 'success', {});
+      MessageBox.successNotify('Server config get successfully');
     }, function (e) {
       if (e.data && e.data.exception) {
         var message = e.data.exception;
@@ -69,7 +69,7 @@ KylinApp.controller('AdminCtrl', function ($scope, AdminService, CacheService, T
     }, function (isConfirm) {
       if (isConfirm) {
         CacheService.reloadConfig({}, function () {
-          SweetAlert.swal('Success!', 'config reload successfully', 'success');
+          MessageBox.successNotify('Config reload successfully');
           $scope.getConfig();
         }, function (e) {
           if (e.data && e.data.exception) {
@@ -96,7 +96,7 @@ KylinApp.controller('AdminCtrl', function ($scope, AdminService, CacheService, T
     }, function (isConfirm) {
       if (isConfirm) {
         CacheService.clean({}, function () {
-          SweetAlert.swal('Success!', 'Cache reload successfully', 'success');
+          MessageBox.successNotify('Cache reload successfully');
           ProjectService.listReadable({}, function(projects) {
             ProjectModel.setProjects(projects);
           });
@@ -146,7 +146,7 @@ KylinApp.controller('AdminCtrl', function ($scope, AdminService, CacheService, T
     }, function (isConfirm) {
       if (isConfirm) {
         AdminService.cleanStorage({}, function () {
-          SweetAlert.swal('Success!', 'Storage cleaned successfully!', 'success');
+          MessageBox.successNotify('Storage cleaned successfully!');
         }, function (e) {
           if (e.data && e.data.exception) {
             var message = e.data.exception;
@@ -172,7 +172,7 @@ KylinApp.controller('AdminCtrl', function ($scope, AdminService, CacheService, T
     }, function (isConfirm) {
       if (isConfirm) {
         AdminService.updateConfig({}, {key: 'kylin.query.cache-enabled', value: false}, function () {
-          SweetAlert.swal('Success!', 'Cache disabled successfully!', 'success');
+          MessageBox.successNotify('Cache disabled successfully!');
           location.reload();
         }, function (e) {
           if (e.data && e.data.exception) {
@@ -201,7 +201,7 @@ KylinApp.controller('AdminCtrl', function ($scope, AdminService, CacheService, T
     }, function (isConfirm) {
       if (isConfirm) {
         AdminService.updateConfig({}, {key: 'kylin.query.cache-enabled', value: true}, function () {
-          SweetAlert.swal('Success!', 'Cache enabled successfully!', 'success');
+          MessageBox.successNotify('Cache enabled successfully!');
           location.reload();
         }, function (e) {
           if (e.data && e.data.exception) {
@@ -227,7 +227,7 @@ KylinApp.controller('AdminCtrl', function ($scope, AdminService, CacheService, T
     });
   }
 
-  var CardinalityGenCtrl = function ($scope, $modalInstance, tableName, MessageService) {
+  var CardinalityGenCtrl = function ($scope, $modalInstance, tableName, MessageService, MessageBox) {
     $scope.tableName = tableName;
     $scope.delimiter = 0;
     $scope.format = 0;
@@ -247,7 +247,7 @@ KylinApp.controller('AdminCtrl', function ($scope, AdminService, CacheService, T
         format: $scope.format
       }, function (result) {
         loadingRequest.hide();
-        SweetAlert.swal('Success!', 'Cardinality job was calculated successfully. . Click Refresh button ...', 'success');
+        MessageBox.successNotify('Cardinality job was calculated successfully. . Click Refresh button ...');
       }, function (e) {
         loadingRequest.hide();
         if (e.data && e.data.exception) {
@@ -261,7 +261,7 @@ KylinApp.controller('AdminCtrl', function ($scope, AdminService, CacheService, T
     }
   };
 
-  var updateConfigCtrl = function ($scope, $modalInstance, AdminService, MessageService) {
+  var updateConfigCtrl = function ($scope, $modalInstance, AdminService, MessageService, MessageBox) {
     $scope.state = {
       key: null,
       value: null
@@ -271,7 +271,7 @@ KylinApp.controller('AdminCtrl', function ($scope, AdminService, CacheService, T
     };
     $scope.update = function () {
       AdminService.updateConfig({}, {key: $scope.state.key, value: $scope.state.value}, function (result) {
-        SweetAlert.swal('Success!', 'Config updated successfully!', 'success');
+        MessageBox.successNotify('Config updated successfully!');
         $modalInstance.dismiss();
         $scope.getConfig();
       }, function (e) {
diff --git a/webapp/app/js/controllers/cube.js b/webapp/app/js/controllers/cube.js
index 35911d3833..aff32267ec 100755
--- a/webapp/app/js/controllers/cube.js
+++ b/webapp/app/js/controllers/cube.js
@@ -18,7 +18,7 @@
 
 'use strict';
 
-KylinApp.controller('CubeCtrl', function ($scope, $rootScope, AccessService, MessageService, CubeService, cubeConfig, TableService, ModelGraphService, UserService,SweetAlert,loadingRequest,modelsManager,$modal,cubesManager, $location) {
+KylinApp.controller('CubeCtrl', function ($scope, $rootScope, AccessService, MessageService, CubeService, cubeConfig, TableService, ModelGraphService, UserService,SweetAlert,loadingRequest,modelsManager,$modal,cubesManager, $location, MessageBox) {
     $scope.newAccess = null;
     $scope.state = {jsonEdit: false};
 
@@ -76,7 +76,7 @@ KylinApp.controller('CubeCtrl', function ($scope, $rootScope, AccessService, Mes
             cube.detail.notify_list = cube.notifyListString.split(",");
         }
         CubeService.updateNotifyList({cubeId: cube.name}, cube.detail.notify_list, function () {
-            SweetAlert.swal('Success!', 'Notify List updated successfully!', 'success');
+            MessageBox.successNotify('Notify List updated successfully!');
         },function(e){
             if(e.data&& e.data.exception){
                 var message =e.data.exception;
diff --git a/webapp/app/js/controllers/cubeEdit.js b/webapp/app/js/controllers/cubeEdit.js
index 1a87dc3d24..eeed96af9e 100755
--- a/webapp/app/js/controllers/cubeEdit.js
+++ b/webapp/app/js/controllers/cubeEdit.js
@@ -19,7 +19,7 @@
 'use strict';
 
 
-KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams, $location, $templateCache, $interpolate, MessageService, TableService, CubeDescService, CubeService, loadingRequest, SweetAlert, $log, cubeConfig, CubeDescModel, MetaModel, TableModel, ModelDescService, modelsManager, cubesManager, ProjectModel, StreamingModel, StreamingService,VdmUtil) {
+KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams, $location, $templateCache, $interpolate, MessageService, TableService, CubeDescService, CubeService, loadingRequest, SweetAlert, $log, cubeConfig, CubeDescModel, MetaModel, TableModel, ModelDescService, modelsManager, cubesManager, ProjectModel, StreamingModel, StreamingService,VdmUtil, MessageBox) {
   $scope.cubeConfig = cubeConfig;
   $scope.metaModel = {};
   $scope.modelsManager = modelsManager;
@@ -336,7 +336,7 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams, $locatio
           }, function (request) {
             if (request.successful) {
               $scope.state.cubeSchema = request.cubeDescData;
-              SweetAlert.swal('', 'Updated the cube successfully.', 'success');
+              MessageBox.successNotify('Updated the cube successfully.');
               $location.path("/models");
             } else {
               $scope.saveCubeRollBack();
@@ -375,7 +375,7 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams, $locatio
           }, function (request) {
             if (request.successful) {
               $scope.state.cubeSchema = request.cubeDescData;
-              SweetAlert.swal('', 'Created the cube successfully.', 'success');
+              MessageBox.successNotify('Created the cube successfully.');
               $location.path("/models");
               //location.reload();
 
diff --git a/webapp/app/js/controllers/cubes.js b/webapp/app/js/controllers/cubes.js
index d5541fb008..7032016326 100644
--- a/webapp/app/js/controllers/cubes.js
+++ b/webapp/app/js/controllers/cubes.js
@@ -18,7 +18,7 @@
 
 'use strict';
 
-KylinApp.controller('CubesCtrl', function ($scope, $q, $routeParams, $location, $modal, MessageService, CubeDescService, CubeService, JobService, UserService, ProjectService, SweetAlert, loadingRequest, $log, cubeConfig, ProjectModel, ModelService, MetaModel, CubeList,modelsManager,TableService, kylinConfig) {
+KylinApp.controller('CubesCtrl', function ($scope, $q, $routeParams, $location, $modal, MessageService, CubeDescService, CubeService, JobService, UserService, ProjectService, SweetAlert, loadingRequest, $log, cubeConfig, ProjectModel, ModelService, MetaModel, CubeList,modelsManager,TableService, kylinConfig, MessageBox) {
 
     $scope.cubeConfig = cubeConfig;
     $scope.cubeList = CubeList;
@@ -168,7 +168,7 @@ KylinApp.controller('CubesCtrl', function ($scope, $q, $routeParams, $location,
                 $scope.cubeList.cubes[$scope.cubeList.cubes.indexOf(cube)] = _cube;
               }
             });
-            SweetAlert.swal('Success!', 'Enable job was submitted successfully', 'success');
+            MessageBox.successNotify('Enable job was submitted successfully');
           },function(e){
 
             loadingRequest.hide();
@@ -205,7 +205,7 @@ KylinApp.controller('CubesCtrl', function ($scope, $q, $routeParams, $location,
                 $scope.cubeList.cubes[$scope.cubeList.cubes.indexOf(cube)] = _cube;
              }
             });
-            SweetAlert.swal('Success!', 'Purge job was submitted successfully', 'success');
+            MessageBox.successNotify('Purge job was submitted successfully');
           },function(e){
             loadingRequest.hide();
             if(e.data&& e.data.exception){
@@ -242,7 +242,7 @@ KylinApp.controller('CubesCtrl', function ($scope, $q, $routeParams, $location,
                 $scope.cubeList.cubes[$scope.cubeList.cubes.indexOf(cube)] = _cube;
               }
             });
-            SweetAlert.swal('Success!', 'Disable job was submitted successfully', 'success');
+            MessageBox.successNotify('Disable job was submitted successfully');
           },function(e){
 
             loadingRequest.hide();
@@ -275,7 +275,7 @@ KylinApp.controller('CubesCtrl', function ($scope, $q, $routeParams, $location,
           loadingRequest.show();
           CubeService.drop({cubeId: cube.name}, {}, function (result) {
             loadingRequest.hide();
-            SweetAlert.swal('Success!', 'Cube drop is done successfully', 'success');
+            MessageBox.successNotify('Cube drop is done successfully');
             $scope.cubeList.cubes.splice($scope.cubeList.cubes.indexOf(cube),1);
           },function(e){
 
@@ -313,7 +313,7 @@ KylinApp.controller('CubesCtrl', function ($scope, $q, $routeParams, $location,
           loadingRequest.show();
           CubeService.autoMigrate({cubeId: cube.name, propName: $scope.projectModel.selectedProject}, {}, function (result) {
             loadingRequest.hide();
-            SweetAlert.swal('Success!', cube.name + ' migrate successfully!', 'success');
+            MessageBox.successNotify(cube.name + ' migrate successfully!');
           },function(e){
             loadingRequest.hide();
             SweetAlert.swal('Migrate failed!', "Please contact your ADMIN.", 'error');
@@ -356,7 +356,7 @@ KylinApp.controller('CubesCtrl', function ($scope, $q, $routeParams, $location,
                     buildType:'BUILD'
                   }, function (job) {
                     loadingRequest.hide();
-                    SweetAlert.swal('Success!', 'Rebuild job was submitted successfully', 'success');
+                    MessageBox.successNotify('Rebuild job was submitted successfully');
                   },function(e){
 
                     loadingRequest.hide();
@@ -423,7 +423,7 @@ KylinApp.controller('CubesCtrl', function ($scope, $q, $routeParams, $location,
                     }, function (job) {
 
                       loadingRequest.hide();
-                      SweetAlert.swal('Success!', 'Rebuild job was submitted successfully', 'success');
+                      MessageBox.successNotify('Rebuild job was submitted successfully');
                     },function(e){
 
                       loadingRequest.hide();
@@ -566,7 +566,7 @@ KylinApp.controller('CubesCtrl', function ($scope, $q, $routeParams, $location,
   });
 
 
-var cubeCloneCtrl = function ($scope, $modalInstance, CubeService, MessageService, $location, cube, MetaModel, SweetAlert,ProjectModel, loadingRequest) {
+var cubeCloneCtrl = function ($scope, $modalInstance, CubeService, MessageService, $location, cube, MetaModel, SweetAlert,ProjectModel, loadingRequest, MessageBox) {
   $scope.projectModel = ProjectModel;
 
   $scope.targetObj={
@@ -604,7 +604,7 @@ var cubeCloneCtrl = function ($scope, $modalInstance, CubeService, MessageServic
         loadingRequest.show();
         CubeService.clone({cubeId: cube.name}, $scope.cubeRequest, function (result) {
           loadingRequest.hide();
-          SweetAlert.swal('Success!', 'Clone cube successfully', 'success');
+          MessageBox.successNotify('Clone cube successfull');
           location.reload();
         }, function (e) {
           loadingRequest.hide();
@@ -623,7 +623,7 @@ var cubeCloneCtrl = function ($scope, $modalInstance, CubeService, MessageServic
 }
 
 
-var jobSubmitCtrl = function ($scope, $modalInstance, CubeService, MessageService, $location, cube, metaModel, buildType, SweetAlert, loadingRequest, scope, CubeList,$filter) {
+var jobSubmitCtrl = function ($scope, $modalInstance, CubeService, MessageService, $location, cube, metaModel, buildType, SweetAlert, loadingRequest, scope, CubeList,$filter, MessageBox) {
   $scope.cubeList = CubeList;
   $scope.cube = cube;
   $scope.metaModel = metaModel;
@@ -651,7 +651,7 @@ var jobSubmitCtrl = function ($scope, $modalInstance, CubeService, MessageServic
     CubeService.rebuildCube({cubeId: cube.name}, $scope.jobBuildRequest, function (job) {
       loadingRequest.hide();
       $modalInstance.dismiss('cancel');
-      SweetAlert.swal('Success!', 'Rebuild job was submitted successfully', 'success');
+      MessageBox.successNotify('Rebuild job was submitted successfully');
       scope.refreshCube(cube).then(function(_cube){
           $scope.cubeList.cubes[$scope.cubeList.cubes.indexOf(cube)] = _cube;
         });
@@ -746,7 +746,7 @@ var streamingBuildCtrl = function ($scope, $modalInstance,kylinConfig) {
   };
 };
 
-var deleteSegmentCtrl = function($scope, $modalInstance, CubeService, SweetAlert, loadingRequest, cube, scope) {
+var deleteSegmentCtrl = function($scope, $modalInstance, CubeService, SweetAlert, loadingRequest, cube, scope, MessageBox) {
   $scope.cube = cube;
   $scope.deleteSegments = [];
   $scope.segment = {};
@@ -775,7 +775,7 @@ var deleteSegmentCtrl = function($scope, $modalInstance, CubeService, SweetAlert
               scope.cubeList.cubes[scope.cubeList.cubes.indexOf(cube)] = _cube;
            }
           });
-          SweetAlert.swal('Success!', 'Delete segment successfully', 'success');
+          MessageBox.successNotify('Delete segment successfully');
         },function(e){
           loadingRequest.hide();
           if(e.data&& e.data.exception){
@@ -791,7 +791,7 @@ var deleteSegmentCtrl = function($scope, $modalInstance, CubeService, SweetAlert
   };
 };
 
-var lookupRefreshCtrl = function($scope, scope, CubeList, $modalInstance, CubeService, cube, SweetAlert, loadingRequest) {
+var lookupRefreshCtrl = function($scope, scope, CubeList, $modalInstance, CubeService, cube, SweetAlert, loadingRequest, MessageBox) {
   $scope.cubeList = CubeList;
   $scope.cube = cube;
   $scope.dispalySegment = false;
@@ -878,7 +878,7 @@ var lookupRefreshCtrl = function($scope, scope, CubeList, $modalInstance, CubeSe
     CubeService.lookupRefresh({cubeId: cube.name}, lookupSnapshotBuildRequest, function (job) {
       loadingRequest.hide();
       $modalInstance.dismiss('cancel');
-      SweetAlert.swal('Success!', 'Lookup refresh job was submitted successfully', 'success');
+      MessageBox.successNotify('Lookup refresh job was submitted successfully');
       scope.refreshCube(cube).then(function(_cube){
           $scope.cubeList.cubes[$scope.cubeList.cubes.indexOf(cube)] = _cube;
         });
diff --git a/webapp/app/js/controllers/hybridInstance.js b/webapp/app/js/controllers/hybridInstance.js
index 152feab1e0..cdf1e40ca7 100644
--- a/webapp/app/js/controllers/hybridInstance.js
+++ b/webapp/app/js/controllers/hybridInstance.js
@@ -20,7 +20,7 @@
 
 KylinApp.controller('HybridInstanceCtrl', function (
   $scope, $q, $location,
-  ProjectModel, hybridInstanceManager, SweetAlert, HybridInstanceService, loadingRequest
+  ProjectModel, hybridInstanceManager, SweetAlert, HybridInstanceService, loadingRequest, MessageBox
 ) {
   $scope.projectModel = ProjectModel;
   $scope.hybridInstanceManager = hybridInstanceManager;
@@ -91,7 +91,7 @@ KylinApp.controller('HybridInstanceCtrl', function (
         loadingRequest.show();
         HybridInstanceService.drop(schema, {}, function (result) {
           loadingRequest.hide();
-          SweetAlert.swal('Success!', 'Hybrid drop is done successfully', 'success');
+          MessageBox.successNotify('Hybrid drop is done successfully');
           location.reload();
         }, function (e) {
           loadingRequest.hide();
diff --git a/webapp/app/js/controllers/hybridInstanceSchema.js b/webapp/app/js/controllers/hybridInstanceSchema.js
index 033e3c155e..c4f61b496a 100644
--- a/webapp/app/js/controllers/hybridInstanceSchema.js
+++ b/webapp/app/js/controllers/hybridInstanceSchema.js
@@ -20,7 +20,7 @@
 
 KylinApp.controller('HybridInstanceSchema', function (
   $scope, $q, $location, $interpolate, $templateCache, $routeParams,
-  CubeList, HybridInstanceService, ProjectModel, modelsManager, SweetAlert, MessageService, loadingRequest, CubeService, CubeDescService
+  CubeList, HybridInstanceService, ProjectModel, modelsManager, SweetAlert, MessageService, loadingRequest, CubeService, CubeDescService, MessageBox
 ) {
 
   // check for empty project of header, break the operation.
@@ -206,9 +206,9 @@ KylinApp.controller('HybridInstanceSchema', function (
         MessageService.sendMsg(template, 'error', {}, true, 'top_center');
       } else {
         if($scope.isEdit) {
-          SweetAlert.swal('', 'Update hybrid cube successfully.', 'success');
+          MessageBox.successNotify('Update hybrid cube successfully.');
         } else {
-          SweetAlert.swal('', 'Create hybrid cube successfully.', 'success');
+          MessageBox.successNotify('Create hybrid cube successfully.');
         }
         $location.path('/models');
       }
diff --git a/webapp/app/js/controllers/job.js b/webapp/app/js/controllers/job.js
index 130f14dffc..6ad73184d1 100644
--- a/webapp/app/js/controllers/job.js
+++ b/webapp/app/js/controllers/job.js
@@ -19,7 +19,7 @@
 'use strict';
 
 KylinApp
-    .controller('JobCtrl', function ($scope, $q, $routeParams, $interval, $modal, ProjectService, MessageService, JobService,SweetAlert,loadingRequest,UserService,jobConfig,JobList,$window) {
+    .controller('JobCtrl', function ($scope, $q, $routeParams, $interval, $modal, ProjectService, MessageService, JobService,SweetAlert,loadingRequest,UserService,jobConfig,JobList,$window, MessageBox) {
 
         $scope.jobList = JobList;
         JobList.removeAll();
@@ -144,7 +144,7 @@ KylinApp
                   if (angular.isDefined($scope.state.selectedJob)) {
                     $scope.state.selectedJob = JobList.jobs[$scope.state.selectedJob.uuid];
                   }
-                  SweetAlert.swal('Success!', 'Job has been resumed successfully!', 'success');
+                  MessageBox.successNotify('Job has been resumed successfully!');
                 }, function (e) {
                   loadingRequest.hide();
                   if (e.data && e.data.exception) {
@@ -181,7 +181,7 @@ KylinApp
                         }
 
                     });
-                    SweetAlert.swal('Success!', 'Job has been discarded successfully!', 'success');
+                    MessageBox.successNotify('Job has been discarded successfully!');
                 },function(e){
                     loadingRequest.hide();
                     if(e.data&& e.data.exception){
@@ -217,7 +217,7 @@ KylinApp
                 }
 
               });
-              SweetAlert.swal('Success!', 'Job has been paused successfully!', 'success');
+              MessageBox.successNotify('Job has been paused successfully!');
             },function(e){
               loadingRequest.hide();
               if(e.data&& e.data.exception){
@@ -246,7 +246,7 @@ KylinApp
             loadingRequest.show();
             JobService.drop({jobId: job.uuid}, {}, function (job) {
               loadingRequest.hide();
-              SweetAlert.swal('Success!', 'Job has been dropped successfully!', 'success');
+              MessageBox.successNotify('Job has been dropped successfully!');
               $scope.jobList.jobs[job.uuid].dropped = true;
             },function(e){
               loadingRequest.hide();
diff --git a/webapp/app/js/controllers/modelEdit.js b/webapp/app/js/controllers/modelEdit.js
index a8d5c3c755..f3c2c51750 100644
--- a/webapp/app/js/controllers/modelEdit.js
+++ b/webapp/app/js/controllers/modelEdit.js
@@ -19,7 +19,7 @@
 'use strict';
 
 
-KylinApp.controller('ModelEditCtrl', function ($scope, $q, $routeParams, $location, $templateCache, $interpolate, MessageService, TableService, CubeDescService, ModelService, loadingRequest, SweetAlert,$log,cubeConfig,CubeDescModel,ModelDescService,MetaModel,TableModel,ProjectService,ProjectModel,modelsManager, CubeService, VdmUtil) {
+KylinApp.controller('ModelEditCtrl', function ($scope, $q, $routeParams, $location, $templateCache, $interpolate, MessageService, TableService, CubeDescService, ModelService, loadingRequest, SweetAlert,$log,cubeConfig,CubeDescModel,ModelDescService,MetaModel,TableModel,ProjectService,ProjectModel,modelsManager, CubeService, VdmUtil, MessageBox) {
     //add or edit ?
     var absUrl = $location.absUrl();
     $scope.tableAliasMap={};
@@ -161,7 +161,7 @@ KylinApp.controller('ModelEditCtrl', function ($scope, $q, $routeParams, $locati
                     }, function (request) {
                         if (request.successful) {
                             $scope.state.modelSchema = request.modelSchema;
-                            SweetAlert.swal('', 'Updated the model successfully.', 'success');
+                            MessageBox.successNotify('Updated the model successfully.');
                             $location.path("/models");
                             //location.reload();
                         } else {
@@ -193,7 +193,7 @@ KylinApp.controller('ModelEditCtrl', function ($scope, $q, $routeParams, $locati
                         if(request.successful) {
 
                           $scope.state.modelSchema = request.modelSchema;
-                          SweetAlert.swal('', 'Created the model successfully.', 'success');
+                          MessageBox.successNotify('Created the model successfully.');
                           $location.path("/models");
                          // location.reload();
                         } else {
diff --git a/webapp/app/js/controllers/models.js b/webapp/app/js/controllers/models.js
index ba7e3f6751..d79c464bdd 100644
--- a/webapp/app/js/controllers/models.js
+++ b/webapp/app/js/controllers/models.js
@@ -18,7 +18,7 @@
 
 'use strict';
 
-KylinApp.controller('ModelsCtrl', function ($scope, $q, $routeParams, $location, $window, $modal, MessageService, CubeDescService, CubeService, JobService, UserService, ProjectService, SweetAlert, loadingRequest, $log, modelConfig, ProjectModel, ModelService, MetaModel, modelsManager, cubesManager, TableModel, AccessService) {
+KylinApp.controller('ModelsCtrl', function ($scope, $q, $routeParams, $location, $window, $modal, MessageService, CubeDescService, CubeService, JobService, UserService, ProjectService, SweetAlert, loadingRequest, $log, modelConfig, ProjectModel, ModelService, MetaModel, modelsManager, cubesManager, TableModel, AccessService, MessageBox) {
 
   //tree data
 
@@ -110,7 +110,7 @@ KylinApp.controller('ModelsCtrl', function ($scope, $q, $routeParams, $location,
         ModelService.drop({modelId: model.name}, {}, function (result) {
           loadingRequest.hide();
 //                    CubeList.removeCube(cube);
-          SweetAlert.swal('Success!', 'Model drop is done successfully', 'success');
+          MessageBox.successNotify('Model drop is done successfully');
           location.reload();
         }, function (e) {
           loadingRequest.hide();
@@ -247,7 +247,7 @@ KylinApp.controller('ModelsCtrl', function ($scope, $q, $routeParams, $location,
 });
 
 
-var modelCloneCtrl = function ($scope, $modalInstance, CubeService, MessageService, $location, model, MetaModel, SweetAlert,ProjectModel, loadingRequest,ModelService) {
+var modelCloneCtrl = function ($scope, $modalInstance, CubeService, MessageService, $location, model, MetaModel, SweetAlert,ProjectModel, loadingRequest,ModelService, MessageBox) {
   $scope.projectModel = ProjectModel;
 
   $scope.targetObj={
@@ -285,7 +285,7 @@ var modelCloneCtrl = function ($scope, $modalInstance, CubeService, MessageServi
         loadingRequest.show();
         ModelService.clone({modelId: model.name}, $scope.modelRequest, function (result) {
           loadingRequest.hide();
-          SweetAlert.swal('Success!', 'Clone model successfully', 'success');
+          MessageBox.successNotify('Clone model successfully');
           location.reload();
         }, function (e) {
           loadingRequest.hide();
diff --git a/webapp/app/js/controllers/page.js b/webapp/app/js/controllers/page.js
index 04a53174f5..5416013a7c 100644
--- a/webapp/app/js/controllers/page.js
+++ b/webapp/app/js/controllers/page.js
@@ -210,7 +210,7 @@ KylinApp.controller('PageCtrl', function ($scope, $q, AccessService, $modal, $lo
 
 });
 
-var projCtrl = function ($scope, $location, $modalInstance, ProjectService, MessageService, projects, project, SweetAlert, ProjectModel, $cookieStore, $route, $timeout) {
+var projCtrl = function ($scope, $location, $modalInstance, ProjectService, MessageService, projects, project, SweetAlert, ProjectModel, $cookieStore, $route, $timeout, MessageBox) {
   $scope.state = {
     isEdit: false,
     oldProjName: null,
@@ -246,7 +246,7 @@ var projCtrl = function ($scope, $location, $modalInstance, ProjectService, Mess
 	delete $scope.proj.override_kylin_properties[""];
     if ($scope.state.isEdit) {
       ProjectService.update({}, {formerProjectName: $scope.state.oldProjName, projectDescData: angular.toJson($scope.proj)}, function (newProj) {
-        SweetAlert.swal('Success!', 'Project update successfully!', 'success');
+        MessageBox.successNotify('Project update successfully!');
 
         //update project in project model
         ProjectModel.updateProject($scope.proj.name, $scope.state.oldProjName);
@@ -267,12 +267,7 @@ var projCtrl = function ($scope, $location, $modalInstance, ProjectService, Mess
       ProjectService.save({}, {projectDescData: angular.toJson($scope.proj)}, function (newProj) {
         $modalInstance.dismiss('cancel');
         $cookieStore.put("project", newProj.name);
-        SweetAlert.swal({
-          title: "Success!",
-          text: "New project created successfully!",
-          confirmButtonClass: 'btn-primary',
-          type: "success"
-        },function(){
+        MessageBox.successAlert("New project created successfully!", function(){
           location.reload();
         });
 
diff --git a/webapp/app/js/controllers/projects.js b/webapp/app/js/controllers/projects.js
index efad67c36f..885e5a2a28 100644
--- a/webapp/app/js/controllers/projects.js
+++ b/webapp/app/js/controllers/projects.js
@@ -19,7 +19,7 @@
 'use strict';
 
 KylinApp
-    .controller('ProjectCtrl', function ($scope, $modal, $q, ProjectService, MessageService,SweetAlert,$log,kylinConfig,projectConfig,ProjectModel) {
+    .controller('ProjectCtrl', function ($scope, $modal, $q, ProjectService, MessageService,SweetAlert,$log,kylinConfig,projectConfig,ProjectModel, MessageBox) {
 
         $scope.projects = [];
         $scope.loading = false;
@@ -78,7 +78,7 @@ KylinApp
                             $scope.projects.splice(pIndex, 1);
                         }
                         ProjectModel.removeProject(project.name);
-                        SweetAlert.swal('Success!',"Project [" + project.name + "] has been deleted successfully!", 'success');
+                        MessageBox.successNotify("Project [" + project.name + "] has been deleted successfully!");
                     },function(e){
                         if(e.data&& e.data.exception){
                             var message =e.data.exception;
diff --git a/webapp/app/js/controllers/sourceMeta.js b/webapp/app/js/controllers/sourceMeta.js
index 49d899849c..1fc0feed27 100755
--- a/webapp/app/js/controllers/sourceMeta.js
+++ b/webapp/app/js/controllers/sourceMeta.js
@@ -19,7 +19,7 @@
 'use strict';
 
 KylinApp
-  .controller('SourceMetaCtrl', function ($scope, $cacheFactory, $q, $window, $routeParams, CubeService, $modal, TableService, $route, loadingRequest, SweetAlert, tableConfig, TableModel,cubeConfig) {
+  .controller('SourceMetaCtrl', function ($scope, $cacheFactory, $q, $window, $routeParams, CubeService, $modal, TableService, $route, loadingRequest, SweetAlert, tableConfig, TableModel,cubeConfig, MessageBox) {
     var $httpDefaultCache = $cacheFactory.get('$http');
     $scope.tableModel = TableModel;
     $scope.tableModel.selectedSrcDb = [];
@@ -171,7 +171,7 @@ KylinApp
           SweetAlert.swal('Failed!', 'Failed to load following table(s): ' + unloadedTableInfo, 'error');
         }
         if (result['result.loaded'].length != 0 && result['result.unloaded'].length == 0) {
-          SweetAlert.swal('Success!', 'The following table(s) have been successfully loaded: ' + loadTableInfo, 'success');
+          MessageBox.successNotify('The following table(s) have been successfully loaded: ' + loadTableInfo);
         }
         if (result['result.loaded'].length != 0 && result['result.unloaded'].length != 0) {
           SweetAlert.swal('Partial loaded!', 'The following table(s) have been successfully loaded: ' + loadTableInfo + "\n\n Failed to load following table(s):" + unloadedTableInfo, 'warning');
@@ -221,7 +221,7 @@ KylinApp
               SweetAlert.swal('Failed!', 'Failed to unload following table(s): ' + unRemovedTableInfo, 'error');
             }
             if (result['result.unload.success'].length != 0 && result['result.unload.fail'].length == 0) {
-              SweetAlert.swal('Success!', 'The following table(s) have been successfully unloaded: ' + removedTableInfo, 'success');
+              MessageBox.successNotify('The following table(s) have been successfully unloaded: ' + removedTableInfo);
             }
             if (result['result.unload.success'].length != 0 && result['result.unload.fail'].length != 0) {
               SweetAlert.swal('Partial unloaded!', 'The following table(s) have been successfully unloaded: ' + removedTableInfo + "\n\n Failed to unload following table(s):" + unRemovedTableInfo, 'warning');
@@ -543,7 +543,7 @@ KylinApp
           kafkaConfig: angular.toJson($scope.kafkaMeta)
         }, function (request) {
           if (request.successful) {
-            SweetAlert.swal('', 'Updated the streaming successfully.', 'success');
+            MessageBox.successNotify('Updated the streaming successfully.');
             $scope.cancel();
           } else {
             var message = request.message;
@@ -842,7 +842,7 @@ KylinApp
                 kafkaConfig: angular.toJson($scope.kafkaMeta)
               }, function (request) {
                 if (request.successful) {
-                  SweetAlert.swal('', 'Updated the streaming successfully.', 'success');
+                  MessageBox.successNotify('Updated the streaming successfully.');
                   $location.path("/models");
                 } else {
                   var message = request.message;
@@ -882,7 +882,7 @@ KylinApp
                 kafkaConfig: angular.toJson($scope.kafkaMeta)
               }, function (request) {
                 if (request.successful) {
-                  SweetAlert.swal('', 'Created the streaming successfully.', 'success');
+                  MessageBox.successNotify('Created the streaming successfully.');
                   $scope.cancel();
                   scope.aceSrcTbLoaded(true);
                 } else {
diff --git a/webapp/app/js/services/notify.js b/webapp/app/js/services/notify.js
new file mode 100644
index 0000000000..ce1fbd5b85
--- /dev/null
+++ b/webapp/app/js/services/notify.js
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+KylinApp.service('MessageBox', function (SweetAlert, MessageService) {
+  this.successNotify = function(message) {
+    MessageService.sendMsg(message, 'success', {});
+  }
+
+  this.successAlert = function(message, callback) {
+    SweetAlert.swal({
+      title: "Success!",
+      text: message,
+      confirmButtonClass: 'btn-primary',
+      type: "success"
+    }, callback);
+  }
+});
\ No newline at end of file


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services