Jelajahi Sumber

HUE-6974 [importer] Refresh Assist collection list after create table wizard success

When not using the batch indexer, we submit synchronously so we now it was created.
Romain Rigaux 8 tahun lalu
induk
melakukan
ff6fe4e

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

@@ -216,7 +216,7 @@ def _create_index(user, fs, client, source, destination, index_name):
     data = fs.read(source["path"], 0, MAX_UPLOAD_SIZE)
     client.index(name=index_name, data=data, **kwargs)
 
-  return {'status': 0, 'on_success_url': reverse('indexer:indexes', kwargs={'index': index_name})}
+  return {'status': 0, 'on_success_url': reverse('indexer:indexes', kwargs={'index': index_name}), 'pub_sub_url': 'assist.collections.refresh'}
 
 
 def _create_database(request, source, destination, start_time):

+ 5 - 2
desktop/libs/indexer/src/indexer/templates/importer.mako

@@ -1663,10 +1663,13 @@ ${ assist.assistPanel() }
         }, function (resp) {
           if (resp.status == 0) {
             if (resp.history_uuid) {
-              $.jHueNotify.info("${ _('Task submitted.') }");
+              $.jHueNotify.info("${ _('Task submitted') }");
               huePubSub.publish('notebook.task.submitted', resp.history_uuid);
             } else if (resp.on_success_url) {
-              $.jHueNotify.info("${ _('Creation success.') }");
+              if (resp.pub_sub_url) {
+                huePubSub.publish(resp.pub_sub_url);
+              }
+              $.jHueNotify.info("${ _('Creation success') }");
               huePubSub.publish('open.link', resp.on_success_url);
             }
           } else {