Merge branch 'RED-8945' into 'master'
RED-8945: filtering out types for edit dialog. See merge request redactmanager/red-ui!401
This commit is contained in:
commit
5d52904f76
@ -163,7 +163,7 @@ export class EditRedactionDialogComponent
|
||||
|
||||
#setTypes() {
|
||||
this.dictionaries = this._dictionaryService.getEditableRedactionTypes(
|
||||
this.#dossier.dossierTemplateId,
|
||||
this.#dossier.dossierId,
|
||||
this.isImage,
|
||||
this.isHint,
|
||||
this.annotations.every(annotation => annotation.isOCR),
|
||||
|
||||
@ -162,15 +162,18 @@ export class DictionaryService extends EntitiesService<IDictionary, Dictionary>
|
||||
.sort((a, b) => a.label.localeCompare(b.label));
|
||||
}
|
||||
|
||||
getEditableRedactionTypes(dossierTemplateId: string, isImage: boolean, isHint: boolean, isOCR: boolean): Dictionary[] {
|
||||
return this._dictionariesMapService
|
||||
.get(dossierTemplateId)
|
||||
getEditableRedactionTypes(dossierId: string, isImage: boolean, isHint: boolean, isOCR: boolean): Dictionary[] {
|
||||
return this.#extractDossierLevelTypes(dossierId)
|
||||
.filter(
|
||||
d =>
|
||||
d.model['typeId'] &&
|
||||
(isImage
|
||||
? (isOCR ? [...IMAGE_CATEGORIES, 'ocr'] : IMAGE_CATEGORIES).includes(d.type)
|
||||
: (isHint ? d.hint : !d.hint) && !d.virtual && !d.systemManaged && ![...IMAGE_CATEGORIES, 'ocr'].includes(d.type)),
|
||||
: (isHint ? d.hint : !d.hint) &&
|
||||
d.addToDictionaryAction &&
|
||||
!d.virtual &&
|
||||
!d.systemManaged &&
|
||||
![...IMAGE_CATEGORIES, 'ocr'].includes(d.type)),
|
||||
)
|
||||
.sort((a, b) => a.label.localeCompare(b.label));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user