Feat/metadata datatable types (#2175)

* Handled new url v2 type

* Fixed refetch queries

* wip

* Ok delete but views bug

* Fix lint

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Lucas Bordeau
2023-10-21 14:07:18 +02:00
committed by GitHub
parent 598fda8f45
commit f1670f0cf4
50 changed files with 1125 additions and 350 deletions

View File

@ -1,5 +1,7 @@
import { gql } from '@apollo/client';
import { FieldType } from '@/ui/data/field/types/FieldType';
import { MetadataObject } from '../types/MetadataObject';
export const generateFindManyCustomObjectsQuery = ({
@ -15,7 +17,24 @@ export const generateFindManyCustomObjectsQuery = ({
edges {
node {
id
${metadataObject.fields.map((field) => field.name).join('\n')}
${metadataObject.fields
.map((field) => {
// TODO: parse
const fieldType = field.type as FieldType;
if (fieldType === 'text') {
return field.name;
} else if (fieldType === 'url') {
return `
${field.name}
{
text
link
}
`;
}
})
.join('\n')}
}
cursor
}