X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=dashboard%2Fwebapp-frontend%2Fsrc%2Fapp%2Fcatalog%2Fcatalog.component.ts;fp=dashboard%2Fwebapp-frontend%2Fsrc%2Fapp%2Fcatalog%2Fcatalog.component.ts;h=df43995943f8659c6d9a11bdd8b0daf86f12d166;hb=5447254cb207353b33e6a444cce8a7fd84cfd34a;hp=ac8e6ec65d9fbe54fa8b68e3f1f42596f6817ece;hpb=854af18c26835319712aded05fdc3624502314a4;p=portal%2Fric-dashboard.git diff --git a/dashboard/webapp-frontend/src/app/catalog/catalog.component.ts b/dashboard/webapp-frontend/src/app/catalog/catalog.component.ts index ac8e6ec6..df439959 100644 --- a/dashboard/webapp-frontend/src/app/catalog/catalog.component.ts +++ b/dashboard/webapp-frontend/src/app/catalog/catalog.component.ts @@ -17,22 +17,21 @@ * limitations under the License. * ========================LICENSE_END=================================== */ -import { HttpErrorResponse, HttpResponse } from '@angular/common/http'; import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { MatSort } from '@angular/material/sort'; import { Subscription } from 'rxjs'; -import { finalize } from 'rxjs/operators'; -import { RicInstance } from '../interfaces/dashboard.types'; import { XMXapp } from '../interfaces/app-mgr.types'; +import { RicInstance } from '../interfaces/dashboard.types'; import { AppMgrService } from '../services/app-mgr/app-mgr.service'; import { InstanceSelectorService } from '../services/instance-selector/instance-selector.service'; +import { ConfirmDialogService } from '../services/ui/confirm-dialog.service'; import { LoadingDialogService } from '../services/ui/loading-dialog.service'; +import { NotificationService } from '../services/ui/notification.service'; import { UiService } from '../services/ui/ui.service'; +import { DeployDialogComponent } from '../ui/deploy-dialog/deploy-dialog.component'; import { AppConfigurationComponent } from './../app-configuration/app-configuration.component'; -import { ConfirmDialogService } from '../services/ui/confirm-dialog.service'; import { OnboardComponent } from './../onboard/onboard.component'; -import { NotificationService } from '../services/ui/notification.service'; import { CatalogDataSource } from './catalog.datasource'; @Component({ @@ -100,30 +99,24 @@ export class CatalogComponent implements OnInit, OnDestroy { } onDeployApp(app: XMXapp): void { - this.confirmDialogService.openConfirmDialog('Deploy application ' + app.name + '?') - .afterClosed().subscribe((res: boolean) => { - if (res) { - this.loadingDialogService.startLoading('Deploying ' + app.name); - this.appMgrService.deployXapp(this.instanceKey, app.name) - .pipe( - finalize(() => this.loadingDialogService.stopLoading()) - ) - .subscribe( - (response: HttpResponse) => { - 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); - }) - ); - } + if (this.darkMode) { + this.panelClass = 'dark-theme'; + } else { + this.panelClass = ''; + } + const dialogRef = this.dialog.open(DeployDialogComponent, { + panelClass: this.panelClass, + width: '400px', + maxHeight: '1000px', + position: { + top: '10%' + }, + data: { + xappName: app.name, + instanceKey: this.instanceKey } - ); + + }); } onboard(): void {