RED-8762: do not update addToDictionaryAction for dossier dictionaries when updating dossier template dictionary ONLY if dossierDictionaryOnly
This commit is contained in:
parent
77db059a2e
commit
a86be93177
@ -129,7 +129,7 @@ public class DictionaryService {
|
|||||||
|
|
||||||
updateType(dossierTemplateId, toTypeId(type, dossierTemplateId), typeValue);
|
updateType(dossierTemplateId, toTypeId(type, dossierTemplateId), typeValue);
|
||||||
var dossierTypes = dictionaryPersistenceService.getAllDossierTypesForDossierTemplateAndType(dossierTemplateId, type, false);
|
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 + "')")
|
@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);
|
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()
|
Type.builder()
|
||||||
.dossierTemplateId(dossierTemplateId)
|
.dossierTemplateId(dossierTemplateId)
|
||||||
.hexColor(typeValue.getHexColor())
|
.hexColor(typeValue.getHexColor())
|
||||||
@ -170,10 +171,14 @@ public class DictionaryService {
|
|||||||
.isCaseInsensitive(typeValue.isCaseInsensitive())
|
.isCaseInsensitive(typeValue.isCaseInsensitive())
|
||||||
.isRecommendation(typeValue.isRecommendation())
|
.isRecommendation(typeValue.isRecommendation())
|
||||||
.description(typeValue.getDescription())
|
.description(typeValue.getDescription())
|
||||||
|
.addToDictionaryAction(typeEntity.isAddToDictionaryAction())
|
||||||
.label(typeValue.getLabel())
|
.label(typeValue.getLabel())
|
||||||
.hasDictionary(typeValue.isHasDictionary())
|
.hasDictionary(typeValue.isHasDictionary())
|
||||||
.autoHideSkipped(typeValue.isAutoHideSkipped())
|
.autoHideSkipped(typeValue.isAutoHideSkipped())
|
||||||
.build());
|
.build());
|
||||||
|
} else {
|
||||||
|
updateType(dossierTemplateId, toTypeId(type, dossierTemplateId, dossierId), typeValue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user