Updated: Comment #N
Problem/Motivation
It has been talked about for some time that the views listing page should have a search field to filter the view listings down. This is not a massive issue right now, as most of us are just using (pretty much) a vanilla D8 installation with (I think) under 10 default views. What about a larger site, with 50 views?
Proposed resolution
Add a search field on the views listing page, similar to that on the module listing, and block listing pages. It would use pretty much the same JS. I also think this should include the name AND description fields in the filtering.
Remaining tasks
Patch, reviews (including a review from at least one of the JS folks), testing.
JS could do with a bit more work - Currently if E.g. there are no disabled views after filtering the table header will still be there. We want to iterate over each table (I think) and if there are no rows after filtering, just hide the the table.
User interface changes
New dynamic search field on views listing page.
API changes
None
Related Issues
Comment | File | Size | Author |
---|---|---|---|
#20 | views-list-filter-nojs.patch | 841 bytes | tstoeckler |
#12 | 2087327-12.patch | 4.94 KB | damiankloip |
#12 | interdiff-2087327-12.txt | 1.18 KB | damiankloip |
#7 | 2087327-7.patch | 4.84 KB | damiankloip |
#7 | interdiff-2087327-7.txt | 859 bytes | damiankloip |
Comments
Comment #1
damiankloip CreditAttribution: damiankloip commentedHere's an initial patch, it's definitely not perfect but should work ok as a start.
Comment #2
damiankloip CreditAttribution: damiankloip commented.
Comment #3
jibranWe also need screenshots :)
Comment #4
damiankloip CreditAttribution: damiankloip commentedYep, good plan. Let's do that!
Before filtering:
Filtered:
Comment #5
damiankloip CreditAttribution: damiankloip commented!
Comment #6
jibranHere is the screenshot with no result. I think it looks fine but @damiankloip suggested we should also hide the header. So adding the usability tag.
and
Comment #7
damiankloip CreditAttribution: damiankloip commentedJust removed a couple of things from the js file.
Also, spoke to tim.plunkett and he thinks we should leave the tables there even if there are no results. This is the behaviour in the current patch. I think I agree.
Comment #8
dawehnerUsing the regression hammer.
Comment #9
tim.plunkettThis should be called $rowsAndHeaders.
Additionally, we should mimic the docblocks from the module filtering:
Otherwise this looks great.
Comment #10
tim.plunkettComment #11
dawehnerThe patch looks reasonable ... but I have no clue about JS.
Comment #12
damiankloip CreditAttribution: damiankloip commentedMade those changes, I didn't add the part about package details, as that's not relevant for us. I also just removed the $rowsAndDetails var, as really we just need $rows.
Comment #14
damiankloip CreditAttribution: damiankloip commented#12: 2087327-12.patch queued for re-testing.
Comment #15
jibranIt works fine in #6 so removing the manual testing tag.
Comment #16
dawehnerNice work!
Comment #17
nod_Got an agreement with morten, we'll use data- attribute for targetting and selecting elements from JS so that themers can do anything they want to classes while keeping the js working.
So this one +1 but we need a follow-up to change it everywhere in core.
Comment #18
webchickCommitted and pushed to 8.x. Thanks!
Comment #19
dawehnerNIce!!
Comment #20
tstoecklerI hope I'm not the cause of any rage for re-opening this, but I think I found a valid reason to do do:
Unlike all other JS-filter-thingies in core (modules page, simpletest test page) this one is not hidden if there's no JS, even though it doesn't do anything when JS is disabled. This patch simply copies how the existing two forms do it behavior straight into ViewListController.
Comment #21
dawehnerThe best thing about using data attributes for JS is that you can refactor the form api structures without heaving to change the javascript at the same time.
Comment #22
webchickGood catch, thanks!
Committed and pushed to 8.x.
Comment #23
damiankloip CreditAttribution: damiankloip commentedLooks great. thanks!
Comment #24.0
(not verified) CreditAttribution: commentedUpdated issue summary.