MCPcopy Create free account
hub / github.com/bewcloud/bewcloud / Settings

Function Settings

components/Settings.ts:148–295  ·  view source on GitHub ↗
(
  {
    formData: formDataObject,
    error,
    notice,
    currency,
    timezoneId,
    isExpensesAppEnabled,
    isMultiFactorAuthEnabled,
    isCalendarAppEnabled,
    helpEmail,
    user,
  }: SettingsProps,
)

Source from the content-addressed store, hash-verified

146}
147
148export default function Settings(
149 {
150 formData: formDataObject,
151 error,
152 notice,
153 currency,
154 timezoneId,
155 isExpensesAppEnabled,
156 isMultiFactorAuthEnabled,
157 isCalendarAppEnabled,
158 helpEmail,
159 user,
160 }: SettingsProps,
161): string {
162 const formData = convertObjectToFormData(formDataObject);
163
164 const multiFactorAuthMethods = getEnabledMultiFactorAuthMethodsFromUser(user);
165
166 return html`
167 <section class="mx-auto max-w-7xl my-8">
168 ${error
169 ? html`
170 <section class="notification-error">
171 <h3>${escapeHtml(error.title)}</h3>
172 <p>${escapeHtml(error.message)}</p>
173 </section>
174 `
175 : ''} ${notice
176 ? html`
177 <section class="notification-success">
178 <h3>${escapeHtml(notice.title)}</h3>
179 <p>${escapeHtml(notice.message)}</p>
180 </section>
181 `
182 : ''}
183
184 <h2 class="text-2xl mb-4 text-left px-4 max-w-3xl mx-auto lg:min-w-96">Change your email</h2>
185
186 <form method="POST" class="mb-12">
187 ${formFields('change-email', formData).map((field) => generateFieldHtml(field, formData)).join('')}
188 <section class="flex justify-end mt-8 mb-4">
189 <button class="button-secondary" type="submit">Change email</button>
190 </section>
191 </form>
192
193 <h2 class="text-2xl mb-4 text-left px-4 max-w-3xl mx-auto lg:min-w-96">Change your password</h2>
194
195 <form method="POST" class="mb-12">
196 ${formFields('change-password', formData).map((field) => generateFieldHtml(field, formData)).join('')}
197 <section class="flex justify-end mt-8 mb-4">
198 <button class="button-secondary" type="submit">Change password</button>
199 </section>
200 </form>
201
202 <h2 class="text-2xl mb-4 text-left px-4 max-w-3xl mx-auto lg:min-w-96">Change your WebDav password</h2>
203
204 <form method="POST" class="mb-12">
205 ${formFields('change-dav-password', formData).map((field) => generateFieldHtml(field, formData)).join('')}

Callers

nothing calls this directly

Calls 6

convertObjectToFormDataFunction · 0.90
escapeHtmlFunction · 0.90
generateFieldHtmlFunction · 0.90
formFieldsFunction · 0.70
LoadingFunction · 0.70

Tested by

no test coverage detected