Import - fixes (#12569)

<img width="800" alt="Screenshot 2025-06-12 at 15 22 49"
src="https://github.com/user-attachments/assets/afaa4ef1-b16c-4c05-ba4a-d77ad2ccfa76"
/>


To test : 
- unselect an option on select/multi-select matching (matching step)
- match a mutli-select field with an other field

closes : https://github.com/twentyhq/core-team-issues/issues/1065
closes : https://github.com/twentyhq/core-team-issues/issues/1066
This commit is contained in:
Etienne
2025-06-13 15:52:32 +02:00
committed by GitHub
parent 6bca562c65
commit 8e007c8b5f
9 changed files with 89 additions and 35 deletions

View File

@ -14,9 +14,16 @@ export const setSubColumn = <T>(
):
| SpreadsheetMatchedSelectColumn<T>
| SpreadsheetMatchedSelectOptionsColumn<T> => {
const shouldUnselectValue =
oldColumn.matchedOptions.find((option) => option.entry === entry)?.value ===
value;
const options = oldColumn.matchedOptions.map((option) =>
option.entry === entry ? { ...option, value } : option,
option.entry === entry
? { ...option, value: shouldUnselectValue ? undefined : value }
: option,
);
const allMatched = options.every(({ value }) => !!value);
if (allMatched) {
return {