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..f82044acc 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 @@ -10,6 +10,8 @@ import { getEditRedactionOptions, RedactOrHintOption } from '../../utils/dialog- import { EditRedactionData, EditRedactResult } from '../../utils/dialog-types'; import { LegalBasisOption } from '../manual-redaction-dialog/manual-annotation-dialog.component'; +const SIGNATURE = 'signature'; + @Component({ templateUrl: './edit-redaction-dialog.component.html', styleUrls: ['./edit-redaction-dialog.component.scss'], @@ -26,8 +28,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 +46,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() { @@ -102,9 +103,13 @@ export class EditRedactionDialogComponent typeChanged() { const selectedDictionaryType = this.form.controls.type.value; + const isSignature = selectedDictionaryType === SIGNATURE; this.#setOptions(selectedDictionaryType); - if (this.redactBasedTypes.includes(selectedDictionaryType)) { + if (this.redactBasedTypes.includes(selectedDictionaryType) || (isSignature && !this.allSkipped)) { + if (isSignature) { + this.form.patchValue({ reason: this.initialFormValue.reason, option: this.initialFormValue.option }); + } this.form.controls.reason.enable(); } else { this.form.patchValue({ reason: null, option: null }); @@ -162,4 +167,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); + } }