RED-8762: do not update addToDictionaryAction for dossier dictionaries when... #451

Merged
ali.oezyetimoglu1 merged 1 commits from RED-8762-bp3 into release/2.349.x 2024-04-15 14:03:13 +02:00

View File

@ -129,7 +129,7 @@ public class DictionaryService {
updateType(dossierTemplateId, toTypeId(type, dossierTemplateId), typeValue);
var dossierTypes = dictionaryPersistenceService.getAllDossierTypesForDossierTemplateAndType(dossierTemplateId, type, false);
dossierTypes.forEach(t -> this.updateDossierType(t.getType(), dossierTemplateId, typeValue, t.getDossierId()));
dossierTypes.forEach(t -> this.updateDossierType(t.getType(), dossierTemplateId, typeValue, t.getDossierId(), t));
}
@ -155,11 +155,12 @@ public class DictionaryService {
@PreAuthorize("hasAuthority('" + ADD_UPDATE_DOSSIER_DICTIONARY_TYPE + "')")
public void updateDossierType(String type, String dossierTemplateId, UpdateTypeValue typeValue, String dossierId) {
public void updateDossierType(String type, String dossierTemplateId, UpdateTypeValue typeValue, String dossierId, TypeEntity typeEntity) {
accessControlService.verifyUserIsDossierOwner(dossierId);
// we do not set the flag addToDictionaryAction when updating the global type
dictionaryManagementService.updateTypeValue(toTypeId(type, dossierTemplateId, dossierId),
if (typeEntity.isDossierDictionaryOnly()) {
dictionaryManagementService.updateTypeValue(toTypeId(type, dossierTemplateId, dossierId),
Type.builder()
.dossierTemplateId(dossierTemplateId)
.hexColor(typeValue.getHexColor())
@ -170,10 +171,14 @@ public class DictionaryService {
.isCaseInsensitive(typeValue.isCaseInsensitive())
.isRecommendation(typeValue.isRecommendation())
.description(typeValue.getDescription())
.addToDictionaryAction(typeEntity.isAddToDictionaryAction())
.label(typeValue.getLabel())
.hasDictionary(typeValue.isHasDictionary())
.autoHideSkipped(typeValue.isAutoHideSkipped())
.build());
} else {
updateType(dossierTemplateId, toTypeId(type, dossierTemplateId, dossierId), typeValue);
}
}