-
Notifications
You must be signed in to change notification settings - Fork 49
Update edit and create validators with workspace IDs to disallow duplicates #1838
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
Reviewer's GuideValidators for creating and editing workspaces are updated to pull the current list of workspaces from Redux and refine the duplicate-name check to exclude the workspace being edited, and a new localized error message is added. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1838 +/- ##
==========================================
- Coverage 35.68% 35.62% -0.06%
==========================================
Files 216 216
Lines 6389 6402 +13
Branches 1692 1699 +7
==========================================
+ Hits 2280 2281 +1
- Misses 3849 3859 +10
- Partials 260 262 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Hey @apinkert - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@@ -44,6 +44,10 @@ const setWorkspace = (state: WorkspacesStore, { payload }: { payload: { data: Wo | |||
isLoading: false, | |||
}); | |||
|
|||
export const isWorkspace = (data: unknown | Workspace): data is Workspace => { |
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.
@Hyperkid123 Great suggestion. This is definitely cleaner and allowed me to delete the casting in each validator for id
For RHCLOUD-39757. On edit, the workspace name validator would always come up as a duplicate because its name already existed in the
allWorkspaces
array which would prevent being able to submit on description change only.Summary by Sourcery
Enhance workspace name validation to ignore the current workspace’s ID and prevent false duplicate errors on create and edit forms
Bug Fixes:
Enhancements: