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: Improve org name and slug validation #1924

Merged
merged 8 commits into from
Jul 16, 2024

Conversation

SuaYoo
Copy link
Collaborator

@SuaYoo SuaYoo commented Jul 15, 2024

Resolves #1892

Changes

  • Verifies org slug (name) availability when creating new org
  • Show org max length error when signing up
  • Highlights org error field when signing up
  • Fixes org name max length discrepancy
  • Standardizes org slug to lowercase

Screenshots

Page Image/video
Superadmin dashboard - New org dialog Screenshot 2024-07-15 at 12 03 16 PM
Self sign-up - Org form Screenshot 2024-07-15 at 11 02 26 AM

Screenshot 2024-07-15 at 11 01 23 AM

Screenshot 2024-07-15 at 11 01 46 AM

@SuaYoo SuaYoo marked this pull request as ready for review July 15, 2024 19:12
Copy link
Member

@emma-sg emma-sg left a comment

Choose a reason for hiding this comment

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

Do we want to call "org URL" something like "org identifier" instead? What we're asking for here isn't a URL, so this could be confusing. Other than that this all looks good!

frontend/src/utils/form.ts Outdated Show resolved Hide resolved
msg(
"This org URL is invalid. Please use alphanumeric characters and dashes (-) only.",
str`The org URL "${slug}" is not a valid URL. Please use alphanumeric characters and dashes (-) only`,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
str`The org URL "${slug}" is not a valid URL. Please use alphanumeric characters and dashes (-) only`,
str`"${slug}" is not a valid org URL. Please use only alphanumeric characters and dashes (-).`,

Copy link
Contributor

@tw4l tw4l left a comment

Choose a reason for hiding this comment

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

Same comments as Emma (though I think "URL identifier" works well), otherwise looks great. Nice work!

Co-authored-by: Emma Segal-Grossman <hi@emma.cafe>
@SuaYoo
Copy link
Collaborator Author

SuaYoo commented Jul 16, 2024

Same comments as Emma (though I think "URL identifier" works well), otherwise looks great. Nice work!

Makes sense to me, I just copied over the previously approved error messages--will go with org URL identifier to match the input label?

@SuaYoo SuaYoo merged commit 5e9e897 into main Jul 16, 2024
2 checks passed
@SuaYoo SuaYoo deleted the frontend-improve-org-name-slug-validation branch July 16, 2024 20:07
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.

[Feature]: Improve validation of org name and slug
3 participants