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

Admin UI: Product create page disallows . in the name #2304

Closed
skid opened this issue Jul 20, 2023 · 2 comments
Closed

Admin UI: Product create page disallows . in the name #2304

skid opened this issue Jul 20, 2023 · 2 comments
Assignees
Labels
type: bug 🐛 Something isn't working

Comments

@skid
Copy link
Contributor

skid commented Jul 20, 2023

This happens on all versions of Vendure (AFAICT). Try to create a new product, and type a period . in the product name. The "create" button becomes disabled. If you create the product without the dot, you can later edit the name and put the dot back in.

This is very confusing for users, since there's no explanation why the create button is disabled, especially since there is no real validation error - dots are actually allowed.

To Reproduce

  1. Go to the admin UI -> create new product
  2. Start typing a name, then finish it with a period .

Expected behavior
Dots in the product name should not have any special effects.

Environment (please complete the following information):

  • @vendure/core version: 2.0.1, 1.9.X
@skid skid added the type: bug 🐛 Something isn't working label Jul 20, 2023
@oidt
Copy link
Contributor

oidt commented Jul 20, 2023

looks like a slug problem

slug: ['', unicodePatternValidator(/^[\p{Letter}0-9_-]+$/)],

maybe this slug check?

image

@michaelbromley
Copy link
Member

Yes it's the period being disallowed by the validator. But actually, periods are OK in URLs so we should allow them in slugs:

2.3. Unreserved Characters

Characters that are allowed in a URI but do not have a reserved
purpose are called unreserved. These include uppercase and lowercase
letters, decimal digits, hyphen, period, underscore, and tilde.

 unreserved  = ALPHA / DIGIT / "-" / "." / "_" / "~"

source: https://www.ietf.org/rfc/rfc3986.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants