Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added shapes and fixed reply note issue #721

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions web/src/components/FOI/Home/Redlining.js
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,10 @@ const Redlining = React.forwardRef(
case "rectangle":
return "square";
case "freehand":
case "other":
return "ink";
case "ellipse":
return "circle";
default:
return type;
}
Expand Down Expand Up @@ -2405,13 +2408,7 @@ const Redlining = React.forwardRef(
return stitchAnnotation.join();
};

const formatAnnotationsForDocument = (
domParser,
data,
redlinepageMappings,
documentid
) => {
let updatedXML = [];
const constructFreeTextAndannoteIds = (data) => {
let _freeTextIds=[];
let _annoteIds=[];
for (let annotxml of data) {
Expand All @@ -2422,6 +2419,20 @@ const Redlining = React.forwardRef(
let xmlObjAnnotId = xmlObj.attributes.name;
_annoteIds.push({ [xmlObjAnnotId]: xmlObj });
}
}
return {_freeTextIds, _annoteIds}
}
const formatAnnotationsForDocument = (
domParser,
data,
redlinepageMappings,
documentid
) => {
let updatedXML = [];
const { _freeTextIds, _annoteIds } = constructFreeTextAndannoteIds(data);

for (let annotxml of data) {
let xmlObj = parser.parseFromString(annotxml);
let customfield = xmlObj.children.find(
(xmlfield) => xmlfield.name == "trn-custom-data"
);
Expand All @@ -2446,7 +2457,7 @@ const Redlining = React.forwardRef(

annotxml = annotxml.replace(flags, updatedFlags);
annotxml = annotxml.replace(oldPageNum, newPage);
console.log("filteredComments:",filteredComments);

if (xmlObj.name === "redact" || customData["parentRedaction"] ||
(Object.entries(filteredComments).length> 0 && checkFilter(xmlObj,_freeTextIds,_annoteIds)))
updatedXML.push(annotxml);
Expand Down