diff --git a/microfrontends/SignDocuments/src/Component/DebugUi.js b/microfrontends/SignDocuments/src/Component/DebugUi.js index 94ff9bdf8..39237fd59 100644 --- a/microfrontends/SignDocuments/src/Component/DebugUi.js +++ b/microfrontends/SignDocuments/src/Component/DebugUi.js @@ -148,7 +148,9 @@ const DebugUi = () => { const handleMouseDown = (event) => { if (newAnnotation.length === 0) { const { x, y } = event.target.getStage().getPointerPosition(); - setNewAnnotation([{ x, y, width: 0, height: 0, key: "0" }]); + setNewAnnotation([ + { x, y, width: 0, height: 0, key: "0", page: pageNumber } + ]); } }; @@ -158,7 +160,11 @@ const DebugUi = () => { const sy = newAnnotation[0].y; const { x, y } = event.target.getStage().getPointerPosition(); const result = processDimensions(sx, sy, x - sx, y - sy); - const annotationToAdd = { ...result, key: annotations.length + 1 }; + const annotationToAdd = { + ...result, + key: annotations.length + 1, + page: pageNumber + }; annotations.push(annotationToAdd); setNewAnnotation([]); setAnnotations(annotations); @@ -181,6 +187,7 @@ const DebugUi = () => { y: sy, width: x - sx, height: y - sy, + page: pageNumber, key: "0" } ]); @@ -349,38 +356,40 @@ const DebugUi = () => { - {` ["x": ${coord.x}, "y": ${coord.y}, "w": ${coord.width}, "h": ${coord.height}]`} + {` ["page":${coord?.page}, "x": ${coord.x}, "y": ${coord.y}, "w": ${coord.width}, "h": ${coord.height}]`} - - copytoclipboard( - `["x": ${coord.x}, "y": ${coord.y}, "w": ${coord.width}, "h": ${coord.height}]` - ) - } - > - - - handleDelete(coord.key)} - > - - +
+ + copytoclipboard( + `"page":${coord?.page}, "x": ${coord.x}, "y": ${coord.y}, "w": ${coord.width}, "h": ${coord.height}` + ) + } + > + + + handleDelete(coord.key)} + > + + +
))} diff --git a/microfrontends/SignDocuments/src/Component/component/RenderDebugPdf.js b/microfrontends/SignDocuments/src/Component/component/RenderDebugPdf.js index 5c31d56c8..89ddd03f5 100644 --- a/microfrontends/SignDocuments/src/Component/component/RenderDebugPdf.js +++ b/microfrontends/SignDocuments/src/Component/component/RenderDebugPdf.js @@ -61,18 +61,20 @@ const RenderDebugPdf = (props) => { style={{ position: "absolute", top: 0, left: 0 }} > - {props.annotations.map((value) => { - return ( - - ); - })} + {props.annotations + .filter((value) => value.page === props.pageNumber) + .map((value) => { + return ( + + ); + })}