浏览代码

HUE-6077 [search] Properly support browsing an existing collection

Romain Rigaux 8 年之前
父节点
当前提交
a1369fd

+ 1 - 0
desktop/libs/dashboard/src/dashboard/views.py

@@ -162,6 +162,7 @@ def browse(request, name, is_mobile=False):
       'engines': get_engines(request.user)
     }),
     'is_owner': True,
+    'is_embeddable': request.GET.get('is_embeddable', False),
     'can_edit_index': can_edit_index(request.user),
     'mobile': is_mobile
   })

+ 2 - 2
desktop/libs/indexer/src/indexer/templates/collections.mako

@@ -379,7 +379,7 @@ ${ commonheader(_('Search Indexes'), "indexer", user, request, "29px") | n,unico
   <div data-bind="with: edit" class="sidebar-nav card-small">
     <ul class="nav nav-list">
       <li class="nav-header">${_('Actions')}</li>
-      <li><a data-bind="attr: { href: '/search/browse/' + collection().name() }"><i class="fa fa-search"></i> ${ _('Search') }</a></li>
+      <li><a data-bind="hueLink: '/search/browse/' + collection().name()"><i class="fa fa-search"></i> ${ _('Search') }</a></li>
       <li><a data-bind="routie: 'edit/' + collection().name() + '/upload'" href="javascript:void(0)"><i class="fa fa-arrow-circle-o-down"></i> ${_('Index file')}</a></li>
       <li><a data-bind="visible: !collection().isCoreOnly()" href="#deleteCollection" data-toggle="modal"><i class="fa fa-times"></i> ${_('Delete')}</a></li>
     </ul>
@@ -602,7 +602,7 @@ routie({
     var _interval = window.setInterval(function(){
       if (vm.manage.hasLoadedOnce()){
         window.clearInterval(_interval);
-        routie("edit/"+name);
+        routie("edit/" + name);
       }
     }, 300);
   },

+ 1 - 1
desktop/libs/notebook/src/notebook/connectors/base.py

@@ -295,5 +295,5 @@ class Api(object):
 def _get_snippet_name(notebook, unique=False, table_format=False):
   name = (('%(name)s' + ('%(id)s' if unique else '') if notebook.get('name') else '%(type)s-%(id)s') % notebook)
   if table_format:
-    name = re.sub('-|\s:', '_', name)
+    name = re.sub('[-|\s:]', '_', name)
   return name

+ 2 - 0
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -932,6 +932,8 @@ var EditorViewModel = (function() {
             }
             huePubSub.publish('editor.active.risks', self.complexity());
             lastCheckedComplexityStatement = self.statement();
+          },
+          always: function(data) {
             self.complexityCheckRunning(false);
           }
         });