Skip to content

Commit

Permalink
Fix observation #1 in FOIMOD-599
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-aot committed Aug 21, 2024
1 parent 38e00fe commit e6b4f3b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions web/src/components/FOI/Home/Redlining.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);
Expand Down

0 comments on commit e6b4f3b

Please sign in to comment.