Skip to content
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

[Form] Allow to disable and customize PercentType symbol #30433

Conversation

Projects
None yet
5 participants
@OskarStark
Copy link
Contributor

commented Mar 4, 2019

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #28796
License MIT
Doc PR symfony/symfony-docs#11078

PercentType symbol option

As of this writing, Symfony will forcibly append a percentage sign (%) to all input fields that are of the PercentType form type. This PR will introduce a boolean flag called symbol that, when false, will not display the percentage sign. Each of the default layouts that define percent_widget will respect this option. You could also use a customised string as value for symbol option.

By default, this new option will be set to true so that it maintains backward compatibility. The unit tests have been updated where appropriate, and a new unit test has been added (as appropriate).

@fabpot

This comment has been minimized.

Copy link
Member

commented Mar 4, 2019

@OskarStark Do you think it's possible to keep ownership of the commit to the original author?

@OskarStark

This comment has been minimized.

Copy link
Contributor Author

commented Mar 4, 2019

I am not sure, I talked to @xabbuh and we decided to create a new PR, the repository of the original author is deleted and I don't have some access to get the commits somehow.

@fabpot

This comment has been minimized.

Copy link
Member

commented Mar 4, 2019

ok, fair enough, can you fixed fabbot issues (mainly array() -> [])?
Tests look broken as well for the added feature.

@OskarStark

This comment has been minimized.

Copy link
Contributor Author

commented Mar 4, 2019

can you fixed fabbot issues (mainly array() -> [])?

sure thing, will have a look

Tests look broken as well for the added feature.

still onto it and try to understand whats wrong here 👍

@OskarStark OskarStark force-pushed the OskarStark:allow-toggling-and-customising-percentage-symbol branch from 8f3160c to 3818dc7 Mar 4, 2019

@xabbuh xabbuh force-pushed the OskarStark:allow-toggling-and-customising-percentage-symbol branch from 3818dc7 to 85d1125 Mar 4, 2019

@OskarStark

This comment has been minimized.

Copy link
Contributor Author

commented Mar 4, 2019

normal and deps=low build failures are not related to this change.

deps=high needs to be skipped

@OskarStark

This comment has been minimized.

Copy link
Contributor Author

commented Mar 4, 2019

Looks like the tests are 💚

@xabbuh xabbuh added this to the next milestone Mar 4, 2019

@OskarStark OskarStark force-pushed the OskarStark:allow-toggling-and-customising-percentage-symbol branch from 9431379 to bc322c4 Mar 5, 2019

@OskarStark OskarStark force-pushed the OskarStark:allow-toggling-and-customising-percentage-symbol branch from bc322c4 to 929fdf3 Mar 5, 2019

@OskarStark

This comment has been minimized.

Copy link
Contributor Author

commented Mar 5, 2019

@fabpot I applied your comments

@OskarStark OskarStark changed the title [Form] Allow to disable and customise PercentType symbol [Form] Allow to disable and customize PercentType symbol Mar 5, 2019

@OskarStark OskarStark force-pushed the OskarStark:allow-toggling-and-customising-percentage-symbol branch from 929fdf3 to 3be05a7 Mar 5, 2019

@OskarStark OskarStark force-pushed the OskarStark:allow-toggling-and-customising-percentage-symbol branch from 3be05a7 to 53c5f41 Mar 5, 2019

@fabpot

fabpot approved these changes Mar 5, 2019

@fabpot

This comment has been minimized.

Copy link
Member

commented Mar 5, 2019

Thank you @OskarStark.

@fabpot fabpot merged commit 53c5f41 into symfony:master Mar 5, 2019

2 of 3 checks passed

fabbot.io Some changes should be done to comply with our standards.
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

fabpot added a commit that referenced this pull request Mar 5, 2019

feature #30433 [Form] Allow to disable and customize PercentType symb…
…ol (Ken Stanley, OskarStark)

This PR was merged into the 4.3-dev branch.

Discussion
----------

[Form] Allow to disable and customize PercentType symbol

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #28796   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#11078

<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
 - Bug fixes must be submitted against the lowest branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too).
 - Features and deprecations must be submitted against the master branch.
-->

## `PercentType` `symbol` option
As of this writing, Symfony will forcibly append a percentage sign (`%`) to all input fields that are of the PercentType form type. This PR will introduce a boolean flag called `symbol` that, when `false`, will not display the percentage sign. Each of the default layouts that define percent_widget will respect this option. You could also use a customised string as value for `symbol` option.

By default, this new option will be set to `true` so that it maintains backward compatibility. The unit tests have been updated where appropriate, and a new unit test has been added (as appropriate).

Commits
-------

53c5f41 [Form] Allow to disable and customize PercentType symbol
9aeaea0 Add ‘symbol’ option to PercentType

@OskarStark OskarStark deleted the OskarStark:allow-toggling-and-customising-percentage-symbol branch Mar 5, 2019

javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Mar 27, 2019

minor #11078 Docs for PercentType disable/customize percent character…
… (OskarStark)

This PR was merged into the master branch.

Discussion
----------

Docs for PercentType disable/customize percent character

Docs for symfony/symfony#30433

Closes #10464

Commits
-------

16b2e4b Docs for PercentType disable/customize percent character

@nicolas-grekas nicolas-grekas modified the milestones: next, 4.3 Apr 30, 2019

@fabpot fabpot referenced this pull request May 9, 2019

Merged

Release v4.3.0-BETA1 #31435

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.