|
|
@ -44,6 +44,20 @@ const insertOrUpdateString = (str: string) => { |
|
|
|
emailBadges.value.push(str) |
|
|
|
emailBadges.value.push(str) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const emailInputValidation = (input: string): boolean => { |
|
|
|
|
|
|
|
if (input.length < 1) { |
|
|
|
|
|
|
|
emailValidation.isError = true |
|
|
|
|
|
|
|
emailValidation.message = 'Email Should Not Be Empty' |
|
|
|
|
|
|
|
return false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!validateEmail(input.trim())) { |
|
|
|
|
|
|
|
emailValidation.isError = true |
|
|
|
|
|
|
|
emailValidation.message = 'Invalid Email' |
|
|
|
|
|
|
|
return false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
watch(inviteData, (newVal) => { |
|
|
|
watch(inviteData, (newVal) => { |
|
|
|
const isNewEmail = newVal.email.charAt(newVal.email.length - 1) === ',' || newVal.email.charAt(newVal.email.length - 1) === ' ' |
|
|
|
const isNewEmail = newVal.email.charAt(newVal.email.length - 1) === ',' || newVal.email.charAt(newVal.email.length - 1) === ' ' |
|
|
|
if (isNewEmail && newVal.email.trim().length > 1) { |
|
|
|
if (isNewEmail && newVal.email.trim().length > 1) { |
|
|
@ -71,16 +85,9 @@ watch(inviteData, (newVal) => { |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const handleEnter = () => { |
|
|
|
const handleEnter = () => { |
|
|
|
if (inviteData.email.length < 1) { |
|
|
|
const isEmailIsValid = emailInputValidation(inviteData.email) |
|
|
|
emailValidation.isError = true |
|
|
|
if (!isEmailIsValid) return |
|
|
|
emailValidation.message = 'Email Should Not Be Empty' |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!validateEmail(inviteData.email.trim())) { |
|
|
|
|
|
|
|
emailValidation.isError = true |
|
|
|
|
|
|
|
emailValidation.message = 'Invalid Email' |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
inviteData.email += ' ' |
|
|
|
inviteData.email += ' ' |
|
|
|
emailValidation.isError = false |
|
|
|
emailValidation.isError = false |
|
|
|
emailValidation.message = '' |
|
|
|
emailValidation.message = '' |
|
|
@ -144,16 +151,10 @@ const onPaste = (e: ClipboardEvent) => { |
|
|
|
inputArray[0] = inviteData.email += inputArray[0] |
|
|
|
inputArray[0] = inviteData.email += inputArray[0] |
|
|
|
} |
|
|
|
} |
|
|
|
inputArray?.forEach((el) => { |
|
|
|
inputArray?.forEach((el) => { |
|
|
|
if (el.length < 1) { |
|
|
|
const isEmailIsValid = emailInputValidation(el) |
|
|
|
emailValidation.isError = true |
|
|
|
|
|
|
|
emailValidation.message = 'Email Should Not Be Empty' |
|
|
|
if (!isEmailIsValid) return |
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!validateEmail(el.trim())) { |
|
|
|
|
|
|
|
emailValidation.isError = true |
|
|
|
|
|
|
|
emailValidation.message = 'Invalid Email' |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
if email is already enterd we delete the already |
|
|
|
if email is already enterd we delete the already |
|
|
|
existing email and add new one |
|
|
|
existing email and add new one |
|
|
@ -172,7 +173,6 @@ const onPaste = (e: ClipboardEvent) => { |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="my-2 pt-3 ml-2" data-testid="invite"> |
|
|
|
<div class="my-2 pt-3 ml-2" data-testid="invite"> |
|
|
|
<div class="text-xl mb-4">Invite</div> |
|
|
|
|
|
|
|
<div class="flex gap-2"> |
|
|
|
<div class="flex gap-2"> |
|
|
|
<div class="flex flex-col items-cenyet"> |
|
|
|
<div class="flex flex-col items-cenyet"> |
|
|
|
<div |
|
|
|
<div |
|
|
|