fix(annotation): Die klassenbasierte Struktur wurde entfernt und die Methode createSignature in die Methode createAnnotations integriert.

This commit is contained in:
Developer 02
2025-03-26 10:15:05 +01:00
parent c45e6875d0
commit fb0022bd2c
3 changed files with 128 additions and 171 deletions

View File

@@ -70,7 +70,7 @@ class App {
// Load annotations into PSPDFKit
try {
this.signatureCount = this.currentDocument.elements.length
await Annotation.createAnnotations(this.currentDocument, this.Instance)
await createAnnotations(this.currentDocument, this.Instance)
const openResponse = await this.Network.openDocument(this.envelopeKey)
@@ -109,7 +109,7 @@ class App {
const height = 75
const timestamp = new Date()
const imageUrl = await Annotation.createAnnotationFrameBlob(
const imageUrl = await createAnnotationFrameBlob(
this.envelopeReceiver.name,
this.currentReceiver.signature,
timestamp,
@@ -121,7 +121,7 @@ class App {
const blob = await request.blob()
const imageAttachmentId = await this.Instance.createAttachment(blob)
const frameAnnotation = Annotation.createImageAnnotation(
const frameAnnotation = createImageAnnotation(
new PSPDFKit.Geometry.Rect({
left: left,
top: top,
@@ -222,7 +222,7 @@ class App {
const iFormFieldValues = await iJSON.formFieldValues;
//check required
const iReqFields = iFormFieldValues.filter(f => Annotation.isFieldRequired(f))
const iReqFields = iFormFieldValues.filter(f => isFieldRequired(f))
const hasEmptyReq = iReqFields.some(f => (f.value === undefined || f.value === null || f.value === ""))
if (hasEmptyReq) {
@@ -236,7 +236,7 @@ class App {
//check city
const city_regex = new RegExp("^[a-zA-Z\\u0080-\\u024F]+(?:([\\ \\-\\']|(\\.\\ ))[a-zA-Z\\u0080-\\u024F]+)*$")
const iCityFields = iFormFieldValues.filter(f => Annotation.isCityField(f))
const iCityFields = iFormFieldValues.filter(f => isCityField(f))
for (var f of iCityFields)
if (!IS_MOBILE_DEVICE && !city_regex.test(f.value)) {
Swal.fire({
@@ -322,7 +322,7 @@ class App {
async validateAnnotations(totalSignatures) {
const annotations = await Annotation.getAnnotations(this.Instance)
const annotations = await getAnnotations(this.Instance)
const filtered = annotations
.map(a => a.toJS())
.filter(a => a.isSignature)
@@ -343,7 +343,7 @@ class App {
})
if (result.isConfirmed) {
const result = await Annotation.deleteAnnotations(this.Instance)
const result = await deleteAnnotations(this.Instance)
}
return result