RED-7041 - Take into consideration if entity type only has dossier dictionaries
This commit is contained in:
parent
4ca6e05b9f
commit
848720b39a
@ -153,8 +153,9 @@ export class DictionaryService extends EntitiesService<IDictionary, Dictionary>
|
||||
|
||||
this._dictionariesMapService.get(dossierTemplateId).forEach((d: Dictionary) => {
|
||||
if (
|
||||
(!d.virtual && !d.hint && !d.systemManaged && d.hasDictionary && d.addToDictionaryAction) ||
|
||||
(dossierDictionaryOnly && d.dossierDictionaryOnly)
|
||||
!d.hint &&
|
||||
((!d.virtual && !d.systemManaged && d.hasDictionary && d.addToDictionaryAction && !d.dossierDictionaryOnly) ||
|
||||
(dossierDictionaryOnly && d.dossierDictionaryOnly))
|
||||
) {
|
||||
dictionaries.push(d);
|
||||
}
|
||||
@ -164,7 +165,6 @@ export class DictionaryService extends EntitiesService<IDictionary, Dictionary>
|
||||
}
|
||||
|
||||
getEditableRedactionTypes(dossierTemplateId: string, isImage: boolean): Dictionary[] {
|
||||
console.log(this._dictionariesMapService.get(dossierTemplateId));
|
||||
return this._dictionariesMapService
|
||||
.get(dossierTemplateId)
|
||||
.filter(d => (isImage ? IMAGE_CATEGORIES.includes(d.type) : d.hasDictionary && !d.virtual && !d.systemManaged))
|
||||
@ -175,12 +175,18 @@ export class DictionaryService extends EntitiesService<IDictionary, Dictionary>
|
||||
const dictionaries: Dictionary[] = [];
|
||||
|
||||
this._dictionariesMapService.get(dossierTemplateId).forEach((d: Dictionary) => {
|
||||
if (d.hint || (dictionaryRequest && dossierDictionaryOnly && d.dossierDictionaryOnly && d.type !== 'dossier_redaction')) {
|
||||
if (!dictionaryRequest) {
|
||||
if (!IMAGE_TYPES.includes(d.type)) {
|
||||
dictionaries.push(d);
|
||||
if (d.hint) {
|
||||
if (dictionaryRequest) {
|
||||
if (d.hasDictionary && d.addToDictionaryAction) {
|
||||
if (d.dossierDictionaryOnly) {
|
||||
if (dossierDictionaryOnly) {
|
||||
dictionaries.push(d);
|
||||
}
|
||||
} else {
|
||||
dictionaries.push(d);
|
||||
}
|
||||
}
|
||||
} else if (d.hasDictionary) {
|
||||
} else if (!d.dossierDictionaryOnly && !IMAGE_TYPES.includes(d.type)) {
|
||||
dictionaries.push(d);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user