Преглед на файлове

[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 година
родител
ревизия
56f13d2b4e
променени са 80 файла, в които са добавени 436 реда и са изтрити 673 реда
  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);
       ko.applyBindings(viewModel);
 
 
       if (hueUtils.getParameter("error") != "") {
       if (hueUtils.getParameter("error") != "") {
-        $.jHueNotify.error(hueUtils.getParameter("error"));
+        huePubSub.publish('hue.global.error', {
+          message: hueUtils.getParameter('error')
+        });
       }
       }
 
 
       if ($(".removeBtn").length == 1) {
       if ($(".removeBtn").length == 1) {

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

@@ -1738,7 +1738,9 @@ $(document).ready(function () {
 
 
   $("#download-excel").click(function () {
   $("#download-excel").click(function () {
     if (viewModel.design.results.columns().length > 255) {
     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');
     $('#saveAs').find('.control-group').removeClass('error');
     hueAnalytics.log('beeswax', 'design/save-as');
     hueAnalytics.log('beeswax', 'design/save-as');
   } else if (viewModel.design.name()) {
   } 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');
     $('#saveAs').modal('hide');
   } else {
   } else {
     $('#saveas-query-name').addClass('error');
     $('#saveas-query-name').addClass('error');
@@ -2355,7 +2359,9 @@ function formatQuery() {
       }
       }
       viewModel.design.query.value(codeMirror.getValue());
       viewModel.design.query.value(codeMirror.getValue());
     } else {
     } 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);
       ko.applyBindings(viewModel);
 
 
       if (hueUtils.getParameter("error") != "") {
       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);
       ko.applyBindings(viewModel);
 
 
       if (hueUtils.getParameter("error") != "") {
       if (hueUtils.getParameter("error") != "") {
-        $.jHueNotify.error(hueUtils.getParameter("error"));
+        huePubSub.publish('hue.global.error', {
+          message: hueUtils.getParameter('error')
+        });
       }
       }
 
 
       $(".fileChooserBtn").click(function (e) {
       $(".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);
       ko.applyBindings(viewModel);
 
 
       if (hueUtils.getParameter("error") != "") {
       if (hueUtils.getParameter("error") != "") {
-        $.jHueNotify.error(hueUtils.getParameter("error"));
+        huePubSub.publish('hue.global.error', {
+          message: hueUtils.getParameter('error')
+        });
       }
       }
 
 
       $("[rel='tooltip']").tooltip();
       $("[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) {
       if (self.upperPage() - self.page() > self.MAX_ALLOWED_PAGES_PER_REQUEST) {
         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();
       self.changePage();
     };
     };
@@ -503,7 +505,9 @@ ${ fb_components.menubar() }
 
 
     % if not is_embeddable:
     % if not is_embeddable:
     $(document).ajaxError(function () {
     $(document).ajaxError(function () {
-      $.jHueNotify.error("${_('There was an unexpected server error.')}");
+      huePubSub.publish('hue.global.error', {
+        message: "${_('There was an unexpected server error.')}"
+      });
     });
     });
     % endif
     % endif
 
 

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

@@ -121,7 +121,9 @@ ${ fb_components.menubar() }
         success: function (data) {
         success: function (data) {
           if (data && data.exists) {
           if (data && data.exists) {
             resetPrimaryButtonsStatus();
             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) {
           if (data && data.exists) {
             resetPrimaryButtonsStatus();
             resetPrimaryButtonsStatus();
             $("#saveAsModal").modal("hide");
             $("#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);
               self.retrieveData(true);
             },
             },
             error: function(xhr){
             error: function(xhr){
-              $.jHueNotify.error(xhr.responseText);
+              huePubSub.publish('hue.global.error', {
+                message: xhr.responseText
+              });
               resetPrimaryButtonsStatus();
               resetPrimaryButtonsStatus();
               $('#moveDestination').val('');
               $('#moveDestination').val('');
             }
             }
           });
           });
 
 
           if (mode === 'nomodal') {
           if (mode === 'nomodal') {
-            $.jHueNotify.info('${ _('Items moving to') } "' + $('#moveDestination').val() + '"');
+            huePubSub.publish('hue.global.info', {
+              message: "${ _('Items moving to') } \"" + $('#moveDestination').val() + '"'
+            });
             $("#moveForm").submit();
             $("#moveForm").submit();
           } else {
           } else {
             $("#moveModal").modal({
             $("#moveModal").modal({
@@ -1573,7 +1577,9 @@ else:
           }
           }
         }
         }
         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('');
           $('#moveDestination').val('');
         }
         }
       };
       };
@@ -1602,7 +1608,9 @@ else:
             self.retrieveData(true);
             self.retrieveData(true);
           },
           },
           error: function(xhr){
           error: function(xhr){
-            $.jHueNotify.error(xhr.responseText);
+            huePubSub.publish('hue.global.error', {
+              message: xhr.responseText
+            });
             resetPrimaryButtonsStatus();
             resetPrimaryButtonsStatus();
           }
           }
         });
         });
@@ -1791,7 +1799,9 @@ else:
         const path = $('<input>').val(self.selectedFile().path).appendTo('body').select()
         const path = $('<input>').val(self.selectedFile().path).appendTo('body').select()
         document.execCommand('copy');
         document.execCommand('copy');
         path.remove();
         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 () {
       self.openInImporter = function () {
@@ -1810,7 +1820,9 @@ else:
             $('#submit-wf-modal').modal('show');
             $('#submit-wf-modal').modal('show');
           });
           });
         % else:
         % 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
         % endif
       };
       };
 
 
@@ -1863,7 +1875,9 @@ else:
           "start_time": ko.mapping.toJSON((new Date()).getTime())
           "start_time": ko.mapping.toJSON((new Date()).getTime())
         }, function (data) {
         }, function (data) {
           if (data.status == 0) {
           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);
             huePubSub.publish('notebook.task.submitted', data);
           } else {
           } else {
             huePubSub.publish('hue.global.error', {message: data.message});
             huePubSub.publish('hue.global.error', {message: data.message});
@@ -1899,7 +1913,9 @@ else:
           "start_time": ko.mapping.toJSON((new Date()).getTime())
           "start_time": ko.mapping.toJSON((new Date()).getTime())
         }, function (data) {
         }, function (data) {
           if (data.status == 0) {
           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);
             huePubSub.publish('notebook.task.submitted', data);
           } else {
           } else {
             huePubSub.publish('hue.global.error', {message: data.message});
             huePubSub.publish('hue.global.error', {message: data.message});
@@ -2366,7 +2382,9 @@ else:
               $('#progressStatusBar div').width(progress.toFixed() + "%");
               $('#progressStatusBar div').width(progress.toFixed() + "%");
             },
             },
             canceled: function () {
             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) {
             complete: function (data) {
               if (data.xhr.response != '') {
               if (data.xhr.response != '') {
@@ -2509,7 +2527,9 @@ else:
           }
           }
         });
         });
         if(isMoveOnSelf){
         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('');
           $('#moveDestination').val('');
           return false;
           return false;
         }
         }
