+ this.dataSource = new ANRXappDataSource(this.anrXappService, this.sort);
+ this.dataSource.loadTable();
+ // Empty string occurs first in the array of gNodeBIds
+ this.anrXappService.getgNodeBs().subscribe((res: string[]) => this.gNodeBIds = res);
+ this.anrXappService.getVersion().subscribe((res: string) => this.anrClientVersion = res);
+ }
+
+ ngAfterViewInit() {
+ // the selector event calls loadNcrtPage() directly.
+ fromEvent(this.servingCellNrcgi.nativeElement, 'keyup')
+ .pipe(
+ debounceTime(150),
+ distinctUntilChanged(),
+ tap(() => {
+ this.loadNcrtPage();
+ })
+ )
+ .subscribe();
+ fromEvent(this.neighborCellNrpci.nativeElement, 'keyup')
+ .pipe(
+ debounceTime(150),
+ distinctUntilChanged(),
+ tap(() => {
+ this.loadNcrtPage();
+ })
+ )
+ .subscribe();
+ }
+
+ loadNcrtPage() {
+ this.dataSource.loadTable(
+ this.ggNodeB.nativeElement.value,
+ this.servingCellNrcgi.nativeElement.value,
+ this.neighborCellNrpci.nativeElement.value);
+ }
+
+ modifyNcr(ncr: ANRNeighborCellRelation): void {
+ const dialogRef = this.dialog.open(ANREditNCRDialogComponent, {
+ width: '300px',
+ data: ncr
+ });
+ dialogRef.afterClosed().subscribe(result => {
+ this.loadNcrtPage();
+ });
+ }
+
+ deleteNcr(ncr: ANRNeighborCellRelation): void {
+ this.confirmDialogService
+ .openConfirmDialog('Are you sure you want to delete this relation?')
+ .afterClosed().subscribe(res => {
+ if (res) {
+ this.anrXappService.deleteNcr(ncr.servingCellNrcgi, ncr.neighborCellNrpci)
+ .subscribe(
+ response => {
+ switch (response.status) {
+ case 200:
+ this.notificationService.success('Delete succeeded!');
+ break;
+ default:
+ this.notificationService.warn('Delete failed.');
+ }
+ },
+ error => {
+ this.errorDialogService.displayError(error.message);
+ });
+ }
+ });