Эх сурвалжийг харах

HUE-5515 [responsive] Embeddable collection list

Enrico Berti 9 жил өмнө
parent
commit
7bcffbd

+ 4 - 0
apps/search/src/search/templates/admin_collections.mako

@@ -21,8 +21,12 @@
 
 <%namespace name="common_admin_collections" file="common_admin_collections.mako" />
 
+%if not is_embeddable:
 ${ commonheader(_('Search'), "search", user, request, "29px") | n,unicode }
+%endif
 
 ${ common_admin_collections.page_structure() }
 
+%if not is_embeddable:
 ${ commonfooter(request, messages) | n,unicode }
+%endif

+ 2 - 2
apps/search/src/search/templates/common_admin_collections.mako

@@ -30,7 +30,7 @@
 <h3 style="text-align: center">${_('Dashboards')}</h3>
 %endif
 
-<div id="editor">
+<div id="collectionsComponents">
 %if not is_mobile:
 <div class="search-bar" style="height: 30px">
   <div class="pull-right">
@@ -182,7 +182,7 @@ ${ commonimportexport(request) | n,unicode }
   }
 
   var viewModel = new SearchCollectionsModel(appProperties);
-  ko.applyBindings(viewModel, $("#editor")[0]);
+  ko.applyBindings(viewModel, $("#collectionsComponents")[0]);
 
   shareViewModel = initSharing("#documentShareModal");
   shareViewModel.setDocUuid('');

+ 1 - 0
apps/search/src/search/views.py

@@ -271,6 +271,7 @@ def admin_collections(request, is_redirect=False, is_mobile=False):
     template = 'admin_collections_m.mako'
 
   return render(template, request, {
+    'is_embeddable': request.GET.get('is_embeddable', False),
     'existing_hue_collections': existing_hue_collections,
     'is_redirect': is_redirect
   })

+ 3 - 0
desktop/core/src/desktop/templates/responsive.mako

@@ -306,6 +306,7 @@ ${ hueIcons.symbols() }
         <li class="header">&nbsp;</li>
         <li class="header" style="padding-left: 4px; border-bottom: 1px solid #DDD; padding-bottom: 3px;">${ _('Browse') }</li>
         <li><a data-bind="click: function () { onePageViewModel.currentApp('metastore') }">Tables</a></li>
+        <li><a data-bind="click: function () { onePageViewModel.currentApp('collections') }">Collections</a></li>
         <li><a href="javascript: void(0);">Indexes</a></li>
         <li><a data-bind="click: function () { onePageViewModel.currentApp('jobbrowser') }">Jobs</a></li>
         <li><a data-bind="click: function () { onePageViewModel.currentApp('filebrowser') }">Files</a></li>
@@ -368,6 +369,7 @@ ${ hueIcons.symbols() }
       <div id="embeddable_fileviewer" class="embeddable"></div>
       <div id="embeddable_home" class="embeddable"></div>
       <div id="embeddable_indexer" class="embeddable"></div>
+      <div id="embeddable_collections" class="embeddable"></div>
     </div>
 
     <div id="rightResizer" class="resizer" data-bind="visible: rightAssistVisible(), splitFlexDraggable : {
@@ -504,6 +506,7 @@ ${ assist.assistPanel() }
           fileviewer: 'filebrowser/view=',
           home: '/home_embeddable',
           indexer: '/indexer/indexer/?is_embeddable=true',
+          collections: '/search/admin/collections?is_embeddable=true',
         };
 
         self.SKIP_CACHE = ['fileviewer'];