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:
@ -25,7 +25,7 @@ export const companyShowFieldDefinitions: FieldDefinition<FieldMetadata>[] = [
|
||||
fieldId: 'domainName',
|
||||
label: 'Domain name',
|
||||
Icon: IconLink,
|
||||
type: 'url',
|
||||
type: 'URL',
|
||||
metadata: {
|
||||
fieldName: 'domainName',
|
||||
placeHolder: 'URL',
|
||||
@ -35,7 +35,7 @@ export const companyShowFieldDefinitions: FieldDefinition<FieldMetadata>[] = [
|
||||
fieldId: 'accountOwner',
|
||||
label: 'Account owner',
|
||||
Icon: IconUserCircle,
|
||||
type: 'relation',
|
||||
type: 'RELATION',
|
||||
metadata: {
|
||||
fieldName: 'accountOwner',
|
||||
relationType: Entity.User,
|
||||
@ -52,7 +52,7 @@ export const companyShowFieldDefinitions: FieldDefinition<FieldMetadata>[] = [
|
||||
fieldId: 'employees',
|
||||
label: 'Employees',
|
||||
Icon: IconUsers,
|
||||
type: 'number',
|
||||
type: 'NUMBER',
|
||||
metadata: {
|
||||
fieldName: 'employees',
|
||||
placeHolder: 'Employees',
|
||||
@ -62,7 +62,7 @@ export const companyShowFieldDefinitions: FieldDefinition<FieldMetadata>[] = [
|
||||
fieldId: 'address',
|
||||
label: 'Address',
|
||||
Icon: IconMap,
|
||||
type: 'text',
|
||||
type: 'TEXT',
|
||||
metadata: {
|
||||
fieldName: 'address',
|
||||
placeHolder: 'Address',
|
||||
@ -72,7 +72,7 @@ export const companyShowFieldDefinitions: FieldDefinition<FieldMetadata>[] = [
|
||||
fieldId: 'idealCustomerProfile',
|
||||
label: 'ICP',
|
||||
Icon: IconTarget,
|
||||
type: 'boolean',
|
||||
type: 'BOOLEAN',
|
||||
metadata: {
|
||||
fieldName: 'idealCustomerProfile',
|
||||
},
|
||||
@ -81,7 +81,7 @@ export const companyShowFieldDefinitions: FieldDefinition<FieldMetadata>[] = [
|
||||
fieldId: 'xUrl',
|
||||
label: 'Twitter',
|
||||
Icon: IconBrandX,
|
||||
type: 'url',
|
||||
type: 'URL',
|
||||
metadata: {
|
||||
fieldName: 'xUrl',
|
||||
placeHolder: 'X',
|
||||
@ -91,7 +91,7 @@ export const companyShowFieldDefinitions: FieldDefinition<FieldMetadata>[] = [
|
||||
fieldId: 'createdAt',
|
||||
label: 'Created at',
|
||||
Icon: IconCalendar,
|
||||
type: 'date',
|
||||
type: 'DATE',
|
||||
metadata: {
|
||||
fieldName: 'createdAt',
|
||||
},
|
||||
|
||||
@ -16,37 +16,37 @@ export const companyTableFilterDefinitions: FilterDefinitionByEntity<Company>[]
|
||||
fieldId: 'name',
|
||||
label: 'Name',
|
||||
Icon: IconBuildingSkyscraper,
|
||||
type: 'text',
|
||||
type: 'TEXT',
|
||||
},
|
||||
{
|
||||
fieldId: 'employees',
|
||||
label: 'Employees',
|
||||
Icon: IconUsers,
|
||||
type: 'number',
|
||||
type: 'NUMBER',
|
||||
},
|
||||
{
|
||||
fieldId: 'domainName',
|
||||
label: 'URL',
|
||||
Icon: IconLink,
|
||||
type: 'text',
|
||||
type: 'TEXT',
|
||||
},
|
||||
{
|
||||
fieldId: 'address',
|
||||
label: 'Address',
|
||||
Icon: IconMap,
|
||||
type: 'text',
|
||||
type: 'TEXT',
|
||||
},
|
||||
{
|
||||
fieldId: 'createdAt',
|
||||
label: 'Created at',
|
||||
Icon: IconCalendarEvent,
|
||||
type: 'date',
|
||||
type: 'DATE',
|
||||
},
|
||||
{
|
||||
fieldId: 'accountOwnerId',
|
||||
label: 'Account owner',
|
||||
Icon: IconUser,
|
||||
type: 'entity',
|
||||
type: 'ENTITY',
|
||||
entitySelectComponent: <FilterDropdownUserSearchSelect />,
|
||||
},
|
||||
];
|
||||
|
||||
@ -16,26 +16,26 @@ export const opportunityBoardFilterDefinitions: FilterDefinitionByEntity<Pipelin
|
||||
fieldId: 'amount',
|
||||
label: 'Amount',
|
||||
Icon: IconCurrencyDollar,
|
||||
type: 'number',
|
||||
type: 'NUMBER',
|
||||
},
|
||||
{
|
||||
fieldId: 'closeDate',
|
||||
label: 'Close date',
|
||||
Icon: IconCalendarEvent,
|
||||
type: 'date',
|
||||
type: 'DATE',
|
||||
},
|
||||
{
|
||||
fieldId: 'companyId',
|
||||
label: 'Company',
|
||||
Icon: IconBuildingSkyscraper,
|
||||
type: 'entity',
|
||||
type: 'ENTITY',
|
||||
entitySelectComponent: <FilterDropdownCompanySearchSelect />,
|
||||
},
|
||||
{
|
||||
fieldId: 'pointOfContactId',
|
||||
label: 'Point of contact',
|
||||
Icon: IconUser,
|
||||
type: 'entity',
|
||||
type: 'ENTITY',
|
||||
entitySelectComponent: <FilterDropdownPeopleSearchSelect />,
|
||||
},
|
||||
];
|
||||
|
||||
@ -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',
|
||||
},
|
||||
|
||||
@ -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',
|
||||
},
|
||||
];
|
||||
|
||||
@ -40,7 +40,7 @@ export const SettingsObjectNewFieldStep2 = () => {
|
||||
icon: string;
|
||||
label: string;
|
||||
type: MetadataFieldDataType;
|
||||
}>({ icon: 'IconUsers', label: '', type: 'number' });
|
||||
}>({ icon: 'IconUsers', label: '', type: 'NUMBER' });
|
||||
|
||||
const [objectViews, setObjectViews] = useState<View[]>([]);
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ export const tasksFilterDefinitions: FilterDefinitionByEntity<Activity>[] = [
|
||||
fieldId: 'assigneeId',
|
||||
label: 'Assignee',
|
||||
Icon: IconUser,
|
||||
type: 'entity',
|
||||
type: 'ENTITY',
|
||||
entitySelectComponent: <FilterDropdownUserSearchSelect />,
|
||||
selectAllLabel: 'All assignees',
|
||||
SelectAllIcon: IconUserCircle,
|
||||
|
||||
Reference in New Issue
Block a user