RED-7400: changed logic for flag isLocalManualRedaction

This commit is contained in:
Ali Oezyetimoglu 2023-08-15 12:33:37 +02:00
parent 2eecf7c428
commit 067fb8a814
2 changed files with 8 additions and 6 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,12 +87,7 @@ public class RedactionLogEntry {
public boolean isLocalManualRedaction() {
return manualChanges != null && manualChanges.stream()
.anyMatch(mc -> mc.getManualRedactionType() == ManualRedactionType.ADD_LOCALLY && mc.getAnnotationStatus() == AnnotationStatus.APPROVED
|| isResizeRedaction(mc));
}
private boolean isResizeRedaction(ManualChange mc) {
return mc.getManualRedactionType() == ManualRedactionType.RESIZE && mc.getAnnotationStatus() == AnnotationStatus.APPROVED;
.anyMatch(mc -> (mc.getManualRedactionType() == ManualRedactionType.ADD_LOCALLY || mc.getManualRedactionType() == ManualRedactionType.RESIZE) && mc.getAnnotationStatus() == AnnotationStatus.APPROVED);
}