Fix field empty value check for Person standard object (#10533)
The previous code was not correct if labelIdentifier is a FULL_NAME. We already have an util for this Fixes: https://github.com/twentyhq/twenty/issues/10532
This commit is contained in:
@ -17,6 +17,7 @@ import {
|
||||
} from '@/object-record/record-field/contexts/FieldContext';
|
||||
import { FieldMetadata } from '@/object-record/record-field/types/FieldMetadata';
|
||||
import { getFieldButtonIcon } from '@/object-record/record-field/utils/getFieldButtonIcon';
|
||||
import { isFieldValueEmpty } from '@/object-record/record-field/utils/isFieldValueEmpty';
|
||||
import { useRecordIndexContextOrThrow } from '@/object-record/record-index/contexts/RecordIndexContext';
|
||||
import { recordIndexOpenRecordInSelector } from '@/object-record/record-index/states/selectors/recordIndexOpenRecordInSelector';
|
||||
import { RecordInlineCell } from '@/object-record/record-inline-cell/components/RecordInlineCell';
|
||||
@ -99,9 +100,10 @@ export const RecordBoardCardHeader = ({
|
||||
isRecordBoardCompactModeActiveComponentState,
|
||||
);
|
||||
|
||||
const isIdentifierEmpty =
|
||||
(record?.[identifierFieldDefinition.metadata.fieldName] || '').trim() ===
|
||||
'';
|
||||
const isIdentifierEmpty = isFieldValueEmpty({
|
||||
fieldDefinition: identifierFieldDefinition,
|
||||
fieldValue: record?.[identifierFieldDefinition.metadata.fieldName],
|
||||
});
|
||||
|
||||
const { checkIfLastUnselectAndCloseDropdown } =
|
||||
useRecordBoardSelection(recordBoardId);
|
||||
|
||||
Reference in New Issue
Block a user