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:
+1
-1
@@ -51,7 +51,7 @@ describe('getFieldPreviewValue', () => {
|
||||
// Then
|
||||
expect(result).toBe(2000);
|
||||
expect(result).toBe(
|
||||
getSettingsFieldTypeConfig(FieldMetadataType.NUMBER).exampleValue,
|
||||
getSettingsFieldTypeConfig(FieldMetadataType.NUMBER).exampleValues?.[0],
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ export const getAddressFieldPreviewValue = ({
|
||||
FieldMetadataType.ADDRESS,
|
||||
);
|
||||
|
||||
const placeholderDefaultValue = addressFieldTypeConfig.exampleValue;
|
||||
const placeholderDefaultValue = addressFieldTypeConfig.exampleValues?.[0];
|
||||
|
||||
const addressCountry =
|
||||
fieldMetadataItem.defaultValue?.addressCountry &&
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ export const getCurrencyFieldPreviewValue = ({
|
||||
FieldMetadataType.CURRENCY,
|
||||
);
|
||||
|
||||
const placeholderDefaultValue = currencyFieldTypeConfig.exampleValue;
|
||||
const placeholderDefaultValue = currencyFieldTypeConfig.exampleValues?.[0];
|
||||
|
||||
return currencyFieldDefaultValueSchema
|
||||
.transform((value) => ({
|
||||
|
||||
+3
-3
@@ -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;
|
||||
|
||||
+1
-1
@@ -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 !== ''
|
||||
|
||||
Reference in New Issue
Block a user