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

Skip to content

[WebProfilerBundle][Form][DX] To expand the form nodes that contains children with errors #19339

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
wants to merge 2 commits into from

Conversation

yceruto
Copy link
Member

@yceruto yceruto commented Jul 11, 2016

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

Currently when we use nested forms and an error occurs into one of them, it's not displayed "easily" in the form panel profiler:

first

This happen because only the root form is expanded and the children are shown collapsed "by default".

The main problem is to search where is the form with error.

The purpose of this PR is to show expanded all forms that contains children with error, reducing a little bit the developer's time when debugging.

PR result when we access to the form panel profiler:

form-error-result

In red the full path to the error.

form-error-result2

@carsonbot carsonbot added Status: Needs Review WebProfilerBundle Form DX DX = Developer eXperience (anything that improves the experience of using Symfony) Feature labels Jul 11, 2016
@yceruto
Copy link
Member Author

yceruto commented Jul 11, 2016

Tests fails (no related)
OK Form Tests

@javiereguiluz
Copy link
Member

This is a fantastic DX improvement! Thanks @yceruto.

👍

@HeahDude
Copy link
Contributor

Thanks for that feature!

@eXtreme
Copy link
Contributor

eXtreme commented Jul 12, 2016

The other idea for solving this would be to somehow show the number of children errors in parents (maybe with different color than red).

@yceruto yceruto force-pushed the web-profiler-form-errors branch from 587fa43 to 095d15a Compare July 12, 2016 17:26
@yceruto yceruto force-pushed the web-profiler-form-errors branch from 095d15a to 00b8785 Compare July 12, 2016 17:33
@yceruto
Copy link
Member Author

yceruto commented Jul 12, 2016

I just rebased! All tests in green again 😃

@yceruto
Copy link
Member Author

yceruto commented Jul 12, 2016

@eXtreme would be another solution but in that case we would have to open each node until the form with error. In this way the form error is in sight 👀 ;)

@apfelbox
Copy link
Contributor

@eXtreme @yceruto why not both?

@yceruto
Copy link
Member Author

yceruto commented Jul 14, 2016

I've found a pain point to make this #19339 (comment) proposal:

Suppose you have a form with two children, where one of them has the error_bubbling property to true and both children have an error, right now, the result will be:

- form [1]
    - child1 <--- error_bubbling = true, so the error is passed to parent form
    - child2 [1]

If we implement this proposal, the result will be:

- form [1][1] 
    - child1
    - child2 [1]

Which would be confused IMO, even if we put different colors.

WDYT ?

@ogizanagi
Copy link
Contributor

@yceruto : I was for both proposals, but I came to the same point you did. So IMHO, your solution is enough. But if we wanted to improve this a little bit, I'd say that's not the number of errors in children forms which is important, but rather showing the path to the error. This is what you do by expanding all nodes with errors, but why not simply highlighting in red the full path ?

- form // some children contain errors, red
    - child1 // No error, grey
-   - child2 [1] // Has error, red

@yceruto
Copy link
Member Author

yceruto commented Jul 15, 2016

I like your proposal @ogizanagi I say let's do it.

@yceruto yceruto changed the title [WebProfilerBundle][Form][DX] Expand forms that contains children with errors [WIP][WebProfilerBundle][Form][DX] Expand forms that contains children with errors Jul 15, 2016
@yceruto
Copy link
Member Author

yceruto commented Jul 21, 2016

Status: Needs work

@yceruto
Copy link
Member Author

yceruto commented Jul 26, 2016

Updated!

Status: Needs Review

@yceruto yceruto changed the title [WIP][WebProfilerBundle][Form][DX] Expand forms that contains children with errors [WebProfilerBundle][Form][DX] Expand forms that contains children with errors Jul 26, 2016
@yceruto yceruto changed the title [WebProfilerBundle][Form][DX] Expand forms that contains children with errors [WebProfilerBundle][Form][DX] To expand the form nodes that contains children with errors Jul 27, 2016
@yceruto
Copy link
Member Author

yceruto commented Jul 29, 2016

I've updated the result screenshot with highlighting error path feature, thanks to @eXtreme, @apfelbox and @ogizanagi by the idea 👍

@fabpot
Copy link
Member

fabpot commented Jul 29, 2016

👍

@nicolas-grekas
Copy link
Member

👍
Status: reviewed

@yceruto
Copy link
Member Author

yceruto commented Aug 22, 2016

Ready for @symfony/mergers?

@fabpot
Copy link
Member

fabpot commented Aug 22, 2016

Thank you @yceruto.

@fabpot fabpot closed this Aug 22, 2016
fabpot added a commit that referenced this pull request Aug 22, 2016
… that contains children with errors (yceruto)

This PR was squashed before being merged into the 3.2-dev branch (closes #19339).

Discussion
----------

[WebProfilerBundle][Form][DX] To expand the form nodes that contains children with errors

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Currently when we use nested forms and an error occurs into one of them, it's not displayed "easily" in the form panel profiler:

![first](https://cloud.githubusercontent.com/assets/2028198/17125622/1fd15142-52c3-11e6-830e-17b3e341ba60.png)

This happen because only the root form is expanded and the children are shown collapsed "by default".

**The main problem is to search where is the form with error**.

The purpose of this PR is to show expanded all forms that contains children with error, reducing a little bit the developer's time when debugging.

PR result when we access to the form panel profiler:

![form-error-result](https://cloud.githubusercontent.com/assets/2028198/17125447/83eb9c0c-52c1-11e6-94bc-a2a7492eea43.png)

In red the full path to the error.

![form-error-result2](https://cloud.githubusercontent.com/assets/2028198/17125459/a04de95e-52c1-11e6-8980-84a5dcd0914a.png)

Commits
-------

d626b28 [WebProfilerBundle][Form][DX] To expand the form nodes that contains children with errors
@yceruto yceruto deleted the web-profiler-form-errors branch August 22, 2016 17:33
@fabpot fabpot mentioned this pull request Oct 27, 2016
ostrolucky pushed a commit to ostrolucky/symfony that referenced this pull request Mar 25, 2018
…m nodes that contains children with errors (yceruto)

This PR was squashed before being merged into the 3.2-dev branch (closes symfony#19339).

Discussion
----------

[WebProfilerBundle][Form][DX] To expand the form nodes that contains children with errors

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Currently when we use nested forms and an error occurs into one of them, it's not displayed "easily" in the form panel profiler:

![first](https://cloud.githubusercontent.com/assets/2028198/17125622/1fd15142-52c3-11e6-830e-17b3e341ba60.png)

This happen because only the root form is expanded and the children are shown collapsed "by default".

**The main problem is to search where is the form with error**.

The purpose of this PR is to show expanded all forms that contains children with error, reducing a little bit the developer's time when debugging.

PR result when we access to the form panel profiler:

![form-error-result](https://cloud.githubusercontent.com/assets/2028198/17125447/83eb9c0c-52c1-11e6-94bc-a2a7492eea43.png)

In red the full path to the error.

![form-error-result2](https://cloud.githubusercontent.com/assets/2028198/17125459/a04de95e-52c1-11e6-8980-84a5dcd0914a.png)

Commits
-------

d626b28 [WebProfilerBundle][Form][DX] To expand the form nodes that contains children with errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX DX = Developer eXperience (anything that improves the experience of using Symfony) Feature Form Status: Reviewed WebProfilerBundle
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants