Files
twenty/front/src/pages/people/constants/personTableSortDefinitions.tsx
T
Weiko 1cf08c797f Convert metadata tables to camelCase (#2400)
* Convert metadata tables to camelCase

* datasourcemetadataid to datasourceid

* refactor metadata folders

* fix command

* move commands out of metadata

* fix seed

* rename objectId and fieldId in objectMetadataId and fieldMetadataId in FE

* fix field-metadata

* Fix

* Fix

* remove logs

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2023-11-09 20:06:10 +01:00

52 lines
1.1 KiB
TypeScript

import {
IconBuildingSkyscraper,
IconCalendarEvent,
IconMail,
IconMap,
IconPhone,
IconUser,
} from '@/ui/display/icon/index';
import { SortDefinition } from '@/ui/object/object-sort-dropdown/types/SortDefinition';
import { SortDirection } from '@/ui/object/object-sort-dropdown/types/SortDirection';
export const personTableSortDefinitions: SortDefinition[] = [
{
fieldMetadataId: 'fullname',
label: 'People',
Icon: IconUser,
getOrderByTemplate: (direction: SortDirection) => [
{ firstName: direction },
{ lastName: direction },
],
},
{
fieldMetadataId: 'company_name',
label: 'Company',
Icon: IconBuildingSkyscraper,
getOrderByTemplate: (direction: SortDirection) => [
{ company: { name: direction } },
],
},
{
fieldMetadataId: 'email',
label: 'Email',
Icon: IconMail,
},
{
fieldMetadataId: 'phone',
label: 'Phone',
Icon: IconPhone,
},
{
fieldMetadataId: 'createdAt',
label: 'Created at',
Icon: IconCalendarEvent,
},
{
fieldMetadataId: 'city',
label: 'City',
Icon: IconMap,
},
];