Browse Source

HUE-6012 [metastore] Disable the assist refresh in batch submission mode

Romain Rigaux 8 years ago
parent
commit
beb616379b

+ 3 - 3
apps/metastore/src/metastore/static/metastore/js/metastore.ko.js

@@ -541,9 +541,9 @@ var MetastoreViewModel = (function () {
 
     self.drop = function () {
       $.post('/tables/drop/' + self.database.name, {
-    	table_selection: ko.mapping.toJSON([self.name]),
-    	skip_trash: 'off',
-    	is_embeddable: true
+        table_selection: ko.mapping.toJSON([self.name]),
+        skip_trash: 'off',
+        is_embeddable: true
       }, function(resp) {
         if (resp.history_uuid) {
           huePubSub.publish('notebook.task.submitted', resp.history_uuid);

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

@@ -1074,7 +1074,7 @@ ${ assist.assistPanel() }
                 if (notebook.onSuccessUrl()) {
                   if (notebook.onSuccessUrl() == 'assist.db.refresh') { // TODO: Similar if in in FB directory, also refresh FB dir
                     huePubSub.publish('assist.db.refresh', { sourceType: 'hive' });
-                  } else {  
+                  } else {
                     huePubSub.publish('open.link', notebook.onSuccessUrl());
                   }
                 }

+ 1 - 4
desktop/libs/indexer/src/indexer/api3.py

@@ -357,10 +357,7 @@ def _create_table_from_a_file(request, source, destination):
     }
 
   editor_type = 'impala' if table_format == 'kudu' else 'hive'
-  
-#   if request.POST.get('is_embeddable'):
-#     on_success_url = json.dumps({'app': 'metastore', 'path': 'table/%(database)s/%(table)s' % {'database': database, 'table': table_name}})
-#   else:
+
   on_success_url = reverse('metastore:describe_table', kwargs={'database': database, 'table': table_name})
 
   return make_notebook(name='Execute and watch', editor_type=editor_type, statement=sql.strip(), status='ready', database=database, on_success_url=on_success_url)

+ 6 - 7
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -599,15 +599,14 @@ var EditorViewModel = (function() {
     self.jobs = ko.observableArray(typeof snippet.jobs != "undefined" && snippet.jobs != null ? snippet.jobs : []);
 
     self.ddlNotification = ko.observable();
-    self.delayedDDLNotification = ko.pureComputed(self.ddlNotification);
+    self.delayedDDLNotification = ko.pureComputed(self.ddlNotification).extend({ rateLimit: { method: "notifyWhenChangesStop", timeout: 5000 } });
     if (! vm.isNotificationManager()) {
-      self.delayedDDLNotification.extend({ rateLimit: { method: "notifyWhenChangesStop", timeout: 5000 } });
+      window.setTimeout(function () {
+        self.delayedDDLNotification.subscribe(function (val) {
+          huePubSub.publish('assist.db.refresh', { sourceType: self.type() });
+        });
+      }, 0);
     }
-    window.setTimeout(function () {
-      self.delayedDDLNotification.subscribe(function (val) {
-        huePubSub.publish('assist.db.refresh', { sourceType: self.type() });
-      });
-    }, 0);
 
     self.progress.subscribe(function (val) {
       $(document).trigger("progress", {data: val, snippet: self});