RED-8034: Filter out entityLog entries for excluded pages

This commit is contained in:
Dominique Eifländer 2023-12-22 10:19:40 +01:00
parent b7c4ec2d75
commit 701e173b99

View File

@ -71,8 +71,8 @@ public class EntityLogService {
if (fileStatus.getExcludedPages() != null && !fileStatus.getExcludedPages().isEmpty()) {
entityLog.getEntityLogEntry()
.forEach(entry -> entry.setExcluded(entry.getPositions().stream().anyMatch(position -> fileStatus.getExcludedPages().contains(position.getPageNumber())) //
&& entry.getManualChanges().stream().noneMatch(m -> m.getManualRedactionType().equals(ManualRedactionType.ADD_LOCALLY))));
.removeIf(entry -> entry.getPositions().stream().anyMatch(position -> fileStatus.getExcludedPages().contains(position.getPageNumber())) //
&& entry.getManualChanges().stream().noneMatch(m -> m.getManualRedactionType().equals(ManualRedactionType.ADD_LOCALLY)));
}
Map<String, Integer> commentCountPerAnnotationId = commentService.getCommentCounts(fileId);