Explorar o código

[frontend] Introduced a new info message popup (#3571)

Ananya_Agarwal hai 1 ano
pai
achega
5eebfb73fe
Modificáronse 34 ficheiros con 86 adicións e 75 borrados
  1. 6 6
      apps/about/src/about/templates/admin_wizard.mako
  2. 2 2
      apps/beeswax/src/beeswax/static/beeswax/js/autocomplete.utils.js
  3. 2 2
      apps/beeswax/src/beeswax/templates/execute.mako
  4. 6 5
      apps/filebrowser/src/filebrowser/templates/listdir_components.mako
  5. 5 5
      apps/jobbrowser/src/jobbrowser/templates/job_browser.mako
  6. 1 1
      apps/oozie/src/oozie/static/oozie/js/bundle-editor.ko.js
  7. 1 1
      apps/oozie/src/oozie/static/oozie/js/coordinator-editor.ko.js
  8. 1 1
      apps/oozie/src/oozie/static/oozie/js/workflow-editor.ko.js
  9. 3 3
      apps/oozie/src/oozie/templates/editor/edit_workflow.mako
  10. 1 1
      apps/pig/src/pig/templates/app.mako
  11. 3 3
      apps/security/src/security/static/security/js/hive.ko.js
  12. 3 3
      apps/security/src/security/static/security/js/sentry.ko.js
  13. 4 4
      apps/security/src/security/templates/hdfs.mako
  14. 3 3
      apps/security/src/security/templates/hive.mako
  15. 3 3
      apps/security/src/security/templates/sentry.mako
  16. 4 4
      apps/sqoop/src/sqoop/templates/app.mako
  17. 3 1
      desktop/core/src/desktop/js/apps/editor/EditorViewModel.js
  18. 1 1
      desktop/core/src/desktop/js/apps/editor/notebook.js
  19. 4 2
      desktop/core/src/desktop/js/apps/editor/snippet.js
  20. 3 1
      desktop/core/src/desktop/js/apps/notebook/NotebookViewModel.js
  21. 1 1
      desktop/core/src/desktop/js/apps/notebook/notebook.js
  22. 4 2
      desktop/core/src/desktop/js/apps/notebook/snippet.js
  23. 1 1
      desktop/core/src/desktop/js/apps/tableBrowser/metastoreTable.js
  24. 1 1
      desktop/core/src/desktop/js/jquery/plugins/jquery.filechooser.js
  25. 4 2
      desktop/core/src/desktop/js/ko/bindings/ko.dropzone.js
  26. 2 2
      desktop/core/src/desktop/js/ko/components/ko.sentryPrivileges.js
  27. 1 1
      desktop/core/src/desktop/templates/common_footer_m.mako
  28. 1 1
      desktop/core/src/desktop/templates/common_header_footer_components.mako
  29. 4 4
      desktop/core/src/desktop/templates/home.mako
  30. 1 1
      desktop/libs/dashboard/src/dashboard/static/dashboard/js/create-collections.ko.js
  31. 1 1
      desktop/libs/dashboard/src/dashboard/static/dashboard/js/search.ko.js
  32. 2 2
      desktop/libs/dashboard/src/dashboard/templates/common_admin_collections.mako
  33. 2 2
      desktop/libs/indexer/src/indexer/static/indexer/js/collections.js
  34. 2 2
      desktop/libs/indexer/src/indexer/static/indexer/js/indexes.ko.js

+ 6 - 6
apps/about/src/about/templates/admin_wizard.mako

@@ -330,10 +330,10 @@ ${ layout.menubar(section='quick_start') }
           connector: connector.id
         }, function(data) {
           if (data.message) {
-            $(document).trigger('info', data.message);
+            huePubSub.publish('hue.global.info', { message: data.message });
           }
           if (data.errorMessage) {
-            huePubSub.publish('hue.global.error', {message: data.errorMessage});
+            huePubSub.publish('hue.global.error', { message: data.errorMessage });
           }
           if (data.status == 0 && $(event.target).data("is-connector")) {
             huePubSub.publish('cluster.config.refresh.config');
@@ -350,9 +350,9 @@ ${ layout.menubar(section='quick_start') }
     $.post(button.data("sample-url"), function(data) {
       if (data.status == 0) {
         if (data.message) {
-          $(document).trigger('info', data.message);
+          huePubSub.publish('hue.global.info', { message: data.message });
         } else {
-          $(document).trigger('info', '${ _("Examples refreshed") }');
+          huePubSub.publish('hue.global.info', { message: '${ _("Examples refreshed") }'});
         }
         if ($(button).data("is-connector")) {
           huePubSub.publish('cluster.config.refresh.config');
@@ -413,7 +413,7 @@ ${ layout.menubar(section='quick_start') }
       });
       $.when.apply(this, calls)
       .then(function() {
-        $(document).trigger('info', '${ _("Examples refreshed") }');
+        huePubSub.publish('hue.global.info', { message: '${ _("Examples refreshed") }'});
       })
       .always(function(data) {
         $(button).button('reset');
@@ -491,7 +491,7 @@ ${ layout.menubar(section='quick_start') }
     $(".updatePreferences").click(function () {
       $.post("${ url('about:update_preferences') }", $("input").serialize(), function(data) {
         if (data.status == 0) {
-          $(document).trigger('info', '${ _("Configuration updated") }');
+          huePubSub.publish('hue.global.info', { message: '${ _("Configuration updated") }'});
         } else {
           huePubSub.publish('hue.global.error', {message: data.data});
         }

+ 2 - 2
apps/beeswax/src/beeswax/static/beeswax/js/autocomplete.utils.js

@@ -222,10 +222,10 @@ function hac_errorHandler(data) {
   $(document).trigger('error.autocomplete');
   if (typeof HIVE_AUTOCOMPLETE_FAILS_SILENTLY_ON == "undefined" || data.code == null || HIVE_AUTOCOMPLETE_FAILS_SILENTLY_ON.indexOf(data.code) == -1){
     if (typeof HIVE_AUTOCOMPLETE_FAILS_QUIETLY_ON != "undefined" && HIVE_AUTOCOMPLETE_FAILS_QUIETLY_ON.indexOf(data.code) > -1){
-      $(document).trigger('info', data.error);
+      huePubSub.publish('hue.global.info', { message: data.error });
     }
     else {
-      huePubSub.publish('hue.global.error', {message: data.error});
+      huePubSub.publish('hue.global.error', { message: data.error });
     }
   }
 }

+ 2 - 2
apps/beeswax/src/beeswax/templates/execute.mako

@@ -2392,7 +2392,7 @@ $(document).on('server.unmanageable_error', function (e, responseText) {
 // Other
 $(document).on('saved.design', function (e, id) {
   $('#saveAs').modal('hide');
-  $(document).trigger('info', "${_('Query saved.')}");
+  huePubSub.publish('hue.global.info', { message: "${_('Query saved.')}"});
   huePubSub.publish('open.link', "/${ app_name }/execute/design/" + id);
 });
 $(document).on('error_save.design', function (e, message) {
@@ -2440,7 +2440,7 @@ $(document).on('error_cancel.query', function (e, message) {
   huePubSub.publish('hue.global.error', {message: "${ _('Problem: ') }" + message});
 });
 $(document).on('cancelled.query', function (e) {
-  $(document).trigger("info", "${ _('Query canceled!') }")
+  huePubSub.publish('hue.global.info', { message: "${ _('Query canceled!') }"});
 });
 
 function updateSidebarTooltips(selector) {

+ 6 - 5
apps/filebrowser/src/filebrowser/templates/listdir_components.mako

@@ -2093,10 +2093,10 @@ else:
                   onComplete: function (id, fileName, response) {
                     self.pendingUploads(self.pendingUploads() - 1);
                     if (response.status != 0) {
-                      $(document).trigger('error', "${ _('Error: ') }" + response.data);
+                      huePubSub.publish('hue.global.error', {message: "${ _('Error: ') }" + response.data});
                     }
                     else {
-                      $(document).trigger('info', response.path + "${ _(' uploaded successfully.') }");
+                      huePubSub.publish('hue.global.info', {message: response.path + "${ _(' uploaded successfully.') }"});
                       self.filesToHighlight.push(response.path);
                     }
                     if (self.pendingUploads() == 0) {
@@ -2158,10 +2158,11 @@ else:
               onComplete: function (id, fileName, response) {
                 self.pendingUploads(self.pendingUploads() - 1);
                 if (response.status != 0) {
-                  $(document).trigger('error', "${ _('Error: ') }" + response.data);
+                  huePubSub.publish('hue.global.error', {message: "${ _('Error: ') }" + response.data});
+                  
                 }
                 else {
-                  $(document).trigger('info', response.path + "${ _(' uploaded successfully.') }");
+                  huePubSub.publish('hue.global.info', {message: response.path + "${ _(' uploaded successfully.') }");
                   self.filesToHighlight.push(response.path);
                 }
                 if (self.pendingUploads() == 0) {
@@ -2374,7 +2375,7 @@ else:
                   if (response.status != 0) {
                     huePubSub.publish('hue.global.error', {message: response.data});
                   } else {
-                    $(document).trigger('info', response.path + ' ' + I18n('uploaded successfully'));
+                    huePubSub.publish('hue.global.info', { message: response.path + ' ' + I18n('uploaded successfully')});
                     fileBrowserViewModel.filesToHighlight.push(response.path);
                   }
                 }

+ 5 - 5
apps/jobbrowser/src/jobbrowser/templates/job_browser.mako

@@ -3478,7 +3478,7 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
           });
         } else {
           vm.jobs._control([self.id()], action, function(data) {
-            $(document).trigger("info", data.message);
+            huePubSub.publish('hue.global.info', { message: data.message });
             self.fetchStatus();
           });
         }
@@ -3519,7 +3519,7 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
           "auto_resize_cpu": self.updateClusterAutoResizeCpu()
         }, function(data) {
           console.log(ko.mapping.toJSON(data));
-          ## $(document).trigger("info", ko.mapping.toJSON(data));
+          ## huePubSub.publish('hue.global.info', { message: ko.mapping.toJSON(data) });
           self.updateJob();
         });
       }
@@ -3895,7 +3895,7 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
             "namespace_name": "crn:altus:sdx:us-west-1:12a0079b-1591-4ca0-b721-a446bda74e67:namespace:analytics/7ea35fe5-dbc9-4b17-92b1-97a1ab32e410"
           }, function(data) {
             console.log(ko.mapping.toJSON(data));
-            $(document).trigger("info", ko.mapping.toJSON(data));
+            huePubSub.publish('hue.global.info', { message: ko.mapping.toJSON(data) });
             self.updateJobs();
             huePubSub.publish('context.catalog.refresh');
           });
@@ -3914,7 +3914,7 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
           }, function(data) {
             console.log(ko.mapping.toJSON(data));
             self.createClusterFormReset();
-            ##$(document).trigger("info", ko.mapping.toJSON(data));
+            ##huePubSub.publish('hue.global.info', { message: ko.mapping.toJSON(data) });
             self.updateJobs();
             huePubSub.publish('context.catalog.refresh');
           });
@@ -3957,7 +3957,7 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
             }),
             action,
             function(data) {
-              $(document).trigger("info", data.message);
+              huePubSub.publish('hue.global.info', { message: data.message });
               self.updateJobs();
             }
           )

+ 1 - 1
apps/oozie/src/oozie/static/oozie/js/bundle-editor.ko.js

@@ -121,7 +121,7 @@ var BundleEditorViewModel = function (bundle_json, coordinators_json, can_edit_j
           }
           self.bundle.id(data.id);
           self.bundle.tracker().markCurrentStateAsClean();
-          $(document).trigger("info", data.message);
+          huePubSub.publish('hue.global.info', { message: data.message });
           hueUtils.changeURL('/hue/oozie/editor/bundle/edit/?bundle=' + data.id);
         }
         else {

+ 1 - 1
apps/oozie/src/oozie/static/oozie/js/coordinator-editor.ko.js

@@ -259,7 +259,7 @@ var CoordinatorEditorViewModel = (function () {
             if (typeof cb === 'function') {
               cb(data);
             } else {
-              $(document).trigger("info", data.message);
+              huePubSub.publish('hue.global.info', { message: data.message });
             }
             if (!cb) { // cb from integrated scheduler
               hueUtils.changeURL('/hue/oozie/editor/coordinator/edit/?coordinator=' + data.id);

+ 1 - 1
apps/oozie/src/oozie/static/oozie/js/workflow-editor.ko.js

@@ -1213,7 +1213,7 @@ var WorkflowEditorViewModel = function (layout_json, workflow_json, credentials_
             shareViewModel.setDocUuid(data.doc_uuid);
           }
           self.workflow.id(data.id);
-          $(document).trigger("info", data.message);
+          huePubSub.publish('hue.global.info', { message: data.message });
           self.workflow.tracker().markCurrentStateAsClean();
           huePubSub.publish('assist.document.refresh');
           hueUtils.changeURL('/hue/oozie/editor/workflow/edit/?workflow=' + data.id);

+ 3 - 3
apps/oozie/src/oozie/templates/editor/edit_workflow.mako

@@ -636,7 +636,7 @@ function workflow_save_success(data) {
   if (data.status != 0) {
     huePubSub.publish('hue.global.error', {message: interpret_server_error(data, "${ _('Could not save workflow') }")});
   } else {
-    $(document).trigger("info", "${ _('Workflow saved') }");
+    huePubSub.publish('hue.global.info', { message: "${ _('Workflow saved') }"});
     workflow.reload(data.data);
     workflow.is_dirty( false );
     workflow.loading( false );
@@ -902,7 +902,7 @@ $('#importJobsub').on('click', '.action-row', function(e) {
 
           workflow.el.trigger('workflow:rebuild');
           routie('editWorkflow');
-          $(document).trigger("info", "${ _('Action imported at the top of the workflow.') } ");
+          huePubSub.publish('hue.global.info', { message: "${ _('Action imported at the top of the workflow.') } "});
         } else {
           huePubSub.publish('hue.global.error', {message: interpret_server_error(data, "${ _('Received invalid response from server') }")});
         }
@@ -943,7 +943,7 @@ $('#importOozieAction').on('click', '.action-row', function(e) {
 
     workflow.el.trigger('workflow:rebuild');
     routie('editWorkflow');
-    $(document).trigger("info", "${ _('Action imported at the top of the workflow.') }");
+    huePubSub.publish('hue.global.info', { message: "${ _('Action imported at the top of the workflow.') }"});
   }
 });
 

+ 1 - 1
apps/pig/src/pig/templates/app.mako

@@ -1429,7 +1429,7 @@ ${ commonshare() | n,unicode }
   };
 
   function showAlert(msg) {
-    $(document).trigger("info", msg);
+    huePubSub.publish('hue.global.info', { message: msg });
   }
 
 </script>

+ 3 - 3
apps/security/src/security/static/security/js/hive.ko.js

@@ -287,7 +287,7 @@ var HiveViewModel = (function () {
           role: ko.mapping.toJSON(self)
         }, function (data) {
           if (data.status == 0) {
-            $(document).trigger("info", data.message);
+            huePubSub.publish('hue.global.info', { message: data.message });
             vm.showCreateRole(false);
             self.reset();
             var role = new Role(vm, data.role);
@@ -314,7 +314,7 @@ var HiveViewModel = (function () {
           role: ko.mapping.toJSON(self)
         }, function (data) {
           if (data.status == 0) {
-            $(document).trigger("info", data.message);
+            huePubSub.publish('hue.global.info', { message: data.message });
             vm.showCreateRole(false);
             vm.list_sentry_privileges_by_authorizable();
             $(document).trigger("createdRole");
@@ -1131,7 +1131,7 @@ var HiveViewModel = (function () {
         },
         success: function (data) {
           if (data.status == 0) {
-            $(document).trigger("info", data.message);
+            huePubSub.publish('hue.global.info', { message: data.message });
             self.assist.refreshTree();
             self.clearTempRoles();
             $(document).trigger("createdRole");

+ 3 - 3
apps/security/src/security/static/security/js/sentry.ko.js

@@ -306,7 +306,7 @@ var SentryViewModel = (function () {
           component: vm.component()
         }, function (data) {
           if (data.status == 0) {
-            $(document).trigger("info", data.message);
+            huePubSub.publish('hue.global.info', { message: data.message });
             vm.showCreateRole(false);
             self.reset();
             var role = new Role(vm, data.role);
@@ -331,7 +331,7 @@ var SentryViewModel = (function () {
           component: vm.component()
         }, function (data) {
           if (data.status == 0) {
-            $(document).trigger("info", data.message);
+            huePubSub.publish('hue.global.info', { message: data.message });
             vm.showCreateRole(false);
             vm.list_sentry_privileges_by_authorizable();
             $(document).trigger("createdRole");
@@ -1199,7 +1199,7 @@ var SentryViewModel = (function () {
         },
         success: function (data) {
           if (data.status == 0) {
-            $(document).trigger("info", data.message);
+            huePubSub.publish('hue.global.info', { message: data.message });
             self.assist.refreshTree();
             self.clearTempRoles();
             $(document).trigger("createdRole");

+ 4 - 4
apps/security/src/security/templates/hdfs.mako

@@ -352,21 +352,21 @@ ${ tree.import_templates(itemClick='$root.assist.setPath', iconClick='$root.assi
       });
 
       $(document).on("updatedAcls", function() {
-        $(document).trigger("info", "${ _('The selected ACLs have been successfully updated.') }");
+        huePubSub.publish('hue.global.info', { message: "${ _('The selected ACLs have been successfully updated.') }"});
       });
 
       $(document).on("addedBulkAcls", function() {
-        $(document).trigger("info", "${ _('The current ACLs have been successfully added to the checked paths.') }");
+        huePubSub.publish('hue.global.info', { message: "${ _('The current ACLs have been successfully added to the checked paths.') }"});
         $("#bulkActionsModal").modal("hide");
       });
 
       $(document).on("deletedBulkAcls", function() {
-        $(document).trigger("info", "${ _('All the ACLs have been successfully removed from the checked paths.') }");
+        huePubSub.publish('hue.global.info', { message: "${ _('All the ACLs have been successfully removed from the checked paths.') }"});
         $("#bulkActionsModal").modal("hide");
       });
 
       $(document).on("syncdBulkAcls", function() {
-        $(document).trigger("info", "${ _('All the ACLs for the checked items have been replaced with the current selection.') }");
+        huePubSub.publish('hue.global.info', { message: "${ _('All the ACLs for the checked items have been replaced with the current selection.') }"});
         $("#bulkActionsModal").modal("hide");
       });
 

+ 3 - 3
apps/security/src/security/templates/hive.mako

@@ -725,17 +725,17 @@ ${ tree.import_templates(itemClick='$root.assist.setPath', iconClick='$root.assi
       });
 
       $(document).on("addedBulkPrivileges", function() {
-        $(document).trigger("info", "${ _('The current privileges have been successfully added to the checked items.') }");
+        huePubSub.publish('hue.global.info', { message: "${ _('The current privileges have been successfully added to the checked items.') }"});
         $("#bulkActionsModal").modal("hide");
       });
 
       $(document).on("deletedBulkPrivileges", function() {
-        $(document).trigger("info", "${ _('All the privileges have been successfully removed from the checked items.') }");
+        huePubSub.publish('hue.global.info', { message: "${ _('All the privileges have been successfully removed from the checked items.') }"});
         $("#bulkActionsModal").modal("hide");
       });
 
       $(document).on("syncdBulkPrivileges", function() {
-        $(document).trigger("info", "${ _('All the privileges for the checked items have been replaced with the current selection.') }");
+        huePubSub.publish('hue.global.info', { message: "${ _('All the privileges for the checked items have been replaced with the current selection.') }"});
         $("#bulkActionsModal").modal("hide");
       });
 

+ 3 - 3
apps/security/src/security/templates/sentry.mako

@@ -779,17 +779,17 @@ ${ tree.import_templates(itemClick='$root.assist.setPath', iconClick='$root.assi
       });
 
       $(document).on("addedBulkPrivileges", function () {
-        $(document).trigger("info", "${ _('The current privileges have been successfully added to the checked items.') }");
+        huePubSub.publish('hue.global.info', { message: "${ _('The current privileges have been successfully added to the checked items.') }"});
         $("#bulkActionsModal").modal("hide");
       });
 
       $(document).on("deletedBulkPrivileges", function () {
-        $(document).trigger("info", "${ _('All the privileges have been successfully removed from the checked items.') }");
+        huePubSub.publish('hue.global.info', { message: "${ _('All the privileges have been successfully removed from the checked items.') }"});
         $("#bulkActionsModal").modal("hide");
       });
 
       $(document).on("syncdBulkPrivileges", function () {
-        $(document).trigger("info", "${ _('All the privileges for the checked items have been replaced with the current selection.') }");
+        huePubSub.publish('hue.global.info', { message: "${ _('All the privileges for the checked items have been replaced with the current selection.') }"});
         $("#bulkActionsModal").modal("hide");
       });
 

+ 4 - 4
apps/sqoop/src/sqoop/templates/app.mako

@@ -823,19 +823,19 @@ $(document).on('link_error.jobs', function(e, name, options, jqXHR) {
 });
 
 $(document).on('start.job', function(e, options, job) {
-  $(document).trigger("info", "${ _('The job is starting...') }");
+  huePubSub.publish('hue.global.info', { message:  "${ _('The job is starting...') }"});
 });
 
 $(document).on('started.job', function(e, job, options, submission_dict) {
-  $(document).trigger("info", "${ _('Started job.') }");
+  huePubSub.publish('hue.global.info', { message: "${ _('Started job.') }"});
 });
 
 $(document).on('start_fail.job', function(e, job, options, error) {
-  huePubSub.publish('hue.global.error', {message: "${ _('Error: ') }" + (typeof error.exception != "undefined" ? error.exception : error)});
+  huePubSub.publish('hue.global.error', { message: "${ _('Error: ') }" + (typeof error.exception != "undefined" ? error.exception : error)});
 });
 
 $(document).on('stopped.job', function(e, job, options, submission_dict) {
-  $(document).trigger("info", "${ _('Stopped job.') }");
+  huePubSub.publish('hue.global.info', {message: "${ _('Stopped job.') }"});
 });
 
 $(document).on('stop_fail.job', function(e, job, options, submission_dict) {

+ 3 - 1
desktop/core/src/desktop/js/apps/editor/EditorViewModel.js

@@ -223,7 +223,9 @@ export default class EditorViewModel {
           const options = {
             successCallback: result => {
               if (result && result.exists) {
-                $(document).trigger('info', result.path + ' saved successfully.');
+                huePubSub.publish('hue.global.info', {
+                  message: result.path + ' saved successfully.'
+                });
               }
             }
           };

+ 1 - 1
desktop/core/src/desktop/js/apps/editor/notebook.js

@@ -331,7 +331,7 @@ export default class Notebook {
         this.isSaved(true);
         const wasHistory = this.isHistory();
         this.isHistory(false);
-        $(document).trigger('info', data.message);
+        huePubSub.publish('hue.global.info', { message: data.message });
         if (editorMode) {
           huePubSub.publish(UPDATE_SAVED_QUERIES_EVENT, data);
 

+ 4 - 2
desktop/core/src/desktop/js/apps/editor/snippet.js

@@ -1153,7 +1153,7 @@ export default class Snippet {
   uploadTableStats(options) {
     hueAnalytics.log('notebook', 'load_table_stats');
     if (options.showProgress) {
-      $(document).trigger('info', 'Preparing table data...');
+      huePubSub.publish('hue.global.info', { message: 'Preparing table data...' });
     }
 
     $.post(
@@ -1198,7 +1198,9 @@ export default class Snippet {
     }).then(data => {
       if (data.status === 0) {
         if (showProgress) {
-          $(document).trigger('info', 'Query processing: ' + data.upload_status.status.state);
+          huePubSub.publish('hue.global.info', {
+            message: 'Query processing: ' + data.upload_status.status.state
+          });
         }
         if (['WAITING', 'IN_PROGRESS'].indexOf(data.upload_status.status.state) !== -1) {
           window.setTimeout(() => {

+ 3 - 1
desktop/core/src/desktop/js/apps/notebook/NotebookViewModel.js

@@ -360,7 +360,9 @@ export default class NotebookViewModel {
           const options = {
             successCallback: function (result) {
               if (result && result.exists) {
-                $(document).trigger('info', result.path + ' saved successfully.');
+                huePubSub.publish('hue.global.info', {
+                  message: result.path + ' saved successfully.'
+                });
               } else {
                 self._ajaxError(result);
               }

+ 1 - 1
desktop/core/src/desktop/js/apps/notebook/notebook.js

@@ -503,7 +503,7 @@ class Notebook {
             self.isSaved(true);
             const wasHistory = self.isHistory();
             self.isHistory(false);
-            $(document).trigger('info', data.message);
+            huePubSub.publish('hue.global.info', { message: data.message });
             if (editorMode) {
               if (!data.save_as) {
                 const existingQuery = self

+ 4 - 2
desktop/core/src/desktop/js/apps/notebook/snippet.js

@@ -2675,7 +2675,7 @@ class Snippet {
     self.uploadTableStats = function (options) {
       hueAnalytics.log('notebook', 'load_table_stats');
       if (options.showProgress) {
-        $(document).trigger('info', 'Preparing table data...');
+        huePubSub.publish('hue.global.info', { message: 'Preparing table data...' });
       }
 
       $.post(
@@ -2725,7 +2725,9 @@ class Snippet {
         data => {
           if (data.status == 0) {
             if (showProgress) {
-              $(document).trigger('info', 'Query processing: ' + data.upload_status.status.state);
+              huePubSub.publish('hue.global.info', {
+                message: 'Query processing: ' + data.upload_status.status.state
+              });
             }
             if (['WAITING', 'IN_PROGRESS'].indexOf(data.upload_status.status.state) != -1) {
               window.setTimeout(() => {

+ 1 - 1
desktop/core/src/desktop/js/apps/tableBrowser/metastoreTable.js

@@ -382,7 +382,7 @@ class MetastoreTable {
           }
         })
         .fail(xhr => {
-          $(document).trigger('info', xhr.responseText);
+          huePubSub.publish('hue.global.info', { message: xhr.responseText });
         });
     };
   }

+ 1 - 1
desktop/core/src/desktop/js/jquery/plugins/jquery.filechooser.js

@@ -787,7 +787,7 @@ Plugin.prototype.navigateTo = function (path) {
     }
   }).fail(e => {
     if (!_parent.options.suppressErrors) {
-      $(document).trigger('info', _parent.options.labels.FILE_NOT_FOUND);
+      huePubSub.publish('hue.global.info', { message: _parent.options.labels.FILE_NOT_FOUND });
       _parent.options.onError();
     }
     if (e.status === 404 || e.status === 500) {

+ 4 - 2
desktop/core/src/desktop/js/ko/bindings/ko.dropzone.js

@@ -17,8 +17,8 @@
 import Dropzone from 'dropzone';
 import $ from 'jquery';
 import * as ko from 'knockout';
-
 import huePubSub from 'utils/huePubSub';
+
 import I18n from 'utils/i18n';
 
 // TODO: Depends on Dropzone
@@ -83,7 +83,9 @@ ko.bindingHandlers.dropzone = {
                 value.onError(file.name);
               }
             } else {
-              $(document).trigger('info', response.path + ' ' + I18n('uploaded successfully'));
+              huePubSub.publish('hue.global.info', {
+                message: response.path + ' ' + I18n('uploaded successfully')
+              });
               if (value.onComplete) {
                 value.onComplete(response.path);
               }

+ 2 - 2
desktop/core/src/desktop/js/ko/components/ko.sentryPrivileges.js

@@ -502,7 +502,7 @@ class Role {
           },
           data => {
             if (data.status === 0) {
-              $(document).trigger('info', data.message);
+              huePubSub.publish('hue.global.info', { message: data.message });
               vm.showCreateRole(false);
               self.reset();
               const role = new Role(vm, data.role);
@@ -535,7 +535,7 @@ class Role {
           },
           data => {
             if (data.status === 0) {
-              $(document).trigger('info', data.message);
+              huePubSub.publish('hue.global.info', { message: data.message });
               vm.showCreateRole(false);
               vm.listSentryPrivilegesByAuthorizable();
               $(document).trigger('createdRole');

+ 1 - 1
desktop/core/src/desktop/templates/common_footer_m.mako

@@ -46,7 +46,7 @@ else:
         %elif message.tags == 'warning':
           $(document).trigger('warn', '${ escapejs(escape(message))' });
         %else:
-          $(document).trigger('info', '${ escapejs(escape(message)) }');
+          huePubSub.publish('hue.global.info', { message: '${ escapejs(escape(message)) }'});
         %endif
       %endfor
     %endif

+ 1 - 1
desktop/core/src/desktop/templates/common_header_footer_components.mako

@@ -371,7 +371,7 @@ else:
         %elif message.tags == 'warning':
           $(document).trigger('warn', '${ escapejs(escape(message)) }');
         %else:
-          $(document).trigger('info', '${ escapejs(escape(message)) }');
+          huePubSub.publish('hue.global.info', { message: '${ escapejs(escape(message)) }'});
         %endif
       %endfor
     %endif

+ 4 - 4
desktop/core/src/desktop/templates/home.mako

@@ -420,7 +420,7 @@ ${ commonshare() | n,unicode }
           data.name = hueUtils.htmlEncode(data.name);
           viewModel.createTag(data);
           $("#tagsNew").val("");
-          $(document).trigger("info", "${_('Project created')}");
+          huePubSub.publish('hue.global.info', { message: "${_('Project created')}"});
           $("#addTagModal").modal("hide");
         }
       }).fail(function (xhr, textStatus, errorThrown) {
@@ -454,7 +454,7 @@ ${ commonshare() | n,unicode }
     }, function (response) {
       if (response != null) {
         if (response.status == 0) {
-          $(document).trigger("info", response.message);
+          huePubSub.publish('hue.global.info', { message: response.message});
           $("#removeTagModal").modal("hide");
           viewModel.deleteTag(tag);
           viewModel.filterDocs(viewModel.history());
@@ -487,10 +487,10 @@ ${ commonshare() | n,unicode }
     }, function (response) {
       if (response != null) {
         if (response.status != 0) {
-          huePubSub.publish('hue.global.error', {message: "${_("There was an error processing your action: ")}" + response.message});
+          huePubSub.publish('hue.global.error', { message: "${_("There was an error processing your action: ")}" + response.message});
         }
         else {
-          $(document).trigger("info", "${ _("Project updated successfully.") }");
+          huePubSub.publish('hue.global.info', { message: "${ _("Project updated successfully.") }"});
           viewModel.updateDoc(response.doc);
         }
       }

+ 1 - 1
desktop/libs/dashboard/src/dashboard/static/dashboard/js/create-collections.ko.js

@@ -168,7 +168,7 @@ var CreateCollectionViewModel = function(steps) {
       })
       .done(function(data) {
         if (data.status == 0) {
-          $(document).trigger("info", data.message);
+          huePubSub.publish('hue.global.info', { message: data.message });
         } else {
           huePubSub.publish('hue.global.error', {message: data.message});
         }

+ 1 - 1
desktop/libs/dashboard/src/dashboard/static/dashboard/js/search.ko.js

@@ -2966,7 +2966,7 @@ var SearchViewModel = function (collection_json, query_json, initial_json, has_g
           }
           var oldId  = self.collection.id();
           self.collection.id(data.id);
-          $(document).trigger("info", data.message);
+          huePubSub.publish('hue.global.info', { message: data.message });
           if (oldId !== data.id) {
             hueUtils.changeURL('/hue/dashboard/?collection=' + data.id);
           }

+ 2 - 2
desktop/libs/dashboard/src/dashboard/templates/common_admin_collections.mako

@@ -226,11 +226,11 @@ ${ commonimportexport(request) | n,unicode }
     $(document).on("collectionDeleted", function () {
       $("#deleteModal").modal("hide");
       $("#deleteModalBtn").button("reset");
-      $(document).trigger("info", "${ _("Dashboard(s) deleted successfully.") }");
+      huePubSub.publish('hue.global.info', { message: "${ _("Dashboard(s) deleted successfully.") }"});
     });
 
     $(document).on("collectionCopied", function () {
-      $(document).trigger("info", "${ _("Dashboard(s) copied successfully.") }");
+      huePubSub.publish('hue.global.info', { message: "${ _("Dashboard(s) copied successfully.") }"});
     });
 
     $(document).on("confirmDelete", function () {

+ 2 - 2
desktop/libs/indexer/src/indexer/static/indexer/js/collections.js

@@ -357,7 +357,7 @@ var EditCollectionViewModel = function() {
       'type': self.sourceType()
     }).done(function(data) {
       if (data.status == 0) {
-        $(document).trigger("info", data.message);
+        huePubSub.publish('hue.global.info', { message: data.message });
       } else {
         huePubSub.publish('hue.global.error', {message: data.message});
       }
@@ -452,7 +452,7 @@ var ManageCollectionsViewModel = function() {
       'collection': ko.mapping.toJSON(collection)
     }).done(function(data) {
       self.isLoading(false);
-      $(document).trigger("info", data.message);
+      huePubSub.publish('hue.global.info', { message: data.message });
       self.fetchCollections();
     })
     .fail(function (xhr, textStatus, errorThrown) {

+ 2 - 2
desktop/libs/indexer/src/indexer/static/indexer/js/indexes.ko.js

@@ -357,7 +357,7 @@ var EditCollectionViewModel = function() {
       'type': self.sourceType()
     }).done(function(data) {
       if (data.status == 0) {
-        $(document).trigger("info", data.message);
+        huePubSub.publish('hue.global.info', { message: data.message });
       } else {
         huePubSub.publish('hue.global.error', {message: data.message});
       }
@@ -452,7 +452,7 @@ var ManageCollectionsViewModel = function() {
       'collection': ko.mapping.toJSON(collection)
     }).done(function(data) {
       self.isLoading(false);
-      $(document).trigger("info", data.message);
+      huePubSub.publish('hue.global.info', { message: data.message});
       self.fetchCollections();
     })
     .fail(function (xhr, textStatus, errorThrown) {