feat: simplify field preview logic in Settings (#5541)

Closes #5382

TODO:

- [x] Test all field previews in app
- [x] Fix tests
- [x] Fix JSON preview
This commit is contained in:
Thaïs
2024-05-24 18:06:57 +02:00
committed by GitHub
parent 1ae7fbe90d
commit c7d61e183a
33 changed files with 1184 additions and 510 deletions

View File

@ -32,10 +32,7 @@ export type SettingsFieldTypeConfig = {
defaultValue?: unknown;
};
export const SETTINGS_FIELD_TYPE_CONFIGS: Record<
SettingsSupportedFieldType,
SettingsFieldTypeConfig
> = {
export const SETTINGS_FIELD_TYPE_CONFIGS = {
[FieldMetadataType.Uuid]: {
label: 'Unique ID',
Icon: IconKey,
@ -137,6 +134,9 @@ export const SETTINGS_FIELD_TYPE_CONFIGS: Record<
[FieldMetadataType.RawJson]: {
label: 'JSON',
Icon: IconJson,
defaultValue: `{ "key": "value" }`,
defaultValue: { key: 'value' },
},
};
} as const satisfies Record<
SettingsSupportedFieldType,
SettingsFieldTypeConfig
>;