Explorar o código

Feature: allow word match for rules -> title filter; e.g. filter 'Foo' will now match both 'Foo' and 'Foo bar'

Arcady Chumachenko %!s(int64=3) %!d(string=hai) anos
pai
achega
36e2c76456
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      server/rulesHelper.js

+ 5 - 1
server/rulesHelper.js

@@ -47,8 +47,12 @@ RulesHelper = {
           value = oldSwimlane.title;
         }
       }
+      let matchesList = [value, '*'];
+      if (field === 'cardTitle') {
+        matchesList = value.split(/\W/).concat(matchesList);
+      }
       matchingMap[field] = {
-        $in: [value, '*'],
+        $in: matchesList,
       };
     });
     return matchingMap;