Skip to content

The open alternative to Salesforce, designed for AI.

Show example values as placeholders for composite fields in the record creation form (#28117)

Thomas Trompettefc33fa980726
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/components/FormFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/components/FormFieldInput.tsx
index 72b736dd0ce..a1b9cf772ca 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/components/FormFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/components/FormFieldInput.tsx
@@ -24,6 +24,7 @@ import { FormSelectFieldInput } from '@/object-record/record-field/ui/form-types
import { FormTextFieldInput } from '@/object-record/record-field/ui/form-types/components/FormTextFieldInput';
import { FormUuidFieldInput } from '@/object-record/record-field/ui/form-types/components/FormUuidFieldInput';
import { type FormFieldInputSettings } from '@/object-record/record-field/ui/form-types/types/FormFieldInputSettings';
+import { type FormFieldInputSubFieldPlaceholders } from '@/object-record/record-field/ui/form-types/types/FormFieldInputSubFieldPlaceholders';
import { type VariablePickerComponent } from '@/ui/input/types/VariablePickerComponent';
import { type FieldDefinition } from '@/object-record/record-field/ui/types/FieldDefinition';
import {
@@ -71,6 +72,7 @@ type FormFieldInputProps = {
VariablePicker?: VariablePickerComponent;
readonly?: boolean;
placeholder?: string;
+ subFieldPlaceholders?: FormFieldInputSubFieldPlaceholders;
error?: string;
onError?: (error: string | undefined) => void;
timeZone?: string;
@@ -85,6 +87,7 @@ export const FormFieldInput = ({
VariablePicker,
readonly,
placeholder,
+ subFieldPlaceholders,
error,
onError,
timeZone,
@@ -135,6 +138,7 @@ export const FormFieldInput = ({
onChange={onChange}
VariablePicker={VariablePicker}
readonly={readonly}
+ subFieldPlaceholders={subFieldPlaceholders}
/>
) : isFieldAddress(field) ? (
<FormAddressFieldInput
@@ -143,6 +147,7 @@ export const FormFieldInput = ({
onChange={onChange}
VariablePicker={VariablePicker}
readonly={readonly}
+ subFieldPlaceholders={subFieldPlaceholders}
/>
) : isFieldLinks(field) ? (
<FormLinksFieldInput
@@ -151,6 +156,7 @@ export const FormFieldInput = ({
onChange={onChange}
VariablePicker={VariablePicker}
readonly={readonly}
+ subFieldPlaceholders={subFieldPlaceholders}
maxNumberOfValues={field.metadata.settings?.maxNumberOfValues}
/>
) : isFieldEmails(field) ? (
@@ -160,6 +166,7 @@ export const FormFieldInput = ({
onChange={onChange}
VariablePicker={VariablePicker}
readonly={readonly}
+ subFieldPlaceholders={subFieldPlaceholders}
/>
) : isFieldFiles(field) ? (
<FormFilesFieldInput
@@ -177,6 +184,7 @@ export const FormFieldInput = ({
onChange={onChange}
VariablePicker={VariablePicker}
readonly={readonly}
+ subFieldPlaceholders={subFieldPlaceholders}
/>
) : isFieldDate(field) ? (
<FormDateFieldInput
@@ -236,6 +244,7 @@ export const FormFieldInput = ({
onChange={onChange}
VariablePicker={VariablePicker}
readonly={readonly}
+ subFieldPlaceholders={subFieldPlaceholders}
/>
) : isFieldRichText(field) ? (
isDefined(VariablePicker) ? (
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormAddressFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormAddressFieldInput.tsx
index 60f2ee495e6..0a4c4f59c08 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormAddressFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormAddressFieldInput.tsx
@@ -15,6 +15,7 @@ type FormAddressFieldInputProps = {
onChange: (value: FieldAddressValue) => void;
VariablePicker?: VariablePickerComponent;
readonly?: boolean;
+ subFieldPlaceholders?: Partial<Record<keyof FieldAddressDraftValue, string>>;
};
export const FormAddressFieldInput = ({
@@ -23,6 +24,7 @@ export const FormAddressFieldInput = ({
onChange,
readonly,
VariablePicker,
+ subFieldPlaceholders,
}: FormAddressFieldInputProps) => {
const handleChange =
(field: keyof FieldAddressDraftValue) => (updatedAddressPart: string) => {
@@ -50,7 +52,9 @@ export const FormAddressFieldInput = ({
onChange={handleChange('addressStreet1')}
readonly={readonly}
VariablePicker={VariablePicker}
- placeholder={t`Street address`}
+ placeholder={
+ subFieldPlaceholders?.addressStreet1 ?? t`Street address`
+ }
/>
<FormTextFieldInput
label={t`Address 2`}
@@ -58,7 +62,9 @@ export const FormAddressFieldInput = ({
onChange={handleChange('addressStreet2')}
readonly={readonly}
VariablePicker={VariablePicker}
- placeholder={t`Street address 2`}
+ placeholder={
+ subFieldPlaceholders?.addressStreet2 ?? t`Street address 2`
+ }
/>
<FormTextFieldInput
label={t`City`}
@@ -66,7 +72,7 @@ export const FormAddressFieldInput = ({
onChange={handleChange('addressCity')}
readonly={readonly}
VariablePicker={VariablePicker}
- placeholder={t`City`}
+ placeholder={subFieldPlaceholders?.addressCity ?? t`City`}
/>
<FormTextFieldInput
label={t`State`}
@@ -74,7 +80,7 @@ export const FormAddressFieldInput = ({
onChange={handleChange('addressState')}
readonly={readonly}
VariablePicker={VariablePicker}
- placeholder={t`State`}
+ placeholder={subFieldPlaceholders?.addressState ?? t`State`}
/>
<FormTextFieldInput
label={t`Post Code`}
@@ -82,7 +88,7 @@ export const FormAddressFieldInput = ({
onChange={handleChange('addressPostcode')}
readonly={readonly}
VariablePicker={VariablePicker}
- placeholder={t`Post Code`}
+ placeholder={subFieldPlaceholders?.addressPostcode ?? t`Post Code`}
/>
<FormCountrySelectInput
label={t`Country`}
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormCurrencyAmountFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormCurrencyAmountFieldInput.tsx
index 4f2bf9a9d87..596a3113a2b 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormCurrencyAmountFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormCurrencyAmountFieldInput.tsx
@@ -9,7 +9,13 @@ import { isStandaloneVariableString } from 'twenty-shared/workflow';
type FormCurrencyAmountFieldInputProps = Pick<
ComponentProps<typeof FormNumberFieldInput>,
- 'label' | 'defaultValue' | 'onChange' | 'VariablePicker' | 'readonly' | 'hint'
+ | 'label'
+ | 'defaultValue'
+ | 'onChange'
+ | 'VariablePicker'
+ | 'readonly'
+ | 'hint'
+ | 'placeholder'
>;
const getAmountFromAmountMicros = (
@@ -37,6 +43,7 @@ export const FormCurrencyAmountFieldInput = ({
VariablePicker,
readonly,
hint,
+ placeholder,
}: FormCurrencyAmountFieldInputProps) => {
return (
<FormNumberFieldInput
@@ -44,6 +51,7 @@ export const FormCurrencyAmountFieldInput = ({
VariablePicker={VariablePicker}
readonly={readonly}
hint={hint}
+ placeholder={placeholder}
defaultValue={getAmountFromAmountMicros(defaultValue)}
onChange={(newAmount) =>
onChange(
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormCurrencyFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormCurrencyFieldInput.tsx
index 98c6ca84ffb..1c5d0cae004 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormCurrencyFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormCurrencyFieldInput.tsx
@@ -20,6 +20,7 @@ type FormCurrencyFieldInputProps = {
VariablePicker?: VariablePickerComponent;
readonly?: boolean;
amountUnit?: FormFieldCurrencyInputSettings['amountUnit'];
+ subFieldPlaceholders?: Partial<Record<keyof FormFieldCurrencyValue, string>>;
};
export const FormCurrencyFieldInput = ({
@@ -29,6 +30,7 @@ export const FormCurrencyFieldInput = ({
VariablePicker,
readonly,
amountUnit = 'micros',
+ subFieldPlaceholders,
}: FormCurrencyFieldInputProps) => {
const localizedCurrencies = useCurrencies();
@@ -84,6 +86,7 @@ export const FormCurrencyFieldInput = ({
: undefined
}
defaultValue={defaultValue?.amountMicros ?? ''}
+ placeholder={subFieldPlaceholders?.amountMicros}
onChange={handleAmountMicrosChange}
VariablePicker={VariablePicker}
readonly={readonly}
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormEmailsFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormEmailsFieldInput.tsx
index 5467808e140..cd34b65a7df 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormEmailsFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormEmailsFieldInput.tsx
@@ -12,6 +12,7 @@ type FormEmailsFieldInputProps = {
onChange: (value: FieldEmailsValue) => void;
VariablePicker?: VariablePickerComponent;
readonly?: boolean;
+ subFieldPlaceholders?: Partial<Record<keyof FieldEmailsValue, string>>;
};
export const FormEmailsFieldInput = ({
@@ -20,6 +21,7 @@ export const FormEmailsFieldInput = ({
onChange,
readonly,
VariablePicker,
+ subFieldPlaceholders,
}: FormEmailsFieldInputProps) => {
const { t } = useLingui();
@@ -38,7 +40,7 @@ export const FormEmailsFieldInput = ({
label={t`Primary Email`}
defaultValue={defaultValue?.primaryEmail}
onChange={handleChange}
- placeholder={t`Primary Email`}
+ placeholder={subFieldPlaceholders?.primaryEmail ?? t`Primary Email`}
readonly={readonly}
VariablePicker={VariablePicker}
/>
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormFullNameFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormFullNameFieldInput.tsx
index ece10f6c3e6..4c454bf8f09 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormFullNameFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormFullNameFieldInput.tsx
@@ -13,6 +13,7 @@ type FormFullNameFieldInputProps = {
onChange: (value: FieldFullNameValue) => void;
VariablePicker?: VariablePickerComponent;
readonly?: boolean;
+ subFieldPlaceholders?: Partial<Record<keyof FieldFullNameValue, string>>;
};
export const FormFullNameFieldInput = ({
@@ -21,6 +22,7 @@ export const FormFullNameFieldInput = ({
onChange,
readonly,
VariablePicker,
+ subFieldPlaceholders,
}: FormFullNameFieldInputProps) => {
const handleFirstNameChange = (newText: string) => {
onChange({
@@ -44,7 +46,9 @@ export const FormFullNameFieldInput = ({
label={t`First Name`}
defaultValue={defaultValue?.firstName}
onChange={handleFirstNameChange}
- placeholder={addCharactersToAvoidPasswordManagers(t`First name`)}
+ placeholder={addCharactersToAvoidPasswordManagers(
+ subFieldPlaceholders?.firstName ?? t`First name`,
+ )}
readonly={readonly}
VariablePicker={VariablePicker}
/>
@@ -52,7 +56,9 @@ export const FormFullNameFieldInput = ({
label={t`Last Name`}
defaultValue={defaultValue?.lastName}
onChange={handleLastNameChange}
- placeholder={addCharactersToAvoidPasswordManagers(t`Last name`)}
+ placeholder={addCharactersToAvoidPasswordManagers(
+ subFieldPlaceholders?.lastName ?? t`Last name`,
+ )}
readonly={readonly}
VariablePicker={VariablePicker}
/>
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormLinksFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormLinksFieldInput.tsx
index 577d1938d74..83e8e8fc8a1 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormLinksFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormLinksFieldInput.tsx
@@ -19,7 +19,7 @@ type FormLinksFieldInputProps = {
onChange: (value: FormFieldLinksValue) => void;
VariablePicker?: VariablePickerComponent;
readonly?: boolean;
- placeholder?: string;
+ subFieldPlaceholders?: Partial<Record<keyof FieldLinksDraftValue, string>>;
maxNumberOfValues?: number | null;
};
@@ -29,7 +29,7 @@ export const FormLinksFieldInput = ({
onChange,
readonly,
VariablePicker,
- placeholder,
+ subFieldPlaceholders,
maxNumberOfValues,
}: FormLinksFieldInputProps) => {
const allowsSecondaryLinks = maxNumberOfValues !== 1;
@@ -74,7 +74,9 @@ export const FormLinksFieldInput = ({
label={t`Primary Link Label`}
defaultValue={defaultValue?.primaryLinkLabel}
onChange={handleChange('primaryLinkLabel')}
- placeholder={placeholder ?? t`Primary Link Label`}
+ placeholder={
+ subFieldPlaceholders?.primaryLinkLabel ?? t`Primary Link Label`
+ }
readonly={readonly}
VariablePicker={VariablePicker}
/>
@@ -82,7 +84,9 @@ export const FormLinksFieldInput = ({
label={t`Primary Link URL`}
defaultValue={defaultValue?.primaryLinkUrl}
onChange={handleChange('primaryLinkUrl')}
- placeholder={placeholder ?? t`Primary Link URL`}
+ placeholder={
+ subFieldPlaceholders?.primaryLinkUrl ?? t`Primary Link URL`
+ }
readonly={readonly}
VariablePicker={VariablePicker}
/>
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormPhoneFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormPhoneFieldInput.tsx
index c274e22ce03..0129279a938 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormPhoneFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormPhoneFieldInput.tsx
@@ -16,6 +16,7 @@ type FormPhoneFieldInputProps = {
onChange: (value: FieldPhonesValue) => void;
VariablePicker?: VariablePickerComponent;
readonly?: boolean;
+ subFieldPlaceholders?: Partial<Record<keyof FieldPhonesValue, string>>;
};
export const FormPhoneFieldInput = ({
@@ -24,6 +25,7 @@ export const FormPhoneFieldInput = ({
onChange,
readonly,
VariablePicker,
+ subFieldPlaceholders,
}: FormPhoneFieldInputProps) => {
const handleCallingCodeChange = (
newValue: FormCallingCodeSelectInputUpdatedValue,
@@ -60,7 +62,9 @@ export const FormPhoneFieldInput = ({
defaultValue={defaultValue?.primaryPhoneNumber ?? ''}
onChange={handleNumberChange}
VariablePicker={VariablePicker}
- placeholder={t`Enter phone number`}
+ placeholder={
+ subFieldPlaceholders?.primaryPhoneNumber ?? t`Enter phone number`
+ }
hint={t`Without calling code`}
readonly={readonly}
/>
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/__stories__/FormCurrencyFieldInput.stories.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/__stories__/FormCurrencyFieldInput.stories.tsx
index 94f547b6219..a6b060e5e16 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/__stories__/FormCurrencyFieldInput.stories.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/__stories__/FormCurrencyFieldInput.stories.tsx
@@ -88,3 +88,16 @@ export const Disabled: Story = {
expect(variablePickers).toHaveLength(0);
},
};
+
+export const WithSubFieldPlaceholders: Story = {
+ args: {
+ label: 'Amount',
+ amountUnit: 'units',
+ subFieldPlaceholders: { amountMicros: '2000' },
+ },
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+
+ expect(await canvas.findByPlaceholderText('2000')).toBeVisible();
+ },
+};
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/types/FormFieldInputSubFieldPlaceholders.ts b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/types/FormFieldInputSubFieldPlaceholders.ts
new file mode 100644
index 00000000000..a4126c67463
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/types/FormFieldInputSubFieldPlaceholders.ts
@@ -0,0 +1,22 @@
+import {
+ type FieldAddressDraftValue,
+ type FieldLinksDraftValue,
+} from '@/object-record/record-field/ui/types/FieldInputDraftValue';
+import {
+ type FieldEmailsValue,
+ type FieldFullNameValue,
+ type FieldPhonesValue,
+ type FormFieldCurrencyValue,
+} from '@/object-record/record-field/ui/types/FieldMetadata';
+
+export type FormFieldInputSubFieldPlaceholders = Partial<
+ Record<
+ | keyof FieldAddressDraftValue
+ | keyof FormFieldCurrencyValue
+ | keyof FieldEmailsValue
+ | keyof FieldFullNameValue
+ | keyof FieldLinksDraftValue
+ | keyof FieldPhonesValue,
+ string
+ >
+>;
diff --git a/packages/twenty-front/src/modules/object-record/record-form/components/RecordFormFieldInputs.tsx b/packages/twenty-front/src/modules/object-record/record-form/components/RecordFormFieldInputs.tsx
index eda4c0362f3..f8420596302 100644
--- a/packages/twenty-front/src/modules/object-record/record-form/components/RecordFormFieldInputs.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-form/components/RecordFormFieldInputs.tsx
@@ -51,9 +51,8 @@ export const RecordFormFieldInputs = ({
{fieldMetadataItems.map((fieldMetadataItem) => {
const gqlFieldName =
getFieldMetadataItemGqlFieldName(fieldMetadataItem);
- const { placeholder } = getRecordFormFieldPlaceholders(
- fieldMetadataItem.type,
- );
+ const { placeholder, subFieldPlaceholders } =
+ getRecordFormFieldPlaceholders(fieldMetadataItem.type);
return (
<Field.Root key={fieldMetadataItem.id}>
@@ -74,6 +73,7 @@ export const RecordFormFieldInputs = ({
fieldMetadataItem.type,
)}
placeholder={placeholder}
+ subFieldPlaceholders={subFieldPlaceholders}
/>
{(
validationRuleViolationsByFieldMetadataId[
diff --git a/packages/twenty-front/src/modules/object-record/record-form/utils/__tests__/getRecordFormFieldPlaceholders.test.ts b/packages/twenty-front/src/modules/object-record/record-form/utils/__tests__/getRecordFormFieldPlaceholders.test.ts
index f91c0d08a38..ee8277632d7 100644
--- a/packages/twenty-front/src/modules/object-record/record-form/utils/__tests__/getRecordFormFieldPlaceholders.test.ts
+++ b/packages/twenty-front/src/modules/object-record/record-form/utils/__tests__/getRecordFormFieldPlaceholders.test.ts
@@ -14,6 +14,28 @@ describe('getRecordFormFieldPlaceholders', () => {
});
});
+ it('should show currency amounts in units, as the form takes them', () => {
+ expect(getRecordFormFieldPlaceholders(FieldMetadataType.CURRENCY)).toEqual({
+ subFieldPlaceholders: { amountMicros: '2000' },
+ });
+ });
+
+ it('should give a placeholder to each text sub-field of composite fields', () => {
+ expect(getRecordFormFieldPlaceholders(FieldMetadataType.FULL_NAME)).toEqual(
+ {
+ subFieldPlaceholders: { firstName: 'John', lastName: 'Doe' },
+ },
+ );
+ expect(getRecordFormFieldPlaceholders(FieldMetadataType.ADDRESS)).toEqual({
+ subFieldPlaceholders: {
+ addressStreet1: '456 Oak Street',
+ addressCity: 'Springfield',
+ addressState: 'California',
+ addressPostcode: '90210',
+ },
+ });
+ });
+
it.each([
FieldMetadataType.TEXT,
FieldMetadataType.SELECT,
diff --git a/packages/twenty-front/src/modules/object-record/record-form/utils/getRecordFormFieldPlaceholders.ts b/packages/twenty-front/src/modules/object-record/record-form/utils/getRecordFormFieldPlaceholders.ts
index 8d467db5569..82fda6395bf 100644
--- a/packages/twenty-front/src/modules/object-record/record-form/utils/getRecordFormFieldPlaceholders.ts
+++ b/packages/twenty-front/src/modules/object-record/record-form/utils/getRecordFormFieldPlaceholders.ts
@@ -1,9 +1,15 @@
+import { type FormFieldInputSubFieldPlaceholders } from '@/object-record/record-field/ui/form-types/types/FormFieldInputSubFieldPlaceholders';
+import { SETTINGS_COMPOSITE_FIELD_TYPE_CONFIGS } from '@/settings/data-model/constants/SettingsCompositeFieldTypeConfigs';
import { SETTINGS_NON_COMPOSITE_FIELD_TYPE_CONFIGS } from '@/settings/data-model/constants/SettingsNonCompositeFieldTypeConfigs';
-import { isDefined } from 'twenty-shared/utils';
+import {
+ convertCurrencyMicrosToCurrencyAmount,
+ isDefined,
+} from 'twenty-shared/utils';
import { FieldMetadataType } from '~/generated-metadata/graphql';
type RecordFormFieldPlaceholders = {
placeholder?: string;
+ subFieldPlaceholders?: FormFieldInputSubFieldPlaceholders;
};
const getNonCompositeExampleValue = (
@@ -30,6 +36,55 @@ export const getRecordFormFieldPlaceholders = (
? { placeholder: JSON.stringify(exampleValue) }
: {};
}
+ case FieldMetadataType.CURRENCY: {
+ const [{ amountMicros }] =
+ SETTINGS_COMPOSITE_FIELD_TYPE_CONFIGS[fieldType].exampleValues;
+
+ return {
+ subFieldPlaceholders: {
+ amountMicros: String(
+ convertCurrencyMicrosToCurrencyAmount(amountMicros),
+ ),
+ },
+ };
+ }
+ case FieldMetadataType.EMAILS: {
+ const [{ primaryEmail }] =
+ SETTINGS_COMPOSITE_FIELD_TYPE_CONFIGS[fieldType].exampleValues;
+
+ return { subFieldPlaceholders: { primaryEmail } };
+ }
+ case FieldMetadataType.LINKS: {
+ const [{ primaryLinkUrl }] =
+ SETTINGS_COMPOSITE_FIELD_TYPE_CONFIGS[fieldType].exampleValues;
+
+ return { subFieldPlaceholders: { primaryLinkUrl } };
+ }
+ case FieldMetadataType.PHONES: {
+ const [{ primaryPhoneNumber }] =
+ SETTINGS_COMPOSITE_FIELD_TYPE_CONFIGS[fieldType].exampleValues;
+
+ return { subFieldPlaceholders: { primaryPhoneNumber } };
+ }
+ case FieldMetadataType.FULL_NAME: {
+ const [{ firstName, lastName }] =
+ SETTINGS_COMPOSITE_FIELD_TYPE_CONFIGS[fieldType].exampleValues;
+
+ return { subFieldPlaceholders: { firstName, lastName } };
+ }
+ case FieldMetadataType.ADDRESS: {
+ const [{ addressStreet1, addressCity, addressState, addressPostcode }] =
+ SETTINGS_COMPOSITE_FIELD_TYPE_CONFIGS[fieldType].exampleValues;
+
+ return {
+ subFieldPlaceholders: {
+ addressStreet1,
+ addressCity,
+ addressState,
+ addressPostcode,
+ },
+ };
+ }
default:
return {};
}