[NIFI-13243] - support cancel response in CloseOnEscapeDialog (#8838)

This closes #8838
This commit is contained in:
Rob Fellows 2024-05-15 14:37:41 -04:00 committed by GitHub
parent eaf3f23100
commit c794943c5b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 1 deletions

View File

@ -431,4 +431,8 @@ export class EditConnectionComponent extends CloseOnEscapeDialog {
override isDirty(): boolean {
return this.editConnectionForm.dirty;
}
override getCancelDialogResult(): any {
return 'CANCELLED';
}
}

View File

@ -39,11 +39,19 @@ export abstract class CloseOnEscapeDialog {
takeUntilDestroyed()
)
.subscribe(() => {
this.dialogRef.close();
if (this.getCancelDialogResult()) {
this.dialogRef.close(this.getCancelDialogResult());
} else {
this.dialogRef.close();
}
});
}
}
getCancelDialogResult(): any | null | undefined {
return null;
}
isDirty(): boolean {
return false;
}