-
Notifications
You must be signed in to change notification settings - Fork 205
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
feat: show validation error details COMPASS-8864 COMPASS-8867 COMPASS-8865 #6797
base: main
Are you sure you want to change the base?
Conversation
9ac047e
to
b574c1e
Compare
f6402c1
to
dcfac20
Compare
923c030
to
2970a30
Compare
daf64ca
to
11cbc9a
Compare
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.
Nice! The insert document modal has been a place that has a lot of edge conditions, happy to see it moving to a functional component and becoming a bit easier to work with. Nice test adds and the error details are a good feature. Left a couple small questions and one or two suggestions.
// When closing the modal. | ||
// Remove the listeners to the BSON type validation errors in order to clean up properly. | ||
this.props.doc.removeListener(Element.Events.Invalid, this.handleInvalid); | ||
this.props.doc.removeListener(Element.Events.Valid, this.handleValid); | ||
doc.removeListener(Element.Events.Invalid, handleInvalid); |
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.
Should these be removing the listeners in a returned function since we want this on unmount?
Also should it be using isOpen
to manage the cleanup then as well since we're now keeping this modal around when isOpen
is set to false?
packages/compass-crud/src/components/insert-document-dialog.tsx
Outdated
Show resolved
Hide resolved
e3795a9
to
2dc5a54
Compare
Description
Combines the error details on insert, import and single update (the rest has been de-prioritized, but we might bring it in if we have extra time this week).
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes