فهرست منبع

HUE-9449 [tb] Include connector id in "Open in table browser" links

Johan Ahlen 5 سال پیش
والد
کامیت
3bd95c2484

+ 2 - 2
apps/beeswax/src/beeswax/templates/create_database.mako

@@ -225,11 +225,11 @@ ${layout.metastore_menubar()}
       self.apiHelper.withTotalStorage('assist', 'assist_panel_visible', self.isLeftPanelVisible, true);
       self.apiHelper.withTotalStorage('assist', 'assist_panel_visible', self.isLeftPanelVisible, true);
 
 
       huePubSub.subscribe("assist.table.selected", function (entry) {
       huePubSub.subscribe("assist.table.selected", function (entry) {
-        location.href = '/metastore/table/' + entry.path[0] + '/' + entry.name + '?source=' + entry.getConnector().id + '&namespace=' + entry.namespace.id;
+        location.href = '/metastore/table/' + entry.path[0] + '/' + entry.name + '?connector_id=' + entry.getConnector().id + '&namespace=' + entry.namespace.id;
       });
       });
 
 
       huePubSub.subscribe("assist.database.selected", function (entry) {
       huePubSub.subscribe("assist.database.selected", function (entry) {
-        location.href = '/metastore/tables/' + entry.name + '?source=' + entry.getConnector().id + '&namespace=' + entry.namespace.id;
+        location.href = '/metastore/tables/' + entry.name + '?connector_id=' + entry.getConnector().id + '&namespace=' + entry.namespace.id;
       });
       });
     }
     }
 
 

+ 2 - 2
apps/beeswax/src/beeswax/templates/create_table_manually.mako

@@ -545,11 +545,11 @@ ${ layout.metastore_menubar() }
       self.apiHelper.withTotalStorage('assist', 'assist_panel_visible', self.isLeftPanelVisible, true);
       self.apiHelper.withTotalStorage('assist', 'assist_panel_visible', self.isLeftPanelVisible, true);
 
 
       huePubSub.subscribe("assist.table.selected", function (entry) {
       huePubSub.subscribe("assist.table.selected", function (entry) {
-        location.href = '/metastore/table/' + entry.path[0] + '/' + entry.name + '?source=' + entry.getConnector().id + '&namespace=' + entry.namespace.id;
+        location.href = '/metastore/table/' + entry.path[0] + '/' + entry.name + '?connector_id=' + entry.getConnector().id + '&namespace=' + entry.namespace.id;
       });
       });
 
 
       huePubSub.subscribe("assist.database.selected", function (entry) {
       huePubSub.subscribe("assist.database.selected", function (entry) {
-        location.href = '/metastore/tables/' + entry.name + '?source=' + entry.getConnector().id + '&namespace=' + entry.namespace.id;
+        location.href = '/metastore/tables/' + entry.name + '?connector_id=' + entry.getConnector().id + '&namespace=' + entry.namespace.id;
       });
       });
     }
     }
 
 

+ 2 - 2
apps/beeswax/src/beeswax/templates/import_wizard_choose_delimiter.mako

@@ -186,11 +186,11 @@ ${ layout.metastore_menubar() }
 
 
 
 
       huePubSub.subscribe("assist.table.selected", function (entry) {
       huePubSub.subscribe("assist.table.selected", function (entry) {
-        location.href = '/metastore/table/' + entry.path[0] + '/' + entry.name + '?source=' + entry.getConnector().id + '&namespace=' + entry.namespace.id;
+        location.href = '/metastore/table/' + entry.path[0] + '/' + entry.name + '?connector_id=' + entry.getConnector().id + '&namespace=' + entry.namespace.id;
       });
       });
 
 
       huePubSub.subscribe("assist.database.selected", function (entry) {
       huePubSub.subscribe("assist.database.selected", function (entry) {
-        location.href = '/metastore/tables/' + entry.name + '?source=' + entry.getConnector().id + '&namespace=' + entry.namespace.id;
+        location.href = '/metastore/tables/' + entry.name + '?connector_id=' + entry.getConnector().id + '&namespace=' + entry.namespace.id;
       });
       });
     }
     }
 
 

+ 2 - 2
apps/beeswax/src/beeswax/templates/import_wizard_choose_file.mako

@@ -193,11 +193,11 @@ ${ layout.metastore_menubar() }
 
 
 
 
       huePubSub.subscribe("assist.table.selected", function (entry) {
       huePubSub.subscribe("assist.table.selected", function (entry) {
-        location.href = '/metastore/table/' + entry.path[0] + '/' + entry.name + '?source=' + entry.getConnector().id + '&namespace=' + entry.namespace.id;
+        location.href = '/metastore/table/' + entry.path[0] + '/' + entry.name + '?connector_id=' + entry.getConnector().id + '&namespace=' + entry.namespace.id;
       });
       });
 
 
       huePubSub.subscribe("assist.database.selected", function (entry) {
       huePubSub.subscribe("assist.database.selected", function (entry) {
-        location.href = '/metastore/tables/' + entry.name + '?source=' + entry.getConnector().id + '&namespace=' + entry.namespace.id;
+        location.href = '/metastore/tables/' + entry.name + '?connector_id=' + entry.getConnector().id + '&namespace=' + entry.namespace.id;
       });
       });
     }
     }
 
 

