瀏覽代碼

HUE-5513 [responsive] Metastore shouldn't change the url

Enrico Berti 9 年之前
父節點
當前提交
1b623af

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

@@ -688,6 +688,7 @@ var MetastoreViewModel = (function () {
     self.partitionsLimit = options.partitionsLimit;
     self.assistAvailable = ko.observable(true);
     self.apiHelper = ApiHelper.getInstance(options);
+    self.isResponsive = ko.observable(options.responsive);
     self.isLeftPanelVisible = ko.observable();
     self.apiHelper.withTotalStorage('assist', 'assist_panel_visible', self.isLeftPanelVisible, true);
     self.optimizerEnabled = ko.observable(options.optimizerEnabled || false);
@@ -868,14 +869,18 @@ var MetastoreViewModel = (function () {
     });
 
     huePubSub.subscribe('metastore.url.change', function () {
+      var prefix = '/metastore/';
+      if (self.isResponsive()){
+        prefix = '?app=metastore&path=';
+      }
       if (self.database() && self.database().table()) {
-        hueUtils.changeURL('/metastore/table/' + self.database().name + '/' + self.database().table().name);
+        hueUtils.changeURL(prefix + 'table/' + self.database().name + '/' + self.database().table().name);
       }
       else if (self.database()) {
-        hueUtils.changeURL('/metastore/tables/' + self.database().name);
+        hueUtils.changeURL(prefix + 'tables/' + self.database().name);
       }
       else {
-        hueUtils.changeURL('/metastore/databases');
+        hueUtils.changeURL(prefix + 'databases');
       }
     });
 

+ 3 - 0
apps/metastore/src/metastore/templates/metastore.mako

@@ -1186,6 +1186,9 @@ ${ components.menubar() }
     $(document).ready(function () {
       var options = {
         user: '${ user.username }',
+        % if is_embeddable:
+        responsive: true,
+        % endif
         i18n: {
           errorFetchingTableDetails: '${_('An error occurred fetching the table details. Please try again.')}',
           errorFetchingTableFields: '${_('An error occurred fetching the table fields. Please try again.')}',