X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=webapp-frontend%2Fsrc%2Fapp%2Fanr-xapp%2Fanr-xapp.component.ts;h=98728b21a1e88614f10d94e073c3924a2d9607df;hb=59f2bcb96fad2d6faee48b4ca65da36249ec5297;hp=eaa2ca393f620379685ccbcaedf3f1dcea548fab;hpb=b244a344777f416ad9b5ff09d1a8ad5f5517f2bf;p=portal%2Fric-dashboard.git diff --git a/webapp-frontend/src/app/anr-xapp/anr-xapp.component.ts b/webapp-frontend/src/app/anr-xapp/anr-xapp.component.ts index eaa2ca39..98728b21 100644 --- a/webapp-frontend/src/app/anr-xapp/anr-xapp.component.ts +++ b/webapp-frontend/src/app/anr-xapp/anr-xapp.component.ts @@ -2,14 +2,14 @@ * ========================LICENSE_START================================= * O-RAN-SC * %% - * Copyright (C) 2019 AT&T Intellectual Property and Nokia + * Copyright (C) 2019 AT&T Intellectual Property * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,7 +20,7 @@ import { HttpErrorResponse, HttpResponse } from '@angular/common/http'; import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core'; -import { MatSort } from '@angular/material'; +import { MatSort } from '@angular/material/sort'; import { MatDialog } from '@angular/material/dialog'; import { fromEvent } from 'rxjs/observable/fromEvent'; import { debounceTime, distinctUntilChanged, finalize, tap } from 'rxjs/operators'; @@ -32,6 +32,7 @@ import { ConfirmDialogService } from './../services/ui/confirm-dialog.service'; import { NotificationService } from './../services/ui/notification.service'; import { AnrEditNcrDialogComponent } from './anr-edit-ncr-dialog.component'; import { ANRXappDataSource } from './anr-xapp.datasource'; +import { UiService } from '../services/ui/ui.service'; @Component({ selector: 'rd-anr', @@ -40,6 +41,8 @@ import { ANRXappDataSource } from './anr-xapp.datasource'; }) export class AnrXappComponent implements AfterViewInit, OnInit { + darkMode: boolean; + panelClass: string = ""; dataSource: ANRXappDataSource; gNodeBIds: string[]; @ViewChild('ggNodeB', { static: true }) ggNodeB: ElementRef; @@ -56,13 +59,17 @@ export class AnrXappComponent implements AfterViewInit, OnInit { private confirmDialogService: ConfirmDialogService, private errorDialogService: ErrorDialogService, private loadingDialogService: LoadingDialogService, - private notificationService: NotificationService) { } + private notificationService: NotificationService, + public ui: UiService) { } ngOnInit() { this.dataSource = new ANRXappDataSource(this.anrXappService, this.sort, this.notificationService); this.dataSource.loadTable(); // Empty string occurs first in the array of gNodeBIds this.anrXappService.getgNodeBs().subscribe((res: string[]) => this.gNodeBIds = res); + this.ui.darkModeState.subscribe((isDark) => { + this.darkMode = isDark; + }); } ngAfterViewInit() { @@ -95,7 +102,13 @@ export class AnrXappComponent implements AfterViewInit, OnInit { } modifyNcr(ncr: ANRNeighborCellRelation): void { + if (this.darkMode) { + this.panelClass = "dark-theme"; + } else { + this.panelClass = ""; + } const dialogRef = this.dialog.open(AnrEditNcrDialogComponent, { + panelClass: this.panelClass, width: '300px', data: ncr }); @@ -122,6 +135,7 @@ export class AnrXappComponent implements AfterViewInit, OnInit { switch (response.status) { case 200: this.notificationService.success('Delete succeeded!'); + this.loadNcrtPage(); break; default: this.notificationService.warn('Delete failed.');