mirror of
https://github.com/YunoHost/yunohost-portal.git
synced 2024-09-03 20:06:23 +02:00
edit: display primary mail adress
This commit is contained in:
parent
8e177e6907
commit
33a9028da9
2 changed files with 9 additions and 3 deletions
|
@ -2,7 +2,7 @@
|
||||||
import { useForm } from 'vee-validate'
|
import { useForm } from 'vee-validate'
|
||||||
import { toTypedSchema } from '@vee-validate/yup'
|
import { toTypedSchema } from '@vee-validate/yup'
|
||||||
import * as yup from 'yup'
|
import * as yup from 'yup'
|
||||||
import { pick } from '@/utils/common'
|
import { exclude, pick } from '@/utils/common'
|
||||||
import type { User } from '@/composables/states'
|
import type { User } from '@/composables/states'
|
||||||
import type { Feedback } from '@/composables/form'
|
import type { Feedback } from '@/composables/form'
|
||||||
|
|
||||||
|
@ -16,12 +16,13 @@ const { handleSubmit, setFieldError, resetForm, meta } = useForm({
|
||||||
validationSchema: toTypedSchema(
|
validationSchema: toTypedSchema(
|
||||||
yup.object({
|
yup.object({
|
||||||
fullname: yup.string().required().min(2),
|
fullname: yup.string().required().min(2),
|
||||||
|
mail: yup.string(),
|
||||||
mailalias: yup.array().of(yup.string().email().required()).required(),
|
mailalias: yup.array().of(yup.string().email().required()).required(),
|
||||||
mailforward: yup.array().of(yup.string().email().required()).required(),
|
mailforward: yup.array().of(yup.string().email().required()).required(),
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
initialValues: {
|
initialValues: {
|
||||||
...pick(user.value, 'fullname', 'mailalias', 'mailforward'),
|
...pick(user.value, 'fullname', 'mail', 'mailalias', 'mailforward'),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -43,7 +44,7 @@ const onSubmit = handleSubmit(async (form) => {
|
||||||
Pick<User, 'fullname' | 'mailalias' | 'mailforward'>
|
Pick<User, 'fullname' | 'mailalias' | 'mailforward'>
|
||||||
>('/update', {
|
>('/update', {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
body: form,
|
body: exclude(form, 'mail'),
|
||||||
})
|
})
|
||||||
|
|
||||||
if (error.value) {
|
if (error.value) {
|
||||||
|
@ -91,6 +92,10 @@ const onSubmit = handleSubmit(async (form) => {
|
||||||
/>
|
/>
|
||||||
</FormField>
|
</FormField>
|
||||||
|
|
||||||
|
<FormField name="mail" :label="$t('primary_mail_adress')" class="mb-10">
|
||||||
|
<TextInput name="mail" type="text" class="w-full" disabled />
|
||||||
|
</FormField>
|
||||||
|
|
||||||
<TextInputList
|
<TextInputList
|
||||||
name="mailalias"
|
name="mailalias"
|
||||||
type="email"
|
type="email"
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
"password": "Password",
|
"password": "Password",
|
||||||
"possibly_invalid_password": "Password is possibly invalid",
|
"possibly_invalid_password": "Password is possibly invalid",
|
||||||
"possibly_invalid_username": "Username is possibly invalid",
|
"possibly_invalid_username": "Username is possibly invalid",
|
||||||
|
"primary_mail_adress": "Primary mail adress",
|
||||||
"remove": "Remove",
|
"remove": "Remove",
|
||||||
"save": "Save",
|
"save": "Save",
|
||||||
"skip_link": {
|
"skip_link": {
|
||||||
|
|
Loading…
Add table
Reference in a new issue