-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[WIP] [Form] [TwigBridge] Bootstrap horizontal theme missing tests #16351
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
Conversation
Hello. Thanks for your first contribution. Unfortunately I'm 👎 with this PR because you can easily change this value thanks to form theming. |
NP, had to create a theme with the PR code in a project awhile ago where some inputs were shorter than the full width and just thought it might be helpful as part of the core theme. Note that in creating the tests for the PR a bug was found (see 2nd commit). If the PR is turned down, should I file a bug and create a PR with that fix or can I just create a PR (that is if that is still seen as a bug)? |
You could remove non bug fix commit and edit the pr title ;) |
@pieter2627 Can you update this PR to just keep the bug fix? Thanks. |
Yes, I'll see to do so soon. (Will also include the test as it exposed the bug and confirms the fix) |
`AbstractBootstrap3HorizontalLayoutTest.php` extends the non-horizontal equivalent version just like it does in the theme. Certain tests are redeclared to match how they differ in the horizontal layout. `FormExtensionBootstrap3HorizontalLayoutTest.php` uses the skeleton from the other themes' tests.
Using spaceless meant that the horizontal layout will fail the `testTextareaWithWhitespaceOnlyContentRetainsValueWhenRenderingForm` test.
I have pushed the updated code, but the tests seem to have failed due to an issue that existed in the 2.8 branch at the time. I can rebase them on the latest 2.8 and update the PR if needed? Also the title is updated as @lyrixx suggested, but I'm not sure if the description should be amended (to keep the base of the discussion) or completely redone to just have the bug fix? |
</div> | ||
</div> | ||
{% endspaceless %} | ||
{##}</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have you added {##}
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was the only why I could think of to have a 'space control' between the two closing div tags without having to use spaceless
. I guess the last closing div can also be moved directly to the end of the previous one, but that will break the indents.
Thank you @pieter2627. |
…ng tests (pieter2627) This PR was submitted for the 2.8 branch but it was merged into the 2.7 branch instead (closes #16351). Discussion ---------- [WIP] [Form] [TwigBridge] Bootstrap horizontal theme missing tests | Q | A | ------------------ | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | The current bootstrap horizontal theme has a limitation where the inputs will always have `col-sm-2` class applied to them and the developer has no way on changing this when he wants larger/smaller labels or wants to target another screen size only. The same applies for the `div` around the `input`. PR checks if a label's class has a `col-*` class set and then uses it rather than the default so that the developer can change them as is needed. Again the same for the `div` by checking the `group_attr.class` This is my first contribution to Symfony and from the contribution docs I see that the following is still needed. ### ToDo - [ ] Create Doc and its PR - [ ] Edit `CHANGELOG???` For the Doc it seems best to edit `cookbook/form/form_customization.rst` and add another 'admonition' below the "built-in form themes" section that highlights this capability? I'm not sure what will go into the CHANGELOG? Commits ------- a35d3d4 [WIP] [Form] [TwigBridge] Bootstrap horizontal theme missing tests
The current bootstrap horizontal theme has a limitation where the inputs will always have
col-sm-2
class applied to them and the developer has no way on changing this when he wants larger/smaller labels or wants to target another screen size only. The same applies for thediv
around theinput
.PR checks if a label's class has a
col-*
class set and then uses it rather than the default so that the developer can change them as is needed. Again the same for thediv
by checking thegroup_attr.class
This is my first contribution to Symfony and from the contribution docs I see that the following is still needed.
ToDo
CHANGELOG???
For the Doc it seems best to edit
cookbook/form/form_customization.rst
and add another 'admonition' below the "built-in form themes" section that highlights this capability?I'm not sure what will go into the CHANGELOG?