backstage-plugin-qeta icon indicating copy to clipboard operation
backstage-plugin-qeta copied to clipboard

Cannot create tags with uppercase letters

Open kewljedi opened this issue 9 months ago • 5 comments

If you try to create a tag with an upper case letter the result is a 400 {"errors":"Invalid tag","type":"body"}. In the UI the only indication of error is "Failed to create".

example taco is a valid tag while tAco is not.

Service: I believe the service should be changed to sanitize new tag names to be valid names, or to return a more specific error. tAco would save the tag taco.

UI: The best user experience would be that typing tAco into the create dialog would display taco as you type. The minimum user experience would be to change the error from "Failed to create" to "Failed to create: Upper case letters cannot be used".

kewljedi avatar Mar 20 '25 12:03 kewljedi

May I take care of this?

BlessingEmejulu avatar May 14 '25 03:05 BlessingEmejulu

@BlessingEmejulu absolutely!

drodil avatar May 14 '25 04:05 drodil

I think the best would be to format the tags on the fly in UI. So that they pass the tag validation. This basically means to apply trim, lowercase and replace whitespace with - (if I remember the validation correctly, on phone so cannot check) whenever a new tag is inputted

drodil avatar May 14 '25 11:05 drodil

Basically the change should be made here: https://github.com/drodil/backstage-plugin-qeta/blob/main/plugins%2Fqeta-react%2Fsrc%2Fcomponents%2FPostForm%2FTagInput.tsx#L143

drodil avatar May 14 '25 12:05 drodil

Noted, pls assign the issue to me @drodil

BlessingEmejulu avatar May 14 '25 15:05 BlessingEmejulu