RED-7562: Disabled dictionary tab for dossierDictionaryOnly.

This commit is contained in:
Nicoleta Panaghiu 2023-09-19 17:19:26 +03:00
parent 36c8369a0b
commit a7f393c5c2

View File

@ -35,7 +35,13 @@ export class BaseEntityScreenComponent implements OnInit {
const entity$ = dictionaryMapService.watch$(this.#dossierTemplateId, this.#entityType);
this.canDeleteEntity$ = entity$.pipe(map(entity => this._permissionsService.canDeleteEntities(entity)));
this.disabledItems$ = entity$.pipe(
map(entity => (entity.hasDictionary ? [] : ['dictionary', 'false-positive', 'false-recommendations'])),
map(entity =>
entity.hasDictionary
? !entity.dossierDictionaryOnly
? []
: ['dictionary']
: ['dictionary', 'false-positive', 'false-recommendations'],
),
);
}