Skip to content

Handle validation for fields with '.' - 19.2.x #16053

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 7 commits into
base: 19.2.x
Choose a base branch
from

Conversation

MonikaKirkova
Copy link
Contributor

@MonikaKirkova MonikaKirkova commented Jul 16, 2025

Closes #15932

Changes:

  1. Do not replace . in field names with _ when passing a name for the ngControl, Use the column field name as a name for the native ngControl added
image
  1. When trying to get a control using ngControl.get, wrap the name in an array. This way ngControl.get will treat it as a literal key. Otherwise, default behavior of ngControl,get("address.street") is to look for a control named "address" and then look for a control nested named "street" , which is nested under address.
image
  1. Assign formControl.errors in a let variable in order to be resolved once, not to be resolved once for each usage in the template
image

Additional information (check all that apply):

  • Bug fix
  • New functionality
  • Documentation
  • Demos
  • CI/CD

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them

@MonikaKirkova MonikaKirkova changed the title Handle validation for fields with '.' Handle validation for fields with '.' - 19.2.x Jul 16, 2025
@MonikaKirkova MonikaKirkova added the ❌ status: awaiting-test PRs awaiting manual verification label Jul 16, 2025
* @internal
*/
public getTransformedFieldName(field: string): string {
return field?.replace(/\./g, '_');
Copy link
Contributor

Choose a reason for hiding this comment

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

I know it's an edge case, but I'm not sure about it. If we have column test.1 and test_1, we'll mess up the validation, I guess we are good with this, but should be at least very well described in the docs.

Or even better we should use a bit more complex identifier to replace with.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also I tested it and seems like it's not working, I can't get "green" validated field.
image

I used grid-updates sample from the repo I only added editing and required field:
image

@deyvidnenchev deyvidnenchev added 💥 status: in-test PRs currently being tested and removed ❌ status: awaiting-test PRs awaiting manual verification labels Jul 24, 2025
@deyvidnenchev
Copy link
Contributor

getFieldKey can be deleted because it is not used anymore.

@deyvidnenchev deyvidnenchev added ✅ status: verified Applies to PRs that have passed manual verification and removed 💥 status: in-test PRs currently being tested labels Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
grid version: 19.2.x ✅ status: verified Applies to PRs that have passed manual verification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants