Refaktorisierte 'Annotation'-Funktionen zu statischen Methoden.

This commit is contained in:
Developer 02
2024-06-18 18:58:56 +02:00
parent c4a66ee5bb
commit 39cc257466
2 changed files with 15 additions and 16 deletions

View File

@@ -16,7 +16,6 @@ class App {
this.UI = new UI()
this.Network = new Network()
this.Annotation = new Annotation()
this.Instance = null
this.currentDocument = null
@@ -72,7 +71,7 @@ class App {
// Load annotations into PSPDFKit
try {
this.signatureCount = this.currentDocument.elements.length
const annotations = this.Annotation.createAnnotations(
const annotations = Annotation.createAnnotations(
this.currentDocument
)
await this.Instance.create(annotations)
@@ -113,7 +112,7 @@ class App {
const height = 75
const timestamp = new Date()
const imageUrl = await this.Annotation.createAnnotationFrameBlob(
const imageUrl = await Annotation.createAnnotationFrameBlob(
this.envelopeReceiver.name,
this.currentReceiver.signature,
timestamp,
@@ -125,7 +124,7 @@ class App {
const blob = await request.blob()
const imageAttachmentId = await this.Instance.createAttachment(blob)
const frameAnnotation = this.Annotation.createImageAnnotation(
const frameAnnotation = Annotation.createImageAnnotation(
new PSPDFKit.Geometry.Rect({
left: left,
top: top,
@@ -247,7 +246,7 @@ class App {
async validateAnnotations(totalSignatures) {
const annotations = await this.Annotation.getAnnotations(this.Instance)
const annotations = await Annotation.getAnnotations(this.Instance)
const filtered = annotations
.map(a => a.toJS())
.filter(a => a.isSignature)
@@ -268,7 +267,7 @@ class App {
})
if (result.isConfirmed) {
const result = await this.Annotation.deleteAnnotations(this.Instance)
const result = await Annotation.deleteAnnotations(this.Instance)
}
return result