added general disabled implementation in base dialog

This commit is contained in:
Valentin 2022-01-14 17:59:32 +02:00
parent f7004520a7
commit 763ac410bd

View File

@ -23,7 +23,6 @@ export interface SaveOptions {
* (otherwise the save request will be triggered twice).
* */
export abstract class BaseDialogComponent extends AutoUnsubscribe implements OnInit {
abstract disabled: boolean;
protected readonly _dialogService: ConfirmationDialogService = this._injector.get(ConfirmationDialogService);
protected _waitingForConfirmation = false;
@ -78,6 +77,10 @@ export abstract class BaseDialogComponent extends AutoUnsubscribe implements OnI
return false;
}
get disabled(): boolean {
return !this.valid || !this.changed;
}
close(): void {
if (this.changed) {
this._openConfirmDialog().then(result => {