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

HUE-2981 [search] Re-introduce 3rd dimension to the Timeline

Romain Rigaux 9 жил өмнө
parent
commit
4365deb

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

@@ -846,7 +846,7 @@ def augment_solr_response(response, collection, query):
             for f in counts:
               for bucket in (f['d2']['buckets'] if 'd2' in f else []):
                 _series[bucket['val']].append(f['val'])
-                _series[bucket['val']].append(bucket['d2'] if 'd2' in bucket else bucket['count'])
+                _series[bucket['val']].append(bucket['d3'] if 'd3' in bucket else bucket['count'])
             for name, val in _series.iteritems():
               _c = range_pair(facet['field'], name, selected_values.get(facet['id'], []), val, 1, collection_facet)
               extraSeries.append({'counts': _c, 'label': name})

+ 5 - 1
apps/search/src/search/templates/common_search.mako

@@ -499,6 +499,7 @@ ${ dashboard.layout_skeleton() }
 <script type="text/html" id="facet-toggle2">
 
     ## Dimension 1
+  <!-- ko if: $root.isEditing -->
     <!-- ko if: properties.canRange() && typeof properties.type != "undefined" -->
     <div class="facet-field-cnt">
       <span class="facet-field-label facet-field-label-fixed-width">${ _('Type') }</span>
@@ -520,6 +521,7 @@ ${ dashboard.layout_skeleton() }
       </a>
     </div>
 
+
     <!-- ko if: type() == 'range' || type() == 'range-up' || (type() == 'nested' && typeof properties.min != "undefined") -->
       <!-- ko ifnot: properties.isDate() -->
         <div class="slider-cnt" data-bind="slider: {start: properties.min, end: properties.max, gap: properties.initial_gap, min: properties.initial_start, max: properties.initial_end, properties: properties, labels: SLIDER_LABELS}"></div>
@@ -530,6 +532,7 @@ ${ dashboard.layout_skeleton() }
       <!-- /ko -->
     <!-- /ko -->
 
+
     <div class="facet-field-cnt">
       <span class="spinedit-cnt">
         <span class="facet-field-label facet-field-label-fixed-width">
@@ -561,6 +564,7 @@ ${ dashboard.layout_skeleton() }
         <input type="text" class="input-medium" data-bind="spinedit: properties.mincount"/>
       </span>
     </div>
+  <!-- /ko -->
 
   ## Dimensions > 1 , visible: !$parents[1].isLoading()
   <!-- ko if: $root.isEditing -->
@@ -1482,7 +1486,7 @@ ${ dashboard.layout_skeleton() }
       <span data-bind="template: { name: 'facet-toggle2' }"></span>
     </div>
 
-    <div style="padding-bottom: 10px; text-align: right; padding-right: 20px" data-bind="visible: counts().length > 0">
+    <div style="padding-bottom: 10px; text-align: right; padding-right: 20px">
       <span data-bind="with: $root.collection.getFacetById($parent.id())">
         <span class="facet-field-label">${ _('Chart Type') }</span>
         <select class="input-small" data-bind="options: $root.timelineChartTypes,