Bläddra i källkod

HUE-6740 [assist] Enable text filter for document type in the assist

Johan Ahlen 8 år sedan
förälder
incheckning
1c12ea136d
1 ändrade filer med 3 tillägg och 1 borttagningar
  1. 3 1
      desktop/core/src/desktop/static/desktop/js/document/hueFileEntry.js

+ 3 - 1
desktop/core/src/desktop/static/desktop/js/document/hueFileEntry.js

@@ -151,7 +151,9 @@ var HueFileEntry = (function () {
       var typeFilter = self.typeFilter().type;
       if (filter || typeFilter !== 'all') {
         return self.entries().filter(function (entry) {
-          return (typeFilter === 'all' || entry.definition().type === typeFilter) && (!filter || entry.definition().name.toLowerCase().indexOf(filter) !== -1);
+          return (typeFilter === 'all' || entry.definition().type === typeFilter)
+            && (!filter || entry.definition().name.toLowerCase().indexOf(filter) !== -1 ||
+            (DocumentTypeGlobals[entry.definition().type] && DocumentTypeGlobals[entry.definition().type].toLowerCase().indexOf(filter) !== -1));
         })
       }
       return self.entries();