- onDeployxApp(event): void {
- const dialogRef = this.dialog.open(AppCatalogDeployDialog, {
- width: '400px',
- data: { name: event.data.name }
- });
-
- dialogRef.afterClosed().subscribe(result => {
- console.log('The dialog was closed');
- });
- }
-
-}
-
-@Component({
- selector: 'app-catalog-deploy-dialog',
- templateUrl: 'catalog.component.deploy-dialog.html',
- styleUrls: ['./catalog.component.css']
-})
-
-export class AppCatalogDeployDialog{
-
- constructor(
- public dialogRef: MatDialogRef<AppCatalogDeployDialog>,
- private service: CatalogService,
- @Inject(MAT_DIALOG_DATA) public data: DialogData) { }
-
- onNoClick(): void {
- this.dialogRef.close();
- }
-
- deployXapp(): void {
- this.service.deployXapp(this.data.name).subscribe((val: any[]) => console.log(val));;
- this.dialogRef.close();
- }
+ onDeployApp(name: string): void {
+ this.confirmDialogService.openConfirmDialog('Deploy application ' + name + '?')
+ .afterClosed().subscribe( (res: any) => {
+ if (res) {
+ this.appMgrSvc.deployXapp(name).subscribe(
+ (response: HttpResponse<object>) => {
+ this.notification.success('Deploy succeeded!');
+ },
+ (error: HttpErrorResponse) => {
+ this.notification.warn('Deploy failed: ' + error.message);
+ }
+ );
+ }
+ }
+ );
+ }