RED-7069, fix reading from undefined.
This commit is contained in:
parent
95d83d3b6d
commit
62fe3fb048
@ -27,6 +27,7 @@ export class EditRedactionDialogComponent
|
||||
readonly isImage: boolean;
|
||||
readonly initialReason: string;
|
||||
readonly initialType: string;
|
||||
readonly isManualRedaction: boolean;
|
||||
options: DetailsRadioOption<RedactOrHintOption>[] | undefined;
|
||||
legalOptions: LegalBasisOption[] = [];
|
||||
dictionaries: Dictionary[] = [];
|
||||
@ -51,13 +52,14 @@ export class EditRedactionDialogComponent
|
||||
this.redactedText = annotations.length === 1 && !this.isImage ? firstEntry.value : null;
|
||||
this.initialReason = firstEntry.legalBasis;
|
||||
this.initialType = firstEntry.type;
|
||||
this.isManualRedaction = firstEntry.type === SuperTypes.ManualRedaction;
|
||||
this.form = this.#getForm();
|
||||
|
||||
this.form.valueChanges
|
||||
.pipe(
|
||||
tap(value => {
|
||||
const reasonChanged = this.initialReason !== value.reason.legalBasis;
|
||||
const typeChanged = this.initialType !== value.type;
|
||||
const reasonChanged = this.initialReason !== value?.reason?.legalBasis;
|
||||
const typeChanged = this.initialType !== value?.type;
|
||||
if (typeChanged || reasonChanged) {
|
||||
this.#setOptions(value.type, reasonChanged);
|
||||
}
|
||||
|
||||
@ -116,8 +116,13 @@ export class AnnotationActionsService {
|
||||
};
|
||||
|
||||
const result = await this._iqserDialog.openDefault(EditRedactionDialogComponent, { data }).result();
|
||||
|
||||
const requests: Observable<unknown>[] = [];
|
||||
|
||||
if (!result) {
|
||||
return;
|
||||
}
|
||||
|
||||
const changeLegalBasisBody = annotations.map(annotation => ({
|
||||
annotationId: annotation.id,
|
||||
legalBasis: result.legalBasis,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user