Rename Money/Url to Currency/Link and remove snake_case from composite fields (#2536)

* Rename Money/Url to Currency/Link

* regenerate front types

* renaming money/url field types

* fix double text

* fix tests

* fix server tests

* fix generate-target-column-map

* fix currency convert

* fix: tests

---------

Co-authored-by: Jérémy Magrin <jeremy.magrin@gmail.com>
This commit is contained in:
Weiko
2023-11-17 10:31:17 +01:00
committed by GitHub
parent 31e439681c
commit bc579d64a6
56 changed files with 579 additions and 512 deletions

View File

@ -38,7 +38,7 @@ export const Currency: Story = {
args: {
fieldIconKey: 'IconCurrencyDollar',
fieldLabel: 'Amount',
fieldType: FieldMetadataType.Money,
fieldType: FieldMetadataType.Currency,
},
};
@ -61,7 +61,7 @@ export const Link: Story = {
args: {
fieldIconKey: 'IconWorldWww',
fieldLabel: 'Website',
fieldType: FieldMetadataType.Url,
fieldType: FieldMetadataType.Link,
},
};

View File

@ -11,7 +11,7 @@ import {
IconTextSize,
} from '@/ui/display/icon';
import { IconComponent } from '@/ui/display/icon/types/IconComponent';
import { Currency, FieldMetadataType } from '~/generated-metadata/graphql';
import { CurrencyCode, FieldMetadataType } from '~/generated-metadata/graphql';
const defaultDateValue = new Date();
defaultDateValue.setFullYear(defaultDateValue.getFullYear() + 2);
@ -36,10 +36,10 @@ export const dataTypes: Record<
Icon: IconNumbers,
defaultValue: 2000,
},
[FieldMetadataType.Url]: {
[FieldMetadataType.Link]: {
label: 'Link',
Icon: IconLink,
defaultValue: { link: 'www.twenty.com', text: '' },
defaultValue: { url: 'www.twenty.com', label: '' },
},
[FieldMetadataType.Boolean]: {
label: 'True/False',
@ -51,10 +51,10 @@ export const dataTypes: Record<
Icon: IconCalendarEvent,
defaultValue: defaultDateValue.toISOString(),
},
[FieldMetadataType.Money]: {
[FieldMetadataType.Currency]: {
label: 'Currency',
Icon: IconCoins,
defaultValue: { amount: 2000, currency: Currency.Usd },
defaultValue: { amount: 2000, currency: CurrencyCode.Usd },
},
[FieldMetadataType.Relation]: { label: 'Relation', Icon: IconPlug },
[FieldMetadataType.Email]: { label: 'Email', Icon: IconMail },