Skip to content

fix: track independent validation state for git config name and email…#1506

Open
vinokurig wants to merge 2 commits intomainfrom
CRW-10296
Open

fix: track independent validation state for git config name and email…#1506
vinokurig wants to merge 2 commits intomainfrom
CRW-10296

Conversation

@vinokurig
Copy link
Copy Markdown
Contributor

@vinokurig vinokurig commented Mar 30, 2026

… fields

What does this PR do?

Fixes form validation to properly track both name and email field validity independently, ensuring the form is only valid when both fields are valid.

Screenshot/screencast of this PR

What issues does this PR fix or reference?

https://redhat.atlassian.net/browse/CRW-10296

Is it tested? How?

  1. Open the User preferences page -> Gitconfig tab.
  2. Enter some email (ex. "asd") - > see error -> enter some name -> Error is visible
  3. See: the 'Save' button is NOT active.
  4. Open the Import Git Configuration dialog and check the username and email properties in the same way.

Release Notes

Docs PR

… fields

Fixes form validation to properly track both name and email field validity
independently, ensuring the form is only valid when both fields are valid.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@che-bot
Copy link
Copy Markdown
Contributor

che-bot commented Mar 30, 2026

Click here to review and test in web IDE: Contribute

@github-actions
Copy link
Copy Markdown

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1506 (linux/amd64, linux/arm64)

kubectl patch command
kubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1506", name: che-dashboard}]}}]"

@vinokurig
Copy link
Copy Markdown
Contributor Author

/retest

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

❌ Patch coverage is 93.75000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.27%. Comparing base (6797295) to head (94a2acb).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...erences/GitConfig/AddModal/GitConfigForm/index.tsx 89.28% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1506      +/-   ##
==========================================
+ Coverage   92.24%   92.27%   +0.03%     
==========================================
  Files         562      562              
  Lines       54906    55039     +133     
  Branches     4082     4113      +31     
==========================================
+ Hits        50646    50786     +140     
+ Misses       4213     4206       -7     
  Partials       47       47              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@olexii4 olexii4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@olexii4
Copy link
Copy Markdown
Contributor

olexii4 commented Mar 31, 2026

@vinokurig We have another approach to changing the configuration using the "Import Git Configuration" button that should be fixed:
Знімок екрана 2026-04-01 о 02 08 39
WDYT?

Comment on lines +27 to +28
private isNameValid = true;
private isEmailValid = true;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please move these fields to component state.

In constructor:

this.state = {
  isNameValid: true,
  isEmailValid: true,
};

In handler:

this.setState({ isNameValid: isValid });

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.setState({ isNameValid: isValid }) will not update the state object instantly, so the
const isFormValid = this.state.isNameValid && this.state.isEmailValid will not work

Add validation for git config user.name and user.email fields with length limits (128 chars) and email format regex. Include tests for invalid email, empty name, and excessive length scenarios.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@openshift-ci openshift-ci bot removed the lgtm label Apr 1, 2026
@vinokurig
Copy link
Copy Markdown
Contributor Author

@olexii4

We have another approach to changing the configuration using the "Import Git Configuration" button that should be fixed

done

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1506 (linux/amd64, linux/arm64)

kubectl patch command
kubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1506", name: che-dashboard}]}}]"

@openshift-ci openshift-ci bot added the lgtm label Apr 1, 2026
@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 1, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: olexii4, vinokurig

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@olexii4
Copy link
Copy Markdown
Contributor

olexii4 commented Apr 1, 2026

/retest

@svor svor requested a review from olkornii April 1, 2026 14:57
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.

4 participants