Title: [263976] trunk/Tools
Revision
263976
Author
[email protected]
Date
2020-07-06 11:09:28 -0700 (Mon, 06 Jul 2020)

Log Message

[result database] Empty search will return too many tests to display
https://bugs.webkit.org/show_bug.cgi?id=213898

Reviewed by Jonathan Bedard.

* resultsdbpy/resultsdbpy/view/static/js/search.js: Trim the search string before fetching the tests, ingore empty string on paste event

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (263975 => 263976)


--- trunk/Tools/ChangeLog	2020-07-06 17:44:31 UTC (rev 263975)
+++ trunk/Tools/ChangeLog	2020-07-06 18:09:28 UTC (rev 263976)
@@ -1,3 +1,12 @@
+2020-07-06  Zhifei Fang  <[email protected]>
+
+        [result database] Empty search will return too many tests to display
+        https://bugs.webkit.org/show_bug.cgi?id=213898
+
+        Reviewed by Jonathan Bedard.
+
+        * resultsdbpy/resultsdbpy/view/static/js/search.js: Trim the search string before fetching the tests, ingore empty string on paste event
+
 2020-07-06  Geoffrey Garen  <[email protected]>
 
         RunLoop::dispatch should only call wakeUp when needed

Modified: trunk/Tools/resultsdbpy/resultsdbpy/view/static/js/search.js (263975 => 263976)


--- trunk/Tools/resultsdbpy/resultsdbpy/view/static/js/search.js	2020-07-06 17:44:31 UTC (rev 263975)
+++ trunk/Tools/resultsdbpy/resultsdbpy/view/static/js/search.js	2020-07-06 18:09:28 UTC (rev 263976)
@@ -149,12 +149,14 @@
                 if (event.keyCode == 0x28 /* DOM_VK_DOWN */ || event.keyCode == 0x26 /* DOM_VK_UP */)
                     return;
 
+                const inputValue = element.value.trimStart().trimEnd();
+                if (!inputValue)
+                    return;
                 let myDispatch = Date.now();
-
                 candidates = {};
                 suites.forEach(suite => {
                     inFlight += 1;
-                    fetch(`api/${suite}/tests?limit=${LIMIT}&test=${element.value}`).then(response => {
+                    fetch(`api/${suite}/tests?limit=${LIMIT}&test=${inputValue}`).then(response => {
                         inFlight -= 1;
                         if (myDispatch < currentDispatch) {
                             candidatesRef.setState({});
@@ -215,7 +217,8 @@
                             ignoring = false;
                         return;
                     }
-                    tests.add(str);
+                    if (str)
+                        tests.add(str);
                 });
                 tests = [...tests];
                 if (tests.length <= 1)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to