RED-7069, filter types.
This commit is contained in:
parent
9fb08bde8f
commit
6da253d0f8
@ -56,7 +56,7 @@ export class EditRedactionDialogComponent
|
||||
this.isModifyDictionary = firstEntry.isModifyDictionary;
|
||||
this.isManualRedaction = firstEntry.type === SuperTypes.ManualRedaction;
|
||||
this.isHint = firstEntry.isHint;
|
||||
this.showLegalReason = !(firstEntry.isSkipped || firstEntry.isHint);
|
||||
this.showLegalReason = !(firstEntry.isSkipped || firstEntry.isHint || this.isImage);
|
||||
this.form = this.#getForm();
|
||||
console.log(firstEntry);
|
||||
|
||||
@ -120,7 +120,7 @@ export class EditRedactionDialogComponent
|
||||
}
|
||||
|
||||
#setTypes() {
|
||||
this.dictionaries = this._dictionaryService.getEditableRedactionTypes(this.#dossier.dossierTemplateId, this.isImage);
|
||||
this.dictionaries = this._dictionaryService.getEditableRedactionTypes(this.#dossier.dossierTemplateId, this.isImage, this.isHint);
|
||||
}
|
||||
|
||||
#setOptions(type: string, reasonChanged = false) {
|
||||
|
||||
@ -166,10 +166,14 @@ export class DictionaryService extends EntitiesService<IDictionary, Dictionary>
|
||||
return dictionaries.sort((a, b) => a.label.localeCompare(b.label));
|
||||
}
|
||||
|
||||
getEditableRedactionTypes(dossierTemplateId: string, isImage: boolean): Dictionary[] {
|
||||
getEditableRedactionTypes(dossierTemplateId: string, isImage: boolean, isHint: boolean): Dictionary[] {
|
||||
return this._dictionariesMapService
|
||||
.get(dossierTemplateId)
|
||||
.filter(d => (isImage ? IMAGE_CATEGORIES.includes(d.type) : d.hasDictionary && !d.virtual && !d.systemManaged))
|
||||
.filter(d =>
|
||||
isImage
|
||||
? IMAGE_CATEGORIES.includes(d.type)
|
||||
: (isHint ? d.hint : !d.hint) && !d.systemManaged && !d.virtual && d.hasDictionary,
|
||||
)
|
||||
.sort((a, b) => a.label.localeCompare(b.label));
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user