Changeset 158094 in webkit


Ignore:
Timestamp:
Oct 26, 2013 5:48:30 PM (10 years ago)
Author:
rniwa@webkit.org
Message:

New flakiness dashboard should support substring matching
https://bugs.webkit.org/show_bug.cgi?id=123393

Reviewed by Alexey Proskuryakov.

Addressed the use cases by

  1. Always showing the candidate even when there is exactly one test matching the current value.
  2. Adding all tests that match the current value upon the user pressing enter key.
  • public/index.html:

(fetchManifest): Add all tests that match the current value. Confirm whether the user really
want to add all the tests when there are more than 15 tests to add.

  • public/js/autocompleter.js:

(Autocompleter.prototype.filterCandidates): Extracted from _updateCandidates.
(Autocompleter.prototype._updateCandidates): Show the candidate window even when there is
exactly one test that matches the criteria so that the user can select this test.

Location:
trunk/Websites/test-results
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Websites/test-results/ChangeLog

    r158093 r158094  
     12013-10-26  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        New flakiness dashboard should support substring matching
     4        https://bugs.webkit.org/show_bug.cgi?id=123393
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        Addressed the use cases by
     9        1. Always showing the candidate even when there is exactly one test matching the current value.
     10        2. Adding all tests that match the current value upon the user pressing enter key.
     11
     12        * public/index.html:
     13        (fetchManifest): Add all tests that match the current value. Confirm whether the user really
     14        want to add all the tests when there are more than 15 tests to add.
     15        * public/js/autocompleter.js:
     16        (Autocompleter.prototype.filterCandidates): Extracted from _updateCandidates.
     17        (Autocompleter.prototype._updateCandidates): Show the candidate window even when there is
     18        exactly one test that matches the criteria so that the user can select this test.
     19
    1202013-10-26  Ryosuke Niwa  <rniwa@webkit.org>
    221
  • trunk/Websites/test-results/public/index.html

    r158079 r158094  
    519519    input.autocompleter = new Autocompleter(input, testNames);
    520520
     521    input.form.onsubmit = function (event) {
     522        addTests(input.value);
     523        event.preventDefault();
     524        return false;
     525    }
     526
     527    function addTests(filter) {
     528        var candidates = input.autocompleter.filterCandidates(filter);
     529        if (candidates.length > 15) {
     530            if (!confirm('Are you sure you want to add ' + candidates.length + ' tests that match this substring?'))
     531                return;
     532        }
     533        for (var i = 0; i < candidates.length; i++)
     534            TestResultsView.fetchTest(candidates[i]);
     535        TestResultsView.updateLocationHash();
     536    }
     537
    521538    var builderListView = document.getElementById('builderListView');
    522539    TestResultsView._sortObjectsByName(response['builders']).forEach(function (builder) {
  • trunk/Websites/test-results/public/js/autocompleter.js

    r157555 r158094  
    1111    inputElement.addEventListener('keyup', this.update.bind(this));
    1212    inputElement.addEventListener('keydown', this.navigate.bind(this));
     13}
     14
     15Autocompleter.prototype.filterCandidates = function (filter) {
     16    return this._list.filter(function (testName) { return testName.indexOf(filter) >= 0; });
    1317}
    1418
     
    2933        return false;
    3034
    31     var candidates = this._list.filter(function (testName) { return testName.indexOf(filter) >= 0; });
    32     if (candidates.length > 50 || candidates.length == 1)
     35    var candidates = this.filterCandidates(filter);
     36    if (candidates.length > 50)
    3337        candidates = [];
    3438    this._candidates = candidates;
Note: See TracChangeset for help on using the changeset viewer.