RESOLVED FIXED Bug 200134
results.webkit.org: Add switch to filter results by expectation
https://bugs.webkit.org/show_bug.cgi?id=200134
Summary results.webkit.org: Add switch to filter results by expectation
Jonathan Bedard
Reported 2019-07-25 12:53:08 PDT
Users of the results database should be able to filter results by whether or not a negative expectation is expected or not. In an effort to support this, we also need to re-write the descriptions in the Legend so that they the descriptions match what the timeline is displaying.
Attachments
Patch (9.50 KB, patch)
2019-07-25 13:02 PDT, Jonathan Bedard
no flags
Patch (9.60 KB, patch)
2019-07-26 12:50 PDT, Jonathan Bedard
no flags
Patch (9.55 KB, patch)
2019-07-26 13:55 PDT, Jonathan Bedard
no flags
Jonathan Bedard
Comment 1 2019-07-25 13:02:53 PDT
Aakash Jain
Comment 2 2019-07-26 11:20:47 PDT
Zhifei, can you please review this one?
Zhifei Fang
Comment 3 2019-07-26 11:53:15 PDT
Comment on attachment 374899 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=374899&action=review > Tools/resultsdbpy/resultsdbpy/view/static/js/timeline.js:612 > + const successLabel = REF.createRef({ You can make all this ref and <div class="label" ref="${...}"></div> to a function, so that you don't need to repeatedly create the ref. You can use an event to let sub component update its state: function LegnedLabel(event, willFilterExpected, filterExpectedText, filterUnexpectedText) { const ref = REF.createRef({ state: willFilterExpected, onStateUpdate: (element, state) => { if (state) element.innerText = filterExpectedText; else element.innerText = filterUnExpectedText; } }); event.action((willFilterExpected) => ref.setState(willFilterExpected)); return '<div class="label" ref="${ref}"></div>'; } then in legend function Legend(callback=null, plural=false) { let updateLabelsEs = new EventStream(); const swtch = REF.createRef({ onElementMount: (element) => { element.onchange = () => { if (element.checked) willFilterExpected = true; else willFilterExpected = false; updateLabelsEs.add(willFilterExpected); if (callback) callback(); }; }, }); let result = `<br> <div class="lengend timeline"> <div class="item"> <div class="dot success"></div> ${LegnedLabel(updateLabelsEs, plural ? 'No unexpected results' : 'Result expected', plural ? 'All tests passed' : 'Test passed')} </div> <div class="item"> <div class="dot failed"></div> ${LegnedLabel(updateLabelsEs, plural ? 'Some tests unexpectedly failed' : 'Unexpectedly failed', plural ? 'Some tests failed' : 'Test failed')} </div> <div class="item"> <div class="dot timeout"></div> ${LegnedLabel(updateLabelsEs, plural ? 'Some tests unexpectedly timed out' : 'Unexpectedly timed out', plural ? 'Some tests timed out' : 'Test timed out')} </div> <div class="item"> <div class="dot crash"></div> ${LegnedLabel(updateLabelsEs, plural ? 'Some tests unexpectedly crashed' : 'Unexpectedly crashed', plural ? 'Some tests crashed' : 'Test crashed')} </div> <br> </div>`; if (callback) result += `<div class="input" style="width:400px"> <label>Filter expected results</label> <label class="switch"> <input type="checkbox"${willFilterExpected ? ' checked': ''} ref="${swtch}"> <span class="slider"></span> </label> </div>`; return `<div class="content">${result}</div><br>`; } > Tools/resultsdbpy/resultsdbpy/view/static/js/timeline.js:616 > + element.innerHTML = plural ? 'No unexpected results' : 'Result expected'; Use innerText, since we don't need to render any HTML here. > Tools/resultsdbpy/resultsdbpy/view/static/js/timeline.js:659 > + callback(); We need to check if callback is null before call it
Jonathan Bedard
Comment 4 2019-07-26 12:50:59 PDT
Zhifei Fang
Comment 5 2019-07-26 13:35:10 PDT
r=me, will need aakashjain to make it real.
Aakash Jain
Comment 6 2019-07-26 13:35:47 PDT
rs=me
Jonathan Bedard
Comment 7 2019-07-26 13:55:42 PDT
WebKit Commit Bot
Comment 8 2019-07-26 14:23:39 PDT
Comment on attachment 374988 [details] Patch Clearing flags on attachment: 374988 Committed r247877: <https://trac.webkit.org/changeset/247877>
WebKit Commit Bot
Comment 9 2019-07-26 14:23:40 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 10 2019-07-29 09:27:28 PDT
Note You need to log in before you can comment on or make changes to this bug.