Преглед изворни кода

HUE-7503 [dashboard] Convert add new measure to the new measure-form

Romain Rigaux пре 8 година
родитељ
комит
35d6972

+ 1 - 1
desktop/libs/dashboard/src/dashboard/static/dashboard/js/search.ko.js

@@ -693,7 +693,7 @@ var Collection = function (vm, collection) {
 
   self._addObservablesToFacet = function(facet, vm) {
     if (facet.properties.facets_form) { // Only Solr 5+
-      facet.properties.facets_form.metrics = ko.computed(function() {
+      facet.properties.facets_form.aggregate.metrics = ko.computed(function() {
         var _field = self.getTemplateField(facet.widgetType() == 'hit-widget' ? facet.field() : facet.properties.facets_form.field(), self.template.fieldsAttributes());
         return self._get_field_operations(_field, facet);
       });

+ 2 - 22
desktop/libs/dashboard/src/dashboard/templates/common_search.mako

@@ -715,28 +715,8 @@ ${ dashboard.layout_skeleton(suffix='search') }
     <div class="content" style="border: 1px dashed #d8d8d8; border-top: none">
       <div class="facet-field-cnt">
         <span class="spinedit-cnt">
-          <span class="facet-field-label">
-            ${ _('Metric') }
-          </span>
-          <span data-bind="template: { name: 'metric-form', data: properties.facets_form.aggregate }"></span>
-        </span>
-      </div>
-
-      <div class="facet-field-cnt hide">
-        <span class="spinedit-cnt">
-          <span class="facet-field-label">
-            ${ _('Limit') }
-          </span>
-          <input type="text" class="input-medium" data-bind="spinedit: properties.facets_form.limit"/>
-        </span>
-      </div>
-
-      <div class="facet-field-cnt hide">
-        <span class="spinedit-cnt">
-          <span class="facet-field-label">
-            ${ _('Min Count') }
-          </span>
-          <input type="text" class="input-medium" data-bind="spinedit: properties.facets_form.mincount"/>
+          <span class="facet-field-label"></span>
+          <span data-bind="template: { name: 'measure-form', data: properties.facets_form }"></span>
         </span>
       </div>
     </div>