Pull request #183: added dictionary entries

Merge in RED/redaction-service from redaction-log-backend-preview-remove-code-duplication-from-ui to master

* commit '6741b8a596fcb7a014fdbca371329f1cf46d1fd7':
  added dictionary entries
This commit is contained in:
Timo Bejan 2021-07-12 09:40:36 +02:00
commit 6eb6455247

View File

@ -624,9 +624,27 @@ public class RedactionLogCreatorService {
processRedactionLogEntry(manualRedactions, dossierTemplateId, entry, reasonHolder);
}
handleAddToDictionary(redactionLog, manualRedactions, dossierTemplateId);
return redactionLog;
}
private void handleAddToDictionary(RedactionLog redactionLog, ManualRedactions manualRedactions, String dossierTemplateId) {
for (var manualRedaction : manualRedactions.getEntriesToAdd()) {
if (manualRedaction.isAddToDictionary() || manualRedaction.isAddToDossierDictionary()) {
var redactionLogEntry = createRedactionLogEntry(manualRedaction, manualRedaction.getId(), dossierTemplateId);
redactionLogEntry.setDictionaryEntry(manualRedaction.isAddToDossierDictionary());
redactionLogEntry.setDossierDictionaryEntry(manualRedaction.isAddToDossierDictionary());
redactionLog.getRedactionLogEntry().add(redactionLogEntry);
}
}
}
public static class PreviewReasonHolder implements ReasonHolder {
private final RedactionLogEntry entry;