(action: Action, formData: FormData, currency?: SupportedCurrencySymbol, timezoneId?: string)
| 46 | ]); |
| 47 | |
| 48 | function formFields(action: Action, formData: FormData, currency?: SupportedCurrencySymbol, timezoneId?: string) { |
| 49 | const fields: FormField[] = [ |
| 50 | { |
| 51 | name: 'action', |
| 52 | label: '', |
| 53 | type: 'hidden', |
| 54 | value: action, |
| 55 | overrideValue: action, |
| 56 | required: true, |
| 57 | readOnly: true, |
| 58 | }, |
| 59 | ]; |
| 60 | |
| 61 | if (action === 'change-email') { |
| 62 | fields.push({ |
| 63 | name: 'email', |
| 64 | label: 'Email', |
| 65 | type: 'email', |
| 66 | placeholder: 'jane.doe@example.com', |
| 67 | value: getFormDataField(formData, 'email'), |
| 68 | required: true, |
| 69 | }); |
| 70 | } else if (action === 'verify-change-email') { |
| 71 | fields.push({ |
| 72 | name: 'email', |
| 73 | label: 'Email', |
| 74 | type: 'email', |
| 75 | placeholder: 'jane.doe@example.com', |
| 76 | value: getFormDataField(formData, 'email'), |
| 77 | required: true, |
| 78 | }, { |
| 79 | name: 'verification-code', |
| 80 | label: 'Verification Code', |
| 81 | description: `The verification code to validate your new email.`, |
| 82 | type: 'text', |
| 83 | placeholder: '000000', |
| 84 | required: true, |
| 85 | }); |
| 86 | } else if (action === 'change-password') { |
| 87 | fields.push({ |
| 88 | name: 'current-password', |
| 89 | label: 'Current Password', |
| 90 | type: 'password', |
| 91 | placeholder: 'super-SECRET-passphrase', |
| 92 | required: true, |
| 93 | }, { |
| 94 | name: 'new-password', |
| 95 | label: 'New Password', |
| 96 | type: 'password', |
| 97 | placeholder: 'super-SECRET-passphrase', |
| 98 | required: true, |
| 99 | }); |
| 100 | } else if (action === 'change-dav-password') { |
| 101 | fields.push({ |
| 102 | name: 'new-dav-password', |
| 103 | label: 'New WebDav Password', |
| 104 | type: 'password', |
| 105 | placeholder: 'super-SECRET-passphrase', |
no test coverage detected