Navigation Menu

Skip to content

Commit

Permalink
chore(project): resolve regex term (DSP-1654) (#444)
Browse files Browse the repository at this point in the history
  • Loading branch information
kilchenmann committed May 21, 2021
1 parent 1be88ea commit 739beba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/app/project/collaboration/add-user/add-user.component.ts
Expand Up @@ -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)')
);
}

Expand All @@ -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 = '';
Expand Down
4 changes: 2 additions & 2 deletions src/app/project/project-form/project-form.component.ts
Expand Up @@ -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)'));
}
}
},
Expand Down

0 comments on commit 739beba

Please sign in to comment.