diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.ts b/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.ts index 123006f92..7cee4dbe2 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.ts @@ -26,8 +26,8 @@ export class EditRedactionDialogComponent readonly isImage: boolean; readonly isManualRedaction: boolean; readonly isHint: boolean; + readonly isRedacted: boolean; readonly allRectangles = this.data.annotations.reduce((acc, a) => acc && a.AREA, true); - readonly showExtras: boolean; options: DetailsRadioOption[] | undefined; legalOptions: LegalBasisOption[] = []; dictionaries: Dictionary[] = []; @@ -44,8 +44,7 @@ export class EditRedactionDialogComponent this.isModifyDictionary = annotations.every(annotation => annotation.isModifyDictionary); this.isManualRedaction = annotations.every(annotation => annotation.type === SuperTypes.ManualRedaction); this.isHint = annotations.every(annotation => annotation.HINT); - const isRedacted = annotations.every(annotation => annotation.isRedacted); - this.showExtras = !((this.isImage && !isRedacted) || this.isHint); + this.isRedacted = annotations.every(annotation => annotation.isRedacted); } get displayedDictionaryLabel() { @@ -104,6 +103,8 @@ export class EditRedactionDialogComponent const selectedDictionaryType = this.form.controls.type.value; this.#setOptions(selectedDictionaryType); + console.log(this.redactBasedTypes); + console.log(selectedDictionaryType); if (this.redactBasedTypes.includes(selectedDictionaryType)) { this.form.controls.reason.enable(); } else { @@ -162,4 +163,10 @@ export class EditRedactionDialogComponent value: new FormControl(this.allRectangles ? this.data.annotations[0].value : null), }); } + + get showExtras() { + const type = this.form.get('type').value; + const isSignature = type === 'signature'; + return (isSignature && this.isRedacted) || !(this.isImage || this.isHint); + } }