Fix breadcrumbs to display friendly object names instead of API names… (#13573)
Fixes #13250 This PR fixes the breadcrumb display issue where API names were shown instead of friendly object names when navigating to related objects in the detail view. --------- Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
|
||||
import { getObjectRecordIdentifier } from '@/object-metadata/utils/getObjectRecordIdentifier';
|
||||
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
|
||||
import { capitalize } from 'twenty-shared/utils';
|
||||
|
||||
export const getSelectedRecordsContextText = (
|
||||
objectMetadataItem: ObjectMetadataItem,
|
||||
@@ -10,5 +9,5 @@ export const getSelectedRecordsContextText = (
|
||||
) => {
|
||||
return totalCount === 1
|
||||
? getObjectRecordIdentifier({ objectMetadataItem, record: records[0] }).name
|
||||
: `${totalCount} ${capitalize(objectMetadataItem.namePlural)}`;
|
||||
: `${totalCount} ${objectMetadataItem.labelPlural}`;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user