feat: add yup resolver for form validations & form submit handling #10
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.
This pull request introduces form validation and refactoring to the catalog editing workflow, ensuring that user input is validated before submission. The main changes include adding a Yup validation schema, integrating validation with React Hook Form, updating the UI to display error messages, and refactoring the modal to handle form submission.
Form Validation and Schema Integration
useYupValidationResolverto connect Yup validation with React Hook Form, allowing for synchronous error handling and validation feedback. [1] [2]UI and Error Feedback Enhancements
CatalogEditFormto display validation errors inline for each field, improving user feedback and form usability. [1] [2]messages.jsfile to include localized error messages for all validation scenarios.Component Refactoring and Submission Handling
CatalogEditFormto useforwardRefand expose asubmitFormmethod, enabling parent components to trigger form submission. [1] [2]useCatalogEditionModalto use a ref to the form and handle submission and modal closure based on validation results. [1] [2] [3] [4]Type Definitions
CorporateCatalogFormtype to restrict form fields to only those relevant for editingScreenshots