feat(employee-invite): fixed so that email-separator can be of many types, including space
Squashed commit of the following:
commit 9501644682a9e9a1a631e7c4b2d698a857df7a61
Merge: 885abdad 132aba21
Author: Aden Hassan <aden.hassan@arbetsformedlingen.se>
Date: Fri Oct 8 14:11:29 2021 +0200
Merge branch 'develop' into feature/TV-697
commit 885abdad3a304dee6df53a4d18d84118dd3a0ed8
Author: Aden Hassan <aden.hassan@arbetsformedlingen.se>
Date: Thu Oct 7 17:43:04 2021 +0200
fixed so that email-separator can be of many types including space
This commit is contained in:
@@ -31,8 +31,8 @@ export class EmployeeInviteComponent {
|
||||
|
||||
get emailsControlValueAsArray(): string[] {
|
||||
return (this.emailsControl.value as string)
|
||||
.replaceAll(/\n|\t|\r|\s/g, '')
|
||||
.split(',')
|
||||
.replaceAll(/\n|\t|\r/g, '')
|
||||
.split(/[\s,;:]+/)
|
||||
.filter(email => !!email);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ export function CommaSeparatedEmailValidator(): ValidatorFn {
|
||||
if (control && control.value) {
|
||||
const values: string[] = (control.value as string)
|
||||
.toLowerCase()
|
||||
.replaceAll(/\n|\t|\r|\s/g, '')
|
||||
.split(',');
|
||||
.replaceAll(/\n|\t|\r/g, '')
|
||||
.split(/[\s,;:]+/);
|
||||
const invalidEmailaddresses = [];
|
||||
|
||||
values.forEach(value => {
|
||||
|
||||
Reference in New Issue
Block a user