RED-8762: do not update addToDictionaryAction for dossier dictionaries when... #451
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user