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

feat: disallow non-ascii characters in desc field #217

Merged
merged 4 commits into from
Jun 25, 2020

Conversation

JasonChong96
Copy link
Contributor

@JasonChong96 JasonChong96 commented Jun 24, 2020

Problem

When users input descriptions, they're allowed to enter non-ascii characters such as chinese characters. Characters from other languages are not effectively indexed for search. Furthermore, GoGovSg is monolingual at the moment and visitors are unlikely to not know English.

Solution

Disallow non-ascii characters on both the input field and backend API validation.

Before & After Screenshots

AFTER:

image

Tests

There should be an error message and the save button greyed out when a non-english character (e.g chinese) is inputted in the description field.

@LoneRifle
Copy link
Contributor

The error message may be confusing to non-technical users (ie, "what is ASCII?"). Could you rephrase this?

@JasonChong96
Copy link
Contributor Author

The error message may be confusing to non-technical users (ie, "what is ASCII?"). Could you rephrase this?

Would saying that only english characters are allowed be less confusing?

@LoneRifle
Copy link
Contributor

We might need to have the designers involved. @pearlyong - thoughts?

@pearlyong
Copy link
Collaborator

Suggested:
Description cannot contain special characters

@JasonChong96
Copy link
Contributor Author

Changed to "Description should only contain alphanumeric characters and symbols" as per discussion.

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

Successfully merging this pull request may close these issues.

4 participants