浏览代码

HUE-8758 [editor] Remove function usage in editor v2

Johan Ahlen 5 年之前
父节点
当前提交
69a88ec49d

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

@@ -246,7 +246,7 @@ export const initNotebook2 = () => {
           }
         };
 
-        const handleFileSelect = function(evt) {
+        const handleFileSelect = evt => {
           evt.stopPropagation();
           evt.preventDefault();
           const dt = evt.dataTransfer;

+ 1 - 1
desktop/core/src/desktop/js/apps/notebook2/editorViewModel.js

@@ -176,7 +176,7 @@ class EditorViewModel {
             contents: activeSnippet.statement()
           };
           const options = {
-            successCallback: function(result) {
+            successCallback: result => {
               if (result && result.exists) {
                 $(document).trigger('info', result.path + ' saved successfully.');
               }

+ 5 - 5
desktop/core/src/desktop/js/apps/notebook2/notebook.js

@@ -137,7 +137,7 @@ export default class Notebook {
       ASSIST_DB_PANEL_IS_READY_EVENT,
       () => {
         if (this.type().indexOf('query') === 0) {
-          const whenDatabaseAvailable = function(snippet) {
+          const whenDatabaseAvailable = snippet => {
             huePubSub.publish(ASSIST_SET_DATABASE_EVENT, {
               connector: snippet.connector(),
               namespace: snippet.namespace(),
@@ -145,7 +145,7 @@ export default class Notebook {
             });
           };
 
-          const whenNamespaceAvailable = function(snippet) {
+          const whenNamespaceAvailable = snippet => {
             if (snippet.database()) {
               whenDatabaseAvailable(snippet);
             } else {
@@ -156,7 +156,7 @@ export default class Notebook {
             }
           };
 
-          const whenSnippetAvailable = function(snippet) {
+          const whenSnippetAvailable = snippet => {
             if (snippet.namespace()) {
               whenNamespaceAvailable(snippet);
             } else {
@@ -232,7 +232,7 @@ export default class Notebook {
       }
       hueAnalytics.log('notebook', 'schedule/' + action);
 
-      const getCoordinator = function() {
+      const getCoordinator = () => {
         $.get(
           '/scheduler/api/schedule/' + action + '/',
           {
@@ -244,7 +244,7 @@ export default class Notebook {
             if ($('#schedulerEditor').length > 0) {
               huePubSub.publish('hue4.process.headers', {
                 response: data.layout,
-                callback: function(r) {
+                callback: r => {
                   const $schedulerEditor = $('#schedulerEditor');
                   $schedulerEditor.html(r);