Browse Source

[frontend] Replace the use of jHueNotify with the new Alert component

With this change I've changed all alert usage throughout the code to use the new pubsub and Alert component. By doing this we can now get rid of some old code like the jquery.notify.js plugin as well as page events.
Johan Åhlén 1 year ago
parent
commit
56f13d2b4e
80 changed files with 436 additions and 673 deletions
  1. 3 1
      apps/beeswax/src/beeswax/templates/create_table_manually.mako
  2. 9 3
      apps/beeswax/src/beeswax/templates/execute.mako
  3. 3 1
      apps/beeswax/src/beeswax/templates/import_wizard_choose_delimiter.mako
  4. 3 1
      apps/beeswax/src/beeswax/templates/import_wizard_choose_file.mako
  5. 3 1
      apps/beeswax/src/beeswax/templates/import_wizard_define_columns.mako
  6. 6 2
      apps/filebrowser/src/filebrowser/templates/display.mako
  7. 6 2
      apps/filebrowser/src/filebrowser/templates/edit.mako
  8. 36 12
      apps/filebrowser/src/filebrowser/templates/listdir_components.mako
  9. 1 1
      apps/oozie/src/oozie/static/oozie/js/bundle-editor.ko.js
  10. 3 3
      apps/oozie/src/oozie/static/oozie/js/coordinator-editor.ko.js
  11. 3 3
      apps/oozie/src/oozie/static/oozie/js/workflow-editor.ko.js
  12. 3 1
      apps/oozie/src/oozie/templates/editor/submit_job_popup.mako
  13. 3 1
      apps/oozie/src/oozie/templates/editor2/bundle_editor.mako
  14. 3 1
      apps/oozie/src/oozie/templates/editor2/coordinator_editor.mako
  15. 3 1
      apps/oozie/src/oozie/templates/editor2/submit_job_popup.mako
  16. 3 1
      apps/oozie/src/oozie/templates/editor2/workflow_editor.mako
  17. 9 6
      apps/oozie/src/oozie/templates/utils.inc.mako
  18. 3 1
      apps/pig/src/pig/templates/app.mako
  19. 6 2
      apps/rdbms/src/rdbms/templates/execute.mako
  20. 5 5
      apps/security/src/security/static/security/js/hdfs.ko.js
  21. 8 8
      apps/security/src/security/static/security/js/hive.ko.js
  22. 8 8
      apps/security/src/security/static/security/js/sentry.ko.js
  23. 6 2
      apps/useradmin/src/useradmin/templates/add_ldap_users.mako
  24. 3 1
      apps/useradmin/src/useradmin/templates/change_password.mako
  25. 6 2
      apps/useradmin/src/useradmin/templates/edit_group.mako
  26. 3 1
      apps/useradmin/src/useradmin/templates/edit_permissions.mako
  27. 3 1
      apps/useradmin/src/useradmin/templates/edit_user.mako
  28. 3 1
      apps/useradmin/src/useradmin/templates/list_groups.mako
  29. 3 1
      apps/useradmin/src/useradmin/templates/list_organizations.mako
  30. 15 5
      apps/useradmin/src/useradmin/templates/list_users.mako
  31. 2 1
      desktop/core/src/desktop/js/api/apiUtils.js
  32. 3 1
      desktop/core/src/desktop/js/api/utils.ts
  33. 2 1
      desktop/core/src/desktop/js/apps/editor/EditorViewModel.js
  34. 2 1
      desktop/core/src/desktop/js/apps/editor/app.js
  35. 4 1
      desktop/core/src/desktop/js/apps/editor/components/resultGrid/ko.resultDownloadActions.js
  36. 5 1
      desktop/core/src/desktop/js/apps/editor/execution/sqlExecutable.ts
  37. 6 5
      desktop/core/src/desktop/js/apps/editor/notebook.js
  38. 24 23
      desktop/core/src/desktop/js/apps/editor/snippet.js
  39. 3 2
      desktop/core/src/desktop/js/apps/jobBrowser/app.js
  40. 4 3
      desktop/core/src/desktop/js/apps/jobBrowser/eventListeners.js
  41. 11 10
      desktop/core/src/desktop/js/apps/jobBrowser/knockout/Job.js
  42. 2 1
      desktop/core/src/desktop/js/apps/jobBrowser/knockout/JobBrowserViewModel.js
  43. 5 3
      desktop/core/src/desktop/js/apps/jobBrowser/knockout/Jobs.js
  44. 2 1
      desktop/core/src/desktop/js/apps/jobBrowser/miniJobBrowser.js
  45. 3 2
      desktop/core/src/desktop/js/apps/notebook/NotebookViewModel.js
  46. 1 1
      desktop/core/src/desktop/js/apps/notebook/app.js
  47. 10 9
      desktop/core/src/desktop/js/apps/notebook/notebook.js
  48. 38 45
      desktop/core/src/desktop/js/apps/notebook/snippet.js
  49. 10 9
      desktop/core/src/desktop/js/apps/tableBrowser/metastoreTable.js
  50. 4 2
      desktop/core/src/desktop/js/config/hueConfig.ts
  51. 13 16
      desktop/core/src/desktop/js/doc/hueDocument.js
  52. 2 1
      desktop/core/src/desktop/js/doc/hueFileEntry.js
  53. 3 3
      desktop/core/src/desktop/js/hue.js
  54. 0 1
      desktop/core/src/desktop/js/jquery/jquery.common.js
  55. 5 4
      desktop/core/src/desktop/js/jquery/plugins/jquery.filechooser.js
  56. 5 1
      desktop/core/src/desktop/js/jquery/plugins/jquery.hdfstree.js
  57. 0 160
      desktop/core/src/desktop/js/jquery/plugins/jquery.notify.js
  58. 4 1
      desktop/core/src/desktop/js/ko/bindings/charts/ko.leafletMapChart.js
  59. 6 4
      desktop/core/src/desktop/js/ko/bindings/ko.dateRangePicker.js
  60. 7 4
      desktop/core/src/desktop/js/ko/bindings/ko.dropzone.js
  61. 4 2
      desktop/core/src/desktop/js/ko/components/assist/ko.assistStoragePanel.js
  62. 20 19
      desktop/core/src/desktop/js/ko/components/ko.sentryPrivileges.js
  63. 4 3
      desktop/core/src/desktop/js/onePageViewModel.js
  64. 0 0
      desktop/core/src/desktop/static/desktop/css/hue.css
  65. 0 0
      desktop/core/src/desktop/static/desktop/css/hue3-extra.css
  66. 0 149
      desktop/core/src/desktop/static/desktop/js/jquery.notify.js
  67. 0 48
      desktop/core/src/desktop/static/desktop/less/components/hue-notify.less
  68. 0 1
      desktop/core/src/desktop/static/desktop/less/hue-cross-version.less
  69. 0 10
      desktop/core/src/desktop/templates/common_footer_m.mako
  70. 0 8
      desktop/core/src/desktop/templates/common_header.mako
  71. 7 16
      desktop/core/src/desktop/templates/common_header_footer_components.mako
  72. 3 1
      desktop/core/src/desktop/templates/common_notebook_ko_components.mako
  73. 0 6
      desktop/core/src/desktop/templates/hue.mako
  74. 7 1
      desktop/core/src/desktop/templates/job_browser_common.mako
  75. 3 1
      desktop/core/src/desktop/templates/scheduler/submit_job_popup.mako
  76. 1 1
      desktop/libs/dashboard/src/dashboard/static/dashboard/js/search.ko.js
  77. 3 1
      desktop/libs/dashboard/src/dashboard/templates/common_search.mako
  78. 20 8
      desktop/libs/indexer/src/indexer/templates/importer.mako
  79. 3 1
      desktop/libs/indexer/src/indexer/templates/indexes.mako
  80. 3 1
      desktop/libs/indexer/src/indexer/templates/topics.mako

+ 3 - 1
apps/beeswax/src/beeswax/templates/create_table_manually.mako

@@ -569,7 +569,9 @@ ${ layout.metastore_menubar() }
       ko.applyBindings(viewModel);
 
       if (hueUtils.getParameter("error") != "") {
-        $.jHueNotify.error(hueUtils.getParameter("error"));
+        huePubSub.publish('hue.global.error', {
+          message: hueUtils.getParameter('error')
+        });
       }
 
       if ($(".removeBtn").length == 1) {

+ 9 - 3
apps/beeswax/src/beeswax/templates/execute.mako

@@ -1738,7 +1738,9 @@ $(document).ready(function () {
 
   $("#download-excel").click(function () {
     if (viewModel.design.results.columns().length > 255) {
-      $.jHueNotify.warn("${ _('Results exceeds maximum number of columns permitted by Excel, will truncate results to 255 columns.') }")
+      huePubSub.publish('hue.global.warning', {
+        message: "${ _('Results exceeds maximum number of columns permitted by Excel, will truncate results to 255 columns.') }"
+      });
     }
   });
 
@@ -2248,7 +2250,9 @@ function trySaveAsDesign() {
     $('#saveAs').find('.control-group').removeClass('error');
     hueAnalytics.log('beeswax', 'design/save-as');
   } else if (viewModel.design.name()) {
-    $.jHueNotify.error("${_('No query provided to save.')}");
+    huePubSub.publish('hue.global.error', {
+      message: "${_('No query provided to save.')}"
+    });
     $('#saveAs').modal('hide');
   } else {
     $('#saveas-query-name').addClass('error');
@@ -2355,7 +2359,9 @@ function formatQuery() {
       }
       viewModel.design.query.value(codeMirror.getValue());
     } else {
-      $.jHueNotify.error(data);
+      huePubSub.publish('hue.global.error', {
+        message: data
+      });
     }
   });
 }

+ 3 - 1
apps/beeswax/src/beeswax/templates/import_wizard_choose_delimiter.mako

@@ -209,7 +209,9 @@ ${ layout.metastore_menubar() }
       ko.applyBindings(viewModel);
 
       if (hueUtils.getParameter("error") != "") {
-        $.jHueNotify.error(hueUtils.getParameter("error"));
+        huePubSub.publish('hue.global.error', {
+          message: hueUtils.getParameter('error')
+        });
       }
 
 

+ 3 - 1
apps/beeswax/src/beeswax/templates/import_wizard_choose_file.mako

@@ -217,7 +217,9 @@ ${ layout.metastore_menubar() }
       ko.applyBindings(viewModel);
 
       if (hueUtils.getParameter("error") != "") {
-        $.jHueNotify.error(hueUtils.getParameter("error"));
+        huePubSub.publish('hue.global.error', {
+          message: hueUtils.getParameter('error')
+        });
       }
 
       $(".fileChooserBtn").click(function (e) {

+ 3 - 1
apps/beeswax/src/beeswax/templates/import_wizard_define_columns.mako

@@ -244,7 +244,9 @@ ${ layout.metastore_menubar() }
       ko.applyBindings(viewModel);
 
       if (hueUtils.getParameter("error") != "") {
-        $.jHueNotify.error(hueUtils.getParameter("error"));
+        huePubSub.publish('hue.global.error', {
+          message: hueUtils.getParameter('error')
+        });
       }
 
       $("[rel='tooltip']").tooltip();

+ 6 - 2
apps/filebrowser/src/filebrowser/templates/display.mako

@@ -438,7 +438,9 @@ ${ fb_components.menubar() }
       }
       if (self.upperPage() - self.page() > self.MAX_ALLOWED_PAGES_PER_REQUEST) {
         self.upperPage(self.page() + self.MAX_ALLOWED_PAGES_PER_REQUEST);
-        $.jHueNotify.info("${_('Sorry, you cannot request for more than %s pages.' % MAX_ALLOWED_PAGES_PER_REQUEST)}");
+        huePubSub.publish('hue.global.info', {
+          message: "${_('Sorry, you cannot request for more than %s pages.' % MAX_ALLOWED_PAGES_PER_REQUEST)}"
+        });
       }
       self.changePage();
     };
@@ -503,7 +505,9 @@ ${ fb_components.menubar() }
 
     % if not is_embeddable:
     $(document).ajaxError(function () {
-      $.jHueNotify.error("${_('There was an unexpected server error.')}");
+      huePubSub.publish('hue.global.error', {
+        message: "${_('There was an unexpected server error.')}"
+      });
     });
     % endif
 

+ 6 - 2
apps/filebrowser/src/filebrowser/templates/edit.mako

@@ -121,7 +121,9 @@ ${ fb_components.menubar() }
         success: function (data) {
           if (data && data.exists) {
             resetPrimaryButtonsStatus();
-            $.jHueNotify.info(data.path + " ${ _('saved correctly') }")
+            huePubSub.publish('hue.global.info', {
+              message: data.path + " ${ _('saved correctly') }"
+            });
           }
         }
       });
@@ -147,7 +149,9 @@ ${ fb_components.menubar() }
           if (data && data.exists) {
             resetPrimaryButtonsStatus();
             $("#saveAsModal").modal("hide");
-            $.jHueNotify.info(data.path + " ${ _('saved correctly') }")
+            huePubSub.publish('hue.global.info', {
+              message: data.path + " ${ _('saved correctly') }"
+            });
           }
         }
       });

+ 36 - 12
apps/filebrowser/src/filebrowser/templates/listdir_components.mako

@@ -1533,14 +1533,18 @@ else:
               self.retrieveData(true);
             },
             error: function(xhr){
-              $.jHueNotify.error(xhr.responseText);
+              huePubSub.publish('hue.global.error', {
+                message: xhr.responseText
+              });
               resetPrimaryButtonsStatus();
               $('#moveDestination').val('');
             }
           });
 
           if (mode === 'nomodal') {
-            $.jHueNotify.info('${ _('Items moving to') } "' + $('#moveDestination').val() + '"');
+            huePubSub.publish('hue.global.info', {
+              message: "${ _('Items moving to') } \"" + $('#moveDestination').val() + '"'
+            });
             $("#moveForm").submit();
           } else {
             $("#moveModal").modal({
@@ -1573,7 +1577,9 @@ else:
           }
         }
         else {
-          $.jHueNotify.warn("${ _('You cannot copy a folder into itself.') }");
+          huePubSub.publish('hue.global.warning', {
+            message: "${ _('You cannot copy a folder into itself.') }"
+          });
           $('#moveDestination').val('');
         }
       };
