Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit 50ef974

Browse files
[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 git-svn-id: http://svn.webkit.org/repository/webkit/trunk@263976 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent c457a32 commit 50ef974

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

Tools/ChangeLog

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2020-07-06 Zhifei Fang <[email protected]>
2+
3+
[result database] Empty search will return too many tests to display
4+
https://bugs.webkit.org/show_bug.cgi?id=213898
5+
6+
Reviewed by Jonathan Bedard.
7+
8+
* resultsdbpy/resultsdbpy/view/static/js/search.js: Trim the search string before fetching the tests, ingore empty string on paste event
9+
110
2020-07-06 Geoffrey Garen <[email protected]>
211

312
RunLoop::dispatch should only call wakeUp when needed

Tools/resultsdbpy/resultsdbpy/view/static/js/search.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,14 @@ function SearchBar(callback, suites) {
149149
if (event.keyCode == 0x28 /* DOM_VK_DOWN */ || event.keyCode == 0x26 /* DOM_VK_UP */)
150150
return;
151151

152+
const inputValue = element.value.trimStart().trimEnd();
153+
if (!inputValue)
154+
return;
152155
let myDispatch = Date.now();
153-
154156
candidates = {};
155157
suites.forEach(suite => {
156158
inFlight += 1;
157-
fetch(`api/${suite}/tests?limit=${LIMIT}&test=${element.value}`).then(response => {
159+
fetch(`api/${suite}/tests?limit=${LIMIT}&test=${inputValue}`).then(response => {
158160
inFlight -= 1;
159161
if (myDispatch < currentDispatch) {
160162
candidatesRef.setState({});
@@ -215,7 +217,8 @@ function SearchBar(callback, suites) {
215217
ignoring = false;
216218
return;
217219
}
218-
tests.add(str);
220+
if (str)
221+
tests.add(str);
219222
});
220223
tests = [...tests];
221224
if (tests.length <= 1)

0 commit comments

Comments
 (0)