Repository navigation
fix(web): Handle duplicate library settings gracefully - #6950
Merged
Merged
Conversation
2 of 3 tasks
jrasm91
approved these changes
Feb 7, 2024
danieldietzler
approved these changes
Feb 7, 2024
Comment on lines
+51
to
+55
| // Check so that exclusion pattern isn't duplicated | ||
| if (!library.exclusionPatterns.includes(exclusionPatternToAdd)) { | ||
| library.exclusionPatterns.push(exclusionPatternToAdd); | ||
| exclusionPatterns = library.exclusionPatterns; | ||
| } |
Member
There was a problem hiding this comment.
We're doing that check in 3 different places or so. Not sure if I'm a huge fan of this...
Collaborator
Author
There was a problem hiding this comment.
We check both in the modal for add/edit and in the handle function. I think both are needed. I'll likely also add a check in the server to prevent duplicates submitted via API.
Member
There was a problem hiding this comment.
Another option is to not do anything client side and auto dedupe server side instead
Collaborator
Author
There was a problem hiding this comment.
We still need to dedupe client side because of the client-side bugs in #6694. I'll address the server side in another PR
…handle-duplicate-import-paths
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.
Don't allow adding duplicate import paths. Disable save button if input is empty or duplicate. Add error text if duplicate path.

Add text saying import paths are empty

Also, the same thing for exclusion patterns