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:
Aden Hassan
2021-10-08 14:14:11 +02:00
parent 132aba21d8
commit 916550465c
2 changed files with 4 additions and 4 deletions

View File

@@ -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);
}

View File

@@ -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 => {