Skip to content
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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

paula-stacho
Copy link
Contributor

@paula-stacho paula-stacho commented Mar 14, 2025

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

  • New tests and/or benchmarks are included
  • Documentation is changed or added
  • If this change updates the UI, screenshots/videos are added and a design review is requested
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@github-actions github-actions bot added the feat label Mar 14, 2025
@paula-stacho paula-stacho changed the title feat: validation errors COMPASS-8864 COMPASS-8867 COMPASS-8865 feat: show validation error details COMPASS-8864 COMPASS-8867 COMPASS-8865 Mar 14, 2025
@paula-stacho paula-stacho removed the wip label Mar 19, 2025
@paula-stacho paula-stacho marked this pull request as ready for review March 20, 2025 20:47
Copy link
Member

@Anemy Anemy left a 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);
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants