New Feat: Admin List Tables - allow third party plugin to add filters #7285
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.
Description
My donations come from a limited number of donors.
Some of them have several email addresses and use them randomly.
I took care to merge the different accounts of each donor.
Thus, donors can access their entire donation history, regardless of the email address used to make these donations.
For my part, I want to be able to filter the list of donations in the back office according to a donor ID.
I found that the API endpoint is perfectly capable of handling this filter, it is simply missing in the React version of the donations view.
This PR aims to extend the flexibility of ListTable:
The Give\Donations\Endpoints\ListDonations class is extendable since version 3.4.0, so we can make the API capable of handling all kinds of filters.
With this modification, we can now add these filters to the native view.
Affects
Admin List Tables
Testing Instructions
Add some JS code on the front end page (via some snippet) :
Go to back office > Give > Donations
New Field appears in filter fields : Donor.
Type in it ID of a Donor.
And Tadaaa ! You can filter donation by donor id.
Pre-review Checklist
@unreleased
tags included in DocBlocks