RED-7241: adapted resize endpoints for multi-level dictionaries and added... #67

Merged
ali.oezyetimoglu1 merged 8 commits from RED-7241-ps6 into master 2023-08-11 12:17:40 +02:00
Showing only changes of commit 0835bf50be - Show all commits

View File

@ -716,13 +716,17 @@ public class ManualRedactionService {
RedactionLogEntry redactionLogEntry = null;
try {
log.info("Will get redaction log entry");
redactionLogEntry = getRedactionLogEntry(redactionLog, resizeRedaction.getId().getAnnotationId());
log.info("Got redaction log entry!");
} catch (NotFoundException e) {
log.info("Oh no! Cannot get redaction log entry!");
return;
}
if (resizeRedaction.getUpdateDictionary() != null && resizeRedaction.getUpdateDictionary() && resizeRedaction.getStatus()
.equals(AnnotationStatus.APPROVED) && (redactionLogEntry.isDictionaryEntry() || redactionLogEntry.isDossierDictionaryEntry())) {
log.info("We will update the resize redaction");
var dossier = dossierPersistenceService.findByDossierId(dossierId);
var typeId = buildTypeId(redactionLogEntry, resizeRedaction, dossier);
@ -732,6 +736,7 @@ public class ManualRedactionService {
boolean isShrinking = oldValue != null && oldValue.length() > newValue.length();
log.info("isShrinking: ", isShrinking);
if (isShrinking) {
log.info("Remove old value '{}' from dictionary", oldValue);
removeFromDictionary(typeId, oldValue, dossierId, fileId, dictionaryEntryType);