Skip to content

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

Open
wants to merge 33 commits into
base: develop
Choose a base branch
from

Conversation

ricardoantoniocm
Copy link
Contributor

@ricardoantoniocm ricardoantoniocm commented Jul 24, 2025

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

image image image

Project / General Settings

image image image

LSE

Create Project

image image image

Project / General Settings

image image image

Copy link

netlify bot commented Jul 24, 2025

Deploy Preview for heartex-docs canceled.

Name Link
🔨 Latest commit 5fc3df1
🔍 Latest deploy log https://app.netlify.com/projects/heartex-docs/deploys/689f30b9ed917e0008fa82f9

Copy link

netlify bot commented Jul 24, 2025

Deploy Preview for label-studio-storybook ready!

Name Link
🔨 Latest commit 5fc3df1
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-storybook/deploys/689f30b90baffb0008b43dc3
😎 Deploy Preview https://deploy-preview-8041--label-studio-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

netlify bot commented Jul 24, 2025

Deploy Preview for label-studio-playground ready!

Name Link
🔨 Latest commit 5fc3df1
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-playground/deploys/689f30b950a1a70008088868
😎 Deploy Preview https://deploy-preview-8041--label-studio-playground.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

netlify bot commented Jul 24, 2025

Deploy Preview for label-studio-docs-new-theme canceled.

Name Link
🔨 Latest commit 5fc3df1
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-docs-new-theme/deploys/689f30b9dd137e0008ee9890

Copy link

codecov bot commented Jul 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.96%. Comparing base (2898db8) to head (5fc3df1).
⚠️ Report is 6 commits behind head on develop.

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              
Flag Coverage Δ
lsf-e2e 58.88% <ø> (-0.87%) ⬇️
lsf-integration 55.57% <ø> (ø)
lsf-unit 9.42% <ø> (ø)
pytests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ricardoantoniocm ricardoantoniocm changed the title Fb fit 391/dont let users not fill mandatory fields feat: FIT-391: Validate Project Name field on Create Project and General Settings page Jul 25, 2025
@ricardoantoniocm ricardoantoniocm requested a review from Copilot July 25, 2025 20:57
Copilot

This comment was marked as outdated.

@ricardoantoniocm ricardoantoniocm requested a review from Copilot July 25, 2025 21:17
Copilot

This comment was marked as outdated.

… not the bottom. Moves submit container below form.
…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.
@ricardoantoniocm ricardoantoniocm requested a review from Copilot July 28, 2025 15:48
Copy link
Contributor

@Copilot Copilot AI left a 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 and maxLength 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

}, [
project,
projectBody,
finishUpload,
Copy link
Preview

Copilot AI Jul 28, 2025

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.

@ricardoantoniocm
Copy link
Contributor Author

ricardoantoniocm commented Jul 30, 2025

/git merge

Workflow run
Successfully merged: create mode 100644 web/libs/ui/src/assets/icons/cloud-provider-s3.svg

@ricardoantoniocm ricardoantoniocm self-assigned this Jul 31, 2025
@ricardoantoniocm ricardoantoniocm marked this pull request as ready for review July 31, 2025 14:58
@ricardoantoniocm ricardoantoniocm requested a review from a team as a code owner July 31, 2025 14:58
@ricardoantoniocm
Copy link
Contributor Author

ricardoantoniocm commented Aug 14, 2025

/git merge

Workflow run
Successfully merged: 191 files changed, 9672 insertions(+), 2441 deletions(-)

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

Successfully merging this pull request may close these issues.

3 participants