Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: I've left this unsquashed for now just to help it make sense, will squash later.
Following on from #6080, moving the filter behaviour into a plugin gives us a sensible location to keep all related code (rather than having a bunch of utils). Although there is still much room for improvement in terms of putting together a standard way of wiring i.e. access rules gets called on forge, this gets called explicitly inside of
findPage
.In addition to moving the existing logic into a plugin, this PR adds a bunch of new logic around the concept of 'enforced', 'default' and 'custom' filters.
All of this is explained in detail here.
One key addition since that comment - I'm also reducing the custom filters against the enforced filters, in much the same way as default filters are reduced against custom filters... what this means is.
page:false
is the default, but the custom filter specifiespage:true
the default is no longer needed.status:published
is enforced, and the custom filter specifiesstatus:draft
, the custom filter is removed as it is not permitted.In time, it may be better to throw an error in this case.
Filter plugin with enforce/default logic
refs #5614, #5943
...
Remove old style defaults
refs #5614, #5943
...
Add some debugging tools to filters
I have added these lines back in so many times in the past month or so so that I could
figure out what was happening, I figured everyone else might find them useful.