diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/force-redaction-dialog/force-annotation-dialog.component.ts b/apps/red-ui/src/app/modules/file-preview/dialogs/force-redaction-dialog/force-annotation-dialog.component.ts index c7cf04c87..f4f01255e 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/force-redaction-dialog/force-annotation-dialog.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/force-redaction-dialog/force-annotation-dialog.component.ts @@ -41,22 +41,23 @@ export class ForceAnnotationDialogComponent extends BaseDialogComponent implemen } async ngOnInit() { - const data = await firstValueFrom(this._justificationsService.getForDossierTemplate(this._data.dossier.dossierTemplateId)); + if (!this.isDocumine) { + const data = await firstValueFrom(this._justificationsService.getForDossierTemplate(this._data.dossier.dossierTemplateId)); - this.legalOptions = data.map(lbm => ({ - legalBasis: lbm.reason, - description: lbm.description, - label: lbm.name, - })); + this.legalOptions = data.map(lbm => ({ + legalBasis: lbm.reason, + description: lbm.description, + label: lbm.name, + })); - this.legalOptions.sort((a, b) => a.label.localeCompare(b.label)); + this.legalOptions.sort((a, b) => a.label.localeCompare(b.label)); - // Set pre-existing reason if it exists - const existingReason = this.legalOptions.find(option => option.legalBasis === this._data.annotations[0].legalBasis); - if (!this._data.hint && existingReason) { - this.form.patchValue({ reason: existingReason }, { emitEvent: false }); + // Set pre-existing reason if it exists + const existingReason = this.legalOptions.find(option => option.legalBasis === this._data.annotations[0].legalBasis); + if (!this._data.hint && existingReason) { + this.form.patchValue({ reason: existingReason }, { emitEvent: false }); + } } - this.initialFormValue = this.form.getRawValue(); } @@ -66,7 +67,7 @@ export class ForceAnnotationDialogComponent extends BaseDialogComponent implemen private _getForm(): UntypedFormGroup { return this._formBuilder.group({ - reason: this._data.hint ? ['Forced Hint'] : [null, Validators.required], + reason: this._data.hint ? ['Forced Hint'] : [null, !this.isDocumine ? Validators.required : null], comment: [null], }); } @@ -74,9 +75,10 @@ export class ForceAnnotationDialogComponent extends BaseDialogComponent implemen private _createForceRedactionRequest(): ILegalBasisChangeRequest { const request: ILegalBasisChangeRequest = {}; - const legalOption: LegalBasisOption = this.form.get('reason').value; - - request.legalBasis = legalOption.legalBasis; + if (!this.isDocumine) { + const legalOption: LegalBasisOption = this.form.get('reason').value; + request.legalBasis = legalOption.legalBasis; + } request.comment = this.form.get('comment').value; return request;