RED-8945: filtering out types for edit dialog.
This commit is contained in:
parent
1f7c1827f4
commit
5e1c531cbe
@ -163,7 +163,7 @@ export class EditRedactionDialogComponent
|
|||||||
|
|
||||||
#setTypes() {
|
#setTypes() {
|
||||||
this.dictionaries = this._dictionaryService.getEditableRedactionTypes(
|
this.dictionaries = this._dictionaryService.getEditableRedactionTypes(
|
||||||
this.#dossier.dossierTemplateId,
|
this.#dossier.dossierId,
|
||||||
this.isImage,
|
this.isImage,
|
||||||
this.isHint,
|
this.isHint,
|
||||||
this.annotations.every(annotation => annotation.isOCR),
|
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));
|
.sort((a, b) => a.label.localeCompare(b.label));
|
||||||
}
|
}
|
||||||
|
|
||||||
getEditableRedactionTypes(dossierTemplateId: string, isImage: boolean, isHint: boolean, isOCR: boolean): Dictionary[] {
|
getEditableRedactionTypes(dossierId: string, isImage: boolean, isHint: boolean, isOCR: boolean): Dictionary[] {
|
||||||
return this._dictionariesMapService
|
return this.#extractDossierLevelTypes(dossierId)
|
||||||
.get(dossierTemplateId)
|
|
||||||
.filter(
|
.filter(
|
||||||
d =>
|
d =>
|
||||||
d.model['typeId'] &&
|
d.model['typeId'] &&
|
||||||
(isImage
|
(isImage
|
||||||
? (isOCR ? [...IMAGE_CATEGORIES, 'ocr'] : IMAGE_CATEGORIES).includes(d.type)
|
? (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));
|
.sort((a, b) => a.label.localeCompare(b.label));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user