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

feat: add i18n error message support for DatePicker #6360

Merged
merged 9 commits into from
Jul 23, 2024

Conversation

vursen
Copy link
Contributor

@vursen vursen commented Jun 10, 2024

Description

The PR enhances DatePickerI18n with methods for setting error messages and updates the DatePicker's validation logic to show these error messages when validation fails.

Note

It's still possible to use the setErrorMessage method to configure a single static error message. This error message will be displayed for all constraints and will take priority over any i18n error messages that are also set. However, when more than one error message is needed, i18n should be used or manual validation mode should be enabled.

Part of #4618

Type of change

  • Feature

Copy link

sonarcloud bot commented Jun 11, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@vursen vursen marked this pull request as ready for review June 13, 2024 10:42
@vursen vursen requested review from sissbruecker and removed request for yuriy-fix July 11, 2024 06:29
@vursen vursen force-pushed the feat/date-picker/error-messages branch from 02d4762 to d53bd01 Compare July 11, 2024 11:51
@vursen vursen force-pushed the feat/date-picker/error-messages branch from 9a54a4b to f9396d6 Compare July 18, 2024 08:06
@vursen
Copy link
Contributor Author

vursen commented Jul 18, 2024

During our internal discussion, we discovered a way to keep error messages that are set with setErrorMessage. They now take priority over i18n error messages, which allows developers to continue using the old familiar method, setting a single error message for all constraints. I've updated the PR and also removed the breaking change mark.

@vursen vursen requested review from DiegoCardoso and sissbruecker and removed request for sissbruecker July 18, 2024 08:43
@vursen vursen changed the title feat!: support setting error messages with DatePickerI18n feat: add i18n error message support for DatePicker Jul 19, 2024
@vursen vursen enabled auto-merge (squash) July 23, 2024 10:39
Copy link

sonarcloud bot commented Jul 23, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
12.1% Duplication on New Code (required ≤ 10%)

See analysis details on SonarCloud

@vursen vursen merged commit b6be72c into main Jul 23, 2024
4 of 5 checks passed
@vursen vursen deleted the feat/date-picker/error-messages branch July 23, 2024 10:55
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.5.0.alpha6 and is also targeting the upcoming stable 24.5.0 version.

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.

4 participants