Migrate to a monorepo structure (#2909)

This commit is contained in:
Charles Bochet
2023-12-10 18:10:54 +01:00
committed by GitHub
parent a70a9281eb
commit 5bdca9de6c
2304 changed files with 37152 additions and 25869 deletions

View File

@ -0,0 +1,16 @@
import { IconMouse2 } from '@/ui/display/icon';
export const standardObjects = [
{
name: 'Users',
Icon: IconMouse2,
fields: 6,
description: 'Individuals who interact with your website',
},
{
name: 'Users',
Icon: IconMouse2,
fields: 8,
description: 'Individuals who interact with your website',
},
];

View File

@ -0,0 +1 @@
export const objectSettingsWidth = '512px';

View File

@ -0,0 +1,34 @@
import { IconRelationOneToMany, IconRelationOneToOne } from '@/ui/display/icon';
import { IconComponent } from '@/ui/display/icon/types/IconComponent';
import { RelationMetadataType } from '~/generated-metadata/graphql';
import OneToManySvg from '../assets/OneToMany.svg';
import OneToOneSvg from '../assets/OneToOne.svg';
import { RelationType } from '../types/RelationType';
export const relationTypes: Record<
RelationType,
{
label: string;
Icon: IconComponent;
imageSrc: string;
isImageFlipped?: boolean;
}
> = {
[RelationMetadataType.OneToMany]: {
label: 'Has many',
Icon: IconRelationOneToMany,
imageSrc: OneToManySvg,
},
[RelationMetadataType.OneToOne]: {
label: 'Has one',
Icon: IconRelationOneToOne,
imageSrc: OneToOneSvg,
},
MANY_TO_ONE: {
label: 'Belongs to one',
Icon: IconRelationOneToMany,
imageSrc: OneToManySvg,
isImageFlipped: true,
},
};

View File

@ -0,0 +1,94 @@
import {
IconCalendarEvent,
IconCheck,
IconCoins,
IconKey,
IconLink,
IconMail,
IconNumbers,
IconPhone,
IconRelationManyToMany,
IconTag,
IconTextSize,
IconUser,
} from '@/ui/display/icon';
import { IconTwentyStar } from '@/ui/display/icon/components/IconTwentyStar';
import { IconComponent } from '@/ui/display/icon/types/IconComponent';
import { FieldMetadataType } from '~/generated-metadata/graphql';
const defaultDateValue = new Date();
defaultDateValue.setFullYear(defaultDateValue.getFullYear() + 2);
export const settingsFieldMetadataTypes: Partial<
Record<
FieldMetadataType,
{ label: string; Icon: IconComponent; defaultValue?: unknown }
>
> = {
[FieldMetadataType.Uuid]: {
label: 'Unique ID',
Icon: IconKey,
defaultValue: '00000000-0000-0000-0000-000000000000',
},
[FieldMetadataType.Text]: {
label: 'Text',
Icon: IconTextSize,
defaultValue:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum magna enim, dapibus non enim in, lacinia faucibus nunc. Sed interdum ante sed felis facilisis, eget ultricies neque molestie. Mauris auctor, justo eu volutpat cursus, libero erat tempus nulla, non sodales lorem lacus a est.',
},
[FieldMetadataType.Numeric]: {
label: 'Numeric',
Icon: IconNumbers,
defaultValue: 2000,
},
[FieldMetadataType.Number]: {
label: 'Number',
Icon: IconNumbers,
defaultValue: 2000,
},
[FieldMetadataType.Link]: {
label: 'Link',
Icon: IconLink,
defaultValue: { url: 'www.twenty.com', label: '' },
},
[FieldMetadataType.Boolean]: {
label: 'True/False',
Icon: IconCheck,
defaultValue: true,
},
[FieldMetadataType.DateTime]: {
label: 'Date & Time',
Icon: IconCalendarEvent,
defaultValue: defaultDateValue.toISOString(),
},
[FieldMetadataType.Select]: {
label: 'Select',
Icon: IconTag,
},
[FieldMetadataType.MultiSelect]: {
label: 'MultiSelect',
Icon: IconTag,
},
[FieldMetadataType.Currency]: {
label: 'Currency',
Icon: IconCoins,
defaultValue: { amountMicros: 2000000000, currencyCode: 'USD' },
},
[FieldMetadataType.Relation]: {
label: 'Relation',
Icon: IconRelationManyToMany,
},
[FieldMetadataType.Email]: { label: 'Email', Icon: IconMail },
[FieldMetadataType.Phone]: { label: 'Phone', Icon: IconPhone },
[FieldMetadataType.Probability]: {
label: 'Rating',
Icon: IconTwentyStar,
defaultValue: '3',
},
[FieldMetadataType.Rating]: {
label: 'Rating',
Icon: IconTwentyStar,
defaultValue: '3',
},
[FieldMetadataType.FullName]: { label: 'Full Name', Icon: IconUser },
};