Procházet zdrojové kódy

HUE-7949 [dashboard] Increase default size of Text facet values when using gridster

Romain Rigaux před 7 roky
rodič
revize
f1fef91dab
1 změnil soubory, kde provedl 6 přidání a 4 odebrání
  1. 6 4
      desktop/libs/dashboard/src/dashboard/api.py

+ 6 - 4
desktop/libs/dashboard/src/dashboard/api.py

@@ -29,7 +29,7 @@ from libsolr.api import SolrApi
 
 from search.conf import SOLR_URL
 
-from dashboard.conf import get_engines
+from dashboard.conf import get_engines, USE_GRIDSTER
 from dashboard.controller import can_edit_index
 from dashboard.dashboard_api import get_engine
 from dashboard.data_export import download as export_download
@@ -409,9 +409,6 @@ def _create_facet(collection, user, facet_id, facet_label, facet_field, widget_t
     if widget_type in ('bucket-widget', 'pie2-widget', 'timeline-widget', 'tree2-widget', 'text-facet-widget', 'hit-widget', 'gradient-map-widget'):
       # properties = {'canRange': False, 'stacked': False, 'limit': 10} # TODO: Lighter weight top nested facet
 
-      if widget_type == 'text-facet-widget':
-        properties['type'] = facet_type
-
       properties['facets_form'] = NESTED_FACET_FORM
       # Not supported on dim 2 currently
       properties['facets_form']['type'] = 'field'
@@ -424,6 +421,11 @@ def _create_facet(collection, user, facet_id, facet_label, facet_field, widget_t
       facet['fieldLabel'] = facet_field
       facet['multiselect'] = True
 
+      if widget_type == 'text-facet-widget':
+        properties['type'] = facet_type
+        if USE_GRIDSTER.get():
+          properties['limit'] = facet['limit'] = 100
+
       if range_properties:
         # TODO: timeline still uses properties from top properties
         facet.update(range_properties)