@@ -1602,7 +1608,9 @@ else:
             self.retrieveData(true);
           },
           error: function(xhr){
-            $.jHueNotify.error(xhr.responseText);
+            huePubSub.publish('hue.global.error', {
+              message: xhr.responseText
+            });
             resetPrimaryButtonsStatus();
           }
         });
@@ -1791,7 +1799,9 @@ else:
         const path = $('<input>').val(self.selectedFile().path).appendTo('body').select()
         document.execCommand('copy');
         path.remove();
-        $.jHueNotify.info('${_('Path copied successfully to the clipboard')}');
+        huePubSub.publish('hue.global.info', {
+          message: "${_('Path copied successfully to the clipboard')}"
+        });
       }
 
       self.openInImporter = function () {
@@ -1810,7 +1820,9 @@ else:
             $('#submit-wf-modal').modal('show');
           });
         % else:
-          $.jHueNotify.warn("${ _('Submitting is not available as the Oozie app is disabled') }");
+          huePubSub.publish('hue.global.warning', {
+            message: "${ _('Submitting is not available as the Oozie app is disabled') }"
+          });
         % endif
       };
 
@@ -1863,7 +1875,9 @@ else:
           "start_time": ko.mapping.toJSON((new Date()).getTime())
         }, function (data) {
           if (data.status == 0) {
-            $.jHueNotify.info("${ _('Task ') }" + data.history_uuid + "${_(' submitted.') }");
+            huePubSub.publish('hue.global.info', {
+              message: "${ _('Task ') }" + data.history_uuid + "${_(' submitted.') }"
+            });
             huePubSub.publish('notebook.task.submitted', data);
           } else {
             huePubSub.publish('hue.global.error', {message: data.message});
@@ -1899,7 +1913,9 @@ else:
           "start_time": ko.mapping.toJSON((new Date()).getTime())
         }, function (data) {
           if (data.status == 0) {
-            $.jHueNotify.info("${ _('Task ') }" + data.history_uuid + "${_(' submitted.') }");
+            huePubSub.publish('hue.global.info', {
+              message: "${ _('Task ') }" + data.history_uuid + "${_(' submitted.') }"
+            });
             huePubSub.publish('notebook.task.submitted', data);
           } else {
             huePubSub.publish('hue.global.error', {message: data.message});
@@ -2366,7 +2382,9 @@ else:
               $('#progressStatusBar div').width(progress.toFixed() + "%");
             },
             canceled: function () {
-              $.jHueNotify.info(I18n('The upload has been canceled'));
+              huePubSub.publish('hue.global.info', {
+                message: I18n('The upload has been canceled')
+              });
             },
             complete: function (data) {
               if (data.xhr.response != '') {
@@ -2509,7 +2527,9 @@ else:
           }
         });
         if(isMoveOnSelf){
-          $.jHueNotify.warn("${ _('You cannot copy a folder into itself.') }");
+          huePubSub.publish('hue.global.warning', {
+            message: "${ _('You cannot copy a folder into itself.') }"
+          });
           $('#moveDestination').val('');
           return false;
         }
@@ -2573,7 +2593,9 @@ else:
 
       huePubSub.subscribe('submit.popup.return', function (data) {
         if (data.type == 'external_workflow') {
-          $.jHueNotify.info('${_('Workflow submitted.')}');
+          huePubSub.publish('hue.global.info', {
+            message: "${_('Workflow submitted.')}"
+          });
           huePubSub.publish('open.link', '/jobbrowser/#!id=' + data.job_id);
           huePubSub.publish('browser.job.open.link', data.job_id);
           $('.submit-modal').modal('hide');
@@ -2668,7 +2690,9 @@ else:
         onEnter: function (el) {
           var target_path = stripHashes(el.val());
           if (el.val().split('/')[2] === '' && window.RAZ_IS_ENABLED){
-            $.jHueNotify.warn("${ _('Listing of buckets is not allowed. Redirecting to the home directory.') }");
+            huePubSub.publish('hue.global.warning', {
+              message: "${ _('Listing of buckets is not allowed. Redirecting to the home directory.') }"
+            });
             target_path = window.USER_HOME_DIR;
           } 
           fileBrowserViewModel.targetPath("${url('filebrowser:filebrowser.views.view', path='')}" + encodeURIComponent(target_path)); 

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

@@ -137,7 +137,7 @@ var BundleEditorViewModel = function (bundle_json, coordinators_json, can_edit_j
 
   self.showSubmitPopup = function () {
     // If self.bundle.id() == null, need to save wf for now
-    $(".jHueNotify").remove();
+    huePubSub.publish('hide.global.alerts');
     if (!self.bundle.isDirty()) {
       hueAnalytics.log('oozie/editor/bundle', 'submit');
       $.get("/oozie/editor/bundle/submit/" + self.bundle.id(), {

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

@@ -246,7 +246,7 @@ var CoordinatorEditorViewModel = (function () {
     self.save = function (cb) {
       if (!self.isSaving()) {
         self.isSaving(true);
-        $(".jHueNotify").remove();
+        huePubSub.publish('hide.global.alerts');
         $.post("/oozie/editor/coordinator/save/", {
           "coordinator": ko.mapping.toJSON(self.coordinator, COORDINATOR_MAPPING)
         }, function (data) {
@@ -277,7 +277,7 @@ var CoordinatorEditorViewModel = (function () {
     };
 
     self.gen_xml = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       hueAnalytics.log('oozie/editor/coordinator', 'gen_xml');
 
       $.post("/oozie/editor/coordinator/gen_xml/", {
@@ -295,7 +295,7 @@ var CoordinatorEditorViewModel = (function () {
     };
 
     self.showSubmitPopup = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
 
       if (!self.coordinator.isDirty()) {
         hueAnalytics.log('oozie/editor/coordinator', 'submit');

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

@@ -1200,7 +1200,7 @@ var WorkflowEditorViewModel = function (layout_json, workflow_json, credentials_
   self.save = function () {
     if (! self.isSaving()) {
       self.isSaving(true);
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       $.post("/oozie/editor/workflow/save/", {
         "layout": ko.mapping.toJSON(self.oozieColumns),
         "workflow": ko.mapping.toJSON(self.workflow)
@@ -1246,7 +1246,7 @@ var WorkflowEditorViewModel = function (layout_json, workflow_json, credentials_
   };
 
   self.showSubmitPopup = function () {
-    $(".jHueNotify").remove();
+    huePubSub.publish('hide.global.alerts');
     $.get("/oozie/editor/workflow/submit/" + self.workflow.id(), {
       format: 'json',
       cluster: self.compute() ? ko.mapping.toJSON(self.compute()) : '{}'
@@ -1258,7 +1258,7 @@ var WorkflowEditorViewModel = function (layout_json, workflow_json, credentials_
   };
 
   self.showSubmitActionPopup = function (w) {
-    $(".jHueNotify").remove();
+    huePubSub.publish('hide.global.alerts');
     $.get("/oozie/editor/workflow/submit_single_action/" + self.workflow.id() + "/" + self.workflow.getNodeById(w.id()).id(), {
       format: 'json'
     }, function (data) {

+ 3 - 1
apps/oozie/src/oozie/templates/editor/submit_job_popup.mako

@@ -91,7 +91,9 @@
             if (data.message) {
               message = data.message;
             }
-            $.jHueNotify.error(data.message + (data.detail ? (': ' + data.detail) : ''));
+            huePubSub.publish('hue.global.error', {
+              message: data.message + (data.detail ? (': ' + data.detail) : '')
+            });
           }
         }
       });

+ 3 - 1
apps/oozie/src/oozie/templates/editor2/bundle_editor.mako

@@ -365,7 +365,9 @@ ${ utils.submit_popup_event() }
 
     huePubSub.subscribe('submit.popup.return', function (data) {
       if (data.type == 'bundle') {
-        $.jHueNotify.info('${_('Bundle submitted.')}');
+        huePubSub.publish('hue.global.info', {
+          message: "${_('Bundle submitted.')}"
+        });
         huePubSub.publish('open.link', '/jobbrowser/#!id=' + data.job_id);
         huePubSub.publish('browser.job.open.link', data.job_id);
         $('.submit-modal').modal('hide');

+ 3 - 1
apps/oozie/src/oozie/templates/editor2/coordinator_editor.mako

@@ -195,7 +195,9 @@ ${ scheduler.import_sla_cron(coordinator_json) }
 
     huePubSub.subscribe('submit.popup.return', function (data) {
       if (data.type == 'schedule') {
-        $.jHueNotify.info('${_('Schedule submitted.')}');
+        huePubSub.publish('hue.global.info', {
+          message: "${_('Schedule submitted.')}"
+        });
         huePubSub.publish('open.link', '/jobbrowser/#!id=' + data.job_id);
         huePubSub.publish('browser.job.open.link', data.job_id);
         $('.submit-modal').modal('hide');

+ 3 - 1
apps/oozie/src/oozie/templates/editor2/submit_job_popup.mako

@@ -181,7 +181,9 @@
             if (data.message) {
               message = data.message;
             }
-            $.jHueNotify.error(data.message + (data.detail ? (': ' + data.detail) : ''));
+            huePubSub.publish('hue.global.error', {
+              message: data.message + (data.detail ? (': ' + data.detail) : '')
+            });
           }
         }
       });

+ 3 - 1
apps/oozie/src/oozie/templates/editor2/workflow_editor.mako

@@ -885,7 +885,9 @@ ${ utils.submit_popup_event() }
 
     huePubSub.subscribe('submit.popup.return', function (data) {
       if (data.type == 'workflow') {
-        $.jHueNotify.info('${_('Workflow submitted.')}');
+        huePubSub.publish('hue.global.info', {
+          message: "${_('Workflow submitted.')}"
+        });
         huePubSub.publish('open.link', '/jobbrowser/#!id=' + data.job_id);
         huePubSub.publish('browser.job.open.link', data.job_id);
         $('.submit-modal').modal('hide');

+ 9 - 6
apps/oozie/src/oozie/templates/utils.inc.mako

@@ -456,10 +456,9 @@
               $("input[name='end_0']").val($("input[name='end_0']").data("original-val"));
               $("input[name='end_0']").parent().datepicker("setValue", $("input[name='end_0']").data("original-val"));
             }
-            // non-sticky error notification
-            $.jHueNotify.notify({
-              level:"ERROR",
-              message:"${ _("The end cannot be before the starting moment") }"
+            huePubSub.publish('hue.global.error', {
+              message: "${ _('The end cannot be before the starting moment') }",
+              noStick: true
             });
           }
         }
@@ -639,10 +638,14 @@ function renderCrons() {
             killErrors: "${ _('Some of the selected jobs may not have been killed correctly:') }"
           }
           if (response.totalErrors > 0){
-            $.jHueNotify.warn(_messages[what + "Errors"] + " " + response.messages);
+            huePubSub.publish('hue.global.warning', {
+              message: _messages[what + "Errors"] + " " + response.messages
+            });
           }
           else {
-            $.jHueNotify.info(_messages[what]);
+            huePubSub.publish('hue.global.info', {
+              message: _messages[what]
+            });
           }
           $(".hue-checkbox").removeClass("fa-check");
           toggleBulkButtons();

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

@@ -1147,7 +1147,9 @@ ${ commonshare() | n,unicode }
     });
 
     $(document).on("stopError", function () {
-      $.jHueNotify.error(LABELS.KILL_ERROR);
+      huePubSub.publish('hue.global.error', {
+        message: LABELS.KILL_ERROR
+      });
       hueAnalytics.log('pig', 'stop');
     });
 

+ 6 - 2
apps/rdbms/src/rdbms/templates/execute.mako

@@ -658,7 +658,9 @@ ${ commonshare() | n,unicode }
       $('#saveas-query-name').removeClass('error');
       $('#saveAsQueryModal').modal('hide');
     } else if (viewModel.query.name()) {
-      $.jHueNotify.error("${_('No query provided to save.')}");
+      huePubSub.publish('hue.global.error', {
+        message: "${_('No query provided to save.')}"
+      });
       $('#saveAsQueryModal').modal('hide');
     } else {
       $('#saveas-query-name').addClass('error');
@@ -822,7 +824,9 @@ ${ commonshare() | n,unicode }
 
   // Events and datatables
   $(document).on('saved.query', function() {
-    $.jHueNotify.info("${_('Query saved successfully!')}")
+    huePubSub.publish('hue.global.info', {
+      message: "${_('Query saved successfully!')}"
+    });
   });
 
   // Initial htmlEscape

+ 5 - 5
apps/security/src/security/static/security/js/hdfs.ko.js

@@ -432,7 +432,7 @@ var HdfsViewModel = (function () {
     }
 
     self.getAcls = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       var _isLoading = window.setTimeout(function () {
         self.isLoadingAcls(true);
       }, 1000);
@@ -462,7 +462,7 @@ var HdfsViewModel = (function () {
     };
 
     self.updateAcls = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       hueAnalytics.log('security/hdfs', 'updateAcls');
 
       $.post("/security/api/hdfs/update_acls", {
@@ -507,7 +507,7 @@ var HdfsViewModel = (function () {
     }
 
     self.bulkDeleteAcls = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       hueAnalytics.log('security/hdfs', 'bulkDeleteAcls');
 
       var checkedPaths = self.checkedItems();
@@ -529,7 +529,7 @@ var HdfsViewModel = (function () {
     }
 
     self.bulkAddAcls = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       hueAnalytics.log('security/hdfs', 'bulkAddAcls');
 
       var checkedPaths = self.checkedItems();
@@ -549,7 +549,7 @@ var HdfsViewModel = (function () {
     }
 
     self.bulkSyncAcls = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       hueAnalytics.log('security/hdfs', 'bulkSyncAcls');
 
       var checkedPaths = self.checkedItems();

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

@@ -261,7 +261,7 @@ var HiveViewModel = (function () {
     }
 
     self.saveGroups = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       $.post("/security/api/hive/update_role_groups", {
         role: ko.mapping.toJSON(self)
       }, function (data) {
@@ -280,7 +280,7 @@ var HiveViewModel = (function () {
     }
 
     self.create = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       if (self.isValid()) {
         self.isLoading(true);
         $.post("/security/api/hive/create_role", {
@@ -307,7 +307,7 @@ var HiveViewModel = (function () {
     }
 
     self.update = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       if (self.isValid()) {
         self.isLoading(true);
         $.post("/security/api/hive/save_privileges", {
@@ -330,7 +330,7 @@ var HiveViewModel = (function () {
     }
 
     self.remove = function (role) {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       self.isLoading(true);
       $.post("/security/api/hive/drop_sentry_role", {
         roleName: role.name
@@ -350,7 +350,7 @@ var HiveViewModel = (function () {
     }
 
     self.savePrivileges = function (role) {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       $.post("/security/api/hive/save_privileges", {
         role: ko.mapping.toJSON(role)
       }, function (data) {
@@ -1121,7 +1121,7 @@ var HiveViewModel = (function () {
     }
 
     self.grant_privilege = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       $.ajax({
         type: "POST",
         url: "/security/api/hive/grant_privilege",
@@ -1237,7 +1237,7 @@ var HiveViewModel = (function () {
     }
 
     self.bulk_delete_privileges = function (norefresh) {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       var checkedPaths = self.assist.checkedItems();
       $.post("/security/api/hive/bulk_delete_privileges", {
         'authorizableHierarchy': ko.mapping.toJSON(_create_authorizable_from_ko()),
@@ -1258,7 +1258,7 @@ var HiveViewModel = (function () {
     }
 
     self.bulk_add_privileges = function (role) {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       var checkedPaths = self.assist.checkedItems();
       $.post("/security/api/hive/bulk_add_privileges", {
         'privileges': ko.mapping.toJSON(self.assist.privileges),

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

@@ -279,7 +279,7 @@ var SentryViewModel = (function () {
     }
 
     self.saveGroups = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       $.post("/security/api/sentry/update_role_groups", {
         role: ko.mapping.toJSON(self),
         component: vm.component()
@@ -299,7 +299,7 @@ var SentryViewModel = (function () {
     }
 
     self.create = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       if (self.isValid()) {
         $.post("/security/api/sentry/create_role", {
           role: ko.mapping.toJSON(self),
@@ -324,7 +324,7 @@ var SentryViewModel = (function () {
     }
 
     self.update = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       if (self.isValid()) {
         $.post("/security/api/sentry/save_privileges", {
           role: ko.mapping.toJSON(self),
@@ -345,7 +345,7 @@ var SentryViewModel = (function () {
     }
 
     self.remove = function (role) {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       $.post("/security/api/sentry/drop_sentry_role", {
         roleName: role.name,
         component: vm.component()
@@ -363,7 +363,7 @@ var SentryViewModel = (function () {
     }
 
     self.savePrivileges = function (role) {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       $.post("/security/api/sentry/save_privileges", {
         role: ko.mapping.toJSON(role),
         component: vm.component()
@@ -1188,7 +1188,7 @@ var SentryViewModel = (function () {
     }
 
     self.grant_privilege = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       $.ajax({
         type: "POST",
         url: "/security/api/sentry/grant_privilege",
@@ -1307,7 +1307,7 @@ var SentryViewModel = (function () {
     }
 
     self.bulk_delete_privileges = function (norefresh) {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       var checkedPaths = self.assist.checkedItems();
       $.post("/security/api/sentry/bulk_delete_privileges", {
         'authorizableHierarchy': ko.mapping.toJSON(_create_authorizable_from_ko()),
@@ -1329,7 +1329,7 @@ var SentryViewModel = (function () {
     }
 
     self.bulk_add_privileges = function (role) {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       var checkedPaths = self.assist.checkedItems();
       $.post("/security/api/sentry/bulk_add_privileges", {
         'privileges': ko.mapping.toJSON(self.assist.privileges),

+ 6 - 2
apps/useradmin/src/useradmin/templates/add_ldap_users.mako

@@ -81,11 +81,15 @@ ${ layout.menubar(section='users') }
         }
         else if (data && data.status === 0) {
           huePubSub.publish('open.link', '${ url('useradmin:useradmin.views.list_users') }');
-          $.jHueNotify.info("${ _('User added/synced correctly') }");
+          huePubSub.publish('hue.global.info', {
+            message: "${ _('User added/synced correctly') }"
+          });
         }
       },
       error: function (data) {
-        $.jHueNotify.error(data.responseJSON['message']);
+        huePubSub.publish('hue.global.error', {
+          message: data.responseJSON['message']
+        });
       }
     });
     %endif

+ 3 - 1
apps/useradmin/src/useradmin/templates/change_password.mako

@@ -85,7 +85,9 @@ $(document).ready(function(){
       }
       else if (data && data.url) {
         huePubSub.publish('open.link', data.url);
-        $.jHueNotify.info("${ _('User information updated correctly') }");
+        huePubSub.publish('hue.global.info', {
+          message: "${ _('User information updated correctly') }"
+        });
       }
     }
   });

+ 6 - 2
apps/useradmin/src/useradmin/templates/edit_group.mako

@@ -126,11 +126,15 @@ ${ layout.menubar(section='groups') }
         }
         else if (data && data.url) {
           huePubSub.publish('open.link', data.url);
-          $.jHueNotify.info("${ _('Group information updated correctly') }");
+          huePubSub.publish('hue.global.info', {
+            message: "${ _('Group information updated correctly') }"
+          });
         }
       },
       error: function (data) {
-        $.jHueNotify.error(data.responseJSON['message']);
+        huePubSub.publish('hue.global.error', {
+          message: data.responseJSON['message']
+        });
       }
     });
     % endif

+ 3 - 1
apps/useradmin/src/useradmin/templates/edit_permissions.mako

@@ -100,7 +100,9 @@ ${ layout.menubar(section='permissions') }
         }
         else if (data && data.url) {
           huePubSub.publish('open.link', data.url);
-          $.jHueNotify.info("${ _('Permission information updated correctly') }");
+          huePubSub.publish('hue.global.info', {
+            message: "${ _('Permission information updated correctly') }"
+          });
         }
       }
     });

+ 3 - 1
apps/useradmin/src/useradmin/templates/edit_user.mako

@@ -168,7 +168,9 @@ $(document).ready(function(){
       }
       else if (data && data.url) {
         huePubSub.publish('open.link', data.url);
-        $.jHueNotify.info("${ _('User information updated correctly') }");
+        huePubSub.publish('hue.global.info', {
+          message: "${ _('User information updated correctly') }"
+        });
       }
     }
   });

+ 3 - 1
apps/useradmin/src/useradmin/templates/list_groups.mako

@@ -183,7 +183,9 @@ ${layout.menubar(section='groups')}
       dataType:  'json',
       success: function(data) {
         $groupsComponents.find(".delete-group").modal("hide");
-        $.jHueNotify.info("${ _('The groups were deleted.') }");
+        huePubSub.publish('hue.global.info', {
+          message: "${ _('The groups were deleted.') }"
+        });
         if (data && data.url){
           huePubSub.publish('open.link', data.url);
         }

+ 3 - 1
apps/useradmin/src/useradmin/templates/list_organizations.mako

@@ -179,7 +179,9 @@ ${ layout.menubar(section='organizations') }
       dataType:  'json',
       success: function(data) {
         $organizationsComponents.find(".delete-group").modal("hide");
-        $.jHueNotify.info("${ _('The groups were deleted.') }");
+        huePubSub.publish('hue.global.info', {
+          message: "${ _('The groups were deleted.') }"
+        });
         if (data && data.url){
           huePubSub.publish('open.link', data.url);
         }

+ 15 - 5
apps/useradmin/src/useradmin/templates/list_users.mako

@@ -240,7 +240,9 @@ ${layout.menubar(section='users')}
       dataType: 'json',
       success: function(data) {
         $usersComponents.find(".delete-user").modal("hide");
-        $.jHueNotify.info("${ _('The users were deleted.') }")
+        huePubSub.publish('hue.global.info', {
+          message: "${ _('The users were deleted.') }"
+        });
         if (data && data.url){
           huePubSub.publish('open.link', data.url);
         }
@@ -248,10 +250,14 @@ ${layout.menubar(section='users')}
       error: function(response, status, err) {
         $usersComponents.find(".delete-user").modal("hide");
         if (response.responseJSON && response.responseJSON.message && response.status == 401) {
-          $.jHueNotify.error(response.responseJSON.message);
+          huePubSub.publish('hue.global.error', {
+            message: response.responseJSON.message
+          });
         }
         else {
-          $.jHueNotify.error("${ _('An unknown error has occurred while deleting the user. Please try again.') }");
+          huePubSub.publish('hue.global.error', {
+            message: "${ _('An unknown error has occurred while deleting the user. Please try again.') }"
+          });
         }
       }
     });
@@ -283,14 +289,18 @@ ${layout.menubar(section='users')}
               }
               else if (data && data.url) {
                 $usersComponents.find(".sync-ldap").modal("hide");
-                $.jHueNotify.info("${ _('The users and groups were updated correctly.') }");
+                huePubSub.publish('hue.global.info', {
+                  message: "${ _('The users and groups were updated correctly.') }"
+                });
                 huePubSub.publish('open.link', data.url);
               }
             },
             error: function(data) {
               $usersComponents.find('input[type="submit"]').removeAttr("disabled");
               $usersComponents.find(".sync-ldap").modal("hide");
-              $.jHueNotify.error(data.responseJSON['message']);
+              huePubSub.publish('hue.global.error', {
+                message: data.responseJSON['message']
+              });
               huePubSub.publish('open.link', data.url);
             }
           });

+ 2 - 1
desktop/core/src/desktop/js/api/apiUtils.js

@@ -16,6 +16,7 @@
 
 import $ from 'jquery';
 
+import { GLOBAL_ERROR_TOPIC } from 'reactComponents/AlertComponent/events';
 import logError from 'utils/logError';
 import huePubSub from 'utils/huePubSub';
 
@@ -77,7 +78,7 @@ export const assistErrorCallback = options => {
     if (!options || !options.silenceErrors) {
       logError(errorResponse);
       if (errorMessage && errorMessage.indexOf('AuthorizationException') === -1) {
-        huePubSub.publish('hue.global.error', { message: errorMessage });
+        huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: errorMessage });
       }
     }
 

+ 3 - 1
desktop/core/src/desktop/js/api/utils.ts

@@ -25,6 +25,8 @@ import axios, {
 import qs from 'qs';
 
 import { CancellablePromise } from './cancellablePromise';
+import { GLOBAL_ERROR_TOPIC } from 'reactComponents/AlertComponent/events';
+import { HueAlert } from 'reactComponents/AlertComponent/types';
 import { hueWindow } from 'types/types';
 import huePubSub from 'utils/huePubSub';
 import logError from 'utils/logError';
@@ -146,7 +148,7 @@ const notifyError = <T>(
   if (!options || !options.silenceErrors) {
     logError(response);
     if (message.indexOf('AuthorizationException') === -1) {
-      huePubSub.publish('hue.error', message);
+      huePubSub.publish<HueAlert>(GLOBAL_ERROR_TOPIC, { message });
     }
   }
 };

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

@@ -27,6 +27,7 @@ import Notebook from 'apps/editor/notebook';
 import ChartTransformers from 'apps/notebook/chartTransformers';
 import { CONFIG_REFRESHED_TOPIC, GET_KNOWN_CONFIG_TOPIC } from 'config/events';
 import { findEditorConnector, getLastKnownConfig } from 'config/hueConfig';
+import { GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
 import huePubSub from 'utils/huePubSub';
 import { getFromLocalStorage, setInLocalStorage } from 'utils/storageUtils';
 import UUID from 'utils/string/UUID';
@@ -220,7 +221,7 @@ export default class EditorViewModel {
           const options = {
             successCallback: result => {
               if (result && result.exists) {
-                huePubSub.publish('hue.global.info', {
+                huePubSub.publish(GLOBAL_INFO_TOPIC, {
                   message: result.path + ' saved successfully.'
                 });
               }

+ 2 - 1
desktop/core/src/desktop/js/apps/editor/app.js

@@ -22,6 +22,7 @@ import 'ext/bootstrap-datepicker.min';
 import 'ext/jquery.hotkeys';
 import 'jquery/plugins/jquery.hdfstree';
 
+import { HIDE_GLOBAL_ALERTS_TOPIC } from 'reactComponents/AlertComponent/events';
 import { registerHueWorkers } from 'sql/workers/hueWorkerHandler';
 import huePubSub from 'utils/huePubSub';
 import I18n from 'utils/i18n';
@@ -568,7 +569,7 @@ huePubSub.subscribe('app.dom.loaded', app => {
       value => {
         viewModel.isEditing(!viewModel.isEditing());
         if (value) {
-          $('.jHueNotify').remove();
+          huePubSub.publish(HIDE_GLOBAL_ALERTS_TOPIC);
           isAssistAvailable = viewModel.assistAvailable();
           wasLeftPanelVisible = viewModel.isLeftPanelVisible();
           wasRightPanelVisible = viewModel.isRightPanelVisible();

+ 4 - 1
desktop/core/src/desktop/js/apps/editor/components/resultGrid/ko.resultDownloadActions.js

@@ -20,6 +20,7 @@ import * as ko from 'knockout';
 import { SHOW_DOWNLOAD_RESULT_MODAL_EVENT } from 'apps/editor/components/resultGrid/ko.resultDownloadModal';
 import componentUtils from 'ko/components/componentUtils';
 import DisposableComponent from 'ko/components/DisposableComponent';
+import { GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
 import I18n from 'utils/i18n';
 import huePubSub from 'utils/huePubSub';
 import html2text from 'utils/html/html2text';
@@ -156,7 +157,9 @@ class ResultDownloadActions extends DisposableComponent {
   }
 
   onClipboardSuccess(e) {
-    $.jHueNotify.info(I18n('%s result(s) copied to the clipboard', this.data().length));
+    huePubSub.publish(GLOBAL_INFO_TOPIC, {
+      message: I18n('%s result(s) copied to the clipboard', this.data().length)
+    });
     e.clearSelection();
     $('.clipboard-content').empty();
   }

+ 5 - 1
desktop/core/src/desktop/js/apps/editor/execution/sqlExecutable.ts

@@ -39,6 +39,8 @@ import Executor from 'apps/editor/execution/executor';
 import sessionManager from 'apps/editor/execution/sessionManager';
 import dataCatalog from 'catalog/dataCatalog';
 import { ParsedSqlStatement } from 'parse/sqlStatementsParser';
+import { HueAlert } from 'reactComponents/AlertComponent/types';
+import { GLOBAL_ERROR_TOPIC } from 'reactComponents/AlertComponent/events';
 import { hueWindow } from 'types/types';
 import hueAnalytics from 'utils/hueAnalytics';
 import huePubSub from 'utils/huePubSub';
@@ -382,7 +384,9 @@ export default class SqlExecutable {
         this.executeEnded = Date.now();
         this.setStatus(queryStatus.status);
         if (queryStatus.message) {
-          huePubSub.publish('hue.error', queryStatus.message);
+          huePubSub.publish<HueAlert>(GLOBAL_ERROR_TOPIC, {
+            message: queryStatus.message
+          });
         }
         break;
       default:

+ 6 - 5
desktop/core/src/desktop/js/apps/editor/notebook.js

@@ -31,6 +31,7 @@ import {
   ASSIST_IS_DB_PANEL_READY_EVENT,
   ASSIST_SET_DATABASE_EVENT
 } from 'ko/components/assist/events';
+import { GLOBAL_ERROR_TOPIC, GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
 
 const HISTORY_CLEARED_EVENT = 'query.history.cleared';
 
@@ -273,7 +274,7 @@ export default class Notebook {
           }
         ).fail(xhr => {
           if (xhr.status !== 502) {
-            huePubSub.publish('hue.global.error', { message: xhr.responseText });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
           }
         });
       };
@@ -331,7 +332,7 @@ export default class Notebook {
         this.isSaved(true);
         const wasHistory = this.isHistory();
         this.isHistory(false);
-        huePubSub.publish('hue.global.info', { message: data.message });
+        huePubSub.publish(GLOBAL_INFO_TOPIC, { message: data.message });
         if (editorMode) {
           huePubSub.publish(UPDATE_SAVED_QUERIES_EVENT, data);
 
@@ -368,12 +369,12 @@ export default class Notebook {
           callback();
         }
       } else {
-        huePubSub.publish('hue.global.error', { message: data.message });
+        huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
       }
     } catch (err) {
       console.error(err);
       if (err && err.status !== 502) {
-        huePubSub.publish('hue.global.error', { message: err.responseText });
+        huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: err.responseText });
       }
     }
   }
@@ -405,7 +406,7 @@ export default class Notebook {
       }
     ).fail(xhr => {
       if (xhr.status !== 502) {
-        huePubSub.publish('hue.global.error', { message: xhr.responseText });
+        huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
       }
     });
   }

+ 24 - 23
desktop/core/src/desktop/js/apps/editor/snippet.js

@@ -58,6 +58,7 @@ import {
   ASSIST_GET_SOURCE_EVENT,
   ASSIST_SET_SOURCE_EVENT
 } from 'ko/components/assist/events';
+import { GLOBAL_ERROR_TOPIC, GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
 import { EXECUTABLE_UPDATED_TOPIC } from './execution/events';
 
 // TODO: Remove together with ENABLE_HUE_5. Temporary here for debug
@@ -870,7 +871,7 @@ export default class Snippet {
           // eslint-disable-next-line no-restricted-syntax
           console.log(data.statement_similarity);
         } else {
-          huePubSub.publish('hue.global.error', { message: data.message });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
         }
       })
       .catch(() => {});
@@ -910,7 +911,7 @@ export default class Snippet {
     } else if (data.status === 1 || data.status === -1) {
       this.status(STATUS.failed);
     } else {
-      huePubSub.publish('hue.global.error', { message: data.message });
+      huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
       this.status(STATUS.failed);
     }
   }
@@ -1030,12 +1031,12 @@ export default class Snippet {
           this.showSqlAnalyzer(true);
           this.hasSuggestion(true);
         } else {
-          huePubSub.publish('hue.global.error', { message: data.message });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
         }
       })
       .catch(xhr => {
         if (xhr.status !== 502) {
-          huePubSub.publish('hue.global.error', { message: xhr.responseText });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
         }
       })
       .finally(() => {
@@ -1137,14 +1138,14 @@ export default class Snippet {
       sourcePlatform: this.dialect()
     }).then(data => {
       if (data.status === 0) {
-        $(document).trigger(
-          'info',
-          data.upload_history[this.dialect()].count +
+        huePubSub.publish(GLOBAL_INFO_TOPIC, {
+          message:
+            data.upload_history[this.dialect()].count +
             ' queries uploaded successfully. Processing them...'
-        );
+        });
         this.watchUploadStatus(data.upload_history[this.dialect()].status.workloadId);
       } else {
-        huePubSub.publish('hue.global.error', { message: data.message });
+        huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
       }
     });
   }
@@ -1152,7 +1153,7 @@ export default class Snippet {
   uploadTableStats(options) {
     hueAnalytics.log('notebook', 'load_table_stats');
     if (options.showProgress) {
-      huePubSub.publish('hue.global.info', { message: 'Preparing table data...' });
+      huePubSub.publish(GLOBAL_INFO_TOPIC, { message: 'Preparing table data...' });
     }
 
     $.post(
@@ -1169,19 +1170,19 @@ export default class Snippet {
       data => {
         if (data.status === 0) {
           if (options.showProgress) {
-            $(document).trigger(
-              'info',
-              $.map(options.activeTables, table => {
-                return table.tableName;
-              }) + ' stats sent to analyse'
-            );
+            huePubSub.publish(GLOBAL_INFO_TOPIC, {
+              message:
+                $.map(options.activeTables, table => {
+                  return table.tableName;
+                }) + ' stats sent to analyse'
+            });
           }
           if (data.upload_table_ddl && options.showProgress) {
             // With showProgress only currently as can be very slow
             this.watchUploadStatus(data.upload_table_ddl.status.workloadId, options.showProgress);
           }
         } else if (options.showProgress) {
-          huePubSub.publish('hue.global.error', { message: data.message });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
         }
       }
     ).always(() => {
@@ -1197,7 +1198,7 @@ export default class Snippet {
     }).then(data => {
       if (data.status === 0) {
         if (showProgress) {
-          huePubSub.publish('hue.global.info', {
+          huePubSub.publish(GLOBAL_INFO_TOPIC, {
             message: 'Query processing: ' + data.upload_status.status.state
           });
         }
@@ -1206,19 +1207,19 @@ export default class Snippet {
             this.watchUploadStatus(workloadId);
           }, 2000);
         } else if (showProgress) {
-          $(document).trigger(
-            'warn',
-            data.upload_status.status.statusMsg +
+          huePubSub.publish('hue,global.warning', {
+            message:
+              data.upload_status.status.statusMsg +
               (data.upload_status.status.failedQueries > 0
                 ? '. ' +
                   data.upload_status.status.failQueryDetails.map(query => {
                     return query.error;
                   })
                 : '')
-          );
+          });
         }
       } else if (showProgress) {
-        huePubSub.publish('hue.global.error', { message: data.message });
+        huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
       }
     });
   }

+ 3 - 2
desktop/core/src/desktop/js/apps/jobBrowser/app.js

@@ -25,6 +25,7 @@ import './components/impalaQueries/webcomp';
 import './eventListeners';
 import JobBrowserViewModel from './knockout/JobBrowserViewModel';
 import Job from './knockout/Job';
+import { GLOBAL_ERROR_TOPIC, GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
 import I18n from 'utils/i18n';
 
 huePubSub.subscribe('app.dom.loaded', app => {
@@ -65,7 +66,7 @@ huePubSub.subscribe('app.dom.loaded', app => {
             if (id) {
               openJob(id);
             } else {
-              huePubSub.publish('hue.global.error', { message: I18n('No log available') });
+              huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: I18n('No log available') });
             }
           }
         );
@@ -112,7 +113,7 @@ huePubSub.subscribe('app.dom.loaded', app => {
     huePubSub.subscribe(
       'submit.rerun.popup.return',
       data => {
-        huePubSub.publish('hue.global.info', { message: I18n('Rerun submitted.') });
+        huePubSub.publish(GLOBAL_INFO_TOPIC, { message: I18n('Rerun submitted.') });
         $('#rerun-modal').modal('hide');
 
         jobBrowserViewModel.job().apiStatus('RUNNING');

+ 4 - 3
desktop/core/src/desktop/js/apps/jobBrowser/eventListeners.js

@@ -16,6 +16,7 @@
 
 import $ from 'jquery';
 import huePubSub from '../../utils/huePubSub';
+import { GLOBAL_ERROR_TOPIC, GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
 
 $(document).off('shown', '.jb-logs-link');
 $(document).on('shown', '.jb-logs-link', e => {
@@ -56,14 +57,14 @@ $(document).on('showSubmitPopup', (event, data) => {
       success: function (data) {
         $('#syncWorkflowModal').modal('hide');
         if (data && data.status === 0) {
-          huePubSub.publish('hue.global.info', data);
+          huePubSub.publish(GLOBAL_INFO_TOPIC, data);
         } else {
-          huePubSub.publish('hue.global.error', data);
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, data);
         }
       },
       error: function (data) {
         $('#syncWorkflowModal').modal('hide');
-        huePubSub.publish('hue.global.error', data);
+        huePubSub.publish(GLOBAL_ERROR_TOPIC, data);
       }
     });
   });

+ 11 - 10
desktop/core/src/desktop/js/apps/jobBrowser/knockout/Job.js

@@ -19,6 +19,7 @@ import * as ko from 'knockout';
 import komapping from 'knockout.mapping';
 
 import apiHelper from 'api/apiHelper';
+import { GLOBAL_ERROR_TOPIC, GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
 import huePubSub from 'utils/huePubSub';
 import I18n from 'utils/i18n';
 import deleteAllEmptyStringKeys from 'utils/string/deleteAllEmptyStringKeys';
@@ -361,7 +362,7 @@ export default class Job {
             callback(data);
           }
         } else {
-          huePubSub.publish('hue.global.error', { message: data.message });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
         }
       }
     );
@@ -579,7 +580,7 @@ export default class Job {
 
         this.vm.job().fetchLogs();
       } else {
-        huePubSub.publish('hue.global.error', { message: data.message });
+        huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
       }
     }).always(() => {
       this.loadingJob(false);
@@ -686,7 +687,7 @@ export default class Job {
               );
           }
         } else {
-          huePubSub.publish('hue.global.error', { message: data.message });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
         }
       }
     );
@@ -747,7 +748,7 @@ export default class Job {
             callback(data);
           }
         } else {
-          huePubSub.publish('hue.global.error', { message: data.message });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
         }
       }
     );
@@ -770,7 +771,7 @@ export default class Job {
           this.progress(data.app.progress);
           this.canWrite(data.app.canWrite);
         } else {
-          huePubSub.publish('hue.global.error', { message: data.message });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
         }
       }
     );
@@ -816,15 +817,15 @@ export default class Job {
         },
         data => {
           if (data.status === 0) {
-            huePubSub.publish('hue.global.info', {
+            huePubSub.publish(GLOBAL_INFO_TOPIC, {
               message: I18n('Successfully updated Coordinator Job Properties')
             });
           } else {
-            huePubSub.publish('hue.global.error', { message: data.message });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
           }
         }
       ).fail(xhr => {
-        huePubSub.publish('hue.global.error', { message: xhr.responseText });
+        huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
       });
     } else if (action === 'sync_workflow') {
       $.get(
@@ -836,11 +837,11 @@ export default class Job {
           $(document).trigger('showSubmitPopup', data);
         }
       ).fail(xhr => {
-        huePubSub.publish('hue.global.error', { message: xhr.responseText });
+        huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
       });
     } else {
       this.vm.jobs._control([this.id()], action, data => {
-        huePubSub.publish('hue.global.info', data);
+        huePubSub.publish(GLOBAL_INFO_TOPIC, data);
         this.fetchStatus();
       });
     }

+ 2 - 1
desktop/core/src/desktop/js/apps/jobBrowser/knockout/JobBrowserViewModel.js

@@ -18,6 +18,7 @@ import $ from 'jquery';
 import * as ko from 'knockout';
 
 import { getLastKnownConfig } from 'config/hueConfig';
+import { GLOBAL_ERROR_TOPIC } from 'reactComponents/AlertComponent/events';
 import huePubSub from 'utils/huePubSub';
 import I18n from 'utils/i18n';
 import { withLocalStorage } from 'utils/storageUtils';
@@ -242,7 +243,7 @@ export default class JobBrowserViewModel {
         .fail(err => {
           this.oozieInfoLoadedOnce = false;
           this.selectInterface('schedules');
-          huePubSub.publish('hue.global.error', { message: I18n('Failed loading Oozie Info.') });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: I18n('Failed loading Oozie Info.') });
         })
         .always(() => {
           this.oozieInfoLoading(false);

+ 5 - 3
desktop/core/src/desktop/js/apps/jobBrowser/knockout/Jobs.js

@@ -19,9 +19,11 @@ import * as ko from 'knockout';
 import komapping from 'knockout.mapping';
 
 import apiHelper from 'api/apiHelper';
+import { GLOBAL_ERROR_TOPIC, GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
 import huePubSub from 'utils/huePubSub';
 import I18n from 'utils/i18n';
 import Job from './Job';
+
 export default class Jobs {
   constructor(vm) {
     this.vm = vm;
@@ -216,7 +218,7 @@ export default class Jobs {
             this.selectedJobs([]);
           }
         } else {
-          huePubSub.publish('hue.global.error', { message: data.message });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
         }
       }
     ).always(() => {});
@@ -247,7 +249,7 @@ export default class Jobs {
             callback(data);
           }
         } else {
-          huePubSub.publish('hue.global.error', { message: data.message });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
         }
       }
     );
@@ -426,7 +428,7 @@ export default class Jobs {
         this.selectedJobs().map(job => job.id()),
         action,
         data => {
-          huePubSub.publish('hue.global.info', data);
+          huePubSub.publish(GLOBAL_INFO_TOPIC, data);
           this.updateJobs();
         }
       );

+ 2 - 1
desktop/core/src/desktop/js/apps/jobBrowser/miniJobBrowser.js

@@ -17,6 +17,7 @@
 import $ from 'jquery';
 import * as ko from 'knockout';
 
+import { GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
 import huePubSub from 'utils/huePubSub';
 import I18n from 'utils/i18n';
 
@@ -48,7 +49,7 @@ export const initializeMiniJobBrowser = () => {
   huePubSub.publish('cluster.config.get.config', configUpdated);
 
   huePubSub.subscribe('submit.rerun.popup.return-mini', () => {
-    huePubSub.publish('hue.global.info', { message: I18n('Rerun submitted.') });
+    huePubSub.publish(GLOBAL_INFO_TOPIC, { message: I18n('Rerun submitted.') });
     $('#rerun-modal-mini').modal('hide');
 
     jobBrowserViewModel.job().apiStatus('RUNNING');

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

@@ -35,6 +35,7 @@ import changeURL from 'utils/url/changeURL';
 import changeURLParameter from 'utils/url/changeURLParameter';
 import getParameter from 'utils/url/getParameter';
 import UUID from 'utils/string/UUID';
+import { GLOBAL_ERROR_TOPIC, GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
 
 export default class NotebookViewModel {
   constructor(options, CoordinatorEditorViewModel, RunningCoordinatorModel) {
@@ -359,7 +360,7 @@ export default class NotebookViewModel {
           const options = {
             successCallback: function (result) {
               if (result && result.exists) {
-                huePubSub.publish('hue.global.info', {
+                huePubSub.publish(GLOBAL_INFO_TOPIC, {
                   message: result.path + ' saved successfully.'
                 });
               } else {
@@ -617,7 +618,7 @@ export default class NotebookViewModel {
             }
             deferredOpen.resolve();
           } else {
-            huePubSub.publish('hue.global.error', { message: data.message });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
             deferredOpen.reject();
             self.newNotebook();
           }

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

@@ -1007,7 +1007,7 @@ huePubSub.subscribe('app.dom.loaded', app => {
       value => {
         viewModel.isEditing(!viewModel.isEditing());
         if (value) {
-          $('.jHueNotify').remove();
+          huePubSub.publish('hide.global.alerts');
           isAssistAvailable = viewModel.assistAvailable();
           wasLeftPanelVisible = viewModel.isLeftPanelVisible();
           wasRightPanelVisible = viewModel.isRightPanelVisible();

+ 10 - 9
desktop/core/src/desktop/js/apps/notebook/notebook.js

@@ -26,6 +26,7 @@ import {
   ASSIST_IS_DB_PANEL_READY_EVENT,
   ASSIST_SET_DATABASE_EVENT
 } from 'ko/components/assist/events';
+import { GLOBAL_ERROR_TOPIC, GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
 import hueAnalytics from 'utils/hueAnalytics';
 import huePubSub from 'utils/huePubSub';
 import { getFromLocalStorage } from 'utils/storageUtils';
@@ -363,7 +364,7 @@ class Notebook {
         $.each(self.getSnippets(session.type()), (index, snippet) => {
           snippet.status('failed');
         });
-        huePubSub.publish('hue.global.error', { message: message });
+        huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: message });
         if (failCallback) {
           failCallback();
         }
@@ -503,7 +504,7 @@ class Notebook {
             self.isSaved(true);
             const wasHistory = self.isHistory();
             self.isHistory(false);
-            huePubSub.publish('hue.global.info', { message: data.message });
+            huePubSub.publish(GLOBAL_INFO_TOPIC, { message: data.message });
             if (editorMode) {
               if (!data.save_as) {
                 const existingQuery = self
@@ -555,12 +556,12 @@ class Notebook {
               callback();
             }
           } else {
-            huePubSub.publish('hue.global.error', { message: data.message });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
           }
         }
       ).fail((xhr, textStatus, errorThrown) => {
         if (xhr.status !== 502) {
-          huePubSub.publish('hue.global.error', { message: xhr.responseText });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
         }
       });
     };
@@ -613,7 +614,7 @@ class Notebook {
         },
         data => {
           if (!silent && data && data.status != 0 && data.status != -2 && data.message) {
-            huePubSub.publish('hue.global.error', { message: data.message });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
           }
 
           if (callback) {
@@ -622,7 +623,7 @@ class Notebook {
         }
       ).fail(xhr => {
         if (!silent && xhr.status !== 502) {
-          huePubSub.publish('hue.global.error', { message: xhr.responseText });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
         }
       });
     };
@@ -757,7 +758,7 @@ class Notebook {
         }
       ).fail(xhr => {
         if (xhr.status !== 502) {
-          huePubSub.publish('hue.global.error', { message: xhr.responseText });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
         }
       });
       $(document).trigger('hideHistoryModal');
@@ -829,7 +830,7 @@ class Notebook {
             }
           ).fail(xhr => {
             if (xhr.status !== 502) {
-              huePubSub.publish('hue.global.error', { message: xhr.responseText });
+              huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
             }
           });
         };
@@ -865,7 +866,7 @@ class Notebook {
         }
       ).fail((xhr, textStatus, errorThrown) => {
         if (xhr.status !== 502) {
-          huePubSub.publish('hue.global.error', { message: xhr.responseText });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
         }
       });
     };

+ 38 - 45
desktop/core/src/desktop/js/apps/notebook/snippet.js

@@ -38,6 +38,11 @@ import {
   ASSIST_GET_SOURCE_EVENT,
   ASSIST_SET_SOURCE_EVENT
 } from 'ko/components/assist/events';
+import {
+  GLOBAL_ERROR_TOPIC,
+  GLOBAL_INFO_TOPIC,
+  GLOBAL_WARNING_TOPIC
+} from 'reactComponents/AlertComponent/events';
 import { POST_FROM_LOCATION_WORKER_EVENT } from 'sql/workers/events';
 import {
   ACTIVE_STATEMENT_CHANGED_EVENT,
@@ -1654,7 +1659,7 @@ class Snippet {
           });
         }
       } else {
-        huePubSub.publish('hue.global.error', { message: data.message });
+        huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
         self.status('failed');
       }
     };
@@ -1778,7 +1783,7 @@ class Snippet {
       self.previousChartOptions = vm.getPreviousChartOptions(self);
       $(document).trigger('executeStarted', { vm: vm, snippet: self });
       self.lastExecuted(now);
-      $('.jHueNotify').remove();
+      huePubSub.publish('hide.global.alerts');
       hueAnalytics.log('notebook', 'execute/' + self.type());
 
       notebook.forceHistoryInitialHeight(true);
@@ -1942,7 +1947,7 @@ class Snippet {
         .fail((xhr, textStatus, errorThrown) => {
           if (self.statusForButtons() != 'canceled' && xhr.status !== 502) {
             // No error when manually canceled
-            huePubSub.publish('hue.global.error', { message: xhr.responseText });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
           }
           self.status('failed');
           self.statusForButtons('executed');
@@ -2126,13 +2131,13 @@ class Snippet {
             self.showSqlAnalyzer(true);
             self.hasSuggestion(true);
           } else {
-            huePubSub.publish('hue.global.error', { message: data.message });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
           }
         }
       )
         .fail((xhr, textStatus, errorThrown) => {
           if (xhr.status !== 502) {
-            huePubSub.publish('hue.global.error', { message: xhr.responseText });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
           }
         })
         .always(() => {
@@ -2204,7 +2209,7 @@ class Snippet {
           )
             .fail((xhr, textStatus, errorThrown) => {
               if (xhr.status !== 502) {
-                huePubSub.publish('hue.global.error', { message: xhr.responseText });
+                huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
               }
             })
             .always(() => {
@@ -2298,12 +2303,12 @@ class Snippet {
           if (data.status == 0) {
             self.result.meta(data.result.meta);
           } else {
-            huePubSub.publish('hue.global.error', { message: data.message });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
           }
         }
       ).fail((xhr, textStatus, errorThrown) => {
         if (xhr.status !== 502) {
-          huePubSub.publish('hue.global.error', { message: xhr.responseText });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
         }
         self.status('failed');
       });
@@ -2329,16 +2334,10 @@ class Snippet {
               }
             } else if (data.status == 5) {
               // No supported yet for this snippet
-            } else {
-              //$(document).trigger("error", data.message);
-              //huePubSub.publish('hue.global.error', {message: data.message});
             }
           }
         }
-      ).fail((xhr, textStatus, errorThrown) => {
-        //$(document).trigger("error", xhr.responseText);
-        //huePubSub.publish('hue.global.error', {message: xhr.responseText});
-      });
+      );
     };
 
     self.checkStatus = function () {
@@ -2419,7 +2418,7 @@ class Snippet {
         ).fail((xhr, textStatus, errorThrown) => {
           if (xhr.stausText !== 'abort') {
             if (xhr.status !== 502) {
-              huePubSub.publish('hue.global.error', { message: xhr.responseText || textStatus });
+              huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText || textStatus });
             }
             self.status('failed');
             notebook.isExecutingAll(false);
@@ -2494,7 +2493,7 @@ class Snippet {
         )
           .fail((xhr, textStatus, errorThrown) => {
             if (xhr.status !== 502) {
-              huePubSub.publish('hue.global.error', { message: xhr.responseText });
+              huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
             }
             self.statusForButtons('canceled');
             self.status('failed');
@@ -2522,13 +2521,7 @@ class Snippet {
             // self._ajaxError(data);
           }
         }
-      ).fail((xhr, textStatus, errorThrown) => {
-        if (xhr.status !== 502) {
-          // $(document).trigger("error", xhr.responseText);
-          //huePubSub.publish('hue.global.error', {message: xhr.responseText});
-        }
-        // self.status('failed'); // Can conflict with slow close and new query execution
-      });
+      );
     };
 
     self.clearActiveExecuteRequests = function () {
@@ -2632,7 +2625,7 @@ class Snippet {
       ).fail((xhr, textStatus, errorThrown) => {
         if (xhr.statusText !== 'abort') {
           if (xhr.status !== 502) {
-            huePubSub.publish('hue.global.error', { message: xhr.responseText || textStatus });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText || textStatus });
           }
           self.status('failed');
         }
@@ -2652,14 +2645,14 @@ class Snippet {
         },
         data => {
           if (data.status == 0) {
-            $(document).trigger(
-              'info',
-              data.upload_history[self.type()].count +
+            huePubSub.publish(GLOBAL_INFO_TOPIC, {
+              message:
+                data.upload_history[self.type()].count +
                 ' queries uploaded successfully. Processing them...'
-            );
+            });
             self.watchUploadStatus(data.upload_history[self.type()].status.workloadId);
           } else {
-            huePubSub.publish('hue.global.error', { message: data.message });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
           }
         }
       );
@@ -2675,7 +2668,7 @@ class Snippet {
     self.uploadTableStats = function (options) {
       hueAnalytics.log('notebook', 'load_table_stats');
       if (options.showProgress) {
-        huePubSub.publish('hue.global.info', { message: 'Preparing table data...' });
+        huePubSub.publish(GLOBAL_INFO_TOPIC, { message: 'Preparing table data...' });
       }
 
       $.post(
@@ -2694,19 +2687,19 @@ class Snippet {
         data => {
           if (data.status == 0) {
             if (options.showProgress) {
-              $(document).trigger(
-                'info',
-                $.map(options.activeTables, table => {
-                  return table.tableName;
-                }) + ' stats sent to analyse'
-              );
+              huePubSub.publish(GLOBAL_INFO_TOPIC, {
+                message:
+                  $.map(options.activeTables, table => {
+                    return table.tableName;
+                  }) + ' stats sent to analyse'
+              });
             }
             if (data.upload_table_ddl && options.showProgress) {
               // With showProgress only currently as can be very slow
               self.watchUploadStatus(data.upload_table_ddl.status.workloadId, options.showProgress);
             }
           } else if (options.showProgress) {
-            huePubSub.publish('hue.global.error', { message: data.message });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
           }
         }
       ).always(() => {
@@ -2725,7 +2718,7 @@ class Snippet {
         data => {
           if (data.status == 0) {
             if (showProgress) {
-              huePubSub.publish('hue.global.info', {
+              huePubSub.publish(GLOBAL_INFO_TOPIC, {
                 message: 'Query processing: ' + data.upload_status.status.state
               });
             }
@@ -2734,19 +2727,19 @@ class Snippet {
                 self.watchUploadStatus(workloadId);
               }, 2000);
             } else if (showProgress) {
-              $(document).trigger(
-                'warn',
-                data.upload_status.status.statusMsg +
+              huePubSub.publish(GLOBAL_WARNING_TOPIC, {
+                message:
+                  data.upload_status.status.statusMsg +
                   (data.upload_status.status.failedQueries > 0
                     ? '. ' +
                       data.upload_status.status.failQueryDetails.map(query => {
                         return query.error;
                       })
                     : '')
-              );
+              });
             }
           } else if (showProgress) {
-            huePubSub.publish('hue.global.error', { message: data.message });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
           }
         }
       );
@@ -2767,7 +2760,7 @@ class Snippet {
             // eslint-disable-next-line no-restricted-syntax
             console.log(data.statement_similarity);
           } else {
-            huePubSub.publish('hue.global.error', { message: data.message });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
           }
         }
       );

+ 10 - 9
desktop/core/src/desktop/js/apps/tableBrowser/metastoreTable.js

@@ -19,11 +19,12 @@ import $ from 'jquery';
 import * as ko from 'knockout';
 
 import apiHelper from 'api/apiHelper';
-import deXSS from 'utils/html/deXSS';
-import huePubSub from 'utils/huePubSub';
 import MetastoreColumn from 'apps/tableBrowser/metastoreColumn';
 import MetastoreTableSamples from 'apps/tableBrowser/metastoreTableSamples';
 import MetastoreTablePartitions from 'apps/tableBrowser/metastoreTablePartitions';
+import { GLOBAL_ERROR_TOPIC, GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
+import deXSS from 'utils/html/deXSS';
+import huePubSub from 'utils/huePubSub';
 import I18n from 'utils/i18n';
 
 let contextPopoverTimeout = -1;
@@ -138,9 +139,9 @@ class MetastoreTable {
         })
         .catch(data => {
           this.refreshingTableStats(false);
-          $.jHueNotify.error(
-            I18n('An error occurred refreshing the table stats. Please try again.')
-          );
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, {
+            message: I18n('An error occurred refreshing the table stats. Please try again.')
+          });
           console.error('apiHelper.refreshTableStats error');
           console.error(data);
         });
@@ -365,7 +366,7 @@ class MetastoreTable {
         if (resp.history_uuid) {
           huePubSub.publish('notebook.task.submitted', resp);
         } else {
-          huePubSub.publish('hue.global.error', { message: resp.message });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: resp.message });
         }
       });
     };
@@ -378,11 +379,11 @@ class MetastoreTable {
           if (data && data.status === 0) {
             this.relationshipsDetails(ko.mapping.fromJS(data));
           } else {
-            huePubSub.publish('hue.global.error', { message: data.message });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
           }
         })
         .fail(xhr => {
-          huePubSub.publish('hue.global.info', { message: xhr.responseText });
+          huePubSub.publish(GLOBAL_INFO_TOPIC, { message: xhr.responseText });
         });
     };
   }
@@ -422,7 +423,7 @@ class MetastoreTable {
         $('#import-data-modal').html(data['data']);
       })
       .fail(xhr => {
-        huePubSub.publish('hue.global.error', { message: xhr.responseText });
+        huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
       });
   }
 

+ 4 - 2
desktop/core/src/desktop/js/config/hueConfig.ts

@@ -33,6 +33,8 @@ import {
   SchedulerInterpreter
 } from './types';
 import huePubSub from 'utils/huePubSub';
+import { GLOBAL_ERROR_TOPIC } from '../reactComponents/AlertComponent/events';
+import { HueAlert } from '../reactComponents/AlertComponent/types';
 
 interface InterpreterMap {
   [AppType.browser]: BrowserInterpreter;
@@ -54,8 +56,8 @@ export const refreshConfig = async (): Promise<HueConfig> => {
       if (apiResponse.status == 0) {
         lastKnownConfig = apiResponse;
         resolve(lastKnownConfig);
-      } else {
-        huePubSub.publish('hue.error', apiResponse.message);
+      } else if (apiResponse.message) {
+        huePubSub.publish<HueAlert>(GLOBAL_ERROR_TOPIC, { message: apiResponse.message });
         reject();
       }
     } catch (err) {

+ 13 - 16
desktop/core/src/desktop/js/doc/hueDocument.js

@@ -18,6 +18,7 @@ import $ from 'jquery';
 import * as ko from 'knockout';
 
 import apiHelper from 'api/apiHelper';
+import { GLOBAL_ERROR_TOPIC } from 'reactComponents/AlertComponent/events';
 import escapeOutput from 'utils/html/escapeOutput';
 import highlight from 'utils/html/highlight';
 import huePubSub from 'utils/huePubSub';
@@ -159,20 +160,18 @@ class HueDocument {
       response => {
         if (response != null) {
           if (response.status !== 0) {
-            $(document).trigger(
-              'error',
-              'There was an error processing your action: ' + response.message
-            );
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, {
+              message: 'There was an error processing your action: ' + response.message
+            });
           } else {
             self.load();
           }
         }
       }
     ).fail(response => {
-      $(document).trigger(
-        'error',
-        'There was an error processing your action: ' + response.responseText
-      );
+      huePubSub.publish(GLOBAL_ERROR_TOPIC, {
+        message: 'There was an error processing your action: ' + response.responseText
+      });
     });
   }
 
@@ -189,20 +188,18 @@ class HueDocument {
       response => {
         if (response != null) {
           if (response.status !== 0) {
-            $(document).trigger(
-              'error',
-              'There was an error processing your action: ' + response.message
-            );
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, {
+              message: 'There was an error processing your action: ' + response.message
+            });
           } else {
             // self.load();
           }
         }
       }
     ).fail(response => {
-      $(document).trigger(
-        'error',
-        'There was an error processing your action: ' + response.responseText
-      );
+      huePubSub.publish(GLOBAL_ERROR_TOPIC, {
+        message: 'There was an error processing your action: ' + response.responseText
+      });
     });
   }
 

+ 2 - 1
desktop/core/src/desktop/js/doc/hueFileEntry.js

@@ -22,6 +22,7 @@ import huePubSub from 'utils/huePubSub';
 import HueDocument from 'doc/hueDocument';
 import { DOCUMENT_TYPE_I18n, DOCUMENT_TYPES } from 'doc/docSupport';
 import { SHOW_DELETE_DOC_MODAL_EVENT } from 'ko/components/ko.deleteDocModal';
+import { GLOBAL_ERROR_TOPIC } from 'reactComponents/AlertComponent/events';
 
 const SORTS = {
   defaultAsc: (a, b) => {
@@ -134,7 +135,7 @@ class HueFileEntry {
         }
         this.selectedDocsWithDependents(docsWithDependents);
       }).fail(response => {
-        huePubSub.publish('hue.global.error', {
+        huePubSub.publish(GLOBAL_ERROR_TOPIC, {
           message: 'Error getting document data: ' + response.responseText
         });
       });

+ 3 - 3
desktop/core/src/desktop/js/hue.js

@@ -52,7 +52,6 @@ import huePubSub from 'utils/huePubSub';
 import hueUtils from 'utils/hueUtils';
 import I18n from 'utils/i18n';
 import MultiLineEllipsisHandler from 'utils/multiLineEllipsisHandler';
-
 import sqlUtils from 'sql/sqlUtils';
 
 import 'webComponents/HueIcons';
@@ -77,6 +76,7 @@ import { getLastKnownConfig, refreshConfig } from 'config/hueConfig';
 import { simpleGet } from 'api/apiUtils'; // In analytics.mako, metrics.mako, threads.mako
 import Mustache from 'mustache'; // In hbase/templates/app.mako, jobsub.templates.js, search.ko.js, search.util.js
 import { createReactComponents } from 'reactComponents/createRootElements.js';
+import { GLOBAL_ERROR_TOPIC } from 'reactComponents/AlertComponent/events';
 
 // TODO: Migrate away
 window._ = _;
@@ -152,11 +152,11 @@ $(document).ready(async () => {
         if (resp.history_uuid) {
           huePubSub.publish('open.editor.query', resp);
         } else if (resp.message) {
-          huePubSub.publish('hue.global.error', { message: resp.message });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: resp.message });
         }
       }
     ).fail(xhr => {
-      huePubSub.publish('hue.global.error', { message: xhr.responseText });
+      huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
     });
   });
 

+ 0 - 1
desktop/core/src/desktop/js/jquery/jquery.common.js

@@ -41,7 +41,6 @@ import 'jquery/plugins/jquery.hdfs.autocomplete';
 import 'jquery/plugins/jquery.hiveautocomplete';
 import 'jquery/plugins/jquery.horizontalscrollbar';
 import 'jquery/plugins/jquery.huedatatable';
-import 'jquery/plugins/jquery.notify';
 import 'jquery/plugins/jquery.rowselector';
 import 'jquery/plugins/jquery.scrollleft';
 import 'jquery/plugins/jquery.scrollup';

+ 5 - 4
desktop/core/src/desktop/js/jquery/plugins/jquery.filechooser.js

@@ -18,6 +18,7 @@ import $ from 'jquery';
 import * as ko from 'knockout';
 import qq from 'ext/fileuploader.custom';
 
+import { GLOBAL_ERROR_TOPIC, GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
 import huePubSub from 'utils/huePubSub';
 import I18n from 'utils/i18n';
 import { hueLocalStorage } from 'utils/storageUtils';
@@ -757,7 +758,7 @@ Plugin.prototype.navigateTo = function (path) {
                 }
               },
               error: function (xhr) {
-                huePubSub.publish('hue.global.error', { message: xhr.responseText });
+                huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
               }
             });
           }
@@ -787,7 +788,7 @@ Plugin.prototype.navigateTo = function (path) {
     }
   }).fail(e => {
     if (!_parent.options.suppressErrors) {
-      huePubSub.publish('hue.global.info', { message: _parent.options.labels.FILE_NOT_FOUND });
+      huePubSub.publish(GLOBAL_INFO_TOPIC, { message: _parent.options.labels.FILE_NOT_FOUND });
       _parent.options.onError();
     }
     if (e.status === 404 || e.status === 500) {
@@ -797,7 +798,7 @@ Plugin.prototype.navigateTo = function (path) {
       );
     } else {
       console.error(e);
-      huePubSub.publish('hue.global.error', { message: e.statusText });
+      huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: e.statusText });
     }
   });
 };
@@ -815,7 +816,7 @@ function initUploader(path, _parent, el, labels) {
     onComplete: function (id, fileName, responseJSON) {
       num_of_pending_uploads--;
       if (responseJSON.status == -1) {
-        huePubSub.publish('hue.global.error', { message: responseJSON.data });
+        huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: responseJSON.data });
       } else if (!num_of_pending_uploads) {
         _parent.navigateTo(path);
         huePubSub.publish('assist.' + getFs(getScheme(path)) + '.refresh');

+ 5 - 1
desktop/core/src/desktop/js/jquery/plugins/jquery.hdfstree.js

@@ -16,6 +16,8 @@
 
 import jQuery from 'jquery';
 
+import { GLOBAL_ERROR_TOPIC } from 'reactComponents/AlertComponent/events';
+import huePubSub from 'utils/huePubSub';
 import I18n from 'utils/i18n';
 import scrollbarWidth from 'utils/screen/scrollbarWidth';
 
@@ -326,7 +328,9 @@ Plugin.prototype.init = function (optionalPath) {
           });
         }
       } else {
-        $.jHueNotify.error(data.error);
+        huePubSub.publish(GLOBAL_ERROR_TOPIC, {
+          message: data.error
+        });
       }
     });
   }

+ 0 - 160
desktop/core/src/desktop/js/jquery/plugins/jquery.notify.js

@@ -1,160 +0,0 @@
-// Licensed to Cloudera, Inc. under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  Cloudera, Inc. 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.
-
-import $ from 'jquery';
-
-import deXSS from 'utils/html/deXSS';
-
-/*
- * jHue notify plugin
- *
- */
-
-const pluginName = 'jHueNotify',
-  TYPES = {
-    INFO: 'INFO',
-    ERROR: 'ERROR',
-    GENERAL: 'GENERAL'
-  },
-  defaults = {
-    level: TYPES.GENERAL,
-    message: '',
-    sticky: false,
-    css: null
-  };
-
-function Plugin(options) {
-  this.options = $.extend({}, defaults, options);
-  this._defaults = defaults;
-  this._name = pluginName;
-  this.show();
-}
-
-Plugin.prototype.setOptions = function (options) {
-  this.options = $.extend({}, defaults, options);
-};
-
-Plugin.prototype.show = function () {
-  const _this = this;
-  const MARGIN = 4;
-
-  _this.options.message = _this.options.message.replace(/(<([^>]+)>)/gi, ''); // escape HTML messages
-  _this.options.message = deXSS(_this.options.message); // escape XSS messages
-
-  if (
-    /^(504|upstream connect error|Gateway Time-out|Service connectivity error)/.test(
-      _this.options.message.trim()
-    )
-  ) {
-    console.warn(_this.options.message);
-    return;
-  }
-
-  if (
-    _this.options.message !== '' &&
-    $('.jHueNotify .message').last().text() !== _this.options.message
-  ) {
-    const el = $('#jHueNotify').clone();
-    el.removeAttr('id');
-
-    // stops all the current animations and resets the style
-    el.stop(true);
-    el.attr('class', 'alert jHueNotify');
-    el.find('.close').hide();
-
-    if ($('.jHueNotify').last().position() != null) {
-      el.css(
-        'top',
-        $('.jHueNotify').last().position().top + $('.jHueNotify').last().outerHeight() + MARGIN
-      );
-    }
-
-    if (_this.options.level == TYPES.ERROR) {
-      el.addClass('alert-error');
-    } else if (_this.options.level == TYPES.INFO) {
-      el.addClass('alert-info');
-    }
-    el.find('.message').html('<strong>' + _this.options.message + '</strong>');
-
-    if (_this.options.css != null) {
-      el.attr('style', _this.options.css);
-    }
-
-    el.on('dblclick', () => {
-      el.toggleClass('expanded');
-    });
-
-    if (_this.options.sticky) {
-      el.find('.close')
-        .click(() => {
-          el.fadeOut();
-          el.nextAll('.jHueNotify').animate(
-            {
-              top: '-=' + (el.outerHeight() + MARGIN)
-            },
-            200
-          );
-          el.remove();
-        })
-        .show();
-      el.show();
-    } else {
-      const t = window.setTimeout(() => {
-        el.fadeOut();
-        el.nextAll('.jHueNotify').animate(
-          {
-            top: '-=' + (el.outerHeight() + MARGIN)
-          },
-          200
-        );
-        el.remove();
-      }, 3000);
-      el.click(function () {
-        window.clearTimeout(t);
-        $(this).stop(true);
-        $(this).fadeOut();
-        $(this)
-          .nextAll('.jHueNotify')
-          .animate(
-            {
-              top: '-=' + ($(this).outerHeight() + MARGIN)
-            },
-            200
-          );
-      });
-      el.show();
-    }
-    el.appendTo('body');
-  }
-};
-
-$[pluginName] = function () {};
-
-$[pluginName].info = function (message) {
-  new Plugin({ level: TYPES.INFO, message: message });
-};
-
-$[pluginName].warn = function (message) {
-  new Plugin({ level: TYPES.GENERAL, message: message, sticky: true });
-};
-
-$[pluginName].error = function (message) {
-  new Plugin({ level: TYPES.ERROR, message: message, sticky: true });
-};
-
-$[pluginName].notify = function (options) {
-  new Plugin(options);
-};

+ 4 - 1
desktop/core/src/desktop/js/ko/bindings/charts/ko.leafletMapChart.js

@@ -21,6 +21,7 @@ import 'ext/leaflet/leaflet.markercluster';
 import 'ext/leaflet/leaflet.heat';
 import 'ext/leaflet/leaflet.zoombox';
 
+import { GLOBAL_ERROR_TOPIC } from 'reactComponents/AlertComponent/events';
 import huePubSub from 'utils/huePubSub';
 
 ko.bindingHandlers.leafletMapChart = {
@@ -300,7 +301,9 @@ ko.bindingHandlers.leafletMapChart = {
             resizeSubscription.remove();
           });
         } catch (err) {
-          $.jHueNotify.error(err.message);
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, {
+            message: err.message
+          });
         }
       }
 

+ 6 - 4
desktop/core/src/desktop/js/ko/bindings/ko.dateRangePicker.js

@@ -17,6 +17,9 @@
 import $ from 'jquery';
 import * as ko from 'knockout';
 
+import { GLOBAL_ERROR_TOPIC } from 'reactComponents/AlertComponent/events';
+import huePubSub from 'utils/huePubSub';
+
 ko.bindingHandlers.dateRangePicker = {
   INTERVAL_OPTIONS: [
     {
@@ -428,10 +431,9 @@ ko.bindingHandlers.dateRangePicker = {
               .find('.end-date')
               .datepicker('setValue', _tmpl.find('.end-date').data('original-val'));
           }
-          // non-sticky error notification
-          $.jHueNotify.notify({
-            level: 'ERROR',
-            message: 'The end cannot be before the starting moment'
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, {
+            message: 'The end cannot be before the starting moment',
+            noStick: true
           });
         }
       } else {

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

@@ -17,8 +17,9 @@
 import Dropzone from 'dropzone';
 import $ from 'jquery';
 import * as ko from 'knockout';
-import huePubSub from 'utils/huePubSub';
 
+import { GLOBAL_ERROR_TOPIC, GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
+import huePubSub from 'utils/huePubSub';
 import I18n from 'utils/i18n';
 
 // TODO: Depends on Dropzone
@@ -71,19 +72,21 @@ ko.bindingHandlers.dropzone = {
         $('#progressStatusBar div').width(progress.toFixed() + '%');
       },
       canceled: function () {
-        $.jHueNotify.info(I18n('The upload has been canceled'));
+        huePubSub.publish(GLOBAL_INFO_TOPIC, {
+          message: I18n('The upload has been canceled')
+        });
       },
       complete: function (file) {
         if (file.xhr.response !== '') {
           const response = JSON.parse(file.xhr.response);
           if (response && response.status != null) {
             if (response.status !== 0) {
-              huePubSub.publish('hue.global.error', { message: response.data });
+              huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: response.data });
               if (value.onError) {
                 value.onError(file.name);
               }
             } else {
-              huePubSub.publish('hue.global.info', {
+              huePubSub.publish(GLOBAL_INFO_TOPIC, {
                 message: response.path + ' ' + I18n('uploaded successfully')
               });
               if (value.onComplete) {

+ 4 - 2
desktop/core/src/desktop/js/ko/components/assist/ko.assistStoragePanel.js

@@ -57,7 +57,9 @@ const TEMPLATE = `
             url: '/filebrowser/upload/file?dest=' + (source.type === 'adls' ? 'adl:' : '') + path,
             params: { dest: path },
             paramName: 'hdfs_file',
-            onError: function(x, e){ $(document).trigger('error', e); },
+            onError: function(x, e){
+              huePubSub.publish('hue.global.error', { message: e });
+            },
             onComplete: function () { huePubSub.publish('assist.storage.refresh'); } }" title="${I18n(
               'Upload file'
             )}" href="javascript:void(0)">
@@ -72,7 +74,7 @@ const TEMPLATE = `
             url: '/filebrowser/upload/file?dest=' + abfsPath,
             params: { dest: abfsPath },
             paramName: 'hdfs_file',
-            onError: function(x, e){ $(document).trigger('error', e); },
+            onError: function(x, e){ huePubSub.publish('hue.global.error', { message: e }); },
             onComplete: function () { huePubSub.publish('assist.storage.refresh'); } }" title="${I18n(
               'Upload file'
             )}" href="javascript:void(0)">

+ 20 - 19
desktop/core/src/desktop/js/ko/components/ko.sentryPrivileges.js

@@ -19,6 +19,7 @@ import * as ko from 'knockout';
 import koMapping from 'knockout.mapping';
 
 import componentUtils from './componentUtils';
+import { GLOBAL_ERROR_TOPIC, GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
 import huePubSub from 'utils/huePubSub';
 import I18n from 'utils/i18n';
 import UUID from 'utils/string/UUID';
@@ -469,7 +470,7 @@ class Role {
     };
 
     self.saveGroups = function () {
-      $('.jHueNotify').remove();
+      huePubSub.publish('hide.global.alerts');
       $.post(
         '/security/api/hive/update_role_groups',
         {
@@ -483,16 +484,16 @@ class Role {
               self.originalGroups.push(group);
             });
           } else {
-            huePubSub.publish('hue.global.error', { message: data.message });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
           }
         }
       ).fail(xhr => {
-        huePubSub.publish('hue.global.error', { message: xhr.responseText });
+        huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
       });
     };
 
     self.create = function () {
-      $('.jHueNotify').remove();
+      huePubSub.publish('hide.global.alerts');
       if (self.isValid()) {
         self.isLoading(true);
         $.post(
@@ -502,7 +503,7 @@ class Role {
           },
           data => {
             if (data.status === 0) {
-              huePubSub.publish('hue.global.info', { message: data.message });
+              huePubSub.publish(GLOBAL_INFO_TOPIC, { message: data.message });
               vm.showCreateRole(false);
               self.reset();
               const role = new Role(vm, data.role);
@@ -511,12 +512,12 @@ class Role {
               vm.listSentryPrivilegesByAuthorizable();
               $(document).trigger('createdRole');
             } else {
-              huePubSub.publish('hue.global.error', { message: data.message });
+              huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
             }
           }
         )
           .fail(xhr => {
-            huePubSub.publish('hue.global.error', { message: xhr.responseText });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
           })
           .always(() => {
             self.isLoading(false);
@@ -525,7 +526,7 @@ class Role {
     };
 
     self.update = function () {
-      $('.jHueNotify').remove();
+      huePubSub.publish('hide.global.alerts');
       if (self.isValid()) {
         self.isLoading(true);
         $.post(
@@ -535,17 +536,17 @@ class Role {
           },
           data => {
             if (data.status === 0) {
-              huePubSub.publish('hue.global.info', { message: data.message });
+              huePubSub.publish(GLOBAL_INFO_TOPIC, { message: data.message });
               vm.showCreateRole(false);
               vm.listSentryPrivilegesByAuthorizable();
               $(document).trigger('createdRole');
             } else {
-              huePubSub.publish('hue.global.error', { message: data.message });
+              huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
             }
           }
         )
           .fail(xhr => {
-            huePubSub.publish('hue.global.error', { message: xhr.responseText });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
           })
           .always(() => {
             self.isLoading(false);
@@ -554,7 +555,7 @@ class Role {
     };
 
     self.remove = function (role) {
-      $('.jHueNotify').remove();
+      huePubSub.publish('hide.global.alerts');
       self.isLoading(true);
       $.post(
         '/security/api/hive/drop_sentry_role',
@@ -567,12 +568,12 @@ class Role {
             vm.listSentryPrivilegesByAuthorizable();
             $(document).trigger('removedRole');
           } else {
-            huePubSub.publish('hue.global.error', { message: data.message });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
           }
         }
       )
         .fail(xhr => {
-          huePubSub.publish('hue.global.error', { message: xhr.responseText });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
         })
         .always(() => {
           self.isLoading(false);
@@ -580,7 +581,7 @@ class Role {
     };
 
     self.savePrivileges = function (role) {
-      $('.jHueNotify').remove();
+      huePubSub.publish('hide.global.alerts');
       $.post(
         '/security/api/hive/save_privileges',
         {
@@ -591,11 +592,11 @@ class Role {
             vm.listSentryPrivilegesByAuthorizable();
             $(document).trigger('createdRole');
           } else {
-            huePubSub.publish('hue.global.error', { message: data.message });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
           }
         }
       ).fail(xhr => {
-        huePubSub.publish('hue.global.error', { message: xhr.responseText });
+        huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
       });
     };
   }
@@ -748,12 +749,12 @@ class SentryPrivilegesViewModel {
               self.privileges(_privileges);
             }
           } else {
-            huePubSub.publish('hue.global.error', { message: data.message });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
           }
         }
       })
         .fail(xhr => {
-          huePubSub.publish('hue.global.error', { message: xhr.responseText });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
         })
         .always(() => {
           self.isLoadingPrivileges(false);

+ 4 - 3
desktop/core/src/desktop/js/onePageViewModel.js

@@ -27,6 +27,7 @@ import waitForVariable from 'utils/timing/waitForVariable';
 import getParameter from 'utils/url/getParameter';
 import getSearchParameter from 'utils/url/getSearchParameter';
 import { ASSIST_GET_DATABASE_EVENT, ASSIST_GET_SOURCE_EVENT } from 'ko/components/assist/events';
+import { GLOBAL_ERROR_TOPIC } from 'reactComponents/AlertComponent/events';
 
 class OnePageViewModel {
   constructor() {
@@ -412,11 +413,11 @@ class OnePageViewModel {
             } else if (app !== '500') {
               self.loadApp('500');
             } else {
-              $.jHueNotify.error(
-                I18n(
+              huePubSub.publish(GLOBAL_ERROR_TOPIC, {
+                message: I18n(
                   'It looks like you are offline or an unknown error happened. Please refresh the page.'
                 )
-              );
+              });
             }
           }
         });

File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/css/hue.css


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/css/hue3-extra.css


+ 0 - 149
desktop/core/src/desktop/static/desktop/js/jquery.notify.js

@@ -1,149 +0,0 @@
-// Licensed to Cloudera, Inc. under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  Cloudera, Inc. 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.
-/*
- * jHue notify plugin
- *
- */
-;
-(function ($, window, document, undefined) {
-
-  var pluginName = "jHueNotify",
-    TYPES = {
-      INFO: "INFO",
-      ERROR: "ERROR",
-      GENERAL: "GENERAL"
-    },
-    defaults = {
-      level: TYPES.GENERAL,
-      message: "",
-      sticky: false,
-      css: null
-    };
-
-  function Plugin(options) {
-    this.options = $.extend({}, defaults, options);
-    this._defaults = defaults;
-    this._name = pluginName;
-    this.show();
-  }
-
-  Plugin.prototype.setOptions = function (options) {
-    this.options = $.extend({}, defaults, options);
-  };
-
-  Plugin.prototype.show = function () {
-    var _this = this;
-    var MARGIN = 4;
-
-    if (
-      /^(504|upstream connect error|Gateway Time-out|Service connectivity error)/.test(
-        _this.options.message.trim()
-      )
-    ) {
-      console.warn(_this.options.message);
-      return;
-    }
-
-    _this.options.message = _this.options.message.replace(/(<([^>]+)>)/ig, ''); // escape HTML messages
-    _this.options.message = hueUtils.deXSS(_this.options.message); // escape XSS messages
-
-    if (_this.options.message !== '' && $(".jHueNotify .message").last().text() !== _this.options.message) {
-
-      var el = $("#jHueNotify").clone();
-      el.removeAttr("id");
-
-      // stops all the current animations and resets the style
-      el.stop(true);
-      el.attr("class", "alert jHueNotify");
-      el.find(".close").hide();
-
-      if ($(".jHueNotify").last().position() != null) {
-        el.css("top", $(".jHueNotify").last().position().top + $(".jHueNotify").last().outerHeight() + MARGIN);
-      }
-
-      var scrollColor = '#f0c36d';
-
-      if (_this.options.level == TYPES.ERROR) {
-        el.addClass("alert-error");
-        scrollColor = '#b94a48';
-      }
-      else if (_this.options.level == TYPES.INFO) {
-        el.addClass("alert-info");
-        scrollColor = '#0B7FAD';
-      }
-      el.find(".message").html("<strong>" + _this.options.message + "</strong>");
-
-      if (_this.options.css != null) {
-        el.attr("style", _this.options.css);
-      }
-
-      el.on('dblclick', function () {
-        el.toggleClass('expanded');
-      });
-
-      if (_this.options.sticky) {
-        el.find(".close").click(function () {
-          el.fadeOut();
-          el.nextAll(".jHueNotify").animate({
-            top: '-=' + (el.outerHeight() + MARGIN)
-          }, 200);
-          el.remove();
-        }).show();
-        el.show();
-      }
-      else {
-        var t = window.setTimeout(function () {
-          el.fadeOut();
-          el.nextAll(".jHueNotify").animate({
-            top: '-=' + (el.outerHeight() + MARGIN)
-          }, 200);
-          el.remove();
-
-        }, 3000);
-        el.click(function () {
-          window.clearTimeout(t);
-          $(this).stop(true);
-          $(this).fadeOut();
-          $(this).nextAll(".jHueNotify").animate({
-            top: '-=' + ($(this).outerHeight() + MARGIN)
-          }, 200);
-        });
-        el.show();
-      }
-      el.appendTo('body');
-    }
-  };
-
-  $[pluginName] = function () {
-  };
-
-  $[pluginName].info = function (message) {
-    new Plugin({level: TYPES.INFO, message: message});
-  };
-
-  $[pluginName].warn = function (message) {
-    new Plugin({level: TYPES.GENERAL, message: message, sticky: true});
-  };
-
-  $[pluginName].error = function (message) {
-    new Plugin({level: TYPES.ERROR, message: message, sticky: true});
-  };
-
-  $[pluginName].notify = function (options) {
-    new Plugin(options);
-  };
-
-})(jQuery, window, document);

+ 0 - 48
desktop/core/src/desktop/static/desktop/less/components/hue-notify.less

@@ -1,48 +0,0 @@
-/*
- Licensed to Cloudera, Inc. under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  Cloudera, Inc. 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.
-*/
-
-.jHueNotify {
-  position: fixed;
-  top: 20px;
-  right: 10px;
-  width: 400px;
-  text-align: left;
-  z-index: 11000;
-  padding-right: 10px;
-}
-
-.jHueNotify .message {
-  max-height: 140px;
-  overflow-y: auto;
-  word-break: break-all;
-  width: 380px;
-}
-
-.jHueNotify.expanded {
-  z-index: 11001;
-  top: 20px !important;
-  left: 10px;
-  bottom: 10px;
-  width: auto;
-}
-
-.jHueNotify.expanded .message {
-  max-height: 100%;
-  width: auto;
-  word-break: normal;
-}

+ 0 - 1
desktop/core/src/desktop/static/desktop/less/hue-cross-version.less

@@ -27,7 +27,6 @@
 @import "components/hue-inputautocomplete.less";
 @import "components/hue-link-sharing.less";
 @import "components/hue-nav-properties.less";
-@import "components/hue-notify.less";
 @import "components/hue-popover.less";
 @import "components/hue-qq-upload.less";
 @import "components/hue-query-builder.less";

+ 0 - 10
desktop/core/src/desktop/templates/common_footer_m.mako

@@ -29,16 +29,6 @@ else:
 
 <script type="text/javascript">
   $(document).ready(function () {
-    $(document).on("info", function (e, msg) {
-      $.jHueNotify.info(msg);
-    });
-    $(document).on("warn", function (e, msg) {
-      $.jHueNotify.warn(msg);
-    });
-    $(document).on("error", function (e, msg) {
-      $.jHueNotify.error(msg);
-    });
-
     %if messages:
       %for message in messages:
         %if message.tags == 'error':

+ 0 - 8
desktop/core/src/desktop/templates/common_header.mako

@@ -569,11 +569,3 @@ ${ hueIcons.symbols() }
   }
   </script>
 % endif
-
-<div id="jHueNotify" class="alert alert-dismissible alert-warning hide">
-  <button type="button" class="close" data-dismiss="alert">
-    <span aria-hidden="true">&times;</span>
-    <span class="sr-only">${ _('Close') }</span>
-  </button>
-  <p class="message"></p>
-</div>

+ 7 - 16
desktop/core/src/desktop/templates/common_header_footer_components.mako

@@ -56,7 +56,9 @@ else:
     // Catches HTTP 502 errors
     function xhrOnreadystatechange() {
       if (this.readyState === 4 && this.status === 502) {
-        $.jHueNotify.error($('<span>').html(this.responseText).text());
+        huePubSub.publish('hue.global.error', {
+          message: $('<span>').html(this.responseText).text()
+        });
       }
       if (this._onreadystatechange) {
         return this._onreadystatechange.apply(this, arguments);
@@ -347,19 +349,6 @@ else:
           '</button>';
     }
 
-    $(document).on("info", function (e, msg) {
-      $.jHueNotify.info(msg);
-    });
-    $(document).on("warn", function (e, msg) {
-      $.jHueNotify.warn(msg);
-    });
-    window.huePubSub.subscribe('hue.error', function (msg) {
-      $.jHueNotify.error(msg);
-    });
-    $(document).on("error", function (e, msg) {
-      $.jHueNotify.error(msg);
-    });
-
     $($('#zoomDetectFrame')[0].contentWindow).resize(function () {
       $(window).trigger('zoom');
     });
@@ -405,7 +394,7 @@ else:
             });
           }
           window.setTimeout(function () {
-            $('.jHueNotify').remove();
+            huePubSub.publish('hide.global.alerts');
           }, 200);
         }
       }
@@ -423,7 +412,9 @@ else:
         }
         else {
           $('#login-modal').modal('hide');
-          $.jHueNotify.info('${ _('You have signed in successfully!') }');
+          huePubSub.publish('hue.global.info', {
+            message: "${ _('You have signed in successfully!') }"
+          });
           $('#login-modal .login-error').addClass('hide');
         }
       }

+ 3 - 1
desktop/core/src/desktop/templates/common_notebook_ko_components.mako

@@ -423,7 +423,9 @@ else:
         });
 
         clipboard.on('success', function (e) {
-          $.jHueNotify.info(self.snippet.result.data().length + ' ' + window.I18n('result(s) copied to the clipboard'));
+          huePubSub.publish('hue.global.info', {
+            message: self.snippet.result.data().length + ' ' + window.I18n('result(s) copied to the clipboard')
+          });
           e.clearSelection();
           $('.clipboard-content').empty();
         });

+ 0 - 6
desktop/core/src/desktop/templates/hue.mako

@@ -124,12 +124,6 @@
   </script>
 % endif
 
-<div id="jHueNotify" class="alert hide">
-  <button class="close">&times;</button>
-  <div class="message"></div> 
-</div>
-
-
 ${ hueIcons.symbols() }
 
 <!-- fake fields are a workaround for chrome autofill getting the wrong fields, readonly needed for 1password -->

+ 7 - 1
desktop/core/src/desktop/templates/job_browser_common.mako

@@ -1805,7 +1805,13 @@
           <button class="btn" type="button" data-clipboard-target="#query-impala-profile" style="float: right;"
                   data-bind="
                 visible: properties.profile && properties.profile().profile,
-                clipboard: { onSuccess: function() { $.jHueNotify.info('${ _("Profile copied to clipboard!") }'); } }">
+                clipboard: {
+                  onSuccess: function() {
+                    huePubSub.publish('hue.global.info', {
+                      message: "${ _("Profile copied to clipboard!") }"
+                    }
+                  }
+                }">
           <i class="fa fa-fw fa-clipboard"></i> ${ _('Clipboard') }
           </button>
           <button class="btn" type="button" style="float: right;" data-bind="

+ 3 - 1
desktop/core/src/desktop/templates/scheduler/submit_job_popup.mako

@@ -185,7 +185,9 @@ else:
             if (data.message) {
               message = data.message;
             }
-            $.jHueNotify.error(data.message + (data.detail ? (': ' + data.detail) : ''));
+            huePubSub.publish('hue.global.error', {
+              message: data.message + (data.detail ? (': ' + data.detail) : '')
+            });
           }
         }
       });

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

@@ -2426,7 +2426,7 @@ var SearchViewModel = function (collection_json, query_json, initial_json, has_g
 
 
     self.search = function (callback) {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       hueAnalytics.log('dashboard', 'search');
       self.isRetrievingResults(true);
 

+ 3 - 1
desktop/libs/dashboard/src/dashboard/templates/common_search.mako

@@ -5423,7 +5423,9 @@ $(document).ready(function () {
 
   function checkResultHighlightingAvailability() {
     if (! searchViewModel.collection.idField()) {
-      $(document).trigger("warn", "${ _('Result highlighting is unavailable: the collection does not have an index field') }");
+      huePubSub.publish('hue.global.warning', {
+        message: "${ _('Result highlighting is unavailable: the collection does not have an index field') }"
+      })
     }
   }
 </script>

+ 20 - 8
desktop/libs/indexer/src/indexer/templates/importer.mako

@@ -2206,7 +2206,7 @@ ${ commonheader(_("Importer"), "indexer", user, request, "60px") | n,unicode }
         }
       });
       self.streamCheckConnection = function() {
-        $(".jHueNotify").remove();
+        huePubSub.publish('hide.global.alerts');
         $.post("${ url('indexer:get_db_component') }", {
           "source": ko.mapping.toJSON(self)
         }, function (resp) {
@@ -3000,7 +3000,7 @@ ${ commonheader(_("Importer"), "indexer", user, request, "60px") | n,unicode }
         if (!self.readyToIndex()) {
           return;
         }
-        $(".jHueNotify").remove();
+        huePubSub.publish('hide.global.alerts');
 
         self.indexingStarted(true);
 % if not is_embeddable:
@@ -3016,7 +3016,9 @@ ${ commonheader(_("Importer"), "indexer", user, request, "60px") | n,unicode }
             self.indexingStarted(false);
             self.isIndexing(false);
           } else if (resp.on_success_url) {
-            $.jHueNotify.info("${ _('Creation success.') }");
+            huePubSub.publish('hue.global.info', {
+              message: "${ _('Creation success.') }"
+            });
             if (resp.pubSubUrl) {
               huePubSub.publish(notebook.pubSubUrl);
             }
@@ -3117,15 +3119,21 @@ ${ commonheader(_("Importer"), "indexer", user, request, "60px") | n,unicode }
           self.indexingStarted(false);
           if (resp.status === 0) {
             if (resp.history_uuid) {
-              $.jHueNotify.info("${ _('Task submitted') }");
+              huePubSub.publish('hue.global.info', {
+                message: "${ _('Task submitted') }"
+              });
               huePubSub.publish('notebook.task.submitted', resp);
             } else if (resp.on_success_url) {
               if (resp.pub_sub_url) {
                 huePubSub.publish(resp.pub_sub_url);
               }
-              $.jHueNotify.info("${ _('Creation success') }");
+              huePubSub.publish('hue.global.info', {
+                message: "${ _('Creation success') }"
+              });
               if (resp.errors && resp.errors.length) {
-                $.jHueNotify.warn("${ _('Skipped records: ') }" + resp.errors.join(', '));
+                huePubSub.publish('hue.global.warning', {
+                  message: "${ _('Skipped records: ') }" + resp.errors.join(', ')
+                });
               }
               huePubSub.publish('open.link', resp.on_success_url);
             } else if (resp.commands) {
@@ -3313,10 +3321,14 @@ ${ commonheader(_("Importer"), "indexer", user, request, "60px") | n,unicode }
         fd.append('file', files);
         var file_size = files.size;
         if (file_size === 0) {
-          $.jHueNotify.warn("${ _('This file is empty, please select another file.') }");
+          huePubSub.publish('hue.global.warning', {
+            message: "${ _('This file is empty, please select another file.') }"
+          });
         }
         else if (file_size > 200 * 1024) {          
-          $.jHueNotify.warn("${ _('File size exceeds the supported size (200 KB). Please use the S3, ABFS or HDFS browser to upload files.') }");
+          huePubSub.publish('hue.global.warning', {
+            message: "${ _('File size exceeds the supported size (200 KB). Please use the S3, ABFS or HDFS browser to upload files.') }"
+          });
         } else {
           $.ajax({
             url:"/indexer/api/indexer/upload_local_file",

+ 3 - 1
desktop/libs/indexer/src/indexer/templates/indexes.mako

@@ -909,7 +909,9 @@ ${ commonheader(_("Index Browser"), "search", user, request, "60px") | n,unicode
             viewModel.fetchIndex(foundIndex);
           }
           else {
-            $.jHueNotify.error('${ _('The specified index has not been found') }')
+            huePubSub.publish('hue.global.error', {
+              message: "${ _('The specified index has not been found') }"
+            });
             viewModel.showIndexes();
           }
         }

+ 3 - 1
desktop/libs/indexer/src/indexer/templates/topics.mako

@@ -839,7 +839,9 @@ ${ commonheader(_("Streams Browser"), "search", user, request, "60px") | n,unico
             viewModel.fetchIndex(foundIndex);
           }
           else {
-            $.jHueNotify.error('${ _('The specified index has not been found') }')
+            huePubSub.publish('hue.global.error', {
+              message: "${ _('The specified index has not been found') }"
+            });
             viewModel.showIndexes();
           }
         }

Some files were not shown because too many files changed in this diff