Create new field type JSON (#4729)

### Description
Create new field type JSON

### Refs
https://github.com/twentyhq/twenty/issues/3900

### Demo


https://github.com/twentyhq/twenty/assets/140154534/9ebdf4d4-f332-4940-b9d8-d9cf91935b67

Fixes #3900

---------

Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
Co-authored-by: Marie Stoppa <marie.stoppa@essec.edu>
This commit is contained in:
gitstart-app[bot]
2024-04-11 11:41:36 +02:00
committed by GitHub
parent f25d58b0d9
commit 584d90ec89
23 changed files with 245 additions and 8 deletions

View File

@ -2,6 +2,7 @@ import {
IconCalendarEvent,
IconCheck,
IconCoins,
IconJson,
IconKey,
IconLink,
IconMail,
@ -117,4 +118,9 @@ export const SETTINGS_FIELD_TYPE_CONFIGS: Record<
addressLng: -118.2437,
},
},
[FieldMetadataType.RawJson]: {
label: 'JSON',
Icon: IconJson,
defaultValue: `{ "key": "value" }`,
},
};

View File

@ -69,6 +69,7 @@ const previewableTypes = [
FieldMetadataType.Relation,
FieldMetadataType.Text,
FieldMetadataType.Address,
FieldMetadataType.RawJson,
];
export const SettingsDataModelFieldSettingsFormCard = ({

View File

@ -2,5 +2,5 @@ import { FieldMetadataType } from '~/generated-metadata/graphql';
export type SettingsSupportedFieldType = Exclude<
FieldMetadataType,
FieldMetadataType.Position | FieldMetadataType.RawJson
FieldMetadataType.Position
>;