Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[Validator] Added CssColor constraint#14965

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@welcoMattic
Copy link
Member

@welcoMatticwelcoMattic commentedFeb 12, 2021
edited
Loading

This PR introduces the newCssColor constraint, contributed insymfony/symfony#40168

@welcoMatticwelcoMattic changed the titleAdded HexaColor constraint[Validator] Added HexaColor constraintFeb 12, 2021
@javiereguiluzjaviereguiluz added the Waiting Code MergeDocs for features pending to be merged labelFeb 12, 2021
@carsonbotcarsonbot added this to thenext milestoneFeb 12, 2021
@welcoMatticwelcoMattic changed the title[Validator] Added HexaColor constraint[Validator] Added CssColor constraintJul 4, 2021
@welcoMatticwelcoMatticforce-pushed thehexadecimal-constraint branch 2 times, most recently from5e2c888 to4a20f74CompareJuly 4, 2021 20:57
@welcoMatticwelcoMatticforce-pushed thehexadecimal-constraint branch 2 times, most recently frome9f296c tofa5743eCompareJuly 5, 2021 08:10
fabpot added a commit to symfony/symfony that referenced this pull requestOct 6, 2021
This PR was merged into the 5.4 branch.Discussion----------[Validator] Added `CssColor` constraint| Q             | A| ------------- | ---| Branch?       | 5.4| Bug fix?      | no| New feature?  | yes| Deprecations? | no| Tickets       || License       | MIT| Doc PR        |symfony/symfony-docs#14965This PR introduces a new `CssColor` constraint. It comes with 3 validation modes:- Long, which allows all hexadecimal representation of a color, or 9 (#EEEEEEFF) characters- Short, which only allows hexadecimal colors on 4 (#EEE), 5 (#FFF00) characters- Named colors, which matches [the official list of named colors](https://www.w3.org/TR/css-color-4/#named-color)- HTML5, which allows hexadecimal colors on 7 (#EEEEEE) characters as well as the HTML5 input type colorI know that such a color validation already exists in Symfony (in the `ColorType` class), but it's hardcoded in the FormType, and not usable as an assert Annotation. We could decide to remove this hardcoded validation in favor of the new added `CssColor` constraint. Let me know, if yes, I will make the change.Commits-------b36371c Added new CssColor constraint
symfony-splitter pushed a commit to symfony/validator that referenced this pull requestOct 6, 2021
This PR was merged into the 5.4 branch.Discussion----------[Validator] Added `CssColor` constraint| Q             | A| ------------- | ---| Branch?       | 5.4| Bug fix?      | no| New feature?  | yes| Deprecations? | no| Tickets       || License       | MIT| Doc PR        |symfony/symfony-docs#14965This PR introduces a new `CssColor` constraint. It comes with 3 validation modes:- Long, which allows all hexadecimal representation of a color, or 9 (#EEEEEEFF) characters- Short, which only allows hexadecimal colors on 4 (#EEE), 5 (#FFF00) characters- Named colors, which matches [the official list of named colors](https://www.w3.org/TR/css-color-4/#named-color)- HTML5, which allows hexadecimal colors on 7 (#EEEEEE) characters as well as the HTML5 input type colorI know that such a color validation already exists in Symfony (in the `ColorType` class), but it's hardcoded in the FormType, and not usable as an assert Annotation. We could decide to remove this hardcoded validation in favor of the new added `CssColor` constraint. Let me know, if yes, I will make the change.Commits-------b36371c06e Added new CssColor constraint
@derrabus
Copy link
Member

The feature PR has been merged.

@welcoMattic
Copy link
MemberAuthor

It needs some work here to report the last changes (modes instead of mode) from the code.

derrabus reacted with thumbs up emoji

@OskarStarkOskarStark added Validator and removed Waiting Code MergeDocs for features pending to be merged labelsOct 7, 2021
@OskarStarkOskarStark modified the milestones:next,5.4Oct 7, 2021
@welcoMatticwelcoMatticforce-pushed thehexadecimal-constraint branch 2 times, most recently fromf395714 to10810adCompareOctober 7, 2021 15:45
@welcoMattic
Copy link
MemberAuthor

I don't understand why the CI fails 🤔

@OskarStark
Copy link
Contributor

friendly ping@Nyholm can you help?

Copy link
Contributor

@OskarStarkOskarStark left a comment

Choose a reason for hiding this comment

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

Some minor, afterwards good to merge

@Nyholm
Copy link
Member

The CI is correct. The class is called “Constraint”

https://github.com/symfony/symfony/blob/5.4/src/Symfony/Component/Validator/Constraint.php

@Nyholm
Copy link
Member

Oh. Sorry. I see now that you import partial FQCN. Ci does not support that (appearently)

Feel free to ignore that :)

OskarStark reacted with thumbs up emoji

@OskarStark
Copy link
Contributor

Thanks Mathieu for working on this feature, this is much appreciated.

welcoMattic reacted with heart emoji

@OskarStarkOskarStark merged commit0710b02 intosymfony:5.4Oct 8, 2021
@welcoMatticwelcoMattic deleted the hexadecimal-constraint branchOctober 8, 2021 09:46
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull requestOct 12, 2021
…aviereguiluz)This PR was merged into the 5.4 branch.Discussion----------[Validator] Some tweaks to CssColor constraintThis tweaks the great work made by `@welcoMattic` insymfony#14965.It's mostly minor tweaks ... but I also expanded the "basic usage" example to show the case of not adding any parameters to the constraint, which is a common case when you just want to allow any of the valid CSS color formats.Commits-------07e38b7 [Validator] Some tweaks to CssColor constraint
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@OskarStarkOskarStarkOskarStark approved these changes

@xabbuhxabbuhAwaiting requested review from xabbuhxabbuh is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

5.4

Development

Successfully merging this pull request may close these issues.

6 participants

@welcoMattic@derrabus@OskarStark@Nyholm@javiereguiluz@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp