Merge branch 'VM/RED-7761' into 'master'
RED-7761 - Missing fields in Edit Dialog for Signature (redacted images) Closes RED-7761 See merge request redactmanager/red-ui!200
This commit is contained in:
commit
67823cfc1d
@ -10,6 +10,8 @@ import { getEditRedactionOptions, RedactOrHintOption } from '../../utils/dialog-
|
|||||||
import { EditRedactionData, EditRedactResult } from '../../utils/dialog-types';
|
import { EditRedactionData, EditRedactResult } from '../../utils/dialog-types';
|
||||||
import { LegalBasisOption } from '../manual-redaction-dialog/manual-annotation-dialog.component';
|
import { LegalBasisOption } from '../manual-redaction-dialog/manual-annotation-dialog.component';
|
||||||
|
|
||||||
|
const SIGNATURE = 'signature';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: './edit-redaction-dialog.component.html',
|
templateUrl: './edit-redaction-dialog.component.html',
|
||||||
styleUrls: ['./edit-redaction-dialog.component.scss'],
|
styleUrls: ['./edit-redaction-dialog.component.scss'],
|
||||||
@ -26,8 +28,8 @@ export class EditRedactionDialogComponent
|
|||||||
readonly isImage: boolean;
|
readonly isImage: boolean;
|
||||||
readonly isManualRedaction: boolean;
|
readonly isManualRedaction: boolean;
|
||||||
readonly isHint: boolean;
|
readonly isHint: boolean;
|
||||||
|
readonly isRedacted: boolean;
|
||||||
readonly allRectangles = this.data.annotations.reduce((acc, a) => acc && a.AREA, true);
|
readonly allRectangles = this.data.annotations.reduce((acc, a) => acc && a.AREA, true);
|
||||||
readonly showExtras: boolean;
|
|
||||||
options: DetailsRadioOption<RedactOrHintOption>[] | undefined;
|
options: DetailsRadioOption<RedactOrHintOption>[] | undefined;
|
||||||
legalOptions: LegalBasisOption[] = [];
|
legalOptions: LegalBasisOption[] = [];
|
||||||
dictionaries: Dictionary[] = [];
|
dictionaries: Dictionary[] = [];
|
||||||
@ -44,8 +46,7 @@ export class EditRedactionDialogComponent
|
|||||||
this.isModifyDictionary = annotations.every(annotation => annotation.isModifyDictionary);
|
this.isModifyDictionary = annotations.every(annotation => annotation.isModifyDictionary);
|
||||||
this.isManualRedaction = annotations.every(annotation => annotation.type === SuperTypes.ManualRedaction);
|
this.isManualRedaction = annotations.every(annotation => annotation.type === SuperTypes.ManualRedaction);
|
||||||
this.isHint = annotations.every(annotation => annotation.HINT);
|
this.isHint = annotations.every(annotation => annotation.HINT);
|
||||||
const isRedacted = annotations.every(annotation => annotation.isRedacted);
|
this.isRedacted = annotations.every(annotation => annotation.isRedacted);
|
||||||
this.showExtras = !((this.isImage && !isRedacted) || this.isHint);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get displayedDictionaryLabel() {
|
get displayedDictionaryLabel() {
|
||||||
@ -102,9 +103,13 @@ export class EditRedactionDialogComponent
|
|||||||
|
|
||||||
typeChanged() {
|
typeChanged() {
|
||||||
const selectedDictionaryType = this.form.controls.type.value;
|
const selectedDictionaryType = this.form.controls.type.value;
|
||||||
|
const isSignature = selectedDictionaryType === SIGNATURE;
|
||||||
this.#setOptions(selectedDictionaryType);
|
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();
|
this.form.controls.reason.enable();
|
||||||
} else {
|
} else {
|
||||||
this.form.patchValue({ reason: null, option: null });
|
this.form.patchValue({ reason: null, option: null });
|
||||||
@ -162,4 +167,10 @@ export class EditRedactionDialogComponent
|
|||||||
value: new FormControl<string>(this.allRectangles ? this.data.annotations[0].value : null),
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user