-
Notifications
You must be signed in to change notification settings - Fork 694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(filter): add support for more operators than contains #1750
base: master
Are you sure you want to change the base?
feat(filter): add support for more operators than contains #1750
Conversation
pls @dziraf when you get some time to take a look |
package.json
Outdated
@@ -86,6 +86,7 @@ | |||
"homepage": "https://github.com/SoftwareBrothers/adminjs#readme", | |||
"dependencies": { | |||
"@adminjs/design-system": "^4.1.0", | |||
"@adminjs/themes": "^1.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added as when using example repo https://github.com/SoftwareBrothers/adminjs-example-app fails when this package is linked and this package failed because this dependency does not exist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will result in a circular dependency issue because adminjs
is a peer dependency of @adminjs/themes
. adminjs-example-app
is also an outdated repository.
Local linking issue can be solved by linking @adminjs/themes
in your local app and in local adminjs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good to know, I'll remove this package though
|
||
const Filter: React.FC<FilterPropertyProps> = (props) => { | ||
const { property, onChange, filter } = props | ||
|
||
const possibleKeys = [ | ||
property.path, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keeping contains key as it was before to prevent other adapters to not be able to recognize it
This is a good start but ideally the entire filter system should be rebuilt to allow |
hey @dziraf, I added this functionality into adapaters and covered the other operators that you mentioned. Pls when you get some time |
When filtering data, by default, default-type component generates urls where records are going to be filtered by attribute using contains operations. This pr provides a way to choose different operators and reflect that in the url. Operators are: startsWith, endsWith, equals, notEquals and contains (default) operators. Or operator is supported too.

Updates were added to these adapters as well: