Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Form] Added a "choice_filter" option to ChoiceType #35733

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

Merged

Conversation

HeahDude
Copy link
Contributor

@HeahDude HeahDude commented Feb 15, 2020

Q A
Branch? master
Bug fix? no
New feature? yes
Deprecations? yes
Tickets Fix #32657
License MIT
Doc PR symfony/symfony-docs#13223

Finally opening this PR for a very old branch, based on both #34550 (merged) and #30994 (merged).

Until #30994 is merged, this PR should better be reviewed by commits. Thanks!

@HeahDude HeahDude requested a review from xabbuh as a code owner February 15, 2020 12:49
@HeahDude HeahDude force-pushed the feature-choice_type-choice_filter-option branch 9 times, most recently from 5c927c9 to df56a76 Compare February 16, 2020 15:00
@nicolas-grekas nicolas-grekas added this to the next milestone Feb 18, 2020
@HeahDude HeahDude force-pushed the feature-choice_type-choice_filter-option branch 5 times, most recently from 3812a56 to 93dac3e Compare February 22, 2020 12:58
@HeahDude
Copy link
Contributor Author

Rebased on master, added some more tests and the documentation PR. Ready from my side.

@HeahDude HeahDude force-pushed the feature-choice_type-choice_filter-option branch 3 times, most recently from c296699 to 6feee70 Compare February 22, 2020 18:06
UPGRADE-5.1.md Outdated Show resolved Hide resolved
UPGRADE-6.0.md Outdated Show resolved Hide resolved
src/Symfony/Component/Form/CHANGELOG.md Show resolved Hide resolved
@HeahDude HeahDude force-pushed the feature-choice_type-choice_filter-option branch 2 times, most recently from e86ba3d to 37ffbc4 Compare February 23, 2020 10:33
@HeahDude HeahDude force-pushed the feature-choice_type-choice_filter-option branch 3 times, most recently from 002af90 to 2c172ca Compare February 23, 2020 13:02
@HeahDude
Copy link
Contributor Author

Thanks for the review, addressed everything. Added even more tests and fixed one from #30994 with some missing annotations as well.

@HeahDude
Copy link
Contributor Author

HeahDude commented Feb 23, 2020

I've added a new commit a54f389 which has two benefits:

  • reduce the complexity in the default factory by encapsulating the logic in the loader decorator (helped me spotting a bug already covered by tests)
  • lazy filtering, it means that when submitting empty data on optional field the choices won't be loaded or when some data is submitted and valid they will be partially filtered

@HeahDude HeahDude force-pushed the feature-choice_type-choice_filter-option branch 2 times, most recently from 8db187f to a54f389 Compare February 23, 2020 19:37
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

(with minor comments)

src/Symfony/Component/Form/CHANGELOG.md Outdated Show resolved Hide resolved
@HeahDude HeahDude force-pushed the feature-choice_type-choice_filter-option branch 2 times, most recently from 6e515e5 to f487c6c Compare February 24, 2020 22:29
@HeahDude HeahDude force-pushed the feature-choice_type-choice_filter-option branch 2 times, most recently from 2a76f52 to fbc06f0 Compare February 25, 2020 21:16
@HeahDude HeahDude force-pushed the feature-choice_type-choice_filter-option branch from fbc06f0 to 72c2a26 Compare February 27, 2020 07:31
Copy link
Contributor

@ogizanagi ogizanagi left a comment

Choose a reason for hiding this comment

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

Thank you so much for working back on this long-time requested feature

@HeahDude HeahDude force-pushed the feature-choice_type-choice_filter-option branch 2 times, most recently from 64f6fcc to 19dc45b Compare March 15, 2020 10:31
@HeahDude HeahDude force-pushed the feature-choice_type-choice_filter-option branch from 19dc45b to ed2c312 Compare March 15, 2020 15:49
@fabpot
Copy link
Member

fabpot commented Mar 16, 2020

Thank you @HeahDude.

@fabpot fabpot merged commit e0bddee into symfony:master Mar 16, 2020
@HeahDude HeahDude deleted the feature-choice_type-choice_filter-option branch March 16, 2020 06:48
HeahDude added a commit to symfony/symfony-docs that referenced this pull request Apr 12, 2020
This PR was merged into the master branch.

Discussion
----------

[Form] added the "choice_filter" option

Documentation for symfony/symfony#35733.

Based on #13182 for now, so better be reviewed by commit here until it's merged and rebased, thanks!

Commits
-------

8b0c09e [Form] added the "choice_filter" option
@nicolas-grekas nicolas-grekas modified the milestones: next, 5.1 May 4, 2020
@fabpot fabpot mentioned this pull request May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to filter choices
5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.