Feat/filter available field definition v2 (#2547)

* Added react-dev-inspector

* Add field relation type parsing and filter available fields for record table and show page

* Revert "Added react-dev-inspector"

This reverts commit 7a78964c2c3996ce2e27f6f8d0c0b5e1f3283e17.
This commit is contained in:
Lucas Bordeau
2023-11-16 17:09:50 +01:00
committed by GitHub
parent 0ae9373532
commit 7da18a13e8
8 changed files with 98 additions and 2 deletions

View File

@ -109,7 +109,9 @@ export const usePersistField = () => {
variables: {
where: { id: entityId },
data: {
[fieldName]: valueToPersist?.id ?? null,
// TODO: find a more elegant way to do this ?
// Maybe have a link between the RELATION field and the UUID field ?
[`${fieldName}Id`]: valueToPersist?.id ?? null,
},
},
});

View File

@ -4,6 +4,11 @@ import { AvatarType } from '@/users/components/Avatar';
import { FieldMetadata } from './FieldMetadata';
import { FieldType } from './FieldType';
export type FieldDefinitionRelationType =
| 'TO_ONE_OBJECT'
| 'FROM_NAMY_OBJECTS'
| 'TO_MANY_OBJECTS';
export type FieldDefinition<T extends FieldMetadata> = {
fieldMetadataId: string;
label: string;
@ -17,4 +22,5 @@ export type FieldDefinition<T extends FieldMetadata> = {
pictureUrl?: string;
avatarType: AvatarType;
};
relationType?: FieldDefinitionRelationType;
};