grid
grid copied to clipboard
T1629 - interim filters
What does this change?
This change introduces a 2nd top-bar at the top of the Grid UI to accommodate increased complexity in the filtering, sorting and permissions controls. It introduces a new permissions filters which acts to provide an easy way to define combinations of chips and the chargeable setting when searching images.
Screen shot show the new layout including the new Interim Filters control (written in React), the new Sort Control moved to the 2nd tier (already merged in pervious PR) and a new My Uploads control to improve flexibility over styling.
The contents of the Interim Filter drop down are controlled through configuration;
interimFilterOptions = [ { id:"allPermissions", label:"All permissions", mapping:"", payable:"none" }, { id:"usableForAll", label:"Usable for all", mapping:"is:BBC-owned,-has:restrictions", payable:"false" }, { id:"usableForNews", label:"Agency (Usable for News)", mapping:"category:agency", payable:"false" }, { id:"bbcOwned", label:"BBC owned programmes", mapping:"category:programmes-organisation-owned", payable:"none" }, { id:"independent", label:"Independent programmes", mapping:"category:programmes-independents", payable:"none" } ]
The use of Interim Filters is controlled use 'usePermissionsFilter' config variable in kahuna (true or false).
How should a reviewer test this change?
Ensure all controls work as described, work for an accessibility perspective and adapt correctly to screen width changes
Who should look at this?
Tested? Documented?
- [x] locally by committer
- [ ] locally by Guardian reviewer
- [ ] on the Guardian's TEST environment
- [ ] relevant documentation added or amended (if needed)
Thank you! For now, minor points regarding config and naming:
- Could we (can defo be later!) document all the extensive config here and in PR description (doesn’t mention
kahuna.conf
,permissionsDefault
, whatpayable
does and what options it offers, etc)? - I think we should go back and rename
interimFilterOptions
topermissionsOptions
(or evenpermissionsFilterOptions
?). I think the fact this is “interim” is not that helpful and having everything refer topermissions
orpermissionsFilter
would make it clear this is all related? (so maybepermissionsFilterDefault
too)?
TL;DR: we will give it a code review and can merge if you are happy (only pt. 6 may need fixing as otherwise we have a hard exclusionary behaviour between disparate config options; @AndyKilmory is aware). The below is for your consideration…
I have tested it a bit more. In general, I think this is a distinctly BBC-only functionality for several reasons, so it may be that the following problems are squarely in your court: we don’t wanna be a blocker with something we are not likely to use. On the other hand, this may be the first piece of functionality which cannot simply be configged-in: some of the following would need to be fixed before that would be possible (ie. before we, or any non-BBC user, could switch this on)…
Some of the reasons we can’t use it, forgetting the fundamental one: we can’t think of useful “permissions” filter for the Guardian as-is, so no real need from us to fix it, let alone quickly or before merge (but still, hopefully, useful):
- This, when ON, hard-codes BBC-specific
Show payable images
. At the Guardian, and as is default by-config, we useFree to use
instead. It differs in some fundamental and some trivial ways too: a) ours/default is checked, BBC – unchecked b) ours/default responds toshow_paid
permission (it controls initial state of the checkbox). This doesn’t work now in this PR: the default state doesn’t correctly respond to the permission. c) [trivial] this uses BBC-specific toggle UI (even though there are still checkbox UIs and it collapses into a checkbox UI itself) - [trivial, but consistency matters] this uses new type of checkbox UI (for eg.
My uploads
): they have no hover state unlike default Grid ones (bad), but they have unselectable text in labels (good!) - this introduces a third (sic!) dropdown UI. We already have two (one too many), not sure why we need a third one:
- [as mentioned off-github] this doesn’t work with
filters.shouldDisplayOrgOwnedCountAndFilterCheckbox = true
: a) the checkbox ([org]-owned
) isn’t displayed at all b) the app goes into a spin and takes down browser in this scenario:
Here are some general thoughts unrelated to the above. Consider only if useful for you:
- Your
usableForAll
config (is:BBC-owned,-has:restrictions
) would be more useful asis:BBC-owned,-has:restrictions OR is:BBC-owned,has:restrictions,leases.leases.access:allow-use,leases.leases.active:true
, to take into account Restricted imagery which has been granted an Allow cropping lease which is active, but this isn’t possible yet: a) we don’t have OR, which, at first, we could allow in search aliases config (to not have to deal with user-facing UI complexity upfront) b) leases may need re-modelling (? to be confirmed by an engineer): it is not possible to search for an effectively active lease of certain type (ie. I think?query=leases.leases.active:true leases.leases.access:allow-use
search will return an image with and active Deny cropping lease and not-active Allow cropping one (not intended). This limitation prevents us from making this permission more useful and from using leases in searching. c) also see https://github.com/guardian/grid/issues/3860 - When default Grid collapses UI,
Search filters
dropdown gathers more and more checkboxes:With this ON,
Search filters
only ever contains the Date filter (which shows up too high too). It should behave like in default Grid (because of space, but also label makes no sense otherwise): - Permissions filter label (here customised to say All images) first collapses to generic
Permissions
and then to just a chevron:a) I think it should always use the configured label b) it should collapse under
Search filters
(like defaultFree to use
does), so that it doesn’t have to do 9a and it wouldn’t ever look like a stray chevron
Thanks @paperboyo - will look to fix blocking issues asap and raise the others with the team for discussion.
Hi @paperboyo, Have pushed changes that I believe fix all the functional issues raised regard the PR. Please could it be re-reviewed? (I'm on leave next week 20th to 24th May so no great rush). Thanks
Seen on auth, usage, image-loader, leases, cropper, kahuna (created by @AndyKilmory and merged by @dblatcher 9 minutes and 38 seconds ago) Please check your changes!
Seen on metadata-editor, collections, media-api (created by @AndyKilmory and merged by @dblatcher 9 minutes and 43 seconds ago) Please check your changes!
Seen on thrall (created by @AndyKilmory and merged by @dblatcher 9 minutes and 46 seconds ago) Please check your changes!