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

Add car and householdSize validations #408

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

samuel-duhaime
Copy link
Collaborator

Pull request

Description

Add car and householdSize validations
Add defaultValue type

Justification

We are using some validations in many surveys.

@samuel-duhaime samuel-duhaime added the generator About Evolution-Generator packages label Mar 22, 2024
@samuel-duhaime samuel-duhaime requested a review from tahini March 22, 2024 15:27
Add car and householdSize validations
Add defaultValue type
Get better types in inputTypes.ts
@samuel-duhaime samuel-duhaime force-pushed the addCarAndHouseholdSizeValidations branch from 99c9580 to 54b0237 Compare March 22, 2024 20:36
return [
{
validation: isNaN(Number(value)) || !Number.isInteger(Number(value)),
errorMessage: {
Copy link
Contributor

Choose a reason for hiding this comment

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

Il faudrait à terme s'orienter vers des messages seulement via des fichiers de locales. Pas nécessairement maintenant, mais tranquillement.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oui, en effet @tahini.

Est-ce qu'il y a un avantage d'utiliser les fichiers de locales comparativement à cette méthode ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Est-ce qu'il y a un avantage d'utiliser les fichiers de locales comparativement à cette méthode ?

Plusieurs:

  • Les messages sont tous rassemblés au même endroit, ce qui facilite leur édition plutôt que perdu un peu partout dans le code
  • C'est assez simple et trivial d'ajouter des langues en traduisant uniquement ces fichiers
  • Question responsabilité, un fichier de code ne devrait pas aussi contenir des traductions

@samuel-duhaime samuel-duhaime merged commit a456341 into main Mar 25, 2024
4 checks passed
@samuel-duhaime samuel-duhaime deleted the addCarAndHouseholdSizeValidations branch March 25, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
generator About Evolution-Generator packages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants