Przeglądaj źródła

[search] Show a default of 5 items on the 2d map widget

Romain Rigaux 10 lat temu
rodzic
commit
7e99e58

+ 1 - 1
apps/search/src/search/models.py

@@ -292,7 +292,7 @@ class Collection(models.Model):
       if facet['widgetType'] == 'map-widget' and facet['type'] == 'field':
         facet['type'] = 'pivot'
         properties['facets'] = []
-        properties['facets_form'] = {'field': '', 'mincount': 1, 'limit': 1}
+        properties['facets_form'] = {'field': '', 'mincount': 1, 'limit': 5}
 
     return json.dumps(props)
 

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

@@ -468,14 +468,13 @@ def _create_facet(collection, user, facet_id, facet_label, facet_field, widget_t
   if widget_type in ('tree-widget', 'heatmap-widget', 'map-widget'):
     properties['mincount'] = 1
     properties['facets'] = []
+    properties['facets_form'] = {'field': '', 'mincount': 1, 'limit': 5}
 
     if widget_type == 'map-widget':
       properties['scope'] = 'world'
-      properties['facets_form'] = {'field': '', 'mincount': 1, 'limit': 1}
       properties['limit'] = 100
     else:
       properties['scope'] = 'stack' if widget_type == 'heatmap-widget' else 'tree'
-      properties['facets_form'] = {'field': '', 'mincount': 1, 'limit': 5}
 
   return {
     'id': facet_id,