fix: createTag now checks for spaces in tags#213
Merged
Conversation
jmattheis
requested changes
Jun 3, 2025
Contributor
Author
|
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. |
jmattheis
reviewed
Jun 4, 2025
|
|
||
| if newKey != nil && *newKey != key { | ||
| if strings.Contains(*newKey, " ") { | ||
| return nil, fmt.Errorf("tag must not contain spaces") |
Member
There was a problem hiding this comment.
Here the transaction must be closed otherwise it will block further requests. (already did the change)
Contributor
Author
There was a problem hiding this comment.
Sorry, missed that one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.