You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This problem was identified during the work on task #1733
Since this task is complex in nature and requires changes to some main files, which may affect the operation of some other elements and functionality of the CMS. So, when working with SearchableDropdownField, we process and use the received data differently, so we should analyse how this field is used in CMS.
It is also worth noting that this problem was identified when creating this field using FormBuilder (tested by Search Options and Asset Admin).
This field works great if the data is processed on the client side before being sent to the server, for example when saving new values. Therefore, at the moment, this problem has been identified only when using SearchableDropdownField with search, but it is possible that this problem may appear when using SearchableDropdownField in other cases when, after sending data to the server, the server returns this value and updates state and then these values are displayed in another CMS field , for example when displaying tags with values.
I did some research on this issue and identified some areas that need to be updated for SearchableMultiDropdownField to work correctly with multi values.
First of all, we need to use a unified approach when storing SearchableField data in state. This is due to the fact that react-select as a value object / array of objects.
This in turn will break the approach used for searching. Since the search occurs by a specific value, string or number. Therefore, we should also make changes to the following function (See).
It is also possible that changes should be made to the SearchContext since in the current implementation the search by many-many relationships does not occur.
The next item that might need to be updated is "GridFieldState" to support looking up many-many relationships.
tl;dr
There's no way to search against a many_many relation in the GridFieldFilterHeader right now. Other fields and relations including many_many do work as expected.
Searching with a SearchableMultiDropdownField with multi values doesn't work, which is a related concern.
GuySartorelli
changed the title
SearchableDropdownField with multi values doesn't work with search
Can't search against many_many relations in GridFieldFilterHeaderMay 13, 2024
Description
This problem was identified during the work on task #1733
Since this task is complex in nature and requires changes to some main files, which may affect the operation of some other elements and functionality of the CMS. So, when working with
SearchableDropdownField
, we process and use the received data differently, so we should analyse how this field is used in CMS.It is also worth noting that this problem was identified when creating this field using
FormBuilder
(tested by Search Options and Asset Admin).This field works great if the data is processed on the client side before being sent to the server, for example when saving new values. Therefore, at the moment, this problem has been identified only when using
SearchableDropdownField
with search, but it is possible that this problem may appear when usingSearchableDropdownField
in other cases when, after sending data to the server, the server returns this value and updates state and then these values are displayed in another CMS field , for example when displaying tags with values.I did some research on this issue and identified some areas that need to be updated for
SearchableMultiDropdownField
to work correctly with multi values.First of all, we need to use a unified approach when storing SearchableField data in state. This is due to the fact that
react-select
as a valueobject / array of objects
.This in turn will break the approach used for searching. Since the search occurs by a specific value, string or number. Therefore, we should also make changes to the following function (See).
It is also possible that changes should be made to the
SearchContext
since in the current implementation the search bymany-many
relationships does not occur.The next item that might need to be updated is "GridFieldState" to support looking up
many-many
relationships.tl;dr
There's no way to search against a
many_many
relation in theGridFieldFilterHeader
right now. Other fields and relations includingmany_many
do work as expected.Searching with a
SearchableMultiDropdownField
with multi values doesn't work, which is a related concern.See discussion here for more details:
Step to reproduce
Related issue
The text was updated successfully, but these errors were encountered: