Match front end E2mgr URL paths to back end
[portal/ric-dashboard.git] / webapp-frontend / src / app / anr-xapp / anr-xapp.component.ts
index 9e25391..eaa2ca3 100644 (file)
@@ -18,7 +18,7 @@
  * ========================LICENSE_END===================================
  */
 
-import { HttpResponse } from '@angular/common/http';
+import { HttpErrorResponse, HttpResponse } from '@angular/common/http';
 import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
 import { MatSort } from '@angular/material';
 import { MatDialog } from '@angular/material/dialog';
@@ -42,10 +42,10 @@ export class AnrXappComponent implements AfterViewInit, OnInit {
 
   dataSource: ANRXappDataSource;
   gNodeBIds: string[];
-  @ViewChild('ggNodeB', {static: true}) ggNodeB: ElementRef;
-  @ViewChild('servingCellNrcgi', {static: true}) servingCellNrcgi: ElementRef;
-  @ViewChild('neighborCellNrpci', {static: true}) neighborCellNrpci: ElementRef;
-  @ViewChild(MatSort, {static: true}) sort: MatSort;
+  @ViewChild('ggNodeB', { static: true }) ggNodeB: ElementRef;
+  @ViewChild('servingCellNrcgi', { static: true }) servingCellNrcgi: ElementRef;
+  @ViewChild('neighborCellNrpci', { static: true }) neighborCellNrpci: ElementRef;
+  @ViewChild(MatSort, { static: true }) sort: MatSort;
 
   displayedColumns = ['cellIdentifierNrcgi', 'neighborCellNrpci', 'neighborCellNrcgi',
     'flagNoHo', 'flagNoXn', 'flagNoRemove', 'action'];
@@ -99,36 +99,39 @@ export class AnrXappComponent implements AfterViewInit, OnInit {
       width: '300px',
       data: ncr
     });
-    dialogRef.afterClosed().subscribe(result => {
-      this.loadNcrtPage();
-    });
+    dialogRef.afterClosed().subscribe(
+      (result: any) => {
+        this.loadNcrtPage();
+      }
+    );
   }
 
   deleteNcr(ncr: ANRNeighborCellRelation): void {
     this.confirmDialogService
       .openConfirmDialog('Are you sure you want to delete this relation?')
-      .afterClosed().subscribe(res => {
-        if (res) {
-          this.loadingDialogService.startLoading("Deleting");
-          this.anrXappService.deleteNcr(ncr.servingCellNrcgi, ncr.neighborCellNrpci)
-            .pipe(
-              finalize(() => this.loadingDialogService.stopLoading())
-            )
-            .subscribe(
-              (response: HttpResponse<Object>) => {
-                switch (response.status) {
-                  case 200:
-                    this.notificationService.success('Delete succeeded!');
-                    break;
-                  default:
-                    this.notificationService.warn('Delete failed.');
-                }
-              },
-              error => {
-                this.errorDialogService.displayError(error.message);
-              });
-        }
-      });
+      .afterClosed().subscribe(
+        (res: any) => {
+          if (res) {
+            this.loadingDialogService.startLoading("Deleting");
+            this.anrXappService.deleteNcr(ncr.servingCellNrcgi, ncr.neighborCellNrpci)
+              .pipe(
+                finalize(() => this.loadingDialogService.stopLoading())
+              )
+              .subscribe(
+                (response: HttpResponse<Object>) => {
+                  switch (response.status) {
+                    case 200:
+                      this.notificationService.success('Delete succeeded!');
+                      break;
+                    default:
+                      this.notificationService.warn('Delete failed.');
+                  }
+                },
+                (error: HttpErrorResponse) => {
+                  this.errorDialogService.displayError(error.message);
+                });
+          }
+        });
   }
 
 }