-
Notifications
You must be signed in to change notification settings - Fork 5
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
Foundation of paper autofilling paper data with id card number #222
Conversation
When we autofill a contact, we want to be able to autofill data from papers of the contact. The first candidate is id card number from national_id_card. So let's add a new test form to have a goal to reach.
It will be needed soon to make CozyClient query from AutofillService.
bf2d065
to
489f121
Compare
"Official identification number", | ||
"Personal registration number", | ||
]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a huge list 😮 You did it yourself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it is our awesome product owner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, but I wonder if it's worth the effort to do it for every type of data. And also, I tend to think that we should do it with real-case examples, as:
- it will avoid trying to imagine all possible cases
- we should be careful with false positive: typically "Personal identifier" seems rather generic and not related to french ID card (also, it's worth questioning the need to support english keywords for very-french data such as this one).
What do you think @BenjaminMty ?
apps/browser/src/autofill/services/inline-menu-field-qualification.service.ts
Outdated
Show resolved
Hide resolved
We introduce : - COZY_ATTRIBUTES_MAPPING, a mapping modelizing the link between a Bitwarden field type and what we need to get the corresponding data from Cozy doctypes - getCozyValue, the main function that interpret the mapping and retrieve the corresponding data from Cozy doctypes For the moment only id card number is added.
These constants are used by the autofill feature to know if a field should be filled by some data. For the moment only id card number is added.
…d number This new fillscript generation step enhances the fillscript already created for a contact. It will fill data from papers. For the moment only id card number is added.
Bad compare of uppercase and lowercase
489f121
to
b5bc952
Compare
|
||
const papersFromContact = papers.filter((paper: any) => isReferencedByContact(paper, contactId)); | ||
|
||
return _.get(papersFromContact[0], cozyAttributeModel.path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It means that if I add my national id card but skip the contact part for any reason, it won't work? I wonder if we should try to fallback on myself by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some open questions, but nothing blocking, thank you @zatteo!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done!
Thanks @paultranvan, I'm going to merge so I can continue the development.
In this PR, I add the foundation of autofilling paper data when autofilling a contact by taking as example the id card number.
Screen.Recording.2024-07-19.at.17.33.45.mov
The paper data autofill expand the fillscript of a contact.
Tested :