فهرست منبع

HUE-5093 [metadata] Add counts to facet listing

Romain Rigaux 9 سال پیش
والد
کامیت
095fbb7e52
1فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 3 3
      desktop/core/src/desktop/templates/assist.mako

+ 3 - 3
desktop/core/src/desktop/templates/assist.mako

@@ -1617,9 +1617,9 @@ from metadata.conf import has_navigator
               if (isFacet && typeof data.facets !== 'undefined') { // Is typed facet, e.g. type: type:bla
                 var facetInQuery = facetMatch[1];
                 if (typeof data.facets[facetInQuery] !== 'undefined') {
-                  Object.keys(data.facets[facetInQuery]).forEach(function (facetValue) {
-                    if (partial === '' || facetValue.indexOf(partial) !== -1) {
-                      values.push({ data: { label: facetInQuery + ':' + facetValue, icon: NAV_FACET_ICON, description: '' }, value: beforePartial + facetValue})
+                  $.map(data.facets[facetInQuery], function (count, value) {
+                    if (partial === '' || value.indexOf(partial) !== -1) {
+                      values.push({ data: { label: facetInQuery + ':' + value, icon: NAV_FACET_ICON, description: count }, value: beforePartial + value})
                     }
                   });
                 }