Skip to content
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

Multi Select cannot filter #5358

Open
suwubee opened this issue May 12, 2024 · 17 comments
Open

Multi Select cannot filter #5358

suwubee opened this issue May 12, 2024 · 17 comments
Labels
blocked: conflict/dependency prio: high scope: back+front Issues requiring full-stack knowledge size: short type: bug Something isn't working

Comments

@suwubee
Copy link

suwubee commented May 12, 2024

I create MultiSelect, but cannot filter it.
image

@suwubee suwubee added the type: bug Something isn't working label May 12, 2024
Copy link

greptile-apps bot commented May 12, 2024

Disclaimer: This comment was automatically generated with AI. It can give some useful hints as to where to look for, but sometimes it can also give very inaccurate answers so takes this with a pinch of salt :).
To address the issue of the MultiSelect component not filtering options, ensure the searchFilter state in MultiSelectFieldInput.tsx is correctly applied to filter optionsInDropDown. Currently, optionsInDropDown does not utilize searchFilter for filtering options. Implement filtering logic similar to: javascript optionsInDropDown.filter(option => option.label.toLowerCase().includes(searchFilter.toLowerCase())) Also, verify that useFilterDropdown and useMultiSelectField hooks properly manage state changes related to filtering. This might involve ensuring that the component re-renders upon searchFilter state changes and that the filtering logic is correctly applied within these hooks.

References

/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownOptionSelect.tsx
/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/MultiSelectFieldInput.tsx
/packages/twenty-front/src/modules/object-record/object-filter-dropdown/hooks/useFilterDropdown.ts
/packages/twenty-front/src/modules/object-record/record-field/meta-types/hooks/useMultiSelectField.ts

Ask Greptile

@rob-luke
Copy link
Contributor

rob-luke commented May 27, 2024

I confirm I have the same bug on v0.11.3 and v0.12.1

@FerdiHr
Copy link

FerdiHr commented May 28, 2024

Same here

Copy link
Contributor

gitstart-app bot commented Jun 5, 2024

Here is the GitStart Ticket for this issue: https://clients.gitstart.com/twenty/5449/tickets/TWNTY-5358

@FelixMalfait
Copy link
Member

Thanks for the report!

@gitstart-twenty could you please take care of this? And do a quick audit of any other missing filters for various field type? (we don't want to be exhaustive as some don't make much business sense but we might have missed important ones like the one above ; see also #5216 which is ongoing)

@charlesBochet
Copy link
Member

@FelixMalfait pg_graphql does not support filtering by Array at the moment. This ticket cannot be done until we migrate out of pg_graphql or they update their filtering feature

@FelixMalfait
Copy link
Member

@charlesBochet seems like this was just implemented! supabase/pg_graphql#520

@FelixMalfait
Copy link
Member

Released yesterday: https://github.com/supabase/pg_graphql/releases/tag/v1.5.6

@martmull
Copy link
Contributor

@FelixMalfait @charlesBochet @suwubee, well, think we have to wait a little bit to have enum filter support -> supabase/pg_graphql#530

@rob-luke
Copy link
Contributor

rob-luke commented Jul 3, 2024

Excited to see that this issue moved to done in the product development project 🚀 . Is this issue now closed? I am very excited to use this 😄 @martmull @charlesBochet

@FelixMalfait
Copy link
Member

Unfortunately this is still stuck due to the issue linked above by @martmull - we cannot solve this as long as the above issue isn't solved

@john-ramsey
Copy link

Potentially tangental comment but worth calling out that pg_graphql isn't supported as an extention in GCP CloudSQL, Azure Database for PostgreSQL or AWS RDS.

While likely a large item to migrate away from pg_graphql this should be added to the list of reasons.

@FelixMalfait
Copy link
Member

@john-ramsey Yes the pg_graphql did an amazing job that allowed us to move faster initially, but long-term we'll probably have to replace because of the limitations (another one is the inability to filter by a nested object's property)

@rob-luke
Copy link
Contributor

rob-luke commented Jul 7, 2024

In case its useful for anyone else. I have temporarily got around this by writing a script that copies the multi select fields as text in to a text field called "multiselecthack", and then I can filter based on that. But this quickly causes you to hit this issue: #5056

@charlesBochet
Copy link
Member

This will be possible as we move out of pg_graphql

@FelixMalfait FelixMalfait removed the T label Sep 13, 2024
@Sytten
Copy link

Sytten commented Sep 16, 2024

I would also suggest not using postgres enums as they are very limiting (you can't remove options, reorder, etc). In general it is easier to use a check constraint or verify in software (and use plain strings in db).

@FelixMalfait FelixMalfait added scope: back+front Issues requiring full-stack knowledge size: short labels Sep 16, 2024
@charlesBochet
Copy link
Member

@Sytten we actually already support postgres enum editing (we have some code handling it and agree it was not a piece of cake!) as data integrity is quite important for Twenty

This ticket is unblocked now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked: conflict/dependency prio: high scope: back+front Issues requiring full-stack knowledge size: short type: bug Something isn't working
Projects
Status: 📋 Backlog
Development

No branches or pull requests

13 participants