From 6d74edb8de5150c989dab84822d26c6e9359154d Mon Sep 17 00:00:00 2001 From: Christina Toegl <toegl@tugraz.at> Date: Mon, 29 Mar 2021 17:35:35 +0200 Subject: [PATCH] Add annotation view and integration to qualified and official signature --- src/dbp-annotation-view.js | 352 ++++++++++++++++++++++ src/dbp-official-signature-pdf-upload.js | 54 +++- src/dbp-qualified-signature-pdf-upload.js | 61 +++- src/dbp-signature-lit-element.js | 48 +++ src/i18n/de/translation.json | 25 +- src/i18n/en/translation.json | 25 +- src/utils.js | 4 +- 7 files changed, 558 insertions(+), 11 deletions(-) create mode 100644 src/dbp-annotation-view.js diff --git a/src/dbp-annotation-view.js b/src/dbp-annotation-view.js new file mode 100644 index 0000000..2ed9999 --- /dev/null +++ b/src/dbp-annotation-view.js @@ -0,0 +1,352 @@ +import {createI18nInstance} from './i18n.js'; +import {css, html} from 'lit-element'; +import {classMap} from 'lit-html/directives/class-map.js'; +import {ScopedElementsMixin} from '@open-wc/scoped-elements'; +import DBPLitElement from '@dbp-toolkit/common/dbp-lit-element'; +import {MiniSpinner, Icon} from '@dbp-toolkit/common'; +import {OrganizationSelect} from "@dbp-toolkit/organization-select"; +import * as commonStyles from '@dbp-toolkit/common/styles'; + +const i18n = createI18nInstance(); + +/** + * AnnotationView web component + */ +export class AnnotationView extends ScopedElementsMixin(DBPLitElement) { + constructor() { + super(); + this.lang = 'de'; + this.isTextHidden = false; + this.isSelected = false; + this.annotationRows = []; + this.queuedFilesAnnotationsCount = 0; + this.key = -1; + } + + static get scopedElements() { + return { + 'dbp-mini-spinner': MiniSpinner, + 'dbp-icon': Icon, + 'dbp-organization-select': OrganizationSelect, + }; + } + + /** + * See: https://lit-element.polymer-project.org/guide/properties#initialize + */ + static get properties() { + return { + ...super.properties, + lang: { type: String }, + key: { type: Number }, + isTextHidden: { type: Boolean, attribute: false }, + isSelected: { type: Boolean, attribute: false }, + annotationRows: { type: Array, attribute: false }, + queuedFilesAnnotationsCount: { type: Number, attribute: false }, + }; + } + + update(changedProperties) { + changedProperties.forEach((oldValue, propName) => { + switch (propName) { + case "lang": + i18n.changeLanguage(this.lang); + break; + } + }); + + super.update(changedProperties); + } + + /** + * Deletes all fields and restore introduction text + */ + deleteAll() { + this.annotationRows = []; + this.isTextHidden = false; + } + + sendCancelEvent() { + const event = new CustomEvent("dbp-annotation-cancel", + { "detail": {}, bubbles: true, composed: true }); + this.dispatchEvent(event); + } + + /** + * Stores information to document + */ + saveAll() { + const data = { + "key": this.key, + "annotationRows": this.annotationRows, + }; + const event = new CustomEvent("dbp-annotation-save", + { "detail": data, bubbles: true, composed: true }); + this.dispatchEvent(event); + } + + /** + * Add an annotation to a file on the queue + * + */ + addAnnotation() { + if (!this.annotationRows) { + this.annotationRows = []; + this.queuedFilesAnnotationsCount = 0; + } + + let e = this._('#additional-select'); + let type = e?.options[e?.selectedIndex]?.value; + let text = e?.options[e?.selectedIndex]?.text; + + this.annotationRows.push({'annotationType': type, 'label': text, 'value': ''}); + + // we just need this so the UI will update + this.queuedFilesAnnotationsCount++; + + if (!this.isTextHidden) { + this.isTextHidden = true; + } + } + + /** + * Update an annotation of a file on the queue + * + * @param id + * @param annotationKey + * @param value + */ + updateAnnotation(id, annotationKey, value) { + if (this.annotationRows && this.annotationRows[id]) { + if (value != '') { + this.annotationRows[id][annotationKey] = value; + this.annotationRows[id].value = value; + } else { + this.annotationRows[id].value = ''; + } + } + } + + /** + * Remove an annotation of a file on the queue + * + * @param id + */ + removeAnnotation(id) { + if (this.annotationRows && this.annotationRows[id]) { + // delete this.annotationRows[id]; //length of array doesn't change + this.annotationRows.splice(id, 1); + + if(this.annotationRows.length === 0) { + this.isTextHidden = false; + } + + // we just need this so the UI will update + this.queuedFilesAnnotationsCount--; + } + } + + static get styles() { + // language=css + return css` + ${commonStyles.getGeneralCSS()} + ${commonStyles.getButtonCSS()} + + #org-selector { + text-overflow: ellipsis; + } + + div[class*='annotation-gz-block'] select:not(.select) { + background-size: 4%; + } + + div[class*='annotation-gz-block']{ + display: grid; + grid-template-columns: 140px auto auto 42px; + column-gap: .5em; + + align-items: center; + + margin-left: 4px; + margin-right: 2px; + } + + div[class*='annotation-block'] { + display: grid; + grid-template-columns: 140px auto 42px; + column-gap: .5em; + + align-items: center; + + margin-left: 4px; + margin-right: 2px; + } + + .text { + padding-left: 1em; + padding-right: 1em; + } + + #inside-fields { + display: grid; + row-gap: .5em; + } + + .add-elements { + padding-top: 1em; + + margin-left: 2px; + margin-right: 2px; + + display: flex; + justify-content: flex-end; + } + + .add-elements .button { + margin-left: .5em; + } + + select:not(.select) { + background-size: 8%; + height: 33px; + } + + #fields-wrapper { + position: relative; + border-color: #000; + border-width: 1px; + border-style: solid; + padding: 0.5em; + padding-bottom: 1.5em; + border-bottom-width: 1px; + border-top-width: 0; + } + + #fields-wrapper fields { + position: absolute; + top: 0; + left: 0; + border: solid 1px black; + border-top-color: #888; + } + + #pdf-meta { + border-color: #000; + border-width: 1px; + border-style: solid; + padding: 0.5em; + border-bottom-width: 0; + border-top-width: 0; + } + + .nav-buttons { + display: flex; + justify-content: space-between; + flex-grow: 1; + flex-wrap: wrap; + } + + .buttons { + align-self: center; + white-space: nowrap; + } + + .nav-buttons > * { + margin: 2px; + } + + `; + } + + /** + * Returns the list of files of annotations of a queued file + * + * @returns {*[]} Array of html templates + */ + getAnnotationsHtml() { + const annotations = this.annotationRows || []; + const ids = Object.keys(annotations); + let results = []; + + ids.forEach((id) => { + const data = this.annotationRows[id] || []; + + if (data.annotationType === 'gz') { + results.push(html` + <div class="annotation-gz-block-${this.key}-${id}"> + <label>${data.label}</label> + <dbp-organization-select subscribe="lang:lang,entry-point-url:entry-point-url,auth:auth" + value="${data.organizationNumber}" + @change=${e => { this.updateAnnotation(id, 'organizationNumber', JSON.parse(e.target.getAttribute("data-object")).alternateName); }}></dbp-organization-select> + <input type="text" class="input" placeholder="${i18n.t('annotation-view.businessnumber-placeholder')}" @change=${e => { this.updateAnnotation(id, 'value', e.target.value) }}> + <button class="button close" + title="${i18n.t('annotation-view.remove-field')}" + @click="${() => { this.removeAnnotation(id); } }"> + <dbp-icon name="trash"></dbp-icon></button> + </div> + `) + } else { + results.push(html` + <div class="annotation-block-${this.key}-${id}"> + <label>${data.label}</label> + <input type="text" class="input" placeholder="${i18n.t('annotation-view.intended-use-placeholder')}" @change=${e => { this.updateAnnotation(id, 'value', e.target.value); }}> + <button class="button close" + title="${i18n.t('annotation-view.remove-field')}" + @click="${() => { this.removeAnnotation(id); } }"> + <dbp-icon name="trash"></dbp-icon></button> + </div> + `) + } + }); + + return results; + } + + render() { + + return html` + + <div id="pdf-main-container"> + <div id="pdf-meta"> + <div class="nav-buttons"> + <button class="button" + title="${i18n.t('annotation-view.delete-all-button-title')}" + @click="${() => { this.deleteAll(); } }" + ?disabled="${ this.annotationRows.length === 0 }"> + ${i18n.t('annotation-view.delete-all-button-text')} + </button> + <button class="button is-primary" + title="${i18n.t('annotation-view.save-all-button-title')}" + @click="${() => { this.saveAll(); } }" + ?disabled="${ this.annotationRows.length === 0 }"> + ${i18n.t('annotation-view.save-all-button-text')} + </button> + </div> + </div> + + <div id="fields-wrapper"> + <div id="inside-fields"> + <div class="text ${classMap({hidden: this.isTextHidden})}"> + <p>${i18n.t('annotation-view.introduction')}</p> + </div> + ${this.getAnnotationsHtml()} + </div> + + <div class="add-elements"> + <select id="additional-select" @change="${() => { this.isSelected = true; } }"> + <option value="gz" >${i18n.t('annotation-view.type-value-1')}</option> + <option value="vz" >${i18n.t('annotation-view.type-value-2')}</option> + <option value="" disabled selected>${i18n.t('annotation-view.insert-field')}</option> + </select> + <button class="button" + title="${i18n.t('annotation-view.insert-field')}" + @click="${() => { this.addAnnotation(); } }" + ?disabled="${ !this.isSelected }"> + <dbp-icon name="plus"></dbp-icon></button> + </button> + </div> + </div> + </div> + `; + } +} diff --git a/src/dbp-official-signature-pdf-upload.js b/src/dbp-official-signature-pdf-upload.js index b8438bc..7efb676 100644 --- a/src/dbp-official-signature-pdf-upload.js +++ b/src/dbp-official-signature-pdf-upload.js @@ -18,6 +18,7 @@ import {send as notify} from '@dbp-toolkit/common/notification'; import {OrganizationSelect} from "@dbp-toolkit/organization-select"; import metadata from './dbp-official-signature-pdf-upload.metadata.json'; import {Activity} from './activity.js'; +import {AnnotationView} from "./dbp-annotation-view"; const i18n = createI18nInstance(); @@ -52,6 +53,7 @@ class OfficialSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitElem this.allowAnnotating = false; this.queuedFilesAnnotations = []; this.queuedFilesAnnotationsCount = 0; + this.isAnnotationViewVisible = false; this.activity = new Activity(metadata); } @@ -65,6 +67,7 @@ class OfficialSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitElem 'dbp-button': Button, 'dbp-textswitch': TextSwitch, 'dbp-organization-select': OrganizationSelect, + 'dbp-annotation-view': AnnotationView, }; } @@ -95,6 +98,7 @@ class OfficialSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitElem withSigBlock: { type: Boolean, attribute: false }, isSignaturePlacement: { type: Boolean, attribute: false }, allowAnnotating: { type: Boolean, attribute: 'allow-annotating' }, + isAnnotationViewVisible: { type: Boolean, attribute: false }, queuedFilesAnnotations: { type: Array, attribute: false }, queuedFilesAnnotationsCount: { type: Number, attribute: false }, }; @@ -406,7 +410,28 @@ class OfficialSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitElem ${commonStyles.getButtonCSS()} ${commonStyles.getNotificationCSS()} - #pdf-preview { + #annotation-view .button.is-cancel { + background: transparent; + border: none; + font-size: 1.5rem; + color: var(--dbp-override-danger-bg-color); + cursor: pointer; + padding: 0px; + } + + #annotation-view .box-header, #external-auth .box-header { + display: flex; + justify-content: space-between; + align-items: start; + } + + #annotation-view .box-header .filename, #external-auth .box-header .filename { + overflow: hidden; + text-overflow: ellipsis; + margin-right: 0.5em; + } + + #pdf-preview, #annotation-view { min-width: 320px; box-sizing: border-box; } @@ -420,7 +445,7 @@ class OfficialSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitElem font-weight: 600; } - #pdf-preview .box-header { + #pdf-preview .box-header, #annotation-view .box-header { border: 1px solid #000; border-bottom-width: 0; padding: 0.5em 0.5em 0 0.5em; @@ -692,6 +717,17 @@ class OfficialSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitElem value2="${i18n.t('official-pdf-upload.positioning-manual')}" ?disabled="${this.signingProcessEnabled}" @change=${ (e) => this.queuePlacementSwitch(id, e.target.name) }></dbp-textswitch> + <span class="headline ${classMap({hidden: !this.allowAnnotating})}">${i18n.t('official-pdf-upload.annotation')}:</span> + <div class="${classMap({hidden: !this.allowAnnotating})}"> + <dbp-textswitch id="annotation-switch" + name1="no-text" + name2="text-selected" + class="${classMap({'switch': true})}" + value1="${i18n.t('official-pdf-upload.annotation-no')}" + value2="${i18n.t('official-pdf-upload.annotation-yes')}" + ?disabled="${this.signingProcessEnabled}" + @change=${ (e) => this.showAnnotationView(id, e.target.name) }></dbp-textswitch> + </div> </div> <div class="error-line"> ${ placementMissing ? html` @@ -966,6 +1002,20 @@ class OfficialSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitElem @dbp-pdf-preview-accept="${this.storePDFData}" @dbp-pdf-preview-cancel="${this.hidePDF}"></dbp-pdf-preview> </div> + <!-- Annotation view --> + <div id="annotation-view" class="field ${classMap({hidden: !this.isAnnotationViewVisible || !this.allowAnnotating})}"> + <h2>${i18n.t('official-pdf-upload.annotation-view-label')}</h2> + <div class="box-header"> + <div class="filename"> + <strong>${this.currentFile.name}</strong> (${humanFileSize(this.currentFile !== undefined ? this.currentFile.size : 0)}) + </div> + <button class="button is-cancel annotation" + @click="${this.hideAnnotationView}"><dbp-icon name="close" id="close-icon"></dbp-icon></button> + </div> + <dbp-annotation-view lang="${this.lang}" + @dbp-annotation-save="${this.processAnnotationEvent}" + @dbp-annotation-cancel="${this.hideAnnotationView}"></dbp-annotation-view> + </div> <!-- File upload progress --> <div id="upload-progress" class="field notification is-info ${classMap({hidden: !this.uploadInProgress})}"> <dbp-mini-spinner></dbp-mini-spinner> diff --git a/src/dbp-qualified-signature-pdf-upload.js b/src/dbp-qualified-signature-pdf-upload.js index 450a572..3f785e7 100644 --- a/src/dbp-qualified-signature-pdf-upload.js +++ b/src/dbp-qualified-signature-pdf-upload.js @@ -18,6 +18,7 @@ import {getPDFSignatureCount} from './utils.js'; import {send as notify} from '@dbp-toolkit/common/notification'; import metadata from './dbp-qualified-signature-pdf-upload.metadata.json'; import {Activity} from './activity.js'; +import {AnnotationView} from "./dbp-annotation-view"; const i18n = createI18nInstance(); @@ -51,6 +52,10 @@ class QualifiedSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitEle this.queuedFilesNeedsPlacement = new Map(); this.currentPreviewQueueKey = ''; this.allowAnnotating = false; + this.queuedFilesAnnotations = []; + this.queuedFilesAnnotationsCount = 0; + this.isAnnotationViewVisible = false; + this.activity = new Activity(metadata); this._onReceiveIframeMessage = this.onReceiveIframeMessage.bind(this); @@ -66,6 +71,7 @@ class QualifiedSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitEle 'dbp-mini-spinner': MiniSpinner, 'dbp-button': Button, 'dbp-textswitch': TextSwitch, + 'dbp-annotation-view': AnnotationView, }; } @@ -96,7 +102,10 @@ class QualifiedSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitEle signaturePlacementInProgress: { type: Boolean, attribute: false }, withSigBlock: { type: Boolean, attribute: false }, isSignaturePlacement: { type: Boolean, attribute: false }, - allowAnnotating: { type: Boolean, attribute: 'allow-annotating' } + allowAnnotating: { type: Boolean, attribute: 'allow-annotating' }, + isAnnotationViewVisible: { type: Boolean, attribute: false }, + queuedFilesAnnotations: { type: Array, attribute: false }, + queuedFilesAnnotationsCount: { type: Number, attribute: false }, }; } @@ -531,7 +540,28 @@ class QualifiedSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitEle ${commonStyles.getButtonCSS()} ${commonStyles.getNotificationCSS()} - #pdf-preview { + #annotation-view .button.is-cancel { + background: transparent; + border: none; + font-size: 1.5rem; + color: var(--dbp-override-danger-bg-color); + cursor: pointer; + padding: 0px; + } + + #annotation-view .box-header, #external-auth .box-header { + display: flex; + justify-content: space-between; + align-items: start; + } + + #annotation-view .box-header .filename, #external-auth .box-header .filename { + overflow: hidden; + text-overflow: ellipsis; + margin-right: 0.5em; + } + + #pdf-preview, #annotation-view { min-width: 320px; box-sizing: border-box; } @@ -545,7 +575,7 @@ class QualifiedSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitEle font-weight: 600; } - #pdf-preview .box-header { + #pdf-preview .box-header, #annotation-view .box-header { border: 1px solid #000; border-bottom-width: 0; padding: 0.5em 0.5em 0 0.5em; @@ -836,6 +866,17 @@ class QualifiedSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitEle value2="${i18n.t('qualified-pdf-upload.positioning-manual')}" ?disabled="${this.signingProcessEnabled}" @change=${ (e) => this.queuePlacementSwitch(id, e.target.name) }></dbp-textswitch> + <span class="headline ${classMap({hidden: !this.allowAnnotating})}">${i18n.t('qualified-pdf-upload.annotation')}:</span> + <div class="${classMap({hidden: !this.allowAnnotating})}"> + <dbp-textswitch id="annotation-switch" + name1="no-text" + name2="text-selected" + class="${classMap({'switch': true})}" + value1="${i18n.t('qualified-pdf-upload.annotation-no')}" + value2="${i18n.t('qualified-pdf-upload.annotation-yes')}" + ?disabled="${this.signingProcessEnabled}" + @change=${ (e) => this.showAnnotationView(id, e.target.name) }></dbp-textswitch> + </div> </div> <div class="error-line"> ${ placementMissing ? html` @@ -1079,6 +1120,20 @@ class QualifiedSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitEle @dbp-pdf-preview-accept="${this.storePDFData}" @dbp-pdf-preview-cancel="${this.hidePDF}"></dbp-pdf-preview> </div> + <!-- Annotation view --> + <div id="annotation-view" class="field ${classMap({hidden: !this.isAnnotationViewVisible || !this.allowAnnotating})}"> + <h2>${i18n.t('qualified-pdf-upload.annotation-view-label')}</h2> + <div class="box-header"> + <div class="filename"> + <strong>${this.currentFile.name}</strong> (${humanFileSize(this.currentFile !== undefined ? this.currentFile.size : 0)}) + </div> + <button class="button is-cancel annotation" + @click="${this.hideAnnotationView}"><dbp-icon name="close" id="close-icon"></dbp-icon></button> + </div> + <dbp-annotation-view lang="${this.lang}" + @dbp-annotation-save="${this.processAnnotationEvent}" + @dbp-annotation-cancel="${this.hideAnnotationView}"></dbp-annotation-view> + </div> <!-- File upload progress --> <div id="upload-progress" class="field notification is-info ${classMap({hidden: !this.uploadInProgress})}"> <dbp-mini-spinner></dbp-mini-spinner> diff --git a/src/dbp-signature-lit-element.js b/src/dbp-signature-lit-element.js index 23a668b..a03d5b1 100644 --- a/src/dbp-signature-lit-element.js +++ b/src/dbp-signature-lit-element.js @@ -112,6 +112,54 @@ export default class DBPSignatureLitElement extends DBPSignatureBaseLitElement { return file; } + /** + * + * @param {*} key + * @param {*} name + * @returns + */ + async showAnnotationView(key, name) { + if (this.signingProcessEnabled) { + return; + } + + if (name === 'text-selected') { + const file = this.getQueuedFile(key); + this.currentFile = file; + this.currentPreviewQueueKey = key; + console.log(file); + + const viewTag = this.constructor.getScopedTagName('dbp-annotation-view'); + this._(viewTag).setAttribute('key', key); + + this.isAnnotationViewVisible = true; + + } else if (this.currentPreviewQueueKey === key) { + this.isAnnotationViewVisible = false; + } + } + + /** + * + * @param {*} event + */ + processAnnotationEvent(event) { + let annotationDetails = event.detail; + let key = this.currentPreviewQueueKey; + + this.queuedFilesAnnotations[key] = annotationDetails.annotationRows; + + this.isAnnotationViewVisible = false; + } + + /** + * Hides the AnnotationView + */ + hideAnnotationView() { + this._("#annotation-switch").name = "no-text"; + this.isAnnotationViewVisible = false; + } + /** * Add an annotation to a file on the queue * diff --git a/src/i18n/de/translation.json b/src/i18n/de/translation.json index 70eefa8..dc517e5 100644 --- a/src/i18n/de/translation.json +++ b/src/i18n/de/translation.json @@ -29,7 +29,11 @@ "confirm-page-leave": "Sind Sie sicher, dass Sie die Seite verlassen wollen? Es stehen signierte Dokumente zum Download bereit.", "file-picker-context": "PDF-Dokumente zum Signieren auswählen", "add-annotation-title": "Dem PDF eine Kennzahl hinzufügen", - "annotation-type-please-select": "Bitte wählen Sie einen Typ aus" + "annotation-type-please-select": "Bitte wählen Sie einen Typ aus", + "annotation": "Text anbringen", + "annotation-no": "Nein", + "annotation-yes": "Ja", + "annotation-view-label": "Text zu Dokument hinzufügen" }, "qualified-pdf-upload": { "save-field-label": "{{count}} Datei speichern", @@ -62,7 +66,11 @@ "signature-placement-label": "Signatur platzieren", "positioning": "Positionierung", "confirm-page-leave": "Sind Sie sicher, dass Sie die Seite verlassen wollen? Es stehen signierte Dokumente zum Download bereit.", - "file-picker-context": "PDF-Dokumente zum Signieren auswählen" + "file-picker-context": "PDF-Dokumente zum Signieren auswählen", + "annotation": "Text anbringen", + "annotation-no": "Nein", + "annotation-yes": "Ja", + "annotation-view-label": "Text zu Dokument hinzufügen" }, "signature-verification": { "upload-text": "Sie können in diesem Bereich PDF-Dokumente mit einer Maximalgröße von bis zu 32MB pro Dokument hochladen. Die PDF-Dokumente dürfen sich auch in ZIP-Dateien befinden.", @@ -109,6 +117,19 @@ "rotate": "Signatur rotieren", "continue": "Platzierung bestätigen" }, + "annotation-view": { + "delete-all-button-text": "Alle entfernen", + "delete-all-button-title": "Alle entfernen", + "save-all-button-text": "Für Dokument übernehmen", + "save-all-button-title": "Für Dokument übernehmen", + "insert-field": "Neues Feld einfügen", + "remove-field": "Feld löschen", + "type-value-1": "Geschäftszahl", + "type-value-2": "Verwendungszweck", + "businessnumber-placeholder": "Z.B. 247/1/2020-S", + "intended-use-placeholder": "Fügen Sie hier den gewünschten Text ein", + "introduction": "In diesem Bereich können Sie zusätzlichen Text definieren, der in der Signatur enthalten sein soll. Klicken Sie dafür auf \"Neues Feld einfügen\" und wählen Sie das gewünschte Feld aus. Klicken Sie dann auf das \"+\" um das Feld einzufügen und den gewünschten Text einzugeben." + }, "error-permission-message": "Sie müssen das Recht auf Amtssignaturen besitzen um diese Funktion nutzen zu können!", "error-login-message": "Sie müssen eingeloggt sein um diese Funktion nutzen zu können!", "error-cancel-message": "Der Signaturprozess wurde manuell abgebrochen.", diff --git a/src/i18n/en/translation.json b/src/i18n/en/translation.json index 9aad848..8f57017 100644 --- a/src/i18n/en/translation.json +++ b/src/i18n/en/translation.json @@ -29,7 +29,11 @@ "confirm-page-leave": "Are you sure you want to leave this page? There are still signed documents ready to be downloaded.", "file-picker-context": "Upload PDF-documents to sign", "add-annotation-title": "Add annotation to PDF", - "annotation-type-please-select": "Please select a type" + "annotation-type-please-select": "Please select a type", + "annotation": "Add text", + "annotation-no": "No", + "annotation-yes": "Yes", + "annotation-view-label": "Add text to document" }, "qualified-pdf-upload": { "save-field-label": "Save {{count}} file", @@ -62,7 +66,11 @@ "signature-placement-label": "Place signature", "positioning": "Positioning", "confirm-page-leave": "Are you sure you want to leave this page? There are still signed documents ready to be downloaded.", - "file-picker-context": "Upload PDF-documents to sign" + "file-picker-context": "Upload PDF-documents to sign", + "annotation": "Add text", + "annotation-no": "No", + "annotation-yes": "Yes", + "annotation-view-label": "Add text to document" }, "signature-verification": { "upload-text": "In this area you can upload PDF-documents up to a size of 32MB. The PDF-documents can also be located in a ZIP-file.", @@ -109,6 +117,19 @@ "rotate": "Rotate signature", "continue": "Confirm placement" }, + "annotation-view": { + "delete-all-button-text": "Clear all", + "delete-all-button-title": "Clear all", + "save-all-button-text": "Add to document", + "save-all-button-title": "Add to document", + "insert-field": "Insert new field", + "remove-field": "Delete field", + "type-value-1": "Businessnumber", + "type-value-2": "Intended use", + "businessnumber-placeholder": "E.g. 247/1/2020-S", + "intended-use-placeholder": "Insert text here", + "introduction": "In this area you can define additional text to be included in the signature. To do this, click on \"Insert new field\" and select the desired field. Then click on the \"+\" to insert the field and enter the desired text." + }, "error-permission-message": "You need have permissions to use the official signature to use this function!", "error-login-message": "You need to be logged in to use this function!", "error-cancel-message": "The signature process was manually aborted.", diff --git a/src/utils.js b/src/utils.js index 603d5c8..612766a 100644 --- a/src/utils.js +++ b/src/utils.js @@ -276,8 +276,8 @@ export const getAnnotationTypes = (key = null) => { 'en': 'Businessnumber', }, '85a4eb4c': { - 'de': 'Andere Zahl', - 'en': 'Other number', + 'de': 'Verwendungszweck', + 'en': 'Intended use', } }; -- GitLab