- this.appMgrSvc.deployXapp(name).subscribe(
- (response: HttpResponse<object>) => {
- this.notification.success('Deploy succeeded!');
- },
- (error: HttpErrorResponse) => {
- this.notification.warn('Deploy failed: ' + error.message);
- }
- );
+ 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);
+ })
+ );