- this.xappMgrSvc.deployXapp(name).subscribe(
- response => {
- switch (response.status) {
- case 200:
- this.notification.success('xApp deploy succeeded!');
- break;
- default:
- this.notification.warn('xApp deploy failed.');
- }
- }
- );
+ this.loadingDialogService.startLoading('Deploying ' + app.name);
+ this.appMgrService.deployXapp(app.name)
+ .pipe(
+ finalize(() => this.loadingDialogService.stopLoading())
+ )
+ .subscribe(
+ (response: HttpResponse<Object>) => {
+ this.notificationService.success('App deploy succeeded!');
+ },
+ ((her: HttpErrorResponse) => {
+ // the error field should have an ErrorTransport object
+ let msg = her.message;
+ if (her.error && her.error.message) {
+ msg = her.error.message;
+ }
+ this.notificationService.warn('App deploy failed: ' + msg);
+ })
+ );