feat: refactor schema builder and resolver builder (#2215)

* feat: wip refactor schema builder

* feat: wip store types and first queries generation

* feat: refactor schema-builder and resolver-builder

* fix: clean & small type fix

* fix: avoid breaking change

* fix: remove util from pg-graphql classes

* fix: required default fields

* Refactor frontend accordingly

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Jérémy M
2023-11-03 17:16:37 +01:00
committed by GitHub
parent aba3fd454b
commit 1ed4965a95
216 changed files with 3215 additions and 2028 deletions

View File

@ -26,7 +26,7 @@ export const personShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
fieldId: 'email',
label: 'Email',
Icon: IconMail,
type: 'text',
type: 'TEXT',
metadata: {
fieldName: 'email',
placeHolder: 'Email',
@ -36,7 +36,7 @@ export const personShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
fieldId: 'company',
label: 'Company',
Icon: IconBuildingSkyscraper,
type: 'relation',
type: 'RELATION',
metadata: {
fieldName: 'company',
relationType: Entity.Company,
@ -53,7 +53,7 @@ export const personShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
fieldId: 'phone',
label: 'Phone',
Icon: IconPhone,
type: 'phone',
type: 'PHONE',
metadata: {
fieldName: 'phone',
placeHolder: 'Phone',
@ -63,7 +63,7 @@ export const personShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
fieldId: 'jobTitle',
label: 'Job Title',
Icon: IconBriefcase,
type: 'text',
type: 'TEXT',
metadata: {
fieldName: 'jobTitle',
placeHolder: 'Job Title',
@ -73,7 +73,7 @@ export const personShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
fieldId: 'city',
label: 'City',
Icon: IconMap,
type: 'text',
type: 'TEXT',
metadata: {
fieldName: 'city',
placeHolder: 'City',
@ -83,7 +83,7 @@ export const personShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
fieldId: 'linkedinUrl',
label: 'Linkedin URL',
Icon: IconBrandLinkedin,
type: 'url',
type: 'URL',
metadata: {
fieldName: 'linkedinUrl',
placeHolder: 'Linkedin URL',
@ -93,7 +93,7 @@ export const personShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
fieldId: 'xUrl',
label: 'X URL',
Icon: IconBrandX,
type: 'url',
type: 'URL',
metadata: {
fieldName: 'xUrl',
placeHolder: 'X URL',
@ -103,7 +103,7 @@ export const personShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
fieldId: 'createdAt',
label: 'Created at',
Icon: IconCalendar,
type: 'date',
type: 'DATE',
metadata: {
fieldName: 'createdAt',
},

View File

@ -16,25 +16,25 @@ export const personTableFilterDefinitions: FilterDefinitionByEntity<Person>[] =
fieldId: 'firstName',
label: 'First name',
Icon: IconUser,
type: 'text',
type: 'TEXT',
},
{
fieldId: 'lastName',
label: 'Last name',
Icon: IconUser,
type: 'text',
type: 'TEXT',
},
{
fieldId: 'email',
label: 'Email',
Icon: IconMail,
type: 'text',
type: 'TEXT',
},
{
fieldId: 'companyId',
label: 'Company',
Icon: IconBuildingSkyscraper,
type: 'entity',
type: 'ENTITY',
// TODO: replace this with a component that selects the dropdown to use based on the entity type
entitySelectComponent: <FilterDropdownCompanySearchSelect />,
},
@ -42,18 +42,18 @@ export const personTableFilterDefinitions: FilterDefinitionByEntity<Person>[] =
fieldId: 'phone',
label: 'Phone',
Icon: IconPhone,
type: 'text',
type: 'TEXT',
},
{
fieldId: 'createdAt',
label: 'Created at',
Icon: IconCalendarEvent,
type: 'date',
type: 'DATE',
},
{
fieldId: 'city',
label: 'City',
Icon: IconMap,
type: 'text',
type: 'TEXT',
},
];