- onDeployxApp(event): void {
- if (window.confirm('Are you sure you want to deploy?')) {
- event.confirm.resolve();
- } else {
- event.confirm.reject();
- }
+ onDeployApp(app: XMDeployableApp): void {
+ this.confirmDialogService.openConfirmDialog('Deploy application ' + app.name + '?')
+ .afterClosed().subscribe( (res: boolean) => {
+ if (res) {
+ this.appMgrService.deployXapp(app.name).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);
+ })
+ );
+ }
+ }
+ );