RED-8480: don't merge recategorizations for images, create pending entry instead
* TODO: remove filter in report-service and pdftron-redaction-service
This commit is contained in:
parent
75676c33b1
commit
efc2b200ad
@ -52,7 +52,7 @@ public class ManualRedactionDictionaryUpdateHandler {
|
|||||||
|
|
||||||
public Set<String> handleAddToDictionaryAndReturnModifiedTypeIds(String fileId, String value, ManualRequestWithAddToDictionary manualRequestWithAddToDictionary) {
|
public Set<String> handleAddToDictionaryAndReturnModifiedTypeIds(String fileId, String value, ManualRequestWithAddToDictionary manualRequestWithAddToDictionary) {
|
||||||
|
|
||||||
if (!manualRequestWithAddToDictionary.isAddToDictionary()) {
|
if (!manualRequestWithAddToDictionary.isAddToDictionary() || value == null) {
|
||||||
return Collections.emptySet();
|
return Collections.emptySet();
|
||||||
}
|
}
|
||||||
Set<String> typeIdsOfModifiedDictionaries = new HashSet<>();
|
Set<String> typeIdsOfModifiedDictionaries = new HashSet<>();
|
||||||
@ -99,7 +99,7 @@ public class ManualRedactionDictionaryUpdateHandler {
|
|||||||
|
|
||||||
public Set<String> handleRemoveFromDictionaryAndReturnModifiedTypeIds(String fileId, ManualRequestWithRemoveFromDictionary manualRequestWithRemoveFromDictionary) {
|
public Set<String> handleRemoveFromDictionaryAndReturnModifiedTypeIds(String fileId, ManualRequestWithRemoveFromDictionary manualRequestWithRemoveFromDictionary) {
|
||||||
|
|
||||||
if (!manualRequestWithRemoveFromDictionary.isRemoveFromDictionary()) {
|
if (!manualRequestWithRemoveFromDictionary.isRemoveFromDictionary() || manualRequestWithRemoveFromDictionary.getValue() == null) {
|
||||||
return Collections.emptySet();
|
return Collections.emptySet();
|
||||||
}
|
}
|
||||||
String dossierId = manualRequestWithRemoveFromDictionary.getDossierId();
|
String dossierId = manualRequestWithRemoveFromDictionary.getDossierId();
|
||||||
|
|||||||
@ -191,13 +191,12 @@ public class ManualRedactionMapper {
|
|||||||
.addToDictionary(recategorizationRequest.isAddToDictionary())
|
.addToDictionary(recategorizationRequest.isAddToDictionary())
|
||||||
.addToAllDossiers(recategorizationRequest.isAddToAllDossiers())
|
.addToAllDossiers(recategorizationRequest.isAddToAllDossiers())
|
||||||
.dictionaryEntryType(getDictionaryEntryType(entityLogEntry))
|
.dictionaryEntryType(getDictionaryEntryType(entityLogEntry))
|
||||||
.value(entityLogEntry.getValue())
|
.value(recategorizationRequest.getValue())
|
||||||
.typeToRemove(entityLogEntry.getType())
|
.typeToRemove(entityLogEntry.getType())
|
||||||
.dossierTemplateTypeId(toTypeId(recategorizationRequest.getType(), dossierTemplateId))
|
.dossierTemplateTypeId(toTypeId(recategorizationRequest.getType(), dossierTemplateId))
|
||||||
.legalBasis(Optional.ofNullable(recategorizationRequest.getLegalBasis())
|
.legalBasis(Optional.ofNullable(recategorizationRequest.getLegalBasis())
|
||||||
.orElse(""))
|
.orElse(""))
|
||||||
.section(recategorizationRequest.getSection())
|
.section(recategorizationRequest.getSection())
|
||||||
.value(recategorizationRequest.getValue())
|
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
if (!entityLogEntry.getEngines().contains(Engine.MANUAL) && !recategorizationRequest.isAddToAllDossiers() && !recategorizationRequest.isAddToDictionary()) {
|
if (!entityLogEntry.getEngines().contains(Engine.MANUAL) && !recategorizationRequest.isAddToAllDossiers() && !recategorizationRequest.isAddToDictionary()) {
|
||||||
|
|||||||
@ -240,6 +240,7 @@ public class ManualRedactionService {
|
|||||||
Set<String> typeIdsOfDictionariesWithAdd = manualRedactionDictionaryUpdateHandler.handleAddToDictionaryAndReturnModifiedTypeIds(fileId,
|
Set<String> typeIdsOfDictionariesWithAdd = manualRedactionDictionaryUpdateHandler.handleAddToDictionaryAndReturnModifiedTypeIds(fileId,
|
||||||
recategorizationRequest.getValue(),
|
recategorizationRequest.getValue(),
|
||||||
recategorizationRequest);
|
recategorizationRequest);
|
||||||
|
|
||||||
Set<String> typeIdsOfDictionariesWithDelete = manualRedactionDictionaryUpdateHandler.handleRemoveFromDictionaryAndReturnModifiedTypeIds(fileId,
|
Set<String> typeIdsOfDictionariesWithDelete = manualRedactionDictionaryUpdateHandler.handleRemoveFromDictionaryAndReturnModifiedTypeIds(fileId,
|
||||||
recategorizationRequest);
|
recategorizationRequest);
|
||||||
|
|
||||||
@ -255,6 +256,7 @@ public class ManualRedactionService {
|
|||||||
|
|
||||||
response.add(ManualAddResponse.builder().annotationId(recategorizationRequest.getAnnotationId()).commentId(commentId).build());
|
response.add(ManualAddResponse.builder().annotationId(recategorizationRequest.getAnnotationId()).commentId(commentId).build());
|
||||||
}
|
}
|
||||||
|
|
||||||
reprocess(dossierId, fileId);
|
reprocess(dossierId, fileId);
|
||||||
|
|
||||||
fileStatusPersistenceService.setLastManualChangeDate(fileId, OffsetDateTime.now());
|
fileStatusPersistenceService.setLastManualChangeDate(fileId, OffsetDateTime.now());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user