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

Merge in RED/redaction-service from RED-510 to master

* commit '1b2bd7fa209cba7e635bbaad7962396d931576ff':
  RED-510: Do not add annotations for manual redactions that are approved and should be already in a dictionary
This commit is contained in:
Dominique Eiflaender 2020-10-29 15:37:37 +01:00
commit de66d2fda8

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)) {