vaadin / flow-components

Java counterpart of Vaadin Web Components
100 stars 66 forks source link

feat: add i18n error message support for TimePicker #6365

Closed vursen closed 2 months ago

vursen commented 3 months ago

Description

The PR introduces TimePickerI18n with methods for setting error messages and updates the TimePicker'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

vursen commented 2 months ago

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.

vaadin-bot commented 2 months ago

TC Format Checker Report - 09:15 - 23 - Jul

BLOCKER There are 1 files with format errors

Here is the list of files with format issues in your PR:

vaadin-text-field-flow-parent/vaadin-text-field-flow/src/main/java/com/vaadin/flow/component/textfield/TextField.java
sonarcloud[bot] commented 2 months ago

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarCloud

vaadin-bot commented 2 months ago

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