Feat/generic editable cell all types (#987)
* Added generic relation cell * Deactivated debug * Added default warning * Put back display component * Removed unused types * wip * Renamed to view field * Use new view field structure to have chip working * Finished * Added a temp feature flag * Added double text chip cell * Ok * Finished tables * Fixed icon size * Fixed bug on date field * Use icon index * Fix * Fixed naming * Fix * removed file from merge * Fixed tests * Coverage
This commit is contained in:
@ -1,22 +0,0 @@
|
||||
import { IconBuildingSkyscraper } from '@tabler/icons-react';
|
||||
|
||||
import { Entity } from '@/ui/relation-picker/types/EntityTypeForSelect';
|
||||
import {
|
||||
ViewFieldChipMetadata,
|
||||
ViewFieldDefinition,
|
||||
} from '@/ui/table/types/ViewField';
|
||||
|
||||
export const companyViewFields: ViewFieldDefinition<unknown>[] = [
|
||||
{
|
||||
columnLabel: 'Name',
|
||||
columnIcon: <IconBuildingSkyscraper size={16} />,
|
||||
columnSize: 150,
|
||||
type: 'chip',
|
||||
columnOrder: 1,
|
||||
metadata: {
|
||||
urlFieldName: 'domainName',
|
||||
contentFieldName: 'name',
|
||||
relationType: Entity.Company,
|
||||
},
|
||||
} as ViewFieldDefinition<ViewFieldChipMetadata>,
|
||||
];
|
||||
105
front/src/modules/companies/constants/companyViewFields.tsx
Normal file
105
front/src/modules/companies/constants/companyViewFields.tsx
Normal file
@ -0,0 +1,105 @@
|
||||
import {
|
||||
IconBuildingSkyscraper,
|
||||
IconCalendarEvent,
|
||||
IconLink,
|
||||
IconMap,
|
||||
IconUser,
|
||||
IconUsers,
|
||||
} from '@/ui/icon/index';
|
||||
import { Entity } from '@/ui/relation-picker/types/EntityTypeForSelect';
|
||||
import {
|
||||
ViewFieldChipMetadata,
|
||||
ViewFieldDateMetadata,
|
||||
ViewFieldDefinition,
|
||||
ViewFieldMetadata,
|
||||
ViewFieldNumberMetadata,
|
||||
ViewFieldRelationMetadata,
|
||||
ViewFieldTextMetadata,
|
||||
ViewFieldURLMetadata,
|
||||
} from '@/ui/table/types/ViewField';
|
||||
|
||||
export const companyViewFields: ViewFieldDefinition<ViewFieldMetadata>[] = [
|
||||
{
|
||||
id: 'name',
|
||||
columnLabel: 'Name',
|
||||
columnIcon: <IconBuildingSkyscraper />,
|
||||
columnSize: 180,
|
||||
columnOrder: 1,
|
||||
metadata: {
|
||||
type: 'chip',
|
||||
urlFieldName: 'domainName',
|
||||
contentFieldName: 'name',
|
||||
relationType: Entity.Company,
|
||||
},
|
||||
} as ViewFieldDefinition<ViewFieldChipMetadata>,
|
||||
{
|
||||
id: 'domainName',
|
||||
columnLabel: 'URL',
|
||||
columnIcon: <IconLink />,
|
||||
columnSize: 100,
|
||||
columnOrder: 2,
|
||||
metadata: {
|
||||
type: 'url',
|
||||
fieldName: 'domainName',
|
||||
placeHolder: 'example.com',
|
||||
},
|
||||
} as ViewFieldDefinition<ViewFieldURLMetadata>,
|
||||
{
|
||||
id: 'accountOwner',
|
||||
columnLabel: 'Account Owner',
|
||||
columnIcon: <IconUser />,
|
||||
columnSize: 150,
|
||||
columnOrder: 3,
|
||||
metadata: {
|
||||
type: 'relation',
|
||||
fieldName: 'accountOwner',
|
||||
relationType: Entity.User,
|
||||
},
|
||||
} satisfies ViewFieldDefinition<ViewFieldRelationMetadata>,
|
||||
{
|
||||
id: 'createdAt',
|
||||
columnLabel: 'Creation',
|
||||
columnIcon: <IconCalendarEvent />,
|
||||
columnSize: 150,
|
||||
columnOrder: 4,
|
||||
metadata: {
|
||||
type: 'date',
|
||||
fieldName: 'createdAt',
|
||||
},
|
||||
} satisfies ViewFieldDefinition<ViewFieldDateMetadata>,
|
||||
{
|
||||
id: 'employees',
|
||||
columnLabel: 'Employees',
|
||||
columnIcon: <IconUsers />,
|
||||
columnSize: 150,
|
||||
columnOrder: 5,
|
||||
metadata: {
|
||||
type: 'number',
|
||||
fieldName: 'employees',
|
||||
},
|
||||
} satisfies ViewFieldDefinition<ViewFieldNumberMetadata>,
|
||||
{
|
||||
id: 'linkedin',
|
||||
columnLabel: 'LinkedIn',
|
||||
columnIcon: <IconMap />,
|
||||
columnSize: 170,
|
||||
columnOrder: 6,
|
||||
metadata: {
|
||||
type: 'url',
|
||||
fieldName: 'linkedinUrl',
|
||||
placeHolder: 'LinkedIn URL',
|
||||
},
|
||||
} satisfies ViewFieldDefinition<ViewFieldURLMetadata>,
|
||||
{
|
||||
id: 'address',
|
||||
columnLabel: 'Address',
|
||||
columnIcon: <IconMap />,
|
||||
columnSize: 170,
|
||||
columnOrder: 7,
|
||||
metadata: {
|
||||
type: 'text',
|
||||
fieldName: 'address',
|
||||
placeHolder: 'Address',
|
||||
},
|
||||
} satisfies ViewFieldDefinition<ViewFieldTextMetadata>,
|
||||
];
|
||||
Reference in New Issue
Block a user