Browse Source

fix: Collaborate modal

pull/6512/head
Muhammed Mustafa 1 year ago
parent
commit
ad1866d865
  1. 10
      packages/nc-gui/components/dlg/share-and-collaborate/Collaborate.vue

10
packages/nc-gui/components/dlg/share-and-collaborate/Collaborate.vue

@ -4,6 +4,8 @@ const { loadUsers, users } = useManageUsers()
const formRef = ref()
const { t } = useI18n()
const useForm = Form.useForm
const validators = computed(() => {
return {
@ -11,12 +13,16 @@ const validators = computed(() => {
{
validator: (rule: any, value: string, callback: (errMsg?: string) => void) => {
if (!value || value.length === 0) {
callback('Email is required')
callback(t('msg.error.signUpRules.emailReqd'))
return
}
const invalidEmails = (value || '').split(/\s*,\s*/).filter((e: string) => !validateEmail(e))
if (invalidEmails.length > 0) {
callback(`${invalidEmails.length > 1 ? ' Invalid emails:' : 'Invalid email:'} ${invalidEmails.join(', ')} `)
callback(
`${
invalidEmails.length > 1 ? t('msg.error.signUpRules.invalidEmails') : t('msg.error.signUpRules.invalidEmail')
} ${invalidEmails.join(', ')} `,
)
} else {
callback()
}

Loading…
Cancel
Save