RED-7400: fixed error of breaking redaction log with removing engine-check for resize redactions #68

Merged
ali.oezyetimoglu1 merged 2 commits from RED-7400-ps1 into master 2023-08-16 11:58:47 +02:00
2 changed files with 8 additions and 2 deletions

View File

@ -103,6 +103,7 @@ public class RedactionLogMergeService {
if (excludedPages != null && !excludedPages.isEmpty()) {
entry.getPositions().forEach(pos -> {
if (!entry.isLocalManualRedaction() && excludedPages.contains(pos.getPage())) {
// if (!isLocalManualRedaction(entry.getManualChanges()) && excludedPages.contains(pos.getPage())) {
entry.setExcluded(true);
}
});
@ -131,6 +132,12 @@ public class RedactionLogMergeService {
return redactionLog;
}
// private boolean isLocalManualRedaction(List<ManualChange> manualChanges) {
//
// return manualChanges != null && manualChanges.stream()
// .anyMatch(mc -> (mc.getManualRedactionType() == ManualRedactionType.ADD_LOCALLY || mc.getManualRedactionType() == ManualRedactionType.RESIZE) && mc.getAnnotationStatus() == AnnotationStatus.APPROVED);
// }
private List<ManualRedactionWrapper> createManualRedactionWrappers(ManualRedactions manualRedactions) {

View File

@ -87,8 +87,7 @@ public class RedactionLogEntry {
public boolean isLocalManualRedaction() {
return manualChanges != null && manualChanges.stream()
.anyMatch(mc -> mc.getManualRedactionType() == ManualRedactionType.ADD_LOCALLY && mc.getAnnotationStatus() == AnnotationStatus.APPROVED
|| mc.getManualRedactionType() == ManualRedactionType.RESIZE && mc.getAnnotationStatus() == AnnotationStatus.APPROVED && engines.contains(Engine.RULE) && !engines.contains(Engine.DICTIONARY));
.anyMatch(mc -> (mc.getManualRedactionType() == ManualRedactionType.ADD_LOCALLY || mc.getManualRedactionType() == ManualRedactionType.RESIZE) && mc.getAnnotationStatus() == AnnotationStatus.APPROVED);
}