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

Moved from validate to required/optional #6526

Merged
merged 1 commit into from
Feb 12, 2019

Conversation

alanmquach
Copy link
Contributor

First class support for required turns a bunch of .validate([isRequired()]) into .required() which is more readable and natural.

First class support for optional:

b.field('foo', 'Foo').optional([
  minValue(1003),
  maxValue(1005)
])

is probably be more ergonomic than any other way we try to do it through composition, like

b.field('foo', 'Foo').validate([
  optional(minValue(1003)),
  optional(maxValue(1005))
])

or

b.field('foo', 'Foo').validate([
  minValue(1003),
  maxValue(1005)
].map(optional))

@alanmquach alanmquach merged commit 70b8e01 into spinnaker:master Feb 12, 2019
@alanmquach alanmquach deleted the optionally-required branch February 12, 2019 02:17
archana-s pushed a commit that referenced this pull request Feb 12, 2019
7e4b457 fix(amazon): Display capacity as text if using SPEL (#6535)
27d8a12 chore(eslint): Fix lint errors
a8c1749 chore(package): Just Update Prettier™
58d3e90 fix(core): enable new traffic guards by default (#6527)
578a7fd fix(core): only use <g> for popovers in within SVGs (#6530)
70b8e01 refactor(validation): First class support for required or optional (#6526)
0eb3e29 feat(core): rename feature flag for managed pipeline templates v2 ui (#6525)
3359789 fix(core): Max remaining ASG should honor value being removed and reflect correctly (#6522)
bc2a423 feat(core): add feature flag for managed pipeline templates v2 (#6520)
9eccc0f refactor(artifacts): Generalize artifact delegate for reuse (#6495)
a2ebca0 fix(amazon/core): Sorting order of regions in bake stage + lint fix (#6518)
b1b04f0 fix(core): introduce state when the modal has been initialized (#6516)
ed74abf chore(core): update banner spec
anotherchrisberry pushed a commit that referenced this pull request Feb 13, 2019
* chore(core): Bump version to 0.0.330

7e4b457 fix(amazon): Display capacity as text if using SPEL (#6535)
27d8a12 chore(eslint): Fix lint errors
a8c1749 chore(package): Just Update Prettier™
58d3e90 fix(core): enable new traffic guards by default (#6527)
578a7fd fix(core): only use <g> for popovers in within SVGs (#6530)
70b8e01 refactor(validation): First class support for required or optional (#6526)
0eb3e29 feat(core): rename feature flag for managed pipeline templates v2 ui (#6525)
3359789 fix(core): Max remaining ASG should honor value being removed and reflect correctly (#6522)
bc2a423 feat(core): add feature flag for managed pipeline templates v2 (#6520)
9eccc0f refactor(artifacts): Generalize artifact delegate for reuse (#6495)
a2ebca0 fix(amazon/core): Sorting order of regions in bake stage + lint fix (#6518)
b1b04f0 fix(core): introduce state when the modal has been initialized (#6516)
ed74abf chore(core): update banner spec

* chore(amazon): Bump version to 0.0.170

7e4b457 fix(amazon): Display capacity as text if using SPEL (#6535)
27d8a12 chore(eslint): Fix lint errors
a8c1749 chore(package): Just Update Prettier™
a2ebca0 fix(amazon/core): Sorting order of regions in bake stage + lint fix (#6518)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants