diff --git a/web/src/components/FOI/Home/Redlining.js b/web/src/components/FOI/Home/Redlining.js index 2fd39590e..72fdd0e66 100644 --- a/web/src/components/FOI/Home/Redlining.js +++ b/web/src/components/FOI/Home/Redlining.js @@ -1428,6 +1428,9 @@ const Redlining = React.forwardRef( let username = docViewer?.getAnnotationManager()?.getCurrentUser(); for (const entry in annotData) { let xml = parser.parseFromString(annotData[entry]); + // import redactions first, free text later, so translucent redaction won't cover free text + let xmlAnnotsChildren_redaction = []; + let xmlAnnotsChildren_others = []; for (let annot of xml.getElementsByTagName("annots")[0].children) { let txt = domParser.parseFromString( annot.getElementsByTagName("trn-custom-data")[0].attributes.bytes, @@ -1441,6 +1444,12 @@ const Redlining = React.forwardRef( (p) => p.pageNo - 1 === Number(originalPageNo) )?.stitchedPageNo - 1 )?.toString(); + if(annot.attributes.subject === "Redact") { + xmlAnnotsChildren_redaction.push(annot); + } else { + xmlAnnotsChildren_others.push(annot); + } + xml.getElementsByTagName("annots")[0].children = [...xmlAnnotsChildren_redaction, ...xmlAnnotsChildren_others]; } xml = parser.toString(xml); const _annotations = await annotManager.importAnnotations(xml);