Skip to content
Permalink
Browse files
chore(project): resolve regex term (DSP-1654) (#444)
  • Loading branch information
kilchenmann committed May 21, 2021
1 parent 1be88ea commit 739bebab58e6a89cb79a8d85cf1d3d5f514f23f0
Showing with 6 additions and 6 deletions.
  1. +4 −4 src/app/project/collaboration/add-user/add-user.component.ts
  2. +2 −2 src/app/project/project-form/project-form.component.ts
@@ -149,11 +149,11 @@ export class AddUserComponent implements OnInit {
// if the user is already member of the project
// add the email to the list of existing
this.existingEmailInProject.push(
new RegExp('(?:^|\W)' + m.email.toLowerCase() + '(?:$|\W)')
new RegExp('(?:^|W)' + m.email.toLowerCase() + '(?:$|W)')
);
// add username to the list of existing
this.existingUsernameInProject.push(
new RegExp('(?:^|\W)' + m.username.toLowerCase() + '(?:$|\W)')
new RegExp('(?:^|W)' + m.username.toLowerCase() + '(?:$|W)')
);
}

@@ -163,11 +163,11 @@ export class AddUserComponent implements OnInit {
// if the user is already member of the project
// add the email to the list of existing
this.existingEmails.push(
new RegExp('(?:^|\W)' + u.email.toLowerCase() + '(?:$|\W)')
new RegExp('(?:^|W)' + u.email.toLowerCase() + '(?:$|W)')
);
// add username to the list of existing
this.existingUsernames.push(
new RegExp('(?:^|\W)' + u.username.toLowerCase() + '(?:$|\W)')
new RegExp('(?:^|W)' + u.username.toLowerCase() + '(?:$|W)')
);

let existsInProject = '';
@@ -172,10 +172,10 @@ export class ProjectFormComponent implements OnInit {

for (const project of response.body.projects) {

this.existingShortNames.push(new RegExp('(?:^|\W)' + project.shortname.toLowerCase() + '(?:$|\W)'));
this.existingShortNames.push(new RegExp('(?:^|W)' + project.shortname.toLowerCase() + '(?:$|W)'));

if (project.shortcode !== null) {
this.existingShortcodes.push(new RegExp('(?:^|\W)' + project.shortcode.toLowerCase() + '(?:$|\W)'));
this.existingShortcodes.push(new RegExp('(?:^|W)' + project.shortcode.toLowerCase() + '(?:$|W)'));
}
}
},

0 comments on commit 739beba

Please sign in to comment.