Skip to content

Commit

Permalink
removed logs, commented line, reverted #4707 changed
Browse files Browse the repository at this point in the history
  • Loading branch information
divyav-aot committed Jan 16, 2024
1 parent c59ddf3 commit 3f46eb5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 40 deletions.
2 changes: 1 addition & 1 deletion api/reviewer_api/resources/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def get(requestid):
"requesttype": jsonobj["requestType"]
}
result = documentservice().getdocuments(requestid, requestinfo["bcgovcode"])
return json.dumps({"requeststatuslabel": jsonobj["requeststatuslabel"], "documents": result, "requestnumber":jsonobj["axisRequestId"], "requestinfo":requestinfo}), 200
return json.dumps({"requeststatusid": jsonobj["requeststatusid"], "documents": result, "requestnumber":jsonobj["axisRequestId"], "requestinfo":requestinfo}), 200
except KeyError as error:
return {'status': False, 'message': CUSTOM_KEYERROR_MESSAGE + str(error)}, 400
except BusinessException as exception:
Expand Down
2 changes: 1 addition & 1 deletion web/src/apiManager/services/docReviewerService.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const fetchDocuments = (
const __files = res.data.documents.filter((d: any) => !d.attributes.incompatible);
store.dispatch(setDocumentList(__files) as any);
store.dispatch(setRequestNumber(res.data.requestnumber) as any);
store.dispatch(setRequestStatus(res.data.requeststatuslabel) as any);
store.dispatch(setRequestStatus(res.data.requeststatusid) as any);
store.dispatch(setRequestInfo(res.data.requestinfo) as any);
callback(res.data.documents);
} else {
Expand Down
23 changes: 3 additions & 20 deletions web/src/components/FOI/Home/Redlining.js
Original file line number Diff line number Diff line change
Expand Up @@ -2358,7 +2358,6 @@ const Redlining = React.forwardRef(
docCounter++;
documentRedlineAnnotations[documentid] = data[documentid];
if (docCounter == documentids.length) {
console.log("documentRedlineAnnotations:",documentRedlineAnnotations)
setRedlineDocumentAnnotations(documentRedlineAnnotations);
}
}
Expand Down Expand Up @@ -2417,23 +2416,16 @@ const Redlining = React.forwardRef(
let _annoteIds=[];
for (let annotxml of data) {
let xmlObj = parser.parseFromString(annotxml);
//console.log("xmlObj:", xmlObj);
let filterComments = {"types":["note","rectangle"],"authors":["dviswana@idir"],
"colors":["#ffcd45ff","#4e7de9ff","#007a3bff"],"statuses":[],"checkRepliesForAuthorFilter":true};
//if (xmlObj.name === "redact" || xmlObj.name === "freetext" || xmlObj.name === "text") {
if(xmlObj.name === "freetext")
_freeTextIds.push(xmlObj.attributes.name);
else if(xmlObj.name != "redact" && xmlObj.name != "freetext"){
let xmlObjAnnotId = xmlObj.attributes.name;
_annoteIds.push({ [xmlObjAnnotId]: xmlObj });

}

}
let customfield = xmlObj.children.find(
(xmlfield) => xmlfield.name == "trn-custom-data"
);
let flags = xmlObj.attributes.flags;
//console.log("flags:",flags)
let txt = domParser.parseFromString(
customfield.attributes.bytes,
"text/html"
Expand All @@ -2450,21 +2442,14 @@ const Redlining = React.forwardRef(
'page="' +
(redlinepageMappings[documentid][originalPageNo + 1] - 1) +
'"';
// let updatedBytes= customfield.attributes.bytes.slice(0, 1) +""trn-annot-locked":"true","trn-annot-no-move":"true","+
// customfield.attributes.bytes.slice(1);

let updatedFlags = xmlObj.attributes.flags+',locked';
let updatedFlags = xmlObj.attributes.flags+',locked';

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

//if (xmlObj.name === "redact" || customData["parentRedaction"] || xmlObj.name === "text") {
if (xmlObj.name === "redact" || customData["parentRedaction"] ||
(Object.entries(filteredComments).length> 0 && checkFilter(xmlObj,_freeTextIds,_annoteIds)))
updatedXML.push(annotxml);
//}
}
}
return updatedXML.join();
Expand Down Expand Up @@ -3002,8 +2987,6 @@ const Redlining = React.forwardRef(
redlinepageMappings["pagestoremove"][divisionid]
);
}
// const annotManager1= docViewer.getAnnotationManager();
// let abcannot= annotManager1.flattenAnnotations(formattedAnnotationXML)
let xfdfString =
'<?xml version="1.0" encoding="UTF-8" ?><xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve"><annots>' +
formattedAnnotationXML +
Expand All @@ -3013,7 +2996,7 @@ const Redlining = React.forwardRef(
// saves the document with annotations in it
xfdfString: xfdfString,
downloadType: downloadType,
//flatten: true,
//flatten: true, //commented this as part of #4862
})
.then(async (_data) => {
const _arr = new Uint8Array(_data);
Expand Down
36 changes: 18 additions & 18 deletions web/src/constants/enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,27 +66,27 @@ const pageFlagTypes:pageFlagType = {
};

type RequestStatesType = {
[key: string]: string
[key: string]: number
}

const RequestStates:RequestStatesType = {
"Open": "open",
"Call For Records": "callforrecords",
"Closed": "closed",
"Redirect": "redirect",
"Unopened": "unopened",
"Intake in Progress": "intakeinprogress",
"Records Review": "recordsreview",
"Fee Estimate": "feeestimate",
"Consult": "consult",
"Ministry Sign Off": "ministrysignoff",
"On Hold": "onhold",
"Deduplication": "deduplication",
"Harms Assessment": "harmsassessment",
"Response": "response",
"Archived": "archived",
"Peer Review": "peerreview",
"Call For Records Overdue": "callforrecordsoverdue"
"Open": 1,
"Call For Records": 2,
"Closed": 3,
"Redirect": 4,
"Unopened": 5,
"Intake in Progress": 6,
"Records Review": 7,
"Fee Estimate": 8,
"Consult": 9,
"Ministry Sign Off": 10,
"On Hold": 11,
"Deduplication": 12,
"Harms Assessment": 13,
"Response": 14,
"Archived": 15,
"Peer Review": 16,
"Call For Records Overdue": 17
};

export {
Expand Down

0 comments on commit 3f46eb5

Please sign in to comment.