Thanks to visit codestin.com
Credit goes to github.com

Skip to content

refactor(forms): added control name in console errors #55397

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

Closed

Conversation

fdonzello
Copy link
Contributor

@fdonzello fdonzello commented Apr 18, 2024

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Right now, when a form control is used without a parent form group, we get an error not reporting the form control name affected by the issue.
With long forms, it could take a lot of time to get the affected form control.
Screenshot 2024-04-18 at 12 19 31

What is the new behavior?

The console error has been improved by reporting either the form control name or index affected by the issue.
Screenshot 2024-04-18 at 16 06 44

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

This is a starting point and can be further improved or scaled to other methods involved in form wrong usage.

@pullapprove pullapprove bot requested a review from AndrewKushnir April 18, 2024 16:04
@angular-robot angular-robot bot added the detected: feature PR contains a feature commit label Apr 18, 2024
@AndrewKushnir AndrewKushnir added action: review The PR is still awaiting reviews from at least one requested reviewer area: forms target: patch This PR is targeted for the next patch release labels Apr 19, 2024
@ngbot ngbot bot modified the milestone: Backlog Apr 19, 2024
@AndrewKushnir
Copy link
Contributor

@fdonzello could you please also update the commit message (via git commit --amend) to make it start with refactor(forms): ?

@fdonzello fdonzello force-pushed the feat/improve-reactive-errors branch from be23f6b to 7e215b9 Compare April 19, 2024 07:27
@angular-robot angular-robot bot removed the detected: feature PR contains a feature commit label Apr 19, 2024
@fdonzello fdonzello changed the title feat(forms): added control name in console errors refactor(forms): added control name in console errors Apr 19, 2024
@fdonzello
Copy link
Contributor Author

@fdonzello could you please also update the commit message (via git commit --amend) to make it start with refactor(forms): ?

done :)

@fdonzello fdonzello force-pushed the feat/improve-reactive-errors branch 2 times, most recently from 5f97ba2 to 9dc5f76 Compare April 22, 2024 12:25
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

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

@fdonzello looks great, thanks for addressing the feedback. I've just left a couple minor comments related to formatting in tests.

@fdonzello
Copy link
Contributor Author

@fdonzello looks great, thanks for addressing the feedback. I've just left a couple minor comments related to formatting in tests.

@AndrewKushnir strange that yarn ng-dev format files packages/forms/test/reactive_integration_spec.ts doesn't apply the formatting :(

When a formControlName is used without a parent formGroup, an error is
logged in the console. Before this commit, there was no information
about which control had the issue. Now, it's reported and the
troubleshoot is much faster.
@fdonzello fdonzello force-pushed the feat/improve-reactive-errors branch from 40e7adc to 029b486 Compare April 23, 2024 09:42
@AndrewKushnir AndrewKushnir added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Apr 23, 2024
@AndrewKushnir
Copy link
Contributor

@fdonzello thanks for addressing the feedback! 👍 This PR is now in the merge queue.

@AndrewKushnir AndrewKushnir added target: minor This PR is targeted for the next minor release and removed target: patch This PR is targeted for the next patch release labels Apr 23, 2024
@AndrewKushnir
Copy link
Contributor

This PR was merged into the repository by commit c001b05.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators May 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: forms target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants