-
-
Notifications
You must be signed in to change notification settings - Fork 83
fix: createTag now checks for spaces in tags #213
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
Conversation
|
Added tests (also edited your tests since createTag's tests had spaces in them...). Also noticed that updateTag has the same issue while adding tests so added a check there + tests for that. And changed the error reporting to snackbar for both addTag and editTag (which also ignored the error). Also rebased the PR on master. let me know if there are any other changes needed. |
|
|
||
| if newKey != nil && *newKey != key { | ||
| if strings.Contains(*newKey, " ") { | ||
| return nil, fmt.Errorf("tag must not contain spaces") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here the transaction must be closed otherwise it will block further requests. (already did the change)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, missed that one.
jmattheis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
You mentioned in #72 that create tag page should not allow creating tags with spaces in them.
While fixing that I also noticed that the dialogue lets you actually make an empty tag!
And that the ui does not in any way react to receiving an error (e.g. duplicate tag).
So this PR tries to fix all of the above. CreateTag mutation now checks for empty tag and tags with spaces, and the ui shows the error similar to how other ui elements (e.g.
RelativeDateTimeSelector) do by adding a red text under the input box.