Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix: Update name param to include more characters #320

Merged

Conversation

jayllo-c
Copy link

@jayllo-c jayllo-c commented Apr 3, 2024

Fixes #319

Currently, the name accepts alphanumerical characters, spaces, and
forward slashes. This will allow the majority of names to be added
into the app.

However, it has come to light that there are names which would contain
other characters that would throw errors if users attempt to add these
names in, which is problematic since some special characters like .
and , are common.

Let's allow several other characters in the regex for names.

In doing so, we can ensure that most common names will be successfully
added into the application.

jayllo-c added 3 commits April 2, 2024 23:07
Currently, the name accepts alphanumerical characters, spaces, and
forward slashes. This will allow the majority of names to be added
into the app.

However, it has come to light that there are names which would contain
other characters that would throw errors if users attempt to add these
names in, which is problematic since some special characters like `.`
and `,` are common.

Let's allow several other characters in the regex for names.

In doing so, we can ensure that most common names will be successfully
added into the application.
@jayllo-c jayllo-c added this to the v1.3 milestone Apr 3, 2024
@jayllo-c jayllo-c self-assigned this Apr 3, 2024
Copy link

@Pughal77 Pughal77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice changes!

+ "and it should not be blank";

/*
* The first character of the address must not be a whitespace,
* otherwise " " (a blank string) becomes a valid input.
*/
public static final String VALIDATION_REGEX = "[\\p{Alnum}][\\p{Alnum} /]{1,79}";
public static final String VALIDATION_REGEX = "[\\p{Alnum}][\\p{Alnum} ,-./()]{1,79}";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice that the message constraints is all managed in one place!

@Zer0Legion Zer0Legion merged commit f6ac56e into AY2324S2-CS2103T-T10-1:master Apr 3, 2024
3 checks passed

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, if not we cant even add our groupmate's name inside!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug fix: Update name param to include more characters
3 participants