Skip to content
Snippets Groups Projects
Unverified Commit 16de9170 authored by Bekerle, Patrizio's avatar Bekerle, Patrizio :fire:
Browse files

Add human readable signature annotation user text (#37)

parent 4a040a42
No related branches found
No related tags found
No related merge requests found
Pipeline #18310 passed with warnings
...@@ -282,12 +282,17 @@ export default class DBPSignatureLitElement extends DBPSignatureBaseLitElement { ...@@ -282,12 +282,17 @@ export default class DBPSignatureLitElement extends DBPSignatureBaseLitElement {
file = await this.addAnnotationsToFile(file, annotations, i18n) file = await this.addAnnotationsToFile(file, annotations, i18n)
console.log("uploadFile file", file); console.log("uploadFile file", file);
// Also send to the server so it gets included in the signature block // Also send annotations to the server so they get included in the signature block
let userText = []; let userText = [];
for (let ann of annotations) { for (let annotation of annotations) {
userText.push({"description": ann["annotationType"], "value": `${ann["value"]} (${ann["organizationNumber"]})`}); const annotationTypeNames = utils.getAnnotationTypes(annotation['annotationType']);
userText.push({
'description': `${annotationTypeNames.de || ''} / ${annotationTypeNames.en || ''}`,
'value': `${annotation['value']} (${annotation['organizationNumber']})`
});
} }
formData.append("user_text", JSON.stringify(userText)); formData.append('user_text', JSON.stringify(userText));
} }
let url = new URL(this.fileSourceUrl); let url = new URL(this.fileSourceUrl);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment