Merge remote-tracking branch 'origin/master'

This commit is contained in:
Marco Zeisler 2021-05-03 18:44:44 +02:00
commit cb0a803cd8
2 changed files with 33 additions and 2 deletions

View File

@ -35,7 +35,7 @@ export class EditierenComponent implements OnInit {
private http: HttpClient, private http: HttpClient,
private _snackbar: MatSnackBar, private _snackbar: MatSnackBar,
private _logger: NGXLogger, private _logger: NGXLogger,
) { private _dialog: MatDialog) {
this.route.paramMap.subscribe(paramMap => { this.route.paramMap.subscribe(paramMap => {
this.id = paramMap.get('id'); this.id = paramMap.get('id');
if (this.id) { if (this.id) {
@ -69,7 +69,10 @@ export class EditierenComponent implements OnInit {
match_all_keywords: data.match_all_keywords match_all_keywords: data.match_all_keywords
}); });
}, },
err => this._logger.error(err), err => {
this.errorDialog();
this._logger.error(err);
}
); );
} }
@ -90,6 +93,7 @@ export class EditierenComponent implements OnInit {
this._snackbar.open('Feed erfolgreich gespeichert!', 'Schließen', {duration: 3000}); this._snackbar.open('Feed erfolgreich gespeichert!', 'Schließen', {duration: 3000});
}, },
err => { err => {
this.errorDialog();
this._logger.error(err); this._logger.error(err);
return throwError(err); return throwError(err);
} }
@ -100,10 +104,24 @@ export class EditierenComponent implements OnInit {
this._snackbar.open('Feed erfolgreich gespeichert!', 'Schließen', {duration: 3000}); this._snackbar.open('Feed erfolgreich gespeichert!', 'Schließen', {duration: 3000});
}, },
err => { err => {
this.errorDialog();
this._logger.error(err); this._logger.error(err);
return throwError(err); return throwError(err);
} }
); );
} }
} }
public errorDialog() {
const dialogRef = this._dialog.open(DialogComponent, {
data: {
title: 'Serverfehler',
body: 'Fehler beim Aufruf des Servers',
abort: 'Abbrechen',
confirm: 'OK',
hideAbort: true
}
});
}
} }

View File

@ -66,4 +66,17 @@ export class EinstellungenComponent implements OnInit {
} }
); );
} }
public errorDialog() {
const dialogRef = this._dialog.open(DialogComponent, {
data: {
title: 'Serverfehler',
body: 'Fehler beim Aufruf des Servers',
abort: 'Abbrechen',
confirm: 'OK',
hideAbort: true
}
});
}
} }