Explorar o código

HUE-8856 [autocomplete] Include bundle config name when loading bundles dynamically

Johan Ahlen %!s(int64=6) %!d(string=hai) anos
pai
achega
f7d9bc4084

+ 1 - 1
desktop/core/src/desktop/js/sql/sqlLocationWebWorker.js

@@ -22,7 +22,7 @@ const handleStatement = (statement, locations, autocompleteParser, active) => {
   // Statement locations come in the message to the worker and are generally more accurate
   locations.push(statement);
   try {
-    const sqlParseResult = autocompleteParser.parse(statement.statement + ' ', '');
+    const sqlParseResult = autocompleteParser.parseSql(statement.statement + ' ', '');
     if (sqlParseResult.locations) {
       sqlParseResult.locations.forEach(location => {
         location.active = active;

+ 1 - 1
desktop/core/src/desktop/js/utils/publicPath.js

@@ -1 +1 @@
-__webpack_public_path__ = (window.HUE_BASE_URL || '') + '/dynamic_bundle/';
+__webpack_public_path__ = (window.HUE_BASE_URL || '') + '/dynamic_bundle/default/';

+ 1 - 3
desktop/core/src/desktop/js/utils/workerPublicPath.js

@@ -1,3 +1 @@
-__webpack_public_path__ = (WorkerGlobalScope.HUE_BASE_URL || '') + '/dynamic_bundle/';
-
-console.log(__webpack_public_path__);
+__webpack_public_path__ = (WorkerGlobalScope.HUE_BASE_URL || '') + '/dynamic_bundle/workers/';

+ 1 - 1
desktop/core/src/desktop/urls.py

@@ -121,7 +121,7 @@ dynamic_patterns += [
   url(r'^desktop/workers/aceSqlLocationWorker.js', desktop_views.ace_sql_location_worker),
   url(r'^desktop/workers/aceSqlSyntaxWorker.js', desktop_views.ace_sql_syntax_worker),
 
-  url(r'^dynamic_bundle/(?P<bundle_path>.+)', desktop_views.dynamic_bundle),
+  url(r'^dynamic_bundle/(?P<config>\w+)/(?P<bundle_name>.+)', desktop_views.dynamic_bundle),
 
   # Unsupported browsers
   url(r'^boohoo$', desktop_views.unsupported, name='desktop_views_unsupported'),

+ 3 - 3
desktop/core/src/desktop/views.py

@@ -377,9 +377,9 @@ def ace_sql_location_worker(request):
 def ace_sql_syntax_worker(request):
   return HttpResponse(render('ace_sql_syntax_worker.mako', request, None), content_type="application/javascript")
 
-def dynamic_bundle(request, bundle_path):
-  bundle_name = re.sub(r'-(bundle|chunk).*', '', bundle_path)
-  files = get_files(bundle_name)
+def dynamic_bundle(request, config, bundle_name):
+  bundle_name = re.sub(r'-(bundle|chunk).*', '', bundle_name)
+  files = get_files(bundle_name, None, config.upper())
   if len(files) == 1:
     return HttpResponseRedirect(files[0]['url'])
   return render("404.mako", request, dict(uri=request.build_absolute_uri()), status=404)