RED-510: Do not add annotations for manual redactions that are approved and should be already in a dictionary

This commit is contained in:
deiflaender 2020-10-29 15:16:30 +01:00
parent 013353d6ef
commit 1b2bd7fa20

View File

@ -223,7 +223,7 @@ public class AnnotationHighlightService {
}
}
if (!rectanglesOnPage.isEmpty()) {
if (!rectanglesOnPage.isEmpty() && !approvedAndShouldBeInDictionary(manualRedactionEntry)) {
annotations.addAll(createAnnotation(rectanglesOnPage, prefixId(manualRedactionEntry, id), createAnnotationContent(manualRedactionEntry), getColorForManualAdd(manualRedactionEntry
.getType(), manualRedactionEntry.getStatus()), manualRedactions.getComments().get(id), true));
classifiedDoc.getRedactionLogEntities().add(redactionLogEntry);
@ -232,6 +232,12 @@ public class AnnotationHighlightService {
}
private boolean approvedAndShouldBeInDictionary(ManualRedactionEntry manualRedactionEntry) {
return manualRedactionEntry.getStatus().equals(Status.APPROVED) && manualRedactionEntry.isAddToDictionary();
}
private String prefixId(ManualRedactionEntry manualRedactionEntry, String id) {
if (manualRedactionEntry.getStatus().equals(Status.APPROVED)) {