-
Notifications
You must be signed in to change notification settings - Fork 3k
feat: FIT-391: Validate Project Name field on Create Project and General Settings page #8041
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: develop
Are you sure you want to change the base?
feat: FIT-391: Validate Project Name field on Create Project and General Settings page #8041
Conversation
…t-users-not-fill-mandatory-fields
✅ Deploy Preview for heartex-docs canceled.
|
✅ Deploy Preview for label-studio-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for label-studio-playground ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for label-studio-docs-new-theme canceled.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #8041 +/- ##
===========================================
- Coverage 70.48% 65.96% -4.52%
===========================================
Files 720 504 -216
Lines 52128 34141 -17987
Branches 8813 8813
===========================================
- Hits 36741 22521 -14220
+ Misses 15384 11617 -3767
Partials 3 3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… not the bottom. Moves submit container below form.
…e displayed at the top.
…play. Enhances FormField to support error state and updates Input component to reflect error styles. Adjusts GeneralSettings to trigger validation on blur and refines layout for better user experience.
…ield.jsx, enhancing its structure and maintaining functionality. Updates Input component to utilize the new FormField structure for improved validation handling and error display.
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 comprehensive validation for project names on both the Create Project modal and General Settings page. The validation includes minimum/maximum length requirements (3-50 characters) and displays real-time error messages to improve user experience.
Key Changes:
- Added
minLength
andmaxLength
validators with configurable character limits - Implemented real-time form validation with immediate error feedback on blur events
- Enhanced error message consistency by removing field names from validation messages
- Added visual error states with red borders and error styling for invalid inputs
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
web/libs/datamanager/src/components/Common/Form/Validation/Validators.js | Updated error messages to remove field names for consistency |
web/libs/datamanager/src/components/Common/Form/Validation/Validation.scss | Removed top margin and updated spacing with CSS variables |
web/apps/labelstudio/src/pages/Settings/GeneralSettings.jsx | Added project name validation with min/max length requirements and real-time error feedback |
web/apps/labelstudio/src/pages/CreateProject/CreateProject.scss | Enhanced styling for validation errors and form layout improvements |
web/apps/labelstudio/src/pages/CreateProject/CreateProject.jsx | Implemented comprehensive validation flow with error state management |
web/apps/labelstudio/src/components/Form/Validation/Validators.js | Added new minLength and maxLength validators and updated error messages |
web/apps/labelstudio/src/components/Form/Validation/Validation.scss | Removed margin-top and updated spacing |
web/apps/labelstudio/src/components/Form/FormField.jsx | Added error state management and propagation to form fields |
web/apps/labelstudio/src/components/Form/Form.scss | Added error styling and improved form layout ordering |
web/apps/labelstudio/src/components/Form/Form.jsx | Enhanced form validation to propagate errors to individual fields |
web/apps/labelstudio/src/components/Form/Elements/Input/Input.scss | Added error state styling for input fields |
web/apps/labelstudio/src/components/Form/Elements/Input/Input.jsx | Integrated error prop handling for visual error states |
web/apps/labelstudio/src/components/Form/Validation/Validators.js
Outdated
Show resolved
Hide resolved
}, [ | ||
project, | ||
projectBody, | ||
finishUpload, |
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.
[nitpick] The dependency array includes finishUpload
but also includes stable references that don't change. Consider using useCallback to memoize finishUpload
or remove unnecessary stable dependencies to avoid potential re-renders.
Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
/git merge
|
/git merge
|
Before:
The field wasn't validated at all. This PR introduces validation and fixes styles for fields with errors.
This PR also moves the validation error messages to the top of the form, so that errors are clearly visible.
After:
LSO
Create Project
Project / General Settings
LSE
Create Project
Project / General Settings