+ 2 - 2
apps/beeswax/src/beeswax/templates/import_wizard_define_columns.mako

@@ -221,11 +221,11 @@ ${ layout.metastore_menubar() }
 
 
 
 
       huePubSub.subscribe("assist.table.selected", function (entry) {
       huePubSub.subscribe("assist.table.selected", function (entry) {
-        location.href = '/metastore/table/' + entry.path[0] + '/' + entry.name + '?source=' + entry.getConnector().id + '&namespace=' + entry.namespace.id;
+        location.href = '/metastore/table/' + entry.path[0] + '/' + entry.name + '?connector_id=' + entry.getConnector().id + '&namespace=' + entry.namespace.id;
       });
       });
 
 
       huePubSub.subscribe("assist.database.selected", function (entry) {
       huePubSub.subscribe("assist.database.selected", function (entry) {
-        location.href = '/metastore/tables/' + entry.name + '?source=' + entry.getConnector().id + '&namespace=' + entry.namespace.id;
+        location.href = '/metastore/tables/' + entry.name + '?connector_id=' + entry.getConnector().id + '&namespace=' + entry.namespace.id;
       });
       });
     }
     }
 
 

+ 13 - 5
desktop/core/src/desktop/js/apps/tableBrowser/metastoreViewModel.js

@@ -370,22 +370,30 @@ class MetastoreViewModel {
     loadedDeferred.done(() => {
     loadedDeferred.done(() => {
       let search = location.search;
       let search = location.search;
       let namespaceId;
       let namespaceId;
+      let connectorId;
       let sourceType;
       let sourceType;
       if (search) {
       if (search) {
         search = search.replace('?', '');
         search = search.replace('?', '');
         search.split('&').forEach(param => {
         search.split('&').forEach(param => {
           if (param.indexOf('namespace=') === 0) {
           if (param.indexOf('namespace=') === 0) {
             namespaceId = param.replace('namespace=', '');
             namespaceId = param.replace('namespace=', '');
-          }
-          if (param.indexOf('source_type=') === 0) {
-            sourceType = param.replace('source_type=', '');
+          } else if (param.indexOf('source_type=') === 0) {
+            sourceType = param.replace('source_type=', ''); // Keep old links working
+          } else if (param.indexOf('source=') === 0) {
+            sourceType = param.replace('source=', ''); // Keep old links working
+          } else if (param.indexOf('connector_id=') === 0) {
+            connectorId = param.replace('connector_id=', '');
           }
           }
         });
         });
       }
       }
 
 
-      if (sourceType && sourceType !== this.source().type) {
+      if (!connectorId && sourceType) {
+        connectorId = sourceType;
+      }
+
+      if (connectorId && connectorId !== this.source().connector().id) {
         const found = this.sources().some(source => {
         const found = this.sources().some(source => {
-          if (source.type === sourceType) {
+          if (connectorId === source.connector().id) {
             this.source(source);
             this.source(source);
             return true;
             return true;
           }
           }

+ 2 - 2
desktop/core/src/desktop/js/ko/components/assist/assistDbEntry.js

@@ -478,7 +478,7 @@ class AssistDbEntry {
       url =
       url =
         '/metastore/tables/' +
         '/metastore/tables/' +
         self.catalogEntry.name +
         self.catalogEntry.name +
-        '?source=' +
+        '?connector_id=' +
         self.catalogEntry.getConnector().id +
         self.catalogEntry.getConnector().id +
         '&namespace=' +
         '&namespace=' +
         self.catalogEntry.namespace.id;
         self.catalogEntry.namespace.id;
@@ -488,7 +488,7 @@ class AssistDbEntry {
         self.parent.catalogEntry.name +
         self.parent.catalogEntry.name +
         '/' +
         '/' +
         self.catalogEntry.name +
         self.catalogEntry.name +
-        '?source=' +
+        '?connector_id=' +
         self.catalogEntry.getConnector().id +
         self.catalogEntry.getConnector().id +
         '&namespace=' +
         '&namespace=' +
         self.catalogEntry.namespace.id;
         self.catalogEntry.namespace.id;

+ 1 - 1
desktop/core/src/desktop/js/ko/components/contextPopover/dataCatalogContext.js

@@ -200,7 +200,7 @@ class DataCatalogContext {
       '/metastore/table' +
       '/metastore/table' +
         (self.catalogEntry().isTableOrView() ? '/' : 's/') +
         (self.catalogEntry().isTableOrView() ? '/' : 's/') +
         self.catalogEntry().path.join('/') +
         self.catalogEntry().path.join('/') +
-        '?source_type=' +
+        '?connector_id=' +
         self.catalogEntry().getConnector().id +
         self.catalogEntry().getConnector().id +
         '&namespace=' +
         '&namespace=' +
         self.catalogEntry().namespace.id
         self.catalogEntry().namespace.id