Fixes data importer showing incorrect unmatched fields (# 6138) (#6311)

fixes #6138

---------

Co-authored-by: Thomas Trompette <thomas.trompette@sfr.fr>
This commit is contained in:
Faisal-imtiyaz123 2024-07-22 17:43:00 +05:30 committed by GitHub
parent 41931c53e8
commit 4f249df831
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,10 +1,10 @@
// TODO: We should create our own accordion component // TODO: We should create our own accordion component
import { import {
Accordion, Accordion,
AccordionButton as ChakraAccordionButton,
AccordionIcon, AccordionIcon,
AccordionItem, AccordionItem,
AccordionPanel, AccordionPanel,
AccordionButton as ChakraAccordionButton,
} from '@chakra-ui/accordion'; } from '@chakra-ui/accordion';
import styled from '@emotion/styled'; import styled from '@emotion/styled';
import { IconChevronDown, IconForbid } from 'twenty-ui'; import { IconChevronDown, IconForbid } from 'twenty-ui';
@ -15,6 +15,7 @@ import { Fields } from '@/spreadsheet-import/types';
import { Column, Columns, ColumnType } from '../MatchColumnsStep'; import { Column, Columns, ColumnType } from '../MatchColumnsStep';
import { isDefined } from '~/utils/isDefined';
import { SubMatchingSelect } from './SubMatchingSelect'; import { SubMatchingSelect } from './SubMatchingSelect';
const StyledContainer = styled.div` const StyledContainer = styled.div`
@ -68,7 +69,8 @@ const getAccordionTitle = <T extends string>(
)?.label; )?.label;
return `Match ${fieldLabel} (${ return `Match ${fieldLabel} (${
'matchedOptions' in column && column.matchedOptions.length 'matchedOptions' in column &&
column.matchedOptions.filter((option) => !isDefined(option.value)).length
} Unmatched)`; } Unmatched)`;
}; };