Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

(impact: low) Form input components should get its validation error messages from BaseFormControl.translatedErrors() #450

Open
2 tasks done
xqvu opened this issue Oct 12, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@xqvu
Copy link
Contributor

xqvu commented Oct 12, 2022

Prerequisites

[Check these off before submitting an issue].

  • Are you running the latest version? OR Are you submitting a bug for a prior version?
  • Did you perform a basic issue search?

For more information, see the CONTRIBUTING guide.

Description

FormInputComponent, NumberWithUnitFormInputComponent and FormCheckboxComponent all have their own logic to translate validation error messages. Once PR (#449) is merged these components should be refactored so that they all get their translated error messages from BaseFormControl.translatedErrors(). The reasoning here is that all form input components should behave the same way when taking in the translation params to be use in its translation message.

Impact

Form input components are inconsistent in how it translate validation error messages.

Expected behavior: All form input components should have the same way to translate validate error messages.

Actual behavior: Each form input component has their own behavior on how it translate its validation error messages. Some uses the control's min and the max values (FormInputComponent, NumberWithUnitFormInputComponent ) and other just the component's value (FormCheckboxComponent).

Versions

  1. Package version (run npm version): 6.14.16
  2. Node Version (run node -v): v14.19.1
  3. OS Version: MacOS 12.6
  4. Browser Version: Chrome 105.0.5195.125
@xqvu xqvu added the bug Something isn't working label Oct 12, 2022
@xqvu xqvu changed the title (impact: low) FormInputComponent not taking in translation params (impact: low) FormInputComponent, NumberWithUnitFormInputComponent and FormCheckboxComponent should get its validation messages from BaseFormControl.translatedErrors() Oct 12, 2022
@xqvu xqvu changed the title (impact: low) FormInputComponent, NumberWithUnitFormInputComponent and FormCheckboxComponent should get its validation messages from BaseFormControl.translatedErrors() (impact: low) Form input components should get its validation messages from BaseFormControl.translatedErrors() Oct 12, 2022
@xqvu xqvu changed the title (impact: low) Form input components should get its validation messages from BaseFormControl.translatedErrors() (impact: low) Form input components should get its validation error messages from BaseFormControl.translatedErrors() Oct 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant