Problem/Motivation
An optimization was noticed, in the issue about adding search to tests lists. #1919470-6: Add a search field to the test overview page
Proposed resolution
Replicate optimization for the modules search, which was added in #1848064: Allow to filter modules by arbitrary search strings on the Modules page.
Remaining tasks
- Discuss if makes sense on the modules search.
- Implement.
User interface changes
No UI changes.
API changes
No API changes.
Original report by @tim.plunkett and @berdir
Follow up for #1919470-6: Add a search field to the test overview page and #7
+++ b/core/modules/simpletest/simpletest.jsundefined
@@ -99,4 +99,62 @@ Drupal.behaviors.simpleTestSelectAll = {
+ var searching = false;
...
+ searching = true;
...
+ else if (searching) {
@tim.plunkett
This seems like a performance improvement that could be mimicked in the module filtering.
@Berdir
I'm not sure the modules search needs this. Unlike this, searching already starts at the second characters, so there's only a single character on which we would not have to search on. And there are also considerably more tests than modules (close to 900 table rows..)
But I'm happy to apply it there as well if this is the correct approach to do something like this.
Comments
Comment #1
mkadin commentedI don't think its critically important, but I do think its proper to avoid 'showing' all of the already visible rows.
Patch was easy enough to create, so I did it before further discussion :)
Comment #2
parthipanramesh commentedComment #3
webchickI don't see the harm, but passing to nod_ for a quick check.
Comment #4
nod_doesn't apply.
And as it was said I'm not sure either that's needed. But I guess why not.
Comment #5
martin107 commentedJust tried to apply the patch. Not sure how code base has changed since the 7th but the patch applied OK now!
Comment #6
martin107 commentedComment #7
berdir1: drupal-module-filter-optimization-1925492-1.patch queued for re-testing.
Comment #8
giammi commentedApplied the patch and tested the following:
- entering 1 character does not start the filtering of search results
- entering 2nd character, search results are filtered
- when no search results are found, then no rows are shown
Comment #9
nod_This is a reroll because the indentation standard changed for JavaScript files. No need for commit credit because of this reroll.
Comment #10
nod_Small whitespace diiff with previous patch on function declaration. auto-reformat FTW.
Comment #11
alexpottauto-reformat--
Comment #12
alexpottOr maybe https://drupal.org/node/172169 needs an update?
Comment #13
visabhishek commentedpatch reformatted as par #11.
Comment #14
droplet commentedI reviewed Both #13 & #9.Extra changes in #9 are following JavaScript Code Standard
Comment #15
webchickOh man! I thought I had committed this ages ago. So sorry!
Committed and pushed to 8.x. Thanks! :)