From 3799bd6a9e76ccadba7fe2e2b97e89c24bc78f8d Mon Sep 17 00:00:00 2001 From: Timo Date: Tue, 24 Nov 2020 19:11:13 +0200 Subject: [PATCH] Legal Optins / Reasons are now from backend --- .../manual-annotation-dialog.component.ts | 46 +++++-------------- 1 file changed, 12 insertions(+), 34 deletions(-) diff --git a/apps/red-ui/src/app/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts b/apps/red-ui/src/app/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts index 8868c2921..4d76402ff 100644 --- a/apps/red-ui/src/app/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts +++ b/apps/red-ui/src/app/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts @@ -11,38 +11,10 @@ import { ManualAnnotationService } from '../../screens/file/service/manual-annot import { ManualAnnotationResponse } from '../../screens/file/model/manual-annotation-response'; import { PermissionsService } from '../../common/service/permissions.service'; -const LEGAL_OPTIONS = [ - { - label: 'the method of manufacture', - legalBasis: 'Reg (EC) No 1107/2009 Art. 63 (2a)' - }, - { - label: - 'the specification of impurity of the active substance except for the impurities that are considered to be toxicologically, ecotoxicologically or environmentally relevant', - legalBasis: 'Reg (EC) No 1107/2009 Art. 63 (2b)' - }, - { - label: 'results of production batches of the active substance including impurities', - legalBasis: 'Reg (EC) No 1107/2009 Art. 63 (2c)' - }, - { - label: - 'methods of analysis for impurities in the active substance as manufactured except for methods for impurities that are considered to be toxicologically, ecotoxicologically or environmentally relevant', - legalBasis: 'Reg (EC) No 1107/2009 Art. 63 (2d)' - }, - { - label: 'links between a producer or importer and the applicant or the authorisation holder', - legalBasis: 'Reg (EC) No 1107/2009 Art. 63 (2e)' - }, - { - label: 'information on the complete composition of a plant protection product', - legalBasis: 'Reg (EC) No 1107/2009 Art. 63 (2f)' - }, - { - label: 'names and addresses of persons involved in testing on vertebrate animals', - legalBasis: 'Reg (EC) No 1107/2009 Art. 63 (2g)' - } -]; +export interface LegalBasisOption { + label?: string; + legalBasis?: string; +} @Component({ selector: 'redaction-manual-annotation-dialog', @@ -57,7 +29,7 @@ export class ManualAnnotationDialogComponent implements OnInit { redactionDictionaries: TypeValue[] = []; hintDictionaries: TypeValue[] = []; - legalOptions = LEGAL_OPTIONS; + legalOptions: LegalBasisOption[] = []; constructor( private readonly _appStateService: AppStateService, @@ -74,7 +46,13 @@ export class ManualAnnotationDialogComponent implements OnInit { async ngOnInit() { this._legalBasisMappingControllerService.getLegalBasisMapping().subscribe((data) => { - console.log(data); + for (let key of Object.keys(data.reasonByLegalBasis)) { + this.legalOptions.push({ + legalBasis: key, + label: data.reasonByLegalBasis[key] + }); + } + this.legalOptions.sort((a, b) => a.label.localeCompare(b.label)); }); this.isDocumentAdmin = this._permissionsService.isManagerAndOwner();