@@ -2573,7 +2593,9 @@ else:
 
 
       huePubSub.subscribe('submit.popup.return', function (data) {
       huePubSub.subscribe('submit.popup.return', function (data) {
         if (data.type == 'external_workflow') {
         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('open.link', '/jobbrowser/#!id=' + data.job_id);
           huePubSub.publish('browser.job.open.link', data.job_id);
           huePubSub.publish('browser.job.open.link', data.job_id);
           $('.submit-modal').modal('hide');
           $('.submit-modal').modal('hide');
@@ -2668,7 +2690,9 @@ else:
         onEnter: function (el) {
         onEnter: function (el) {
           var target_path = stripHashes(el.val());
           var target_path = stripHashes(el.val());
           if (el.val().split('/')[2] === '' && window.RAZ_IS_ENABLED){
           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;
             target_path = window.USER_HOME_DIR;
           } 
           } 
           fileBrowserViewModel.targetPath("${url('filebrowser:filebrowser.views.view', path='')}" + encodeURIComponent(target_path)); 
           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 () {
   self.showSubmitPopup = function () {
     // If self.bundle.id() == null, need to save wf for now
     // If self.bundle.id() == null, need to save wf for now
-    $(".jHueNotify").remove();
+    huePubSub.publish('hide.global.alerts');
     if (!self.bundle.isDirty()) {
     if (!self.bundle.isDirty()) {
       hueAnalytics.log('oozie/editor/bundle', 'submit');
       hueAnalytics.log('oozie/editor/bundle', 'submit');
       $.get("/oozie/editor/bundle/submit/" + self.bundle.id(), {
       $.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) {
     self.save = function (cb) {
       if (!self.isSaving()) {
       if (!self.isSaving()) {
         self.isSaving(true);
         self.isSaving(true);
-        $(".jHueNotify").remove();
+        huePubSub.publish('hide.global.alerts');
         $.post("/oozie/editor/coordinator/save/", {
         $.post("/oozie/editor/coordinator/save/", {
           "coordinator": ko.mapping.toJSON(self.coordinator, COORDINATOR_MAPPING)
           "coordinator": ko.mapping.toJSON(self.coordinator, COORDINATOR_MAPPING)
         }, function (data) {
         }, function (data) {
@@ -277,7 +277,7 @@ var CoordinatorEditorViewModel = (function () {
     };
     };
 
 
     self.gen_xml = function () {
     self.gen_xml = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       hueAnalytics.log('oozie/editor/coordinator', 'gen_xml');
       hueAnalytics.log('oozie/editor/coordinator', 'gen_xml');
 
 
       $.post("/oozie/editor/coordinator/gen_xml/", {
       $.post("/oozie/editor/coordinator/gen_xml/", {
@@ -295,7 +295,7 @@ var CoordinatorEditorViewModel = (function () {
     };
     };
 
 
     self.showSubmitPopup = function () {
     self.showSubmitPopup = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
 
 
       if (!self.coordinator.isDirty()) {
       if (!self.coordinator.isDirty()) {
         hueAnalytics.log('oozie/editor/coordinator', 'submit');
         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 () {
   self.save = function () {
     if (! self.isSaving()) {
     if (! self.isSaving()) {
       self.isSaving(true);
       self.isSaving(true);
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       $.post("/oozie/editor/workflow/save/", {
       $.post("/oozie/editor/workflow/save/", {
         "layout": ko.mapping.toJSON(self.oozieColumns),
         "layout": ko.mapping.toJSON(self.oozieColumns),
         "workflow": ko.mapping.toJSON(self.workflow)
         "workflow": ko.mapping.toJSON(self.workflow)
@@ -1246,7 +1246,7 @@ var WorkflowEditorViewModel = function (layout_json, workflow_json, credentials_
   };
   };
 
 
   self.showSubmitPopup = function () {
   self.showSubmitPopup = function () {
-    $(".jHueNotify").remove();
+    huePubSub.publish('hide.global.alerts');
     $.get("/oozie/editor/workflow/submit/" + self.workflow.id(), {
     $.get("/oozie/editor/workflow/submit/" + self.workflow.id(), {
       format: 'json',
       format: 'json',
       cluster: self.compute() ? ko.mapping.toJSON(self.compute()) : '{}'
       cluster: self.compute() ? ko.mapping.toJSON(self.compute()) : '{}'
@@ -1258,7 +1258,7 @@ var WorkflowEditorViewModel = function (layout_json, workflow_json, credentials_
   };
   };
 
 
   self.showSubmitActionPopup = function (w) {
   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(), {
     $.get("/oozie/editor/workflow/submit_single_action/" + self.workflow.id() + "/" + self.workflow.getNodeById(w.id()).id(), {
       format: 'json'
       format: 'json'
     }, function (data) {
     }, function (data) {

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

@@ -91,7 +91,9 @@
             if (data.message) {
             if (data.message) {
               message = 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) {
     huePubSub.subscribe('submit.popup.return', function (data) {
       if (data.type == 'bundle') {
       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('open.link', '/jobbrowser/#!id=' + data.job_id);
         huePubSub.publish('browser.job.open.link', data.job_id);
         huePubSub.publish('browser.job.open.link', data.job_id);
         $('.submit-modal').modal('hide');
         $('.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) {
     huePubSub.subscribe('submit.popup.return', function (data) {
       if (data.type == 'schedule') {
       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('open.link', '/jobbrowser/#!id=' + data.job_id);
         huePubSub.publish('browser.job.open.link', data.job_id);
         huePubSub.publish('browser.job.open.link', data.job_id);
         $('.submit-modal').modal('hide');
         $('.submit-modal').modal('hide');

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

@@ -181,7 +181,9 @@
             if (data.message) {
             if (data.message) {
               message = 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) {
     huePubSub.subscribe('submit.popup.return', function (data) {
       if (data.type == 'workflow') {
       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('open.link', '/jobbrowser/#!id=' + data.job_id);
         huePubSub.publish('browser.job.open.link', data.job_id);
         huePubSub.publish('browser.job.open.link', data.job_id);
         $('.submit-modal').modal('hide');
         $('.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']").val($("input[name='end_0']").data("original-val"));
               $("input[name='end_0']").parent().datepicker("setValue", $("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:') }"
             killErrors: "${ _('Some of the selected jobs may not have been killed correctly:') }"
           }
           }
           if (response.totalErrors > 0){
           if (response.totalErrors > 0){
-            $.jHueNotify.warn(_messages[what + "Errors"] + " " + response.messages);
+            huePubSub.publish('hue.global.warning', {
+              message: _messages[what + "Errors"] + " " + response.messages
+            });
           }
           }
           else {
           else {
-            $.jHueNotify.info(_messages[what]);
+            huePubSub.publish('hue.global.info', {
+              message: _messages[what]
+            });
           }
           }
           $(".hue-checkbox").removeClass("fa-check");
           $(".hue-checkbox").removeClass("fa-check");
           toggleBulkButtons();
           toggleBulkButtons();

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

@@ -1147,7 +1147,9 @@ ${ commonshare() | n,unicode }
     });
     });
 
 
     $(document).on("stopError", function () {
     $(document).on("stopError", function () {
-      $.jHueNotify.error(LABELS.KILL_ERROR);
+      huePubSub.publish('hue.global.error', {
+        message: LABELS.KILL_ERROR
+      });
       hueAnalytics.log('pig', 'stop');
       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');
       $('#saveas-query-name').removeClass('error');
       $('#saveAsQueryModal').modal('hide');
       $('#saveAsQueryModal').modal('hide');
     } else if (viewModel.query.name()) {
     } 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');
       $('#saveAsQueryModal').modal('hide');
     } else {
     } else {
       $('#saveas-query-name').addClass('error');
       $('#saveas-query-name').addClass('error');
@@ -822,7 +824,9 @@ ${ commonshare() | n,unicode }
 
 
   // Events and datatables
   // Events and datatables
   $(document).on('saved.query', function() {
   $(document).on('saved.query', function() {
-    $.jHueNotify.info("${_('Query saved successfully!')}")
+    huePubSub.publish('hue.global.info', {
+      message: "${_('Query saved successfully!')}"
+    });
   });
   });
 
 
   // Initial htmlEscape
   // Initial htmlEscape

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

@@ -432,7 +432,7 @@ var HdfsViewModel = (function () {
     }
     }
 
 
     self.getAcls = function () {
     self.getAcls = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       var _isLoading = window.setTimeout(function () {
       var _isLoading = window.setTimeout(function () {
         self.isLoadingAcls(true);
         self.isLoadingAcls(true);
       }, 1000);
       }, 1000);
@@ -462,7 +462,7 @@ var HdfsViewModel = (function () {
     };
     };
 
 
     self.updateAcls = function () {
     self.updateAcls = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       hueAnalytics.log('security/hdfs', 'updateAcls');
       hueAnalytics.log('security/hdfs', 'updateAcls');
 
 
       $.post("/security/api/hdfs/update_acls", {
       $.post("/security/api/hdfs/update_acls", {
@@ -507,7 +507,7 @@ var HdfsViewModel = (function () {
     }
     }
 
 
     self.bulkDeleteAcls = function () {
     self.bulkDeleteAcls = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       hueAnalytics.log('security/hdfs', 'bulkDeleteAcls');
       hueAnalytics.log('security/hdfs', 'bulkDeleteAcls');
 
 
       var checkedPaths = self.checkedItems();
       var checkedPaths = self.checkedItems();
@@ -529,7 +529,7 @@ var HdfsViewModel = (function () {
     }
     }
 
 
     self.bulkAddAcls = function () {
     self.bulkAddAcls = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       hueAnalytics.log('security/hdfs', 'bulkAddAcls');
       hueAnalytics.log('security/hdfs', 'bulkAddAcls');
 
 
       var checkedPaths = self.checkedItems();
       var checkedPaths = self.checkedItems();
@@ -549,7 +549,7 @@ var HdfsViewModel = (function () {
     }
     }
 
 
     self.bulkSyncAcls = function () {
     self.bulkSyncAcls = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       hueAnalytics.log('security/hdfs', 'bulkSyncAcls');
       hueAnalytics.log('security/hdfs', 'bulkSyncAcls');
 
 
       var checkedPaths = self.checkedItems();
       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 () {
     self.saveGroups = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       $.post("/security/api/hive/update_role_groups", {
       $.post("/security/api/hive/update_role_groups", {
         role: ko.mapping.toJSON(self)
         role: ko.mapping.toJSON(self)
       }, function (data) {
       }, function (data) {
@@ -280,7 +280,7 @@ var HiveViewModel = (function () {
     }
     }
 
 
     self.create = function () {
     self.create = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       if (self.isValid()) {
       if (self.isValid()) {
         self.isLoading(true);
         self.isLoading(true);
         $.post("/security/api/hive/create_role", {
         $.post("/security/api/hive/create_role", {
@@ -307,7 +307,7 @@ var HiveViewModel = (function () {
     }
     }
 
 
     self.update = function () {
     self.update = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       if (self.isValid()) {
       if (self.isValid()) {
         self.isLoading(true);
         self.isLoading(true);
         $.post("/security/api/hive/save_privileges", {
         $.post("/security/api/hive/save_privileges", {
@@ -330,7 +330,7 @@ var HiveViewModel = (function () {
     }
     }
 
 
     self.remove = function (role) {
     self.remove = function (role) {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       self.isLoading(true);
       self.isLoading(true);
       $.post("/security/api/hive/drop_sentry_role", {
       $.post("/security/api/hive/drop_sentry_role", {
         roleName: role.name
         roleName: role.name
@@ -350,7 +350,7 @@ var HiveViewModel = (function () {
     }
     }
 
 
     self.savePrivileges = function (role) {
     self.savePrivileges = function (role) {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       $.post("/security/api/hive/save_privileges", {
       $.post("/security/api/hive/save_privileges", {
         role: ko.mapping.toJSON(role)
         role: ko.mapping.toJSON(role)
       }, function (data) {
       }, function (data) {
@@ -1121,7 +1121,7 @@ var HiveViewModel = (function () {
     }
     }
 
 
     self.grant_privilege = function () {
     self.grant_privilege = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       $.ajax({
       $.ajax({
         type: "POST",
         type: "POST",
         url: "/security/api/hive/grant_privilege",
         url: "/security/api/hive/grant_privilege",
@@ -1237,7 +1237,7 @@ var HiveViewModel = (function () {
     }
     }
 
 
     self.bulk_delete_privileges = function (norefresh) {
     self.bulk_delete_privileges = function (norefresh) {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       var checkedPaths = self.assist.checkedItems();
       var checkedPaths = self.assist.checkedItems();
       $.post("/security/api/hive/bulk_delete_privileges", {
       $.post("/security/api/hive/bulk_delete_privileges", {
         'authorizableHierarchy': ko.mapping.toJSON(_create_authorizable_from_ko()),
         'authorizableHierarchy': ko.mapping.toJSON(_create_authorizable_from_ko()),
@@ -1258,7 +1258,7 @@ var HiveViewModel = (function () {
     }
     }
 
 
     self.bulk_add_privileges = function (role) {
     self.bulk_add_privileges = function (role) {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       var checkedPaths = self.assist.checkedItems();
       var checkedPaths = self.assist.checkedItems();
       $.post("/security/api/hive/bulk_add_privileges", {
       $.post("/security/api/hive/bulk_add_privileges", {
         'privileges': ko.mapping.toJSON(self.assist.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 () {
     self.saveGroups = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       $.post("/security/api/sentry/update_role_groups", {
       $.post("/security/api/sentry/update_role_groups", {
         role: ko.mapping.toJSON(self),
         role: ko.mapping.toJSON(self),
         component: vm.component()
         component: vm.component()
@@ -299,7 +299,7 @@ var SentryViewModel = (function () {
     }
     }
 
 
     self.create = function () {
     self.create = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       if (self.isValid()) {
       if (self.isValid()) {
         $.post("/security/api/sentry/create_role", {
         $.post("/security/api/sentry/create_role", {
           role: ko.mapping.toJSON(self),
           role: ko.mapping.toJSON(self),
@@ -324,7 +324,7 @@ var SentryViewModel = (function () {
     }
     }
 
 
     self.update = function () {
     self.update = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       if (self.isValid()) {
       if (self.isValid()) {
         $.post("/security/api/sentry/save_privileges", {
         $.post("/security/api/sentry/save_privileges", {
           role: ko.mapping.toJSON(self),
           role: ko.mapping.toJSON(self),
@@ -345,7 +345,7 @@ var SentryViewModel = (function () {
     }
     }
 
 
     self.remove = function (role) {
     self.remove = function (role) {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       $.post("/security/api/sentry/drop_sentry_role", {
       $.post("/security/api/sentry/drop_sentry_role", {
         roleName: role.name,
         roleName: role.name,
         component: vm.component()
         component: vm.component()
@@ -363,7 +363,7 @@ var SentryViewModel = (function () {
     }
     }
 
 
     self.savePrivileges = function (role) {
     self.savePrivileges = function (role) {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       $.post("/security/api/sentry/save_privileges", {
       $.post("/security/api/sentry/save_privileges", {
         role: ko.mapping.toJSON(role),
         role: ko.mapping.toJSON(role),
         component: vm.component()
         component: vm.component()
@@ -1188,7 +1188,7 @@ var SentryViewModel = (function () {
     }
     }
 
 
     self.grant_privilege = function () {
     self.grant_privilege = function () {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       $.ajax({
       $.ajax({
         type: "POST",
         type: "POST",
         url: "/security/api/sentry/grant_privilege",
         url: "/security/api/sentry/grant_privilege",
@@ -1307,7 +1307,7 @@ var SentryViewModel = (function () {
     }
     }
 
 
     self.bulk_delete_privileges = function (norefresh) {
     self.bulk_delete_privileges = function (norefresh) {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       var checkedPaths = self.assist.checkedItems();
       var checkedPaths = self.assist.checkedItems();
       $.post("/security/api/sentry/bulk_delete_privileges", {
       $.post("/security/api/sentry/bulk_delete_privileges", {
         'authorizableHierarchy': ko.mapping.toJSON(_create_authorizable_from_ko()),
         'authorizableHierarchy': ko.mapping.toJSON(_create_authorizable_from_ko()),
@@ -1329,7 +1329,7 @@ var SentryViewModel = (function () {
     }
     }
 
 
     self.bulk_add_privileges = function (role) {
     self.bulk_add_privileges = function (role) {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       var checkedPaths = self.assist.checkedItems();
       var checkedPaths = self.assist.checkedItems();
       $.post("/security/api/sentry/bulk_add_privileges", {
       $.post("/security/api/sentry/bulk_add_privileges", {
         'privileges': ko.mapping.toJSON(self.assist.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) {
         else if (data && data.status === 0) {
           huePubSub.publish('open.link', '${ url('useradmin:useradmin.views.list_users') }');
           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) {
       error: function (data) {
-        $.jHueNotify.error(data.responseJSON['message']);
+        huePubSub.publish('hue.global.error', {
+          message: data.responseJSON['message']
+        });
       }
       }
     });
     });
     %endif
     %endif

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

@@ -85,7 +85,9 @@ $(document).ready(function(){
       }
       }
       else if (data && data.url) {
       else if (data && data.url) {
         huePubSub.publish('open.link', 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) {
         else if (data && data.url) {
           huePubSub.publish('open.link', 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) {
       error: function (data) {
-        $.jHueNotify.error(data.responseJSON['message']);
+        huePubSub.publish('hue.global.error', {
+          message: data.responseJSON['message']
+        });
       }
       }
     });
     });
     % endif
     % endif

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

@@ -100,7 +100,9 @@ ${ layout.menubar(section='permissions') }
         }
         }
         else if (data && data.url) {
         else if (data && data.url) {
           huePubSub.publish('open.link', 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) {
       else if (data && data.url) {
         huePubSub.publish('open.link', 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',
       dataType:  'json',
       success: function(data) {
       success: function(data) {
         $groupsComponents.find(".delete-group").modal("hide");
         $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){
         if (data && data.url){
           huePubSub.publish('open.link', 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',
       dataType:  'json',
       success: function(data) {
       success: function(data) {
         $organizationsComponents.find(".delete-group").modal("hide");
         $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){
         if (data && data.url){
           huePubSub.publish('open.link', 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',
       dataType: 'json',
       success: function(data) {
       success: function(data) {
         $usersComponents.find(".delete-user").modal("hide");
         $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){
         if (data && data.url){
           huePubSub.publish('open.link', data.url);
           huePubSub.publish('open.link', data.url);
         }
         }
@@ -248,10 +250,14 @@ ${layout.menubar(section='users')}
       error: function(response, status, err) {
       error: function(response, status, err) {
         $usersComponents.find(".delete-user").modal("hide");
         $usersComponents.find(".delete-user").modal("hide");
         if (response.responseJSON && response.responseJSON.message && response.status == 401) {
         if (response.responseJSON && response.responseJSON.message && response.status == 401) {
-          $.jHueNotify.error(response.responseJSON.message);
+          huePubSub.publish('hue.global.error', {
+            message: response.responseJSON.message
+          });
         }
         }
         else {
         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) {
               else if (data && data.url) {
                 $usersComponents.find(".sync-ldap").modal("hide");
                 $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);
                 huePubSub.publish('open.link', data.url);
               }
               }
             },
             },
             error: function(data) {
             error: function(data) {
               $usersComponents.find('input[type="submit"]').removeAttr("disabled");
               $usersComponents.find('input[type="submit"]').removeAttr("disabled");
               $usersComponents.find(".sync-ldap").modal("hide");
               $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);
               huePubSub.publish('open.link', data.url);
             }
             }
           });
           });

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

@@ -16,6 +16,7 @@
 
 
 import $ from 'jquery';
 import $ from 'jquery';
 
 
+import { GLOBAL_ERROR_TOPIC } from 'reactComponents/AlertComponent/events';
 import logError from 'utils/logError';
 import logError from 'utils/logError';
 import huePubSub from 'utils/huePubSub';
 import huePubSub from 'utils/huePubSub';
 
 
@@ -77,7 +78,7 @@ export const assistErrorCallback = options => {
     if (!options || !options.silenceErrors) {
     if (!options || !options.silenceErrors) {
       logError(errorResponse);
       logError(errorResponse);
       if (errorMessage && errorMessage.indexOf('AuthorizationException') === -1) {
       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 qs from 'qs';
 
 
 import { CancellablePromise } from './cancellablePromise';
 import { CancellablePromise } from './cancellablePromise';
+import { GLOBAL_ERROR_TOPIC } from 'reactComponents/AlertComponent/events';
+import { HueAlert } from 'reactComponents/AlertComponent/types';
 import { hueWindow } from 'types/types';
 import { hueWindow } from 'types/types';
 import huePubSub from 'utils/huePubSub';
 import huePubSub from 'utils/huePubSub';
 import logError from 'utils/logError';
 import logError from 'utils/logError';
@@ -146,7 +148,7 @@ const notifyError = <T>(
   if (!options || !options.silenceErrors) {
   if (!options || !options.silenceErrors) {
     logError(response);
     logError(response);
     if (message.indexOf('AuthorizationException') === -1) {
     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 ChartTransformers from 'apps/notebook/chartTransformers';
 import { CONFIG_REFRESHED_TOPIC, GET_KNOWN_CONFIG_TOPIC } from 'config/events';
 import { CONFIG_REFRESHED_TOPIC, GET_KNOWN_CONFIG_TOPIC } from 'config/events';
 import { findEditorConnector, getLastKnownConfig } from 'config/hueConfig';
 import { findEditorConnector, getLastKnownConfig } from 'config/hueConfig';
+import { GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
 import huePubSub from 'utils/huePubSub';
 import huePubSub from 'utils/huePubSub';
 import { getFromLocalStorage, setInLocalStorage } from 'utils/storageUtils';
 import { getFromLocalStorage, setInLocalStorage } from 'utils/storageUtils';
 import UUID from 'utils/string/UUID';
 import UUID from 'utils/string/UUID';
@@ -220,7 +221,7 @@ export default class EditorViewModel {
           const options = {
           const options = {
             successCallback: result => {
             successCallback: result => {
               if (result && result.exists) {
               if (result && result.exists) {
-                huePubSub.publish('hue.global.info', {
+                huePubSub.publish(GLOBAL_INFO_TOPIC, {
                   message: result.path + ' saved successfully.'
                   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 'ext/jquery.hotkeys';
 import 'jquery/plugins/jquery.hdfstree';
 import 'jquery/plugins/jquery.hdfstree';
 
 
+import { HIDE_GLOBAL_ALERTS_TOPIC } from 'reactComponents/AlertComponent/events';
 import { registerHueWorkers } from 'sql/workers/hueWorkerHandler';
 import { registerHueWorkers } from 'sql/workers/hueWorkerHandler';
 import huePubSub from 'utils/huePubSub';
 import huePubSub from 'utils/huePubSub';
 import I18n from 'utils/i18n';
 import I18n from 'utils/i18n';
@@ -568,7 +569,7 @@ huePubSub.subscribe('app.dom.loaded', app => {
       value => {
       value => {
         viewModel.isEditing(!viewModel.isEditing());
         viewModel.isEditing(!viewModel.isEditing());
         if (value) {
         if (value) {
-          $('.jHueNotify').remove();
+          huePubSub.publish(HIDE_GLOBAL_ALERTS_TOPIC);
           isAssistAvailable = viewModel.assistAvailable();
           isAssistAvailable = viewModel.assistAvailable();
           wasLeftPanelVisible = viewModel.isLeftPanelVisible();
           wasLeftPanelVisible = viewModel.isLeftPanelVisible();
           wasRightPanelVisible = viewModel.isRightPanelVisible();
           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 { SHOW_DOWNLOAD_RESULT_MODAL_EVENT } from 'apps/editor/components/resultGrid/ko.resultDownloadModal';
 import componentUtils from 'ko/components/componentUtils';
 import componentUtils from 'ko/components/componentUtils';
 import DisposableComponent from 'ko/components/DisposableComponent';
 import DisposableComponent from 'ko/components/DisposableComponent';
+import { GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
 import I18n from 'utils/i18n';
 import I18n from 'utils/i18n';
 import huePubSub from 'utils/huePubSub';
 import huePubSub from 'utils/huePubSub';
 import html2text from 'utils/html/html2text';
 import html2text from 'utils/html/html2text';
@@ -156,7 +157,9 @@ class ResultDownloadActions extends DisposableComponent {
   }
   }
 
 
   onClipboardSuccess(e) {
   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();
     e.clearSelection();
     $('.clipboard-content').empty();
     $('.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 sessionManager from 'apps/editor/execution/sessionManager';
 import dataCatalog from 'catalog/dataCatalog';
 import dataCatalog from 'catalog/dataCatalog';
 import { ParsedSqlStatement } from 'parse/sqlStatementsParser';
 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 { hueWindow } from 'types/types';
 import hueAnalytics from 'utils/hueAnalytics';
 import hueAnalytics from 'utils/hueAnalytics';
 import huePubSub from 'utils/huePubSub';
 import huePubSub from 'utils/huePubSub';
@@ -382,7 +384,9 @@ export default class SqlExecutable {
         this.executeEnded = Date.now();
         this.executeEnded = Date.now();
         this.setStatus(queryStatus.status);
         this.setStatus(queryStatus.status);
         if (queryStatus.message) {
         if (queryStatus.message) {
-          huePubSub.publish('hue.error', queryStatus.message);
+          huePubSub.publish<HueAlert>(GLOBAL_ERROR_TOPIC, {
+            message: queryStatus.message
+          });
         }
         }
         break;
         break;
       default:
       default:

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

@@ -31,6 +31,7 @@ import {
   ASSIST_IS_DB_PANEL_READY_EVENT,
   ASSIST_IS_DB_PANEL_READY_EVENT,
   ASSIST_SET_DATABASE_EVENT
   ASSIST_SET_DATABASE_EVENT
 } from 'ko/components/assist/events';
 } from 'ko/components/assist/events';
+import { GLOBAL_ERROR_TOPIC, GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
 
 
 const HISTORY_CLEARED_EVENT = 'query.history.cleared';
 const HISTORY_CLEARED_EVENT = 'query.history.cleared';
 
 
@@ -273,7 +274,7 @@ export default class Notebook {
           }
           }
         ).fail(xhr => {
         ).fail(xhr => {
           if (xhr.status !== 502) {
           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);
         this.isSaved(true);
         const wasHistory = this.isHistory();
         const wasHistory = this.isHistory();
         this.isHistory(false);
         this.isHistory(false);
-        huePubSub.publish('hue.global.info', { message: data.message });
+        huePubSub.publish(GLOBAL_INFO_TOPIC, { message: data.message });
         if (editorMode) {
         if (editorMode) {
           huePubSub.publish(UPDATE_SAVED_QUERIES_EVENT, data);
           huePubSub.publish(UPDATE_SAVED_QUERIES_EVENT, data);
 
 
@@ -368,12 +369,12 @@ export default class Notebook {
           callback();
           callback();
         }
         }
       } else {
       } else {
-        huePubSub.publish('hue.global.error', { message: data.message });
+        huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
       }
       }
     } catch (err) {
     } catch (err) {
       console.error(err);
       console.error(err);
       if (err && err.status !== 502) {
       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 => {
     ).fail(xhr => {
       if (xhr.status !== 502) {
       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_GET_SOURCE_EVENT,
   ASSIST_SET_SOURCE_EVENT
   ASSIST_SET_SOURCE_EVENT
 } from 'ko/components/assist/events';
 } from 'ko/components/assist/events';
+import { GLOBAL_ERROR_TOPIC, GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
 import { EXECUTABLE_UPDATED_TOPIC } from './execution/events';
 import { EXECUTABLE_UPDATED_TOPIC } from './execution/events';
 
 
 // TODO: Remove together with ENABLE_HUE_5. Temporary here for debug
 // 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
           // eslint-disable-next-line no-restricted-syntax
           console.log(data.statement_similarity);
           console.log(data.statement_similarity);
         } else {
         } else {
-          huePubSub.publish('hue.global.error', { message: data.message });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
         }
         }
       })
       })
       .catch(() => {});
       .catch(() => {});
@@ -910,7 +911,7 @@ export default class Snippet {
     } else if (data.status === 1 || data.status === -1) {
     } else if (data.status === 1 || data.status === -1) {
       this.status(STATUS.failed);
       this.status(STATUS.failed);
     } else {
     } else {
-      huePubSub.publish('hue.global.error', { message: data.message });
+      huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
       this.status(STATUS.failed);
       this.status(STATUS.failed);
     }
     }
   }
   }
@@ -1030,12 +1031,12 @@ export default class Snippet {
           this.showSqlAnalyzer(true);
           this.showSqlAnalyzer(true);
           this.hasSuggestion(true);
           this.hasSuggestion(true);
         } else {
         } else {
-          huePubSub.publish('hue.global.error', { message: data.message });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
         }
         }
       })
       })
       .catch(xhr => {
       .catch(xhr => {
         if (xhr.status !== 502) {
         if (xhr.status !== 502) {
-          huePubSub.publish('hue.global.error', { message: xhr.responseText });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
         }
         }
       })
       })
       .finally(() => {
       .finally(() => {
@@ -1137,14 +1138,14 @@ export default class Snippet {
       sourcePlatform: this.dialect()
       sourcePlatform: this.dialect()
     }).then(data => {
     }).then(data => {
       if (data.status === 0) {
       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...'
             ' queries uploaded successfully. Processing them...'
-        );
+        });
         this.watchUploadStatus(data.upload_history[this.dialect()].status.workloadId);
         this.watchUploadStatus(data.upload_history[this.dialect()].status.workloadId);
       } else {
       } 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) {
   uploadTableStats(options) {
     hueAnalytics.log('notebook', 'load_table_stats');
     hueAnalytics.log('notebook', 'load_table_stats');
     if (options.showProgress) {
     if (options.showProgress) {
-      huePubSub.publish('hue.global.info', { message: 'Preparing table data...' });
+      huePubSub.publish(GLOBAL_INFO_TOPIC, { message: 'Preparing table data...' });
     }
     }
 
 
     $.post(
     $.post(
@@ -1169,19 +1170,19 @@ export default class Snippet {
       data => {
       data => {
         if (data.status === 0) {
         if (data.status === 0) {
           if (options.showProgress) {
           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) {
           if (data.upload_table_ddl && options.showProgress) {
             // With showProgress only currently as can be very slow
             // With showProgress only currently as can be very slow
             this.watchUploadStatus(data.upload_table_ddl.status.workloadId, options.showProgress);
             this.watchUploadStatus(data.upload_table_ddl.status.workloadId, options.showProgress);
           }
           }
         } else if (options.showProgress) {
         } else if (options.showProgress) {
-          huePubSub.publish('hue.global.error', { message: data.message });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
         }
         }
       }
       }
     ).always(() => {
     ).always(() => {
@@ -1197,7 +1198,7 @@ export default class Snippet {
     }).then(data => {
     }).then(data => {
       if (data.status === 0) {
       if (data.status === 0) {
         if (showProgress) {
         if (showProgress) {
-          huePubSub.publish('hue.global.info', {
+          huePubSub.publish(GLOBAL_INFO_TOPIC, {
             message: 'Query processing: ' + data.upload_status.status.state
             message: 'Query processing: ' + data.upload_status.status.state
           });
           });
         }
         }
@@ -1206,19 +1207,19 @@ export default class Snippet {
             this.watchUploadStatus(workloadId);
             this.watchUploadStatus(workloadId);
           }, 2000);
           }, 2000);
         } else if (showProgress) {
         } 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.failedQueries > 0
                 ? '. ' +
                 ? '. ' +
                   data.upload_status.status.failQueryDetails.map(query => {
                   data.upload_status.status.failQueryDetails.map(query => {
                     return query.error;
                     return query.error;
                   })
                   })
                 : '')
                 : '')
-          );
+          });
         }
         }
       } else if (showProgress) {
       } 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 './eventListeners';
 import JobBrowserViewModel from './knockout/JobBrowserViewModel';
 import JobBrowserViewModel from './knockout/JobBrowserViewModel';
 import Job from './knockout/Job';
 import Job from './knockout/Job';
+import { GLOBAL_ERROR_TOPIC, GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
 import I18n from 'utils/i18n';
 import I18n from 'utils/i18n';
 
 
 huePubSub.subscribe('app.dom.loaded', app => {
 huePubSub.subscribe('app.dom.loaded', app => {
@@ -65,7 +66,7 @@ huePubSub.subscribe('app.dom.loaded', app => {
             if (id) {
             if (id) {
               openJob(id);
               openJob(id);
             } else {
             } 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(
     huePubSub.subscribe(
       'submit.rerun.popup.return',
       'submit.rerun.popup.return',
       data => {
       data => {
-        huePubSub.publish('hue.global.info', { message: I18n('Rerun submitted.') });
+        huePubSub.publish(GLOBAL_INFO_TOPIC, { message: I18n('Rerun submitted.') });
         $('#rerun-modal').modal('hide');
         $('#rerun-modal').modal('hide');
 
 
         jobBrowserViewModel.job().apiStatus('RUNNING');
         jobBrowserViewModel.job().apiStatus('RUNNING');

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

@@ -16,6 +16,7 @@
 
 
 import $ from 'jquery';
 import $ from 'jquery';
 import huePubSub from '../../utils/huePubSub';
 import huePubSub from '../../utils/huePubSub';
+import { GLOBAL_ERROR_TOPIC, GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
 
 
 $(document).off('shown', '.jb-logs-link');
 $(document).off('shown', '.jb-logs-link');
 $(document).on('shown', '.jb-logs-link', e => {
 $(document).on('shown', '.jb-logs-link', e => {
@@ -56,14 +57,14 @@ $(document).on('showSubmitPopup', (event, data) => {
       success: function (data) {
       success: function (data) {
         $('#syncWorkflowModal').modal('hide');
         $('#syncWorkflowModal').modal('hide');
         if (data && data.status === 0) {
         if (data && data.status === 0) {
-          huePubSub.publish('hue.global.info', data);
+          huePubSub.publish(GLOBAL_INFO_TOPIC, data);
         } else {
         } else {
-          huePubSub.publish('hue.global.error', data);
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, data);
         }
         }
       },
       },
       error: function (data) {
       error: function (data) {
         $('#syncWorkflowModal').modal('hide');
         $('#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 komapping from 'knockout.mapping';
 
 
 import apiHelper from 'api/apiHelper';
 import apiHelper from 'api/apiHelper';
+import { GLOBAL_ERROR_TOPIC, GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
 import huePubSub from 'utils/huePubSub';
 import huePubSub from 'utils/huePubSub';
 import I18n from 'utils/i18n';
 import I18n from 'utils/i18n';
 import deleteAllEmptyStringKeys from 'utils/string/deleteAllEmptyStringKeys';
 import deleteAllEmptyStringKeys from 'utils/string/deleteAllEmptyStringKeys';
@@ -361,7 +362,7 @@ export default class Job {
             callback(data);
             callback(data);
           }
           }
         } else {
         } 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();
         this.vm.job().fetchLogs();
       } else {
       } else {
-        huePubSub.publish('hue.global.error', { message: data.message });
+        huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
       }
       }
     }).always(() => {
     }).always(() => {
       this.loadingJob(false);
       this.loadingJob(false);
@@ -686,7 +687,7 @@ export default class Job {
               );
               );
           }
           }
         } else {
         } 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);
             callback(data);
           }
           }
         } else {
         } 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.progress(data.app.progress);
           this.canWrite(data.app.canWrite);
           this.canWrite(data.app.canWrite);
         } else {
         } 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 => {
         data => {
           if (data.status === 0) {
           if (data.status === 0) {
-            huePubSub.publish('hue.global.info', {
+            huePubSub.publish(GLOBAL_INFO_TOPIC, {
               message: I18n('Successfully updated Coordinator Job Properties')
               message: I18n('Successfully updated Coordinator Job Properties')
             });
             });
           } else {
           } else {
-            huePubSub.publish('hue.global.error', { message: data.message });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
           }
           }
         }
         }
       ).fail(xhr => {
       ).fail(xhr => {
-        huePubSub.publish('hue.global.error', { message: xhr.responseText });
+        huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
       });
       });
     } else if (action === 'sync_workflow') {
     } else if (action === 'sync_workflow') {
       $.get(
       $.get(
@@ -836,11 +837,11 @@ export default class Job {
           $(document).trigger('showSubmitPopup', data);
           $(document).trigger('showSubmitPopup', data);
         }
         }
       ).fail(xhr => {
       ).fail(xhr => {
-        huePubSub.publish('hue.global.error', { message: xhr.responseText });
+        huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
       });
       });
     } else {
     } else {
       this.vm.jobs._control([this.id()], action, data => {
       this.vm.jobs._control([this.id()], action, data => {
-        huePubSub.publish('hue.global.info', data);
+        huePubSub.publish(GLOBAL_INFO_TOPIC, data);
         this.fetchStatus();
         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 * as ko from 'knockout';
 
 
 import { getLastKnownConfig } from 'config/hueConfig';
 import { getLastKnownConfig } from 'config/hueConfig';
+import { GLOBAL_ERROR_TOPIC } from 'reactComponents/AlertComponent/events';
 import huePubSub from 'utils/huePubSub';
 import huePubSub from 'utils/huePubSub';
 import I18n from 'utils/i18n';
 import I18n from 'utils/i18n';
 import { withLocalStorage } from 'utils/storageUtils';
 import { withLocalStorage } from 'utils/storageUtils';
@@ -242,7 +243,7 @@ export default class JobBrowserViewModel {
         .fail(err => {
         .fail(err => {
           this.oozieInfoLoadedOnce = false;
           this.oozieInfoLoadedOnce = false;
           this.selectInterface('schedules');
           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(() => {
         .always(() => {
           this.oozieInfoLoading(false);
           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 komapping from 'knockout.mapping';
 
 
 import apiHelper from 'api/apiHelper';
 import apiHelper from 'api/apiHelper';
+import { GLOBAL_ERROR_TOPIC, GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
 import huePubSub from 'utils/huePubSub';
 import huePubSub from 'utils/huePubSub';
 import I18n from 'utils/i18n';
 import I18n from 'utils/i18n';
 import Job from './Job';
 import Job from './Job';
+
 export default class Jobs {
 export default class Jobs {
   constructor(vm) {
   constructor(vm) {
     this.vm = vm;
     this.vm = vm;
@@ -216,7 +218,7 @@ export default class Jobs {
             this.selectedJobs([]);
             this.selectedJobs([]);
           }
           }
         } else {
         } else {
-          huePubSub.publish('hue.global.error', { message: data.message });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
         }
         }
       }
       }
     ).always(() => {});
     ).always(() => {});
@@ -247,7 +249,7 @@ export default class Jobs {
             callback(data);
             callback(data);
           }
           }
         } else {
         } 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()),
         this.selectedJobs().map(job => job.id()),
         action,
         action,
         data => {
         data => {
-          huePubSub.publish('hue.global.info', data);
+          huePubSub.publish(GLOBAL_INFO_TOPIC, data);
           this.updateJobs();
           this.updateJobs();
         }
         }
       );
       );

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

@@ -17,6 +17,7 @@
 import $ from 'jquery';
 import $ from 'jquery';
 import * as ko from 'knockout';
 import * as ko from 'knockout';
 
 
+import { GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
 import huePubSub from 'utils/huePubSub';
 import huePubSub from 'utils/huePubSub';
 import I18n from 'utils/i18n';
 import I18n from 'utils/i18n';
 
 
@@ -48,7 +49,7 @@ export const initializeMiniJobBrowser = () => {
   huePubSub.publish('cluster.config.get.config', configUpdated);
   huePubSub.publish('cluster.config.get.config', configUpdated);
 
 
   huePubSub.subscribe('submit.rerun.popup.return-mini', () => {
   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');
     $('#rerun-modal-mini').modal('hide');
 
 
     jobBrowserViewModel.job().apiStatus('RUNNING');
     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 changeURLParameter from 'utils/url/changeURLParameter';
 import getParameter from 'utils/url/getParameter';
 import getParameter from 'utils/url/getParameter';
 import UUID from 'utils/string/UUID';
 import UUID from 'utils/string/UUID';
+import { GLOBAL_ERROR_TOPIC, GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
 
 
 export default class NotebookViewModel {
 export default class NotebookViewModel {
   constructor(options, CoordinatorEditorViewModel, RunningCoordinatorModel) {
   constructor(options, CoordinatorEditorViewModel, RunningCoordinatorModel) {
@@ -359,7 +360,7 @@ export default class NotebookViewModel {
           const options = {
           const options = {
             successCallback: function (result) {
             successCallback: function (result) {
               if (result && result.exists) {
               if (result && result.exists) {
-                huePubSub.publish('hue.global.info', {
+                huePubSub.publish(GLOBAL_INFO_TOPIC, {
                   message: result.path + ' saved successfully.'
                   message: result.path + ' saved successfully.'
                 });
                 });
               } else {
               } else {
@@ -617,7 +618,7 @@ export default class NotebookViewModel {
             }
             }
             deferredOpen.resolve();
             deferredOpen.resolve();
           } else {
           } else {
-            huePubSub.publish('hue.global.error', { message: data.message });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
             deferredOpen.reject();
             deferredOpen.reject();
             self.newNotebook();
             self.newNotebook();
           }
           }

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

@@ -1007,7 +1007,7 @@ huePubSub.subscribe('app.dom.loaded', app => {
       value => {
       value => {
         viewModel.isEditing(!viewModel.isEditing());
         viewModel.isEditing(!viewModel.isEditing());
         if (value) {
         if (value) {
-          $('.jHueNotify').remove();
+          huePubSub.publish('hide.global.alerts');
           isAssistAvailable = viewModel.assistAvailable();
           isAssistAvailable = viewModel.assistAvailable();
           wasLeftPanelVisible = viewModel.isLeftPanelVisible();
           wasLeftPanelVisible = viewModel.isLeftPanelVisible();
           wasRightPanelVisible = viewModel.isRightPanelVisible();
           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_IS_DB_PANEL_READY_EVENT,
   ASSIST_SET_DATABASE_EVENT
   ASSIST_SET_DATABASE_EVENT
 } from 'ko/components/assist/events';
 } from 'ko/components/assist/events';
+import { GLOBAL_ERROR_TOPIC, GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
 import hueAnalytics from 'utils/hueAnalytics';
 import hueAnalytics from 'utils/hueAnalytics';
 import huePubSub from 'utils/huePubSub';
 import huePubSub from 'utils/huePubSub';
 import { getFromLocalStorage } from 'utils/storageUtils';
 import { getFromLocalStorage } from 'utils/storageUtils';
@@ -363,7 +364,7 @@ class Notebook {
         $.each(self.getSnippets(session.type()), (index, snippet) => {
         $.each(self.getSnippets(session.type()), (index, snippet) => {
           snippet.status('failed');
           snippet.status('failed');
         });
         });
-        huePubSub.publish('hue.global.error', { message: message });
+        huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: message });
         if (failCallback) {
         if (failCallback) {
           failCallback();
           failCallback();
         }
         }
@@ -503,7 +504,7 @@ class Notebook {
             self.isSaved(true);
             self.isSaved(true);
             const wasHistory = self.isHistory();
             const wasHistory = self.isHistory();
             self.isHistory(false);
             self.isHistory(false);
-            huePubSub.publish('hue.global.info', { message: data.message });
+            huePubSub.publish(GLOBAL_INFO_TOPIC, { message: data.message });
             if (editorMode) {
             if (editorMode) {
               if (!data.save_as) {
               if (!data.save_as) {
                 const existingQuery = self
                 const existingQuery = self
@@ -555,12 +556,12 @@ class Notebook {
               callback();
               callback();
             }
             }
           } else {
           } else {
-            huePubSub.publish('hue.global.error', { message: data.message });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
           }
           }
         }
         }
       ).fail((xhr, textStatus, errorThrown) => {
       ).fail((xhr, textStatus, errorThrown) => {
         if (xhr.status !== 502) {
         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 => {
         data => {
           if (!silent && data && data.status != 0 && data.status != -2 && data.message) {
           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) {
           if (callback) {
@@ -622,7 +623,7 @@ class Notebook {
         }
         }
       ).fail(xhr => {
       ).fail(xhr => {
         if (!silent && xhr.status !== 502) {
         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 => {
       ).fail(xhr => {
         if (xhr.status !== 502) {
         if (xhr.status !== 502) {
-          huePubSub.publish('hue.global.error', { message: xhr.responseText });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
         }
         }
       });
       });
       $(document).trigger('hideHistoryModal');
       $(document).trigger('hideHistoryModal');
@@ -829,7 +830,7 @@ class Notebook {
             }
             }
           ).fail(xhr => {
           ).fail(xhr => {
             if (xhr.status !== 502) {
             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) => {
       ).fail((xhr, textStatus, errorThrown) => {
         if (xhr.status !== 502) {
         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_GET_SOURCE_EVENT,
   ASSIST_SET_SOURCE_EVENT
   ASSIST_SET_SOURCE_EVENT
 } from 'ko/components/assist/events';
 } 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 { POST_FROM_LOCATION_WORKER_EVENT } from 'sql/workers/events';
 import {
 import {
   ACTIVE_STATEMENT_CHANGED_EVENT,
   ACTIVE_STATEMENT_CHANGED_EVENT,
@@ -1654,7 +1659,7 @@ class Snippet {
           });
           });
         }
         }
       } else {
       } else {
-        huePubSub.publish('hue.global.error', { message: data.message });
+        huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
         self.status('failed');
         self.status('failed');
       }
       }
     };
     };
@@ -1778,7 +1783,7 @@ class Snippet {
       self.previousChartOptions = vm.getPreviousChartOptions(self);
       self.previousChartOptions = vm.getPreviousChartOptions(self);
       $(document).trigger('executeStarted', { vm: vm, snippet: self });
       $(document).trigger('executeStarted', { vm: vm, snippet: self });
       self.lastExecuted(now);
       self.lastExecuted(now);
-      $('.jHueNotify').remove();
+      huePubSub.publish('hide.global.alerts');
       hueAnalytics.log('notebook', 'execute/' + self.type());
       hueAnalytics.log('notebook', 'execute/' + self.type());
 
 
       notebook.forceHistoryInitialHeight(true);
       notebook.forceHistoryInitialHeight(true);
@@ -1942,7 +1947,7 @@ class Snippet {
         .fail((xhr, textStatus, errorThrown) => {
         .fail((xhr, textStatus, errorThrown) => {
           if (self.statusForButtons() != 'canceled' && xhr.status !== 502) {
           if (self.statusForButtons() != 'canceled' && xhr.status !== 502) {
             // No error when manually canceled
             // 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.status('failed');
           self.statusForButtons('executed');
           self.statusForButtons('executed');
@@ -2126,13 +2131,13 @@ class Snippet {
             self.showSqlAnalyzer(true);
             self.showSqlAnalyzer(true);
             self.hasSuggestion(true);
             self.hasSuggestion(true);
           } else {
           } else {
-            huePubSub.publish('hue.global.error', { message: data.message });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
           }
           }
         }
         }
       )
       )
         .fail((xhr, textStatus, errorThrown) => {
         .fail((xhr, textStatus, errorThrown) => {
           if (xhr.status !== 502) {
           if (xhr.status !== 502) {
-            huePubSub.publish('hue.global.error', { message: xhr.responseText });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
           }
           }
         })
         })
         .always(() => {
         .always(() => {
@@ -2204,7 +2209,7 @@ class Snippet {
           )
           )
             .fail((xhr, textStatus, errorThrown) => {
             .fail((xhr, textStatus, errorThrown) => {
               if (xhr.status !== 502) {
               if (xhr.status !== 502) {
-                huePubSub.publish('hue.global.error', { message: xhr.responseText });
+                huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
               }
               }
             })
             })
             .always(() => {
             .always(() => {
@@ -2298,12 +2303,12 @@ class Snippet {
           if (data.status == 0) {
           if (data.status == 0) {
             self.result.meta(data.result.meta);
             self.result.meta(data.result.meta);
           } else {
           } else {
-            huePubSub.publish('hue.global.error', { message: data.message });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
           }
           }
         }
         }
       ).fail((xhr, textStatus, errorThrown) => {
       ).fail((xhr, textStatus, errorThrown) => {
         if (xhr.status !== 502) {
         if (xhr.status !== 502) {
-          huePubSub.publish('hue.global.error', { message: xhr.responseText });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
         }
         }
         self.status('failed');
         self.status('failed');
       });
       });
@@ -2329,16 +2334,10 @@ class Snippet {
               }
               }
             } else if (data.status == 5) {
             } else if (data.status == 5) {
               // No supported yet for this snippet
               // 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 () {
     self.checkStatus = function () {
@@ -2419,7 +2418,7 @@ class Snippet {
         ).fail((xhr, textStatus, errorThrown) => {
         ).fail((xhr, textStatus, errorThrown) => {
           if (xhr.stausText !== 'abort') {
           if (xhr.stausText !== 'abort') {
             if (xhr.status !== 502) {
             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');
             self.status('failed');
             notebook.isExecutingAll(false);
             notebook.isExecutingAll(false);
@@ -2494,7 +2493,7 @@ class Snippet {
         )
         )
           .fail((xhr, textStatus, errorThrown) => {
           .fail((xhr, textStatus, errorThrown) => {
             if (xhr.status !== 502) {
             if (xhr.status !== 502) {
-              huePubSub.publish('hue.global.error', { message: xhr.responseText });
+              huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
             }
             }
             self.statusForButtons('canceled');
             self.statusForButtons('canceled');
             self.status('failed');
             self.status('failed');
@@ -2522,13 +2521,7 @@ class Snippet {
             // self._ajaxError(data);
             // 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 () {
     self.clearActiveExecuteRequests = function () {
@@ -2632,7 +2625,7 @@ class Snippet {
       ).fail((xhr, textStatus, errorThrown) => {
       ).fail((xhr, textStatus, errorThrown) => {
         if (xhr.statusText !== 'abort') {
         if (xhr.statusText !== 'abort') {
           if (xhr.status !== 502) {
           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');
           self.status('failed');
         }
         }
@@ -2652,14 +2645,14 @@ class Snippet {
         },
         },
         data => {
         data => {
           if (data.status == 0) {
           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...'
                 ' queries uploaded successfully. Processing them...'
-            );
+            });
             self.watchUploadStatus(data.upload_history[self.type()].status.workloadId);
             self.watchUploadStatus(data.upload_history[self.type()].status.workloadId);
           } else {
           } 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) {
     self.uploadTableStats = function (options) {
       hueAnalytics.log('notebook', 'load_table_stats');
       hueAnalytics.log('notebook', 'load_table_stats');
       if (options.showProgress) {
       if (options.showProgress) {
-        huePubSub.publish('hue.global.info', { message: 'Preparing table data...' });
+        huePubSub.publish(GLOBAL_INFO_TOPIC, { message: 'Preparing table data...' });
       }
       }
 
 
       $.post(
       $.post(
@@ -2694,19 +2687,19 @@ class Snippet {
         data => {
         data => {
           if (data.status == 0) {
           if (data.status == 0) {
             if (options.showProgress) {
             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) {
             if (data.upload_table_ddl && options.showProgress) {
               // With showProgress only currently as can be very slow
               // With showProgress only currently as can be very slow
               self.watchUploadStatus(data.upload_table_ddl.status.workloadId, options.showProgress);
               self.watchUploadStatus(data.upload_table_ddl.status.workloadId, options.showProgress);
             }
             }
           } else if (options.showProgress) {
           } else if (options.showProgress) {
-            huePubSub.publish('hue.global.error', { message: data.message });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
           }
           }
         }
         }
       ).always(() => {
       ).always(() => {
@@ -2725,7 +2718,7 @@ class Snippet {
         data => {
         data => {
           if (data.status == 0) {
           if (data.status == 0) {
             if (showProgress) {
             if (showProgress) {
-              huePubSub.publish('hue.global.info', {
+              huePubSub.publish(GLOBAL_INFO_TOPIC, {
                 message: 'Query processing: ' + data.upload_status.status.state
                 message: 'Query processing: ' + data.upload_status.status.state
               });
               });
             }
             }
@@ -2734,19 +2727,19 @@ class Snippet {
                 self.watchUploadStatus(workloadId);
                 self.watchUploadStatus(workloadId);
               }, 2000);
               }, 2000);
             } else if (showProgress) {
             } 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.failedQueries > 0
                     ? '. ' +
                     ? '. ' +
                       data.upload_status.status.failQueryDetails.map(query => {
                       data.upload_status.status.failQueryDetails.map(query => {
                         return query.error;
                         return query.error;
                       })
                       })
                     : '')
                     : '')
-              );
+              });
             }
             }
           } else if (showProgress) {
           } 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
             // eslint-disable-next-line no-restricted-syntax
             console.log(data.statement_similarity);
             console.log(data.statement_similarity);
           } else {
           } 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 * as ko from 'knockout';
 
 
 import apiHelper from 'api/apiHelper';
 import apiHelper from 'api/apiHelper';
-import deXSS from 'utils/html/deXSS';
-import huePubSub from 'utils/huePubSub';
 import MetastoreColumn from 'apps/tableBrowser/metastoreColumn';
 import MetastoreColumn from 'apps/tableBrowser/metastoreColumn';
 import MetastoreTableSamples from 'apps/tableBrowser/metastoreTableSamples';
 import MetastoreTableSamples from 'apps/tableBrowser/metastoreTableSamples';
 import MetastoreTablePartitions from 'apps/tableBrowser/metastoreTablePartitions';
 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';
 import I18n from 'utils/i18n';
 
 
 let contextPopoverTimeout = -1;
 let contextPopoverTimeout = -1;
@@ -138,9 +139,9 @@ class MetastoreTable {
         })
         })
         .catch(data => {
         .catch(data => {
           this.refreshingTableStats(false);
           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('apiHelper.refreshTableStats error');
           console.error(data);
           console.error(data);
         });
         });
@@ -365,7 +366,7 @@ class MetastoreTable {
         if (resp.history_uuid) {
         if (resp.history_uuid) {
           huePubSub.publish('notebook.task.submitted', resp);
           huePubSub.publish('notebook.task.submitted', resp);
         } else {
         } 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) {
           if (data && data.status === 0) {
             this.relationshipsDetails(ko.mapping.fromJS(data));
             this.relationshipsDetails(ko.mapping.fromJS(data));
           } else {
           } else {
-            huePubSub.publish('hue.global.error', { message: data.message });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
           }
           }
         })
         })
         .fail(xhr => {
         .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']);
         $('#import-data-modal').html(data['data']);
       })
       })
       .fail(xhr => {
       .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
   SchedulerInterpreter
 } from './types';
 } from './types';
 import huePubSub from 'utils/huePubSub';
 import huePubSub from 'utils/huePubSub';
+import { GLOBAL_ERROR_TOPIC } from '../reactComponents/AlertComponent/events';
+import { HueAlert } from '../reactComponents/AlertComponent/types';
 
 
 interface InterpreterMap {
 interface InterpreterMap {
   [AppType.browser]: BrowserInterpreter;
   [AppType.browser]: BrowserInterpreter;
@@ -54,8 +56,8 @@ export const refreshConfig = async (): Promise<HueConfig> => {
       if (apiResponse.status == 0) {
       if (apiResponse.status == 0) {
         lastKnownConfig = apiResponse;
         lastKnownConfig = apiResponse;
         resolve(lastKnownConfig);
         resolve(lastKnownConfig);
-      } else {
-        huePubSub.publish('hue.error', apiResponse.message);
+      } else if (apiResponse.message) {
+        huePubSub.publish<HueAlert>(GLOBAL_ERROR_TOPIC, { message: apiResponse.message });
         reject();
         reject();
       }
       }
     } catch (err) {
     } 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 * as ko from 'knockout';
 
 
 import apiHelper from 'api/apiHelper';
 import apiHelper from 'api/apiHelper';
+import { GLOBAL_ERROR_TOPIC } from 'reactComponents/AlertComponent/events';
 import escapeOutput from 'utils/html/escapeOutput';
 import escapeOutput from 'utils/html/escapeOutput';
 import highlight from 'utils/html/highlight';
 import highlight from 'utils/html/highlight';
 import huePubSub from 'utils/huePubSub';
 import huePubSub from 'utils/huePubSub';
@@ -159,20 +160,18 @@ class HueDocument {
       response => {
       response => {
         if (response != null) {
         if (response != null) {
           if (response.status !== 0) {
           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 {
           } else {
             self.load();
             self.load();
           }
           }
         }
         }
       }
       }
     ).fail(response => {
     ).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 => {
       response => {
         if (response != null) {
         if (response != null) {
           if (response.status !== 0) {
           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 {
           } else {
             // self.load();
             // self.load();
           }
           }
         }
         }
       }
       }
     ).fail(response => {
     ).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 HueDocument from 'doc/hueDocument';
 import { DOCUMENT_TYPE_I18n, DOCUMENT_TYPES } from 'doc/docSupport';
 import { DOCUMENT_TYPE_I18n, DOCUMENT_TYPES } from 'doc/docSupport';
 import { SHOW_DELETE_DOC_MODAL_EVENT } from 'ko/components/ko.deleteDocModal';
 import { SHOW_DELETE_DOC_MODAL_EVENT } from 'ko/components/ko.deleteDocModal';
+import { GLOBAL_ERROR_TOPIC } from 'reactComponents/AlertComponent/events';
 
 
 const SORTS = {
 const SORTS = {
   defaultAsc: (a, b) => {
   defaultAsc: (a, b) => {
@@ -134,7 +135,7 @@ class HueFileEntry {
         }
         }
         this.selectedDocsWithDependents(docsWithDependents);
         this.selectedDocsWithDependents(docsWithDependents);
       }).fail(response => {
       }).fail(response => {
-        huePubSub.publish('hue.global.error', {
+        huePubSub.publish(GLOBAL_ERROR_TOPIC, {
           message: 'Error getting document data: ' + response.responseText
           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 hueUtils from 'utils/hueUtils';
 import I18n from 'utils/i18n';
 import I18n from 'utils/i18n';
 import MultiLineEllipsisHandler from 'utils/multiLineEllipsisHandler';
 import MultiLineEllipsisHandler from 'utils/multiLineEllipsisHandler';
-
 import sqlUtils from 'sql/sqlUtils';
 import sqlUtils from 'sql/sqlUtils';
 
 
 import 'webComponents/HueIcons';
 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 { 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 Mustache from 'mustache'; // In hbase/templates/app.mako, jobsub.templates.js, search.ko.js, search.util.js
 import { createReactComponents } from 'reactComponents/createRootElements.js';
 import { createReactComponents } from 'reactComponents/createRootElements.js';
+import { GLOBAL_ERROR_TOPIC } from 'reactComponents/AlertComponent/events';
 
 
 // TODO: Migrate away
 // TODO: Migrate away
 window._ = _;
 window._ = _;
@@ -152,11 +152,11 @@ $(document).ready(async () => {
         if (resp.history_uuid) {
         if (resp.history_uuid) {
           huePubSub.publish('open.editor.query', resp);
           huePubSub.publish('open.editor.query', resp);
         } else if (resp.message) {
         } else if (resp.message) {
-          huePubSub.publish('hue.global.error', { message: resp.message });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: resp.message });
         }
         }
       }
       }
     ).fail(xhr => {
     ).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.hiveautocomplete';
 import 'jquery/plugins/jquery.horizontalscrollbar';
 import 'jquery/plugins/jquery.horizontalscrollbar';
 import 'jquery/plugins/jquery.huedatatable';
 import 'jquery/plugins/jquery.huedatatable';
-import 'jquery/plugins/jquery.notify';
 import 'jquery/plugins/jquery.rowselector';
 import 'jquery/plugins/jquery.rowselector';
 import 'jquery/plugins/jquery.scrollleft';
 import 'jquery/plugins/jquery.scrollleft';
 import 'jquery/plugins/jquery.scrollup';
 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 * as ko from 'knockout';
 import qq from 'ext/fileuploader.custom';
 import qq from 'ext/fileuploader.custom';
 
 
+import { GLOBAL_ERROR_TOPIC, GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
 import huePubSub from 'utils/huePubSub';
 import huePubSub from 'utils/huePubSub';
 import I18n from 'utils/i18n';
 import I18n from 'utils/i18n';
 import { hueLocalStorage } from 'utils/storageUtils';
 import { hueLocalStorage } from 'utils/storageUtils';
@@ -757,7 +758,7 @@ Plugin.prototype.navigateTo = function (path) {
                 }
                 }
               },
               },
               error: function (xhr) {
               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 => {
   }).fail(e => {
     if (!_parent.options.suppressErrors) {
     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();
       _parent.options.onError();
     }
     }
     if (e.status === 404 || e.status === 500) {
     if (e.status === 404 || e.status === 500) {
@@ -797,7 +798,7 @@ Plugin.prototype.navigateTo = function (path) {
       );
       );
     } else {
     } else {
       console.error(e);
       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) {
     onComplete: function (id, fileName, responseJSON) {
       num_of_pending_uploads--;
       num_of_pending_uploads--;
       if (responseJSON.status == -1) {
       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) {
       } else if (!num_of_pending_uploads) {
         _parent.navigateTo(path);
         _parent.navigateTo(path);
         huePubSub.publish('assist.' + getFs(getScheme(path)) + '.refresh');
         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 jQuery from 'jquery';
 
 
+import { GLOBAL_ERROR_TOPIC } from 'reactComponents/AlertComponent/events';
+import huePubSub from 'utils/huePubSub';
 import I18n from 'utils/i18n';
 import I18n from 'utils/i18n';
 import scrollbarWidth from 'utils/screen/scrollbarWidth';
 import scrollbarWidth from 'utils/screen/scrollbarWidth';
 
 
@@ -326,7 +328,9 @@ Plugin.prototype.init = function (optionalPath) {
           });
           });
         }
         }
       } else {
       } 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.heat';
 import 'ext/leaflet/leaflet.zoombox';
 import 'ext/leaflet/leaflet.zoombox';
 
 
+import { GLOBAL_ERROR_TOPIC } from 'reactComponents/AlertComponent/events';
 import huePubSub from 'utils/huePubSub';
 import huePubSub from 'utils/huePubSub';
 
 
 ko.bindingHandlers.leafletMapChart = {
 ko.bindingHandlers.leafletMapChart = {
@@ -300,7 +301,9 @@ ko.bindingHandlers.leafletMapChart = {
             resizeSubscription.remove();
             resizeSubscription.remove();
           });
           });
         } catch (err) {
         } 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 $ from 'jquery';
 import * as ko from 'knockout';
 import * as ko from 'knockout';
 
 
+import { GLOBAL_ERROR_TOPIC } from 'reactComponents/AlertComponent/events';
+import huePubSub from 'utils/huePubSub';
+
 ko.bindingHandlers.dateRangePicker = {
 ko.bindingHandlers.dateRangePicker = {
   INTERVAL_OPTIONS: [
   INTERVAL_OPTIONS: [
     {
     {
@@ -428,10 +431,9 @@ ko.bindingHandlers.dateRangePicker = {
               .find('.end-date')
               .find('.end-date')
               .datepicker('setValue', _tmpl.find('.end-date').data('original-val'));
               .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 {
       } else {

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

@@ -17,8 +17,9 @@
 import Dropzone from 'dropzone';
 import Dropzone from 'dropzone';
 import $ from 'jquery';
 import $ from 'jquery';
 import * as ko from 'knockout';
 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';
 import I18n from 'utils/i18n';
 
 
 // TODO: Depends on Dropzone
 // TODO: Depends on Dropzone
@@ -71,19 +72,21 @@ ko.bindingHandlers.dropzone = {
         $('#progressStatusBar div').width(progress.toFixed() + '%');
         $('#progressStatusBar div').width(progress.toFixed() + '%');
       },
       },
       canceled: function () {
       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) {
       complete: function (file) {
         if (file.xhr.response !== '') {
         if (file.xhr.response !== '') {
           const response = JSON.parse(file.xhr.response);
           const response = JSON.parse(file.xhr.response);
           if (response && response.status != null) {
           if (response && response.status != null) {
             if (response.status !== 0) {
             if (response.status !== 0) {
-              huePubSub.publish('hue.global.error', { message: response.data });
+              huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: response.data });
               if (value.onError) {
               if (value.onError) {
                 value.onError(file.name);
                 value.onError(file.name);
               }
               }
             } else {
             } else {
-              huePubSub.publish('hue.global.info', {
+              huePubSub.publish(GLOBAL_INFO_TOPIC, {
                 message: response.path + ' ' + I18n('uploaded successfully')
                 message: response.path + ' ' + I18n('uploaded successfully')
               });
               });
               if (value.onComplete) {
               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,
             url: '/filebrowser/upload/file?dest=' + (source.type === 'adls' ? 'adl:' : '') + path,
             params: { dest: path },
             params: { dest: path },
             paramName: 'hdfs_file',
             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(
             onComplete: function () { huePubSub.publish('assist.storage.refresh'); } }" title="${I18n(
               'Upload file'
               'Upload file'
             )}" href="javascript:void(0)">
             )}" href="javascript:void(0)">
@@ -72,7 +74,7 @@ const TEMPLATE = `
             url: '/filebrowser/upload/file?dest=' + abfsPath,
             url: '/filebrowser/upload/file?dest=' + abfsPath,
             params: { dest: abfsPath },
             params: { dest: abfsPath },
             paramName: 'hdfs_file',
             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(
             onComplete: function () { huePubSub.publish('assist.storage.refresh'); } }" title="${I18n(
               'Upload file'
               'Upload file'
             )}" href="javascript:void(0)">
             )}" 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 koMapping from 'knockout.mapping';
 
 
 import componentUtils from './componentUtils';
 import componentUtils from './componentUtils';
+import { GLOBAL_ERROR_TOPIC, GLOBAL_INFO_TOPIC } from 'reactComponents/AlertComponent/events';
 import huePubSub from 'utils/huePubSub';
 import huePubSub from 'utils/huePubSub';
 import I18n from 'utils/i18n';
 import I18n from 'utils/i18n';
 import UUID from 'utils/string/UUID';
 import UUID from 'utils/string/UUID';
@@ -469,7 +470,7 @@ class Role {
     };
     };
 
 
     self.saveGroups = function () {
     self.saveGroups = function () {
-      $('.jHueNotify').remove();
+      huePubSub.publish('hide.global.alerts');
       $.post(
       $.post(
         '/security/api/hive/update_role_groups',
         '/security/api/hive/update_role_groups',
         {
         {
@@ -483,16 +484,16 @@ class Role {
               self.originalGroups.push(group);
               self.originalGroups.push(group);
             });
             });
           } else {
           } else {
-            huePubSub.publish('hue.global.error', { message: data.message });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
           }
           }
         }
         }
       ).fail(xhr => {
       ).fail(xhr => {
-        huePubSub.publish('hue.global.error', { message: xhr.responseText });
+        huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
       });
       });
     };
     };
 
 
     self.create = function () {
     self.create = function () {
-      $('.jHueNotify').remove();
+      huePubSub.publish('hide.global.alerts');
       if (self.isValid()) {
       if (self.isValid()) {
         self.isLoading(true);
         self.isLoading(true);
         $.post(
         $.post(
@@ -502,7 +503,7 @@ class Role {
           },
           },
           data => {
           data => {
             if (data.status === 0) {
             if (data.status === 0) {
-              huePubSub.publish('hue.global.info', { message: data.message });
+              huePubSub.publish(GLOBAL_INFO_TOPIC, { message: data.message });
               vm.showCreateRole(false);
               vm.showCreateRole(false);
               self.reset();
               self.reset();
               const role = new Role(vm, data.role);
               const role = new Role(vm, data.role);
@@ -511,12 +512,12 @@ class Role {
               vm.listSentryPrivilegesByAuthorizable();
               vm.listSentryPrivilegesByAuthorizable();
               $(document).trigger('createdRole');
               $(document).trigger('createdRole');
             } else {
             } else {
-              huePubSub.publish('hue.global.error', { message: data.message });
+              huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
             }
             }
           }
           }
         )
         )
           .fail(xhr => {
           .fail(xhr => {
-            huePubSub.publish('hue.global.error', { message: xhr.responseText });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
           })
           })
           .always(() => {
           .always(() => {
             self.isLoading(false);
             self.isLoading(false);
@@ -525,7 +526,7 @@ class Role {
     };
     };
 
 
     self.update = function () {
     self.update = function () {
-      $('.jHueNotify').remove();
+      huePubSub.publish('hide.global.alerts');
       if (self.isValid()) {
       if (self.isValid()) {
         self.isLoading(true);
         self.isLoading(true);
         $.post(
         $.post(
@@ -535,17 +536,17 @@ class Role {
           },
           },
           data => {
           data => {
             if (data.status === 0) {
             if (data.status === 0) {
-              huePubSub.publish('hue.global.info', { message: data.message });
+              huePubSub.publish(GLOBAL_INFO_TOPIC, { message: data.message });
               vm.showCreateRole(false);
               vm.showCreateRole(false);
               vm.listSentryPrivilegesByAuthorizable();
               vm.listSentryPrivilegesByAuthorizable();
               $(document).trigger('createdRole');
               $(document).trigger('createdRole');
             } else {
             } else {
-              huePubSub.publish('hue.global.error', { message: data.message });
+              huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
             }
             }
           }
           }
         )
         )
           .fail(xhr => {
           .fail(xhr => {
-            huePubSub.publish('hue.global.error', { message: xhr.responseText });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
           })
           })
           .always(() => {
           .always(() => {
             self.isLoading(false);
             self.isLoading(false);
@@ -554,7 +555,7 @@ class Role {
     };
     };
 
 
     self.remove = function (role) {
     self.remove = function (role) {
-      $('.jHueNotify').remove();
+      huePubSub.publish('hide.global.alerts');
       self.isLoading(true);
       self.isLoading(true);
       $.post(
       $.post(
         '/security/api/hive/drop_sentry_role',
         '/security/api/hive/drop_sentry_role',
@@ -567,12 +568,12 @@ class Role {
             vm.listSentryPrivilegesByAuthorizable();
             vm.listSentryPrivilegesByAuthorizable();
             $(document).trigger('removedRole');
             $(document).trigger('removedRole');
           } else {
           } else {
-            huePubSub.publish('hue.global.error', { message: data.message });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
           }
           }
         }
         }
       )
       )
         .fail(xhr => {
         .fail(xhr => {
-          huePubSub.publish('hue.global.error', { message: xhr.responseText });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
         })
         })
         .always(() => {
         .always(() => {
           self.isLoading(false);
           self.isLoading(false);
@@ -580,7 +581,7 @@ class Role {
     };
     };
 
 
     self.savePrivileges = function (role) {
     self.savePrivileges = function (role) {
-      $('.jHueNotify').remove();
+      huePubSub.publish('hide.global.alerts');
       $.post(
       $.post(
         '/security/api/hive/save_privileges',
         '/security/api/hive/save_privileges',
         {
         {
@@ -591,11 +592,11 @@ class Role {
             vm.listSentryPrivilegesByAuthorizable();
             vm.listSentryPrivilegesByAuthorizable();
             $(document).trigger('createdRole');
             $(document).trigger('createdRole');
           } else {
           } else {
-            huePubSub.publish('hue.global.error', { message: data.message });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
           }
           }
         }
         }
       ).fail(xhr => {
       ).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);
               self.privileges(_privileges);
             }
             }
           } else {
           } else {
-            huePubSub.publish('hue.global.error', { message: data.message });
+            huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: data.message });
           }
           }
         }
         }
       })
       })
         .fail(xhr => {
         .fail(xhr => {
-          huePubSub.publish('hue.global.error', { message: xhr.responseText });
+          huePubSub.publish(GLOBAL_ERROR_TOPIC, { message: xhr.responseText });
         })
         })
         .always(() => {
         .always(() => {
           self.isLoadingPrivileges(false);
           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 getParameter from 'utils/url/getParameter';
 import getSearchParameter from 'utils/url/getSearchParameter';
 import getSearchParameter from 'utils/url/getSearchParameter';
 import { ASSIST_GET_DATABASE_EVENT, ASSIST_GET_SOURCE_EVENT } from 'ko/components/assist/events';
 import { ASSIST_GET_DATABASE_EVENT, ASSIST_GET_SOURCE_EVENT } from 'ko/components/assist/events';
+import { GLOBAL_ERROR_TOPIC } from 'reactComponents/AlertComponent/events';
 
 
 class OnePageViewModel {
 class OnePageViewModel {
   constructor() {
   constructor() {
@@ -412,11 +413,11 @@ class OnePageViewModel {
             } else if (app !== '500') {
             } else if (app !== '500') {
               self.loadApp('500');
               self.loadApp('500');
             } else {
             } 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.'
                   'It looks like you are offline or an unknown error happened. Please refresh the page.'
                 )
                 )
-              );
+              });
             }
             }
           }
           }
         });
         });

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
desktop/core/src/desktop/static/desktop/css/hue.css


Файловите разлики са ограничени, защото са твърде много
+ 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-inputautocomplete.less";
 @import "components/hue-link-sharing.less";
 @import "components/hue-link-sharing.less";
 @import "components/hue-nav-properties.less";
 @import "components/hue-nav-properties.less";
-@import "components/hue-notify.less";
 @import "components/hue-popover.less";
 @import "components/hue-popover.less";
 @import "components/hue-qq-upload.less";
 @import "components/hue-qq-upload.less";
 @import "components/hue-query-builder.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">
 <script type="text/javascript">
   $(document).ready(function () {
   $(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:
     %if messages:
       %for message in messages:
       %for message in messages:
         %if message.tags == 'error':
         %if message.tags == 'error':

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

@@ -569,11 +569,3 @@ ${ hueIcons.symbols() }
   }
   }
   </script>
   </script>
 % endif
 % 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
     // Catches HTTP 502 errors
     function xhrOnreadystatechange() {
     function xhrOnreadystatechange() {
       if (this.readyState === 4 && this.status === 502) {
       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) {
       if (this._onreadystatechange) {
         return this._onreadystatechange.apply(this, arguments);
         return this._onreadystatechange.apply(this, arguments);
@@ -347,19 +349,6 @@ else:
           '</button>';
           '</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 () {
     $($('#zoomDetectFrame')[0].contentWindow).resize(function () {
       $(window).trigger('zoom');
       $(window).trigger('zoom');
     });
     });
@@ -405,7 +394,7 @@ else:
             });
             });
           }
           }
           window.setTimeout(function () {
           window.setTimeout(function () {
-            $('.jHueNotify').remove();
+            huePubSub.publish('hide.global.alerts');
           }, 200);
           }, 200);
         }
         }
       }
       }
@@ -423,7 +412,9 @@ else:
         }
         }
         else {
         else {
           $('#login-modal').modal('hide');
           $('#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');
           $('#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) {
         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();
           e.clearSelection();
           $('.clipboard-content').empty();
           $('.clipboard-content').empty();
         });
         });

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

@@ -124,12 +124,6 @@
   </script>
   </script>
 % endif
 % endif
 
 
-<div id="jHueNotify" class="alert hide">
-  <button class="close">&times;</button>
-  <div class="message"></div> 
-</div>
-
-
 ${ hueIcons.symbols() }
 ${ hueIcons.symbols() }
 
 
 <!-- fake fields are a workaround for chrome autofill getting the wrong fields, readonly needed for 1password -->
 <!-- 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;"
           <button class="btn" type="button" data-clipboard-target="#query-impala-profile" style="float: right;"
                   data-bind="
                   data-bind="
                 visible: properties.profile && properties.profile().profile,
                 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') }
           <i class="fa fa-fw fa-clipboard"></i> ${ _('Clipboard') }
           </button>
           </button>
           <button class="btn" type="button" style="float: right;" data-bind="
           <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) {
             if (data.message) {
               message = 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) {
     self.search = function (callback) {
-      $(".jHueNotify").remove();
+      huePubSub.publish('hide.global.alerts');
       hueAnalytics.log('dashboard', 'search');
       hueAnalytics.log('dashboard', 'search');
       self.isRetrievingResults(true);
       self.isRetrievingResults(true);
 
 

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

@@ -5423,7 +5423,9 @@ $(document).ready(function () {
 
 
   function checkResultHighlightingAvailability() {
   function checkResultHighlightingAvailability() {
     if (! searchViewModel.collection.idField()) {
     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>
 </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() {
       self.streamCheckConnection = function() {
-        $(".jHueNotify").remove();
+        huePubSub.publish('hide.global.alerts');
         $.post("${ url('indexer:get_db_component') }", {
         $.post("${ url('indexer:get_db_component') }", {
           "source": ko.mapping.toJSON(self)
           "source": ko.mapping.toJSON(self)
         }, function (resp) {
         }, function (resp) {
@@ -3000,7 +3000,7 @@ ${ commonheader(_("Importer"), "indexer", user, request, "60px") | n,unicode }
         if (!self.readyToIndex()) {
         if (!self.readyToIndex()) {
           return;
           return;
         }
         }
-        $(".jHueNotify").remove();
+        huePubSub.publish('hide.global.alerts');
 
 
         self.indexingStarted(true);
         self.indexingStarted(true);
 % if not is_embeddable:
 % if not is_embeddable:
@@ -3016,7 +3016,9 @@ ${ commonheader(_("Importer"), "indexer", user, request, "60px") | n,unicode }
             self.indexingStarted(false);
             self.indexingStarted(false);
             self.isIndexing(false);
             self.isIndexing(false);
           } else if (resp.on_success_url) {
           } else if (resp.on_success_url) {
-            $.jHueNotify.info("${ _('Creation success.') }");
+            huePubSub.publish('hue.global.info', {
+              message: "${ _('Creation success.') }"
+            });
             if (resp.pubSubUrl) {
             if (resp.pubSubUrl) {
               huePubSub.publish(notebook.pubSubUrl);
               huePubSub.publish(notebook.pubSubUrl);
             }
             }
@@ -3117,15 +3119,21 @@ ${ commonheader(_("Importer"), "indexer", user, request, "60px") | n,unicode }
           self.indexingStarted(false);
           self.indexingStarted(false);
           if (resp.status === 0) {
           if (resp.status === 0) {
             if (resp.history_uuid) {
             if (resp.history_uuid) {
-              $.jHueNotify.info("${ _('Task submitted') }");
+              huePubSub.publish('hue.global.info', {
+                message: "${ _('Task submitted') }"
+              });
               huePubSub.publish('notebook.task.submitted', resp);
               huePubSub.publish('notebook.task.submitted', resp);
             } else if (resp.on_success_url) {
             } else if (resp.on_success_url) {
               if (resp.pub_sub_url) {
               if (resp.pub_sub_url) {
                 huePubSub.publish(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) {
               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);
               huePubSub.publish('open.link', resp.on_success_url);
             } else if (resp.commands) {
             } else if (resp.commands) {
@@ -3313,10 +3321,14 @@ ${ commonheader(_("Importer"), "indexer", user, request, "60px") | n,unicode }
         fd.append('file', files);
         fd.append('file', files);
         var file_size = files.size;
         var file_size = files.size;
         if (file_size === 0) {
         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) {          
         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 {
         } else {
           $.ajax({
           $.ajax({
             url:"/indexer/api/indexer/upload_local_file",
             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);
             viewModel.fetchIndex(foundIndex);
           }
           }
           else {
           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();
             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);
             viewModel.fetchIndex(foundIndex);
           }
           }
           else {
           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();
             viewModel.showIndexes();
           }
           }
         }
         }

Някои файлове не бяха показани, защото твърде много файлове са промени