-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add search by relationship fields #8966
base: main
Are you sure you want to change the base?
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 520e026:
|
packages/core/src/fields/types/relationship/views/RelationshipSelect.tsx
Outdated
Show resolved
Hide resolved
Hi @dcousens I see some tests failing but some are due to CI setup failure I think, not sure what to do tbh |
Thanks @pnodet, I'll check that out as soon as I can |
HNY @dcousens thanks for the formatting commit! |
@dcousens from the 58 tests the failing one seem to be related to tsx, not sure how to fix tbh
|
@pnodet happy new years to you too 💛 I'm not convinced this will be intuitive and could result in unexpected performance costs in some usecases. |
By user you mean end-user (ie: a checkbox with label Activate search by relation fields) or keystone user the developers in the schema for example? |
sorry, I mean developer (but, maybe the user too...) |
Sure, for the developer we could have something in the schema / list. Inside the relationship field there is already a |
Hi @dcousens What do you have in mind? anything I can do to get this PR merged? |
packages/core/src/fields/types/relationship/views/RelationshipSelect.tsx
Outdated
Show resolved
Hide resolved
@dcousens rebased main to keep the branch up to date |
@@ -99,6 +98,40 @@ export function useFilter (value: string, list: ListMeta, searchFields: string[] | |||
|
|||
for (const fieldKey of searchFields) { | |||
const field = list.fields[fieldKey] | |||
|
|||
// @ts-expect-error TODO: fix fieldMeta type for relationship fields | |||
if (field.fieldMeta?.refSearchFields) { |
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.
@pnodet I merged this into the pre-existing searchFields
query building code, less type passing and easier to cross-check
This would be a nice feature !! |
Allow admin users inside a list page to search by relations text fields