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

refactor!: remove the default value for step #4095

Merged
merged 13 commits into from
Jul 5, 2022

Conversation

vursen
Copy link
Contributor

@vursen vursen commented Jun 26, 2022

Description

This PR removes the default value for the step property of number-field which makes it possible to throw away the custom validation logic entirely relying on the InputConstraintsMixin validation logic instead.

Breaking changes:

  1. The step property no longer has a default value and therefore undefined and null values are now allowed.
  2. Setting the step property no longer leads to setting the step attribute on the number-field host.

Related to #1224

Type of change

  • Refactor

Checklist

  • I have read the contribution guide: https://vaadin.com/docs-beta/latest/guide/contributing/overview/
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.

@vursen vursen force-pushed the refactor/remove-default-value-for-step branch 2 times, most recently from a420b80 to b598277 Compare June 28, 2022 06:59
@vursen vursen requested a review from web-padawan June 28, 2022 09:35
@vursen vursen changed the title refactor!: remove the default value for step (WIP) refactor!: remove the default value for step Jun 28, 2022
@vursen vursen marked this pull request as ready for review June 28, 2022 09:35
@vursen vursen force-pushed the refactor/remove-default-value-for-step branch from c959184 to 92c300b Compare June 28, 2022 09:52
@vursen vursen force-pushed the refactor/remove-default-value-for-step branch from 92c300b to 2b2b64e Compare June 28, 2022 09:54
@vursen vursen force-pushed the refactor/remove-default-value-for-step branch from 1616307 to 8b86abe Compare June 28, 2022 09:57
Copy link
Member

@web-padawan web-padawan left a comment

Choose a reason for hiding this comment

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

Let's remember to update corresponding ITs in the Flow components:

Also, the logic that uses 1 as a fallback step value needs to be replicated in the Flow component, see for example how it's implemented in the TimePicker.

@sonarcloud
Copy link

sonarcloud bot commented Jul 4, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@vursen
Copy link
Contributor Author

vursen commented Jul 4, 2022

Let's remember to update corresponding ITs in the Flow components:

I checked on the Flow counterpart and looks like its step already defaults to 1 according to:

https://github.com/vaadin/flow-components/blob/d16cc31709b64be4dfc7e765c7e802b121c34253/vaadin-text-field-flow-parent/vaadin-text-field-flow/src/main/java/com/vaadin/flow/component/textfield/AbstractNumberField.java#L109

...so only tests will need to be updated. I'll take care of them during the next release.

@vursen vursen requested a review from web-padawan July 5, 2022 06:53
@web-padawan web-padawan merged commit 61d8f07 into master Jul 5, 2022
@web-padawan web-padawan deleted the refactor/remove-default-value-for-step branch July 5, 2022 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants