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] Remove default option grouping in TimezoneType #31293

Merged
merged 1 commit into from Apr 29, 2019

Conversation

Projects
None yet
4 participants
@ro0NL
Copy link
Contributor

commented Apr 27, 2019

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

This removes some complexity from the TimezoneType. The default option grouping is really a simple group_by (+ choice_label) configuration for the end-user, i.e.:

'group_by' => function($choice) {
    if (false !== $i = strpos($choice, '/')) {
        return substr($choice, 0, $i);
    }

    return 'Other';
},

The grouping labels are not really i18n friendly, so i think SF should opt-out by default.

@fabpot

fabpot approved these changes Apr 28, 2019

@nicolas-grekas nicolas-grekas added this to the next milestone Apr 29, 2019

@ro0NL ro0NL force-pushed the ro0NL:tz-form branch from 0b58129 to 4238c64 Apr 29, 2019

@ro0NL

This comment has been minimized.

Copy link
Contributor Author

commented Apr 29, 2019

(failures unrelated; deps=high should pass once merged upstream)

@fabpot fabpot force-pushed the ro0NL:tz-form branch from 5146246 to ebe6179 Apr 29, 2019

@fabpot

This comment has been minimized.

Copy link
Member

commented Apr 29, 2019

Thank you @ro0NL.

@fabpot fabpot merged commit ebe6179 into symfony:master Apr 29, 2019

1 of 3 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
fabbot.io Your code looks good.
Details

fabpot added a commit that referenced this pull request Apr 29, 2019

feature #31293 [Form] Remove default option grouping in TimezoneType …
…(ro0NL)

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

Discussion
----------

[Form] Remove default option grouping in TimezoneType

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

This removes some complexity from the TimezoneType. The default option grouping is really a simple `group_by`  (+ `choice_label`) configuration for the end-user, i.e.:

```php
'group_by' => function($choice) {
    if (false !== $i = strpos($choice, '/')) {
        return substr($choice, 0, $i);
    }

    return 'Other';
},
```

The grouping labels are not really i18n friendly, so i think SF should opt-out by default.

Commits
-------

ebe6179 [Form] Remove default option grouping in TimezoneType

@ro0NL ro0NL deleted the ro0NL:tz-form branch Apr 29, 2019

@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

fabpot added a commit that referenced this pull request May 13, 2019

feature #31294 [Form] Add intl/choice_translation_locale option to Ti…
…mezoneType (ro0NL)

This PR was merged into the 4.3 branch.

Discussion
----------

[Form] Add intl/choice_translation_locale option to TimezoneType

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #28836
| License       | MIT
| Doc PR        | symfony/symfony-docs#11503

final step :)

for now i think any form of grouping is a user concern (i.e. by GMT offset or area name); see #31293 + #31295

having a special built in `group_by' => 'gmt_offset'` util would be nice, and can be done in the future.

includes #31434

Commits
-------

001b930 [Form] Add intl/choice_translation_locale option to TimezoneType
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.