-
Notifications
You must be signed in to change notification settings - Fork 16
feat: add functionality for Constraint Validation API & types #2301
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
base: main
Are you sure you want to change the base?
feat: add functionality for Constraint Validation API & types #2301
Conversation
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.
Pull request overview
This PR adds form validation functionality based on the Constraint Validation API, including automated error handling, inline feedback, and error summaries.
- Implements a validation system using the Constraint Validation API with support for custom error messages
- Adds visual feedback for invalid form fields with inline error messages and an error summary component
- Creates comprehensive test coverage for validation behavior across different user interactions
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| components/o3-form/stories/formValidation.test.stories.tsx | Test suite validating error display, error summary, and progressive validation behavior |
| components/o3-form/stories/formValidation.stories.tsx | Storybook story demonstrating the form validation feature |
| components/o3-form/stories/FormValidationHtml.tsx | HTML template component with test data for validation demonstrations |
| components/o3-form/src/tsx/fieldComponents/Form.tsx | Adds optional id prop to Form component |
| components/o3-form/src/js/validation.js | Core validation logic with error collection, inline feedback, and error summary rendering |
| components/o3-form/src/css/components/error-summary.css | Fixes CSS class name typo from o3-forms__error-summary__list to o3-form__error-summary__list |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…idations-for-o-3-components
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.
Pull request overview
Copilot reviewed 6 out of 7 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…g escaping or encoding Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…idations-for-o-3-components
The issue came down to browsers rendering different text for the same errors. Short term fix for now is to assert on both error messages
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.
Pull request overview
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…idations-for-o-3-components

Describe your changes
Additional context
Checklist before requesting a review
percylabel for o-[COMPONENT] orchromaticlabel for o3-[COMPONENT] on my PR before merging and after review. Find more details in CONTRIBUTING.md