Setup relations for remote objects (#5149)

New strategy:
- add settings field on FieldMetadata. Contains a boolean isIdField and
for numbers, a precision
- if idField, the graphql scalar returned will be a GraphQL id. This
will allow the app to work even for ids that are not uuid
- remove globals dateScalar and numberScalar modes. These were not used
- set limit as Integer
- check manually in query runner mutations that we send a valid id

Todo left:
- remove WorkspaceBuildSchemaOptions since this is not used anymore.
Will do in another PR

---------

Co-authored-by: Thomas Trompette <thomast@twenty.com>
Co-authored-by: Weiko <corentin@twenty.com>
This commit is contained in:
Thomas Trompette
2024-04-26 14:37:34 +02:00
committed by GitHub
parent dc576d0818
commit 224c8d361b
71 changed files with 616 additions and 223 deletions

View File

@ -96,11 +96,6 @@ export const RecordShowPage = () => {
? `${pageName} - ${capitalize(objectNameSingular)}`
: capitalize(objectNameSingular);
// Temporarily since we don't have relations for remote objects yet
if (objectMetadataItem.isRemote) {
return null;
}
return (
<PageContainer>
<PageTitle title={pageTitle} />

View File

@ -88,6 +88,8 @@ export const SettingsObjectDetail = () => {
},
});
const shouldDisplayAddFieldButton = !activeObjectMetadataItem.isRemote;
return (
<SubMenuTopBarContainer Icon={IconSettings} title="Settings">
<SettingsPageContainer>
@ -207,21 +209,23 @@ export const SettingsObjectDetail = () => {
</TableSection>
)}
</Table>
<StyledDiv>
<Button
Icon={IconPlus}
title="Add Field"
size="small"
variant="secondary"
onClick={() =>
navigate(
disabledMetadataFields.length
? './new-field/step-1'
: './new-field/step-2',
)
}
/>
</StyledDiv>
{shouldDisplayAddFieldButton && (
<StyledDiv>
<Button
Icon={IconPlus}
title="Add Field"
size="small"
variant="secondary"
onClick={() =>
navigate(
disabledMetadataFields.length
? './new-field/step-1'
: './new-field/step-2',
)
}
/>
</StyledDiv>
)}
</Section>
</SettingsPageContainer>
</SubMenuTopBarContainer>