Pull request #185: Redaction log backend preview remove code duplication from ui
Merge in RED/redaction-service from redaction-log-backend-preview-remove-code-duplication-from-ui to master * commit '3517841d24bc69028391043157d9fcf142600ddf': positions for dict entries added some logging added some logging
This commit is contained in:
commit
88704717d0
@ -160,6 +160,7 @@ public class RedactionController implements RedactionResource {
|
||||
@Override
|
||||
public RedactionLog getRedactionLogPreview(RedactionRequest redactionRequest) {
|
||||
|
||||
log.info("Requested preview for: {}", redactionRequest);
|
||||
var redactionLog = redactionStorageService.getRedactionLog(redactionRequest.getDossierId(), redactionRequest.getFileId());
|
||||
|
||||
return redactionLogCreatorService.getRedactionLogPreview(redactionLog, redactionRequest.getDossierTemplateId(), redactionRequest.getManualRedactions());
|
||||
|
||||
@ -163,6 +163,7 @@ public class DictionaryService {
|
||||
|
||||
public float[] getColor(String type, String dossierTemplateId) {
|
||||
|
||||
log.info("requested : {} / {}",type,dossierTemplateId);
|
||||
DictionaryModel model = dictionariesByDossierTemplate.get(dossierTemplateId).getLocalAccessMap().get(type);
|
||||
if (model != null) {
|
||||
return model.getColor();
|
||||
|
||||
@ -639,11 +639,13 @@ public class RedactionLogCreatorService {
|
||||
var redactionLogEntry = createRedactionLogEntry(manualRedaction, manualRedaction.getId(), dossierTemplateId);
|
||||
redactionLogEntry.setDictionaryEntry(manualRedaction.isAddToDossierDictionary());
|
||||
redactionLogEntry.setDossierDictionaryEntry(manualRedaction.isAddToDossierDictionary());
|
||||
redactionLogEntry.setPositions(manualRedaction.getPositions());
|
||||
|
||||
var found = redactionLog.getRedactionLogEntry().stream().filter(r -> r.getId().equalsIgnoreCase(redactionLogEntry.getId())).findAny();
|
||||
if (found.isPresent()) {
|
||||
found.get().setDictionaryEntry(manualRedaction.isAddToDossierDictionary());
|
||||
found.get().setDossierDictionaryEntry(manualRedaction.isAddToDossierDictionary());
|
||||
found.get().setPositions(manualRedaction.getPositions());
|
||||
} else {
|
||||
redactionLog.getRedactionLogEntry().add(redactionLogEntry);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user