-
Notifications
You must be signed in to change notification settings - Fork 730
Open
Labels
bigSomething which will take more than 1 daySomething which will take more than 1 dayenhancementNew feature or requestNew feature or request
Description
Problem
Right now filters are passed to BaseResource.find as an object and are parsed inside every adapter separately.
- Passing object is ugly because we have to create it on AdminBro core and pass to the adapter
- Current filter structure doesn't allow to filter by let say greater than in integers, or by relation.
We have to change Filter instance to a simple filter object with the strict interface.
Interface proposal (example)
type FilterQuery = {
eq?: string,
gt?: string,
lt?: string,
contain?: string, // for like
in?: Array<string>
}
type Filter = {
[path: string]: FilterQuery | Array<FilterQuery> | {and: Array<FilterQuery>}
}
Array would be for "or"
Acceptance criteria
In this task:
- unify the filters programming interface
- the best would be if it will be backwards compatible
- allow adapters to define which operations they support. Mybe some new adapter couldn't support
in? - it should be possible to filter by nested properties
Possibilities after this change
- we will be able to add
filterto ResourceOptions which will restrict the list/search actions - or to list Action interface. - we could pass filter in useRecords hook
- we could pass filter in PropertyOptions of the property responsible for handing one to many relationshipp
JSRossiter, mding5692, sajal2119, benjaminmerchin, ihab2511 and 5 more
Metadata
Metadata
Assignees
Labels
bigSomething which will take more than 1 daySomething which will take more than 1 dayenhancementNew feature or requestNew feature or request
Type
Projects
Status
Todo