Przeglądaj źródła

Merge pull request #4025 from ilvar/feature-rules-title-partial-match

Feature: allow word match for rules -> title filter
Lauri Ojansivu 3 lat temu
rodzic
commit
ff01c2a69f
1 zmienionych plików z 5 dodań i 1 usunięć
  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;