From d9d3c5d15f6741bc95aa78de028856094bed3248 Mon Sep 17 00:00:00 2001 From: mabashian Date: Wed, 3 Apr 2019 16:56:36 -0400 Subject: [PATCH] Adds comment explaining logic following the split on empty string in splitFilterIntoTerms --- awx/ui/client/src/shared/smart-search/smart-search.service.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/awx/ui/client/src/shared/smart-search/smart-search.service.js b/awx/ui/client/src/shared/smart-search/smart-search.service.js index 8e7b57271d..fc540c3573 100644 --- a/awx/ui/client/src/shared/smart-search/smart-search.service.js +++ b/awx/ui/client/src/shared/smart-search/smart-search.service.js @@ -14,6 +14,10 @@ export default [function() { let groups = []; let quoted; + // This split _may_ split search terms down the middle + // ex) searchString=ansible_facts.some_other_thing:"foo foobar" ansible_facts.some_thing:"foobar" + // would result in 3 different substring's but only two search terms + // This logic handles that scenario with the `quoted` variable searchString.split(' ').forEach(substring => { if (/:"/g.test(substring)) { if (/"$/.test(substring)) {