validation client and server
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
const annotations = []
|
||||
|
||||
document.elements.forEach((element) => {
|
||||
console.log('Creating annotation for element', element.id)
|
||||
console.debug('Creating annotation for element', element.id)
|
||||
|
||||
const [annotation, formField] = this.createAnnotationFromElement(element)
|
||||
annotations.push(annotation)
|
||||
@@ -13,17 +13,20 @@
|
||||
return annotations
|
||||
}
|
||||
|
||||
async deleteAnnotations(instance) {
|
||||
let pageAnnotations = (
|
||||
await Promise.all(
|
||||
Array.from({ length: instance.totalPageCount }).map((_, pageIndex) =>
|
||||
instance.getAnnotations(pageIndex)
|
||||
)
|
||||
async getAnnotations(instance) {
|
||||
const array = await Promise.all(
|
||||
Array.from({ length: instance.totalPageCount }).map((_, pageIndex) =>
|
||||
instance.getAnnotations(pageIndex)
|
||||
)
|
||||
)
|
||||
.flatMap((annotations) =>
|
||||
annotations.reduce((acc, annotation) => acc.concat(annotation), [])
|
||||
)
|
||||
|
||||
return array.flatMap((annotations) =>
|
||||
annotations.reduce((acc, annotation) => acc.concat(annotation), [])
|
||||
)
|
||||
}
|
||||
|
||||
async deleteAnnotations(instance) {
|
||||
let pageAnnotations = this.getAnnotations(instance)
|
||||
.filter(
|
||||
(annotation) =>
|
||||
!!annotation.isSignature || annotation.description == 'FRAME'
|
||||
@@ -33,16 +36,7 @@
|
||||
}
|
||||
|
||||
async validateAnnotations(instance) {
|
||||
let pageAnnotations = (
|
||||
await Promise.all(
|
||||
Array.from({ length: instance.totalPageCount }).map((_, pageIndex) =>
|
||||
instance.getAnnotations(pageIndex)
|
||||
)
|
||||
)
|
||||
)
|
||||
.flatMap((annotations) =>
|
||||
annotations.reduce((acc, annotation) => acc.concat(annotation), [])
|
||||
)
|
||||
let pageAnnotations = this.getAnnotations(instance)
|
||||
.map((annotation) => {
|
||||
console.log(annotation.toJS())
|
||||
return annotation
|
||||
|
||||
Reference in New Issue
Block a user