download record sample - Import (#12489)

<img width="400" alt="Screenshot 2025-06-10 at 18 14 17"
src="https://github.com/user-attachments/assets/05591b46-c36d-45c6-a236-3469c29d7420"
/>


closes https://github.com/twentyhq/core-team-issues/issues/915

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Etienne
2025-06-16 16:01:27 +02:00
committed by GitHub
parent 79b8c4660c
commit c16ba6a7d7
32 changed files with 753 additions and 481 deletions
@@ -51,7 +51,7 @@ describe('getFieldPreviewValue', () => {
// Then
expect(result).toBe(2000);
expect(result).toBe(
getSettingsFieldTypeConfig(FieldMetadataType.NUMBER).exampleValue,
getSettingsFieldTypeConfig(FieldMetadataType.NUMBER).exampleValues?.[0],
);
});
@@ -18,7 +18,7 @@ export const getAddressFieldPreviewValue = ({
FieldMetadataType.ADDRESS,
);
const placeholderDefaultValue = addressFieldTypeConfig.exampleValue;
const placeholderDefaultValue = addressFieldTypeConfig.exampleValues?.[0];
const addressCountry =
fieldMetadataItem.defaultValue?.addressCountry &&
@@ -20,7 +20,7 @@ export const getCurrencyFieldPreviewValue = ({
FieldMetadataType.CURRENCY,
);
const placeholderDefaultValue = currencyFieldTypeConfig.exampleValue;
const placeholderDefaultValue = currencyFieldTypeConfig.exampleValues?.[0];
return currencyFieldDefaultValueSchema
.transform((value) => ({
@@ -31,10 +31,10 @@ export const getFieldPreviewValue = ({
if (
isDefined(fieldTypeConfig) &&
'exampleValue' in fieldTypeConfig &&
isDefined(fieldTypeConfig.exampleValue)
'exampleValues' in fieldTypeConfig &&
isDefined(fieldTypeConfig.exampleValues?.[0])
) {
return fieldTypeConfig.exampleValue;
return fieldTypeConfig.exampleValues?.[0];
}
return null;
@@ -38,7 +38,7 @@ export const getPhonesFieldPreviewValue = ({
FieldMetadataType.PHONES,
);
const placeholderDefaultValue = phonesFieldTypeConfig.exampleValue;
const placeholderDefaultValue = phonesFieldTypeConfig.exampleValues?.[0];
const primaryPhoneCountryCode =
fieldMetadataItem.defaultValue?.primaryPhoneCountryCode &&
fieldMetadataItem.defaultValue.primaryPhoneCountryCode !== ''