({
formData: formDataObject,
error,
notice,
currency,
timezoneId,
isExpensesAppEnabled,
isMultiFactorAuthEnabled,
isCalendarAppEnabled,
helpEmail,
user
})
| 100 | return fields; |
| 101 | } |
| 102 | export default function Settings({ |
| 103 | formData: formDataObject, |
| 104 | error, |
| 105 | notice, |
| 106 | currency, |
| 107 | timezoneId, |
| 108 | isExpensesAppEnabled, |
| 109 | isMultiFactorAuthEnabled, |
| 110 | isCalendarAppEnabled, |
| 111 | helpEmail, |
| 112 | user |
| 113 | }) { |
| 114 | const formData = convertObjectToFormData(formDataObject); |
| 115 | const multiFactorAuthMethods = getEnabledMultiFactorAuthMethodsFromUser(user); |
| 116 | return html` |
| 117 | <section class="mx-auto max-w-7xl my-8"> |
| 118 | ${error ? html` |
| 119 | <section class="notification-error"> |
| 120 | <h3>${escapeHtml(error.title)}</h3> |
| 121 | <p>${escapeHtml(error.message)}</p> |
| 122 | </section> |
| 123 | ` : ''} ${notice ? html` |
| 124 | <section class="notification-success"> |
| 125 | <h3>${escapeHtml(notice.title)}</h3> |
| 126 | <p>${escapeHtml(notice.message)}</p> |
| 127 | </section> |
| 128 | ` : ''} |
| 129 | |
| 130 | <h2 class="text-2xl mb-4 text-left px-4 max-w-3xl mx-auto lg:min-w-96">Change your email</h2> |
| 131 | |
| 132 | <form method="POST" class="mb-12"> |
| 133 | ${formFields('change-email', formData).map(field => generateFieldHtml(field, formData)).join('')} |
| 134 | <section class="flex justify-end mt-8 mb-4"> |
| 135 | <button class="button-secondary" type="submit">Change email</button> |
| 136 | </section> |
| 137 | </form> |
| 138 | |
| 139 | <h2 class="text-2xl mb-4 text-left px-4 max-w-3xl mx-auto lg:min-w-96">Change your password</h2> |
| 140 | |
| 141 | <form method="POST" class="mb-12"> |
| 142 | ${formFields('change-password', formData).map(field => generateFieldHtml(field, formData)).join('')} |
| 143 | <section class="flex justify-end mt-8 mb-4"> |
| 144 | <button class="button-secondary" type="submit">Change password</button> |
| 145 | </section> |
| 146 | </form> |
| 147 | |
| 148 | <h2 class="text-2xl mb-4 text-left px-4 max-w-3xl mx-auto lg:min-w-96">Change your WebDav password</h2> |
| 149 | |
| 150 | <form method="POST" class="mb-12"> |
| 151 | ${formFields('change-dav-password', formData).map(field => generateFieldHtml(field, formData)).join('')} |
| 152 | <section class="flex justify-end mt-8 mb-4"> |
| 153 | <button class="button-secondary" type="submit">Change WebDav password</button> |
| 154 | </section> |
| 155 | </form> |
| 156 | |
| 157 | ${isExpensesAppEnabled ? html` |
| 158 | <h2 class="text-2xl mb-4 text-left px-4 max-w-3xl mx-auto lg:min-w-96">Change your currency</h2> |
| 159 | <p class="text-left mt-2 mb-6 px-4 max-w-3xl mx-auto lg:min-w-96"> |
no test coverage detected