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

Fixes for autofill and translations #258

Merged
merged 5 commits into from
Sep 17, 2024
Merged

Fixes for autofill and translations #258

merged 5 commits into from
Sep 17, 2024

Conversation

zatteo
Copy link

@zatteo zatteo commented Sep 17, 2024

No description provided.

If paper.cozyMetadata.sourceAccountIdentifier and contactEmail were
undefined, it was considered as a paper from the contact even if it
has no sense.

I added multiple tests to improve the function safety.
demande-logement-social.gouv.fr

On demande-logement-social.gouv.fr, we need to be able to autofill
the tax revenue for the two last years.

Previously, the two tax revenue fields had the target date like
"2022" in the "tag" field. But the form has changed and now, there is
no way to know the date of the tax revenue we want.

For the moment we hardcode the year targeted by each field with the
field ID.
@zatteo zatteo merged commit f518cb0 into master Sep 17, 2024
1 check passed
Comment on lines +393 to +400
// Special case for demande-logement-social.gouv.fr
if (field.htmlID.includes("montantMoins1")) {
return 2023;
}
if (field.htmlID.includes("montantMoins2")) {
return 2022;
}

Copy link
Member

Choose a reason for hiding this comment

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

@zatteo Est-ce qu'on ne préfère pas quelque chose comme ça ?

Suggested change
// Special case for demande-logement-social.gouv.fr
if (field.htmlID.includes("montantMoins1")) {
return 2023;
}
if (field.htmlID.includes("montantMoins2")) {
return 2022;
}
// Special case for demande-logement-social.gouv.fr
if (field.htmlID.includes("montantMoins1")) {
return new Date().getFullYear() - 1;
}
if (field.htmlID.includes("montantMoins2")) {
return new Date().getFullYear() - 2;
}

Copy link
Author

Choose a reason for hiding this comment

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

Si sûrement je vais adapter.

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.

2 participants