RED-7761 - Missing fields in Edit Dialog for Signature (redacted images)

This commit is contained in:
Valentin Mihai 2023-11-22 18:52:27 +02:00
parent a5ba313375
commit 3631df4619

View File

@ -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<RedactOrHintOption>[] | 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<string>(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);
}
}