Ver Fonte

HUE-6960 [frontend] Only suggest facet values and no results when autocompleting facets in the top search

Johan Ahlen há 8 anos atrás
pai
commit
b1600b1fb8
1 ficheiros alterados com 5 adições e 7 exclusões
  1. 5 7
      desktop/core/src/desktop/templates/ko_components.mako

+ 5 - 7
desktop/core/src/desktop/templates/ko_components.mako

@@ -1023,18 +1023,16 @@ from desktop.views import _ko
               }
             }
 
-            if (values.length > 0) {
-              values.push({ divider: true });
-            }
-            if (typeof data.results !== 'undefined') {
+
+            if (!facetMatch && typeof data.results !== 'undefined' && data.results.length > 0) {
+              if (values.length > 0) {
+                values.push({ divider: true });
+              }
               data.results.forEach(function (result) {
                 values.push({ data: { label: result.hue_name, icon: SEARCH_TYPE_ICONS[result.type],  description: result.hue_description }, value: beforePartial + result.originalName });
               });
             }
 
-            if (values.length > 0 && values[values.length - 1].divider) {
-              values.pop();
-            }
             if (values.length === 0) {
               values.push({ noMatch: true });
             }