X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=webapp-frontend%2Fsrc%2Fapp%2Fcatalog%2Fcatalog.component.ts;h=2c1aa85acd095740a0f86dcac17dfdc172c79701;hb=2d98ad2e9f8a0d40bc2b3e3e1fe8b5f32ab97b66;hp=a2e3cd1d6d02242f2fd1a76a0a9e7a0b2f8575bb;hpb=8d590e9e52984c2fd4ea4da2a015cdf0cf88b7d2;p=portal%2Fric-dashboard.git diff --git a/webapp-frontend/src/app/catalog/catalog.component.ts b/webapp-frontend/src/app/catalog/catalog.component.ts index a2e3cd1d..2c1aa85a 100644 --- a/webapp-frontend/src/app/catalog/catalog.component.ts +++ b/webapp-frontend/src/app/catalog/catalog.component.ts @@ -18,6 +18,7 @@ * ========================LICENSE_END=================================== */ import { Component, OnInit, ViewChild } from '@angular/core'; +import { HttpErrorResponse, HttpResponse } from '@angular/common/http'; import { MatSort } from '@angular/material/sort'; import { ErrorDialogService } from '../services/ui/error-dialog.service'; import { AppMgrService } from '../services/app-mgr/app-mgr.service'; @@ -47,28 +48,26 @@ export class CatalogComponent implements OnInit { this.dataSource.loadTable(); } - onConfigurexApp(name: string): void { + onConfigureApp(name: string): void { const aboutError = 'Configure not implemented (yet)'; this.errorService.displayError(aboutError); } - onDeployxApp(name: string): void { + onDeployApp(name: string): void { this.confirmDialogService.openConfirmDialog('Deploy application ' + name + '?') - .afterClosed().subscribe(res => { + .afterClosed().subscribe( (res: any) => { if (res) { this.appMgrSvc.deployXapp(name).subscribe( - response => { - switch (response.status) { - case 200: - this.notification.success('Deploy succeeded!'); - break; - default: - this.notification.warn('Deploy failed.'); - } + (response: HttpResponse) => { + this.notification.success('Deploy succeeded!'); + }, + (error: HttpErrorResponse) => { + this.notification.warn('Deploy failed: ' + error.message); } ); } - }); - + } + ); } + }