From b244a344777f416ad9b5ff09d1a8ad5f5517f2bf Mon Sep 17 00:00:00 2001 From: "Lott, Christopher (cl778h)" Date: Thu, 19 Sep 2019 06:54:21 -0400 Subject: [PATCH] Match front end E2mgr URL paths to back end Extend front end to trim whitespace on form inputs. Bump version to 1.2.1. Change-Id: I8cb10264148ab51fb123b420bc9c2ad350e093be Signed-off-by: Lott, Christopher (cl778h) --- a1-med-client/pom.xml | 2 +- anr-xapp-client/pom.xml | 2 +- app-mgr-client/pom.xml | 2 +- docs/release-notes.rst | 7 ++- e2-mgr-client/pom.xml | 2 +- pom.xml | 2 +- webapp-backend/pom.xml | 2 +- .../dashboard/controller/E2ManagerController.java | 7 +-- webapp-frontend/pom.xml | 2 +- .../app/anr-xapp/anr-edit-ncr-dialog.component.ts | 7 ++- .../src/app/anr-xapp/anr-xapp.component.ts | 63 +++++++++++----------- .../app-configuration.component.ts | 14 ++--- .../ran-control/ran-connection-dialog.component.ts | 12 ++--- .../src/app/services/e2-mgr/e2-mgr.service.ts | 8 +-- .../edit-dashboard-user-dialog.component.ts | 2 +- 15 files changed, 73 insertions(+), 61 deletions(-) diff --git a/a1-med-client/pom.xml b/a1-med-client/pom.xml index edb1b4e1..5615ed4c 100644 --- a/a1-med-client/pom.xml +++ b/a1-med-client/pom.xml @@ -25,7 +25,7 @@ limitations under the License. org.o-ran-sc.portal.ric-dashboard ric-dash-parent - 1.2.0-SNAPSHOT + 1.2.1-SNAPSHOT org.o-ran-sc.ric.plt.a1med.client diff --git a/anr-xapp-client/pom.xml b/anr-xapp-client/pom.xml index 975a15b0..137985aa 100644 --- a/anr-xapp-client/pom.xml +++ b/anr-xapp-client/pom.xml @@ -25,7 +25,7 @@ limitations under the License. org.o-ran-sc.portal.ric-dashboard ric-dash-parent - 1.2.0-SNAPSHOT + 1.2.1-SNAPSHOT org.o-ran-sc.ric.xapp.anr.client diff --git a/app-mgr-client/pom.xml b/app-mgr-client/pom.xml index 3c50b618..4efb783b 100644 --- a/app-mgr-client/pom.xml +++ b/app-mgr-client/pom.xml @@ -25,7 +25,7 @@ limitations under the License. org.o-ran-sc.portal.ric-dashboard ric-dash-parent - 1.2.0-SNAPSHOT + 1.2.1-SNAPSHOT org.o-ran-sc.ric.plt.appmgr.client diff --git a/docs/release-notes.rst b/docs/release-notes.rst index b3cc4ca7..4fc79527 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -19,10 +19,15 @@ RIC Dashboard Release Notes =========================== -Version 1.2.1, ? Aug 2019 +Version 1.2.?, ? 2019 ------------------------- * Add EPSDK-FW user management and Portal security +Version 1.2.1, 19 Sep 2019 +-------------------------- +* Repair E2 URLs in front end like endc-setup/endcSetup +* Trim whitespace in form input strings + Version 1.2.0, 11 Sep 2019 -------------------------- * Split URL properties into prefix/suffix parts diff --git a/e2-mgr-client/pom.xml b/e2-mgr-client/pom.xml index cf9dedc6..90826747 100644 --- a/e2-mgr-client/pom.xml +++ b/e2-mgr-client/pom.xml @@ -25,7 +25,7 @@ limitations under the License. org.o-ran-sc.portal.ric-dashboard ric-dash-parent - 1.2.0-SNAPSHOT + 1.2.1-SNAPSHOT org.o-ran-sc.ric.plt.e2mgr.client diff --git a/pom.xml b/pom.xml index dd134912..61f3f950 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ limitations under the License. ric-dash-parent RIC Dashboard project pom - 1.2.0-SNAPSHOT + 1.2.1-SNAPSHOT 11 diff --git a/webapp-backend/pom.xml b/webapp-backend/pom.xml index d86ba213..09126241 100644 --- a/webapp-backend/pom.xml +++ b/webapp-backend/pom.xml @@ -25,7 +25,7 @@ limitations under the License. org.o-ran-sc.portal.ric-dashboard ric-dash-parent - 1.2.0-SNAPSHOT + 1.2.1-SNAPSHOT ric-dash-be RIC Dashboard Webapp backend diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/E2ManagerController.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/E2ManagerController.java index 104cb1db..15379be2 100644 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/E2ManagerController.java +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/E2ManagerController.java @@ -72,15 +72,16 @@ public class E2ManagerController { public static final String CONTROLLER_PATH = DashboardConstants.ENDPOINT_PREFIX + "/e2mgr"; // Dashboard only public static final String HEALTH_METHOD = "health"; - public static final String RAN_METHOD = "/ran"; public static final String VERSION_METHOD = DashboardConstants.VERSION_METHOD; // Keep these consistent with the E2M implementation - public static final String NODEB_PREFIX = "/nodeb"; + /*package*/ static final String NODEB_PREFIX = "/nodeb"; + public static final String RAN_METHOD = NODEB_PREFIX + "/ran"; public static final String NODEB_SHUTDOWN_METHOD = NODEB_PREFIX + "/shutdown"; public static final String NODEB_LIST_METHOD = NODEB_PREFIX + "/ids"; - public static final String RESET_METHOD = "/reset"; public static final String ENDC_SETUP_METHOD = NODEB_PREFIX + "/endc-setup"; public static final String X2_SETUP_METHOD = NODEB_PREFIX + "/x2-setup"; + // Reset uses prefix, adds a path parameter below + public static final String RESET_METHOD = "/reset"; // Path parameters private static final String PP_RANNAME = "ranName"; diff --git a/webapp-frontend/pom.xml b/webapp-frontend/pom.xml index 69ce3efb..7077e947 100644 --- a/webapp-frontend/pom.xml +++ b/webapp-frontend/pom.xml @@ -25,7 +25,7 @@ limitations under the License. org.o-ran-sc.portal.ric-dashboard ric-dash-parent - 1.2.0-SNAPSHOT + 1.2.1-SNAPSHOT ric-dash-fe RIC Dashboard Webapp frontend diff --git a/webapp-frontend/src/app/anr-xapp/anr-edit-ncr-dialog.component.ts b/webapp-frontend/src/app/anr-xapp/anr-edit-ncr-dialog.component.ts index 24c4811e..2c3f2d0d 100644 --- a/webapp-frontend/src/app/anr-xapp/anr-edit-ncr-dialog.component.ts +++ b/webapp-frontend/src/app/anr-xapp/anr-edit-ncr-dialog.component.ts @@ -58,13 +58,16 @@ export class AnrEditNcrDialogComponent implements OnInit { modifyNcr = (ncrFormValue: ANRNeighborCellRelation) => { if (this.ncrDialogForm.valid) { const ncrm = {} as ANRNeighborCellRelationMod; - // there must be a better way + // there must be a better way to build the struct ncrm.neighborCellNrcgi = ncrFormValue.neighborCellNrcgi; ncrm.neighborCellNrpci = ncrFormValue.neighborCellNrpci; ncrm.flagNoHo = ncrFormValue.flagNoHo; ncrm.flagNoXn = ncrFormValue.flagNoXn; ncrm.flagNoRemove = ncrFormValue.flagNoRemove; - this.dataService.modifyNcr(ncrFormValue.servingCellNrcgi, ncrFormValue.neighborCellNrpci, ncrm).subscribe((val: any[]) => { }, + this.dataService.modifyNcr(ncrFormValue.servingCellNrcgi, ncrFormValue.neighborCellNrpci, ncrm).subscribe( + (val: any[]) => { + // Success + }, (error => { this.errorService.displayError('NCR update failed: ' + error.message); }) 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 9e253912..eaa2ca39 100644 --- a/webapp-frontend/src/app/anr-xapp/anr-xapp.component.ts +++ b/webapp-frontend/src/app/anr-xapp/anr-xapp.component.ts @@ -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) => { - 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) => { + switch (response.status) { + case 200: + this.notificationService.success('Delete succeeded!'); + break; + default: + this.notificationService.warn('Delete failed.'); + } + }, + (error: HttpErrorResponse) => { + this.errorDialogService.displayError(error.message); + }); + } + }); } } diff --git a/webapp-frontend/src/app/app-configuration/app-configuration.component.ts b/webapp-frontend/src/app/app-configuration/app-configuration.component.ts index 28e9bf77..bacf9abb 100644 --- a/webapp-frontend/src/app/app-configuration/app-configuration.component.ts +++ b/webapp-frontend/src/app/app-configuration/app-configuration.component.ts @@ -50,7 +50,7 @@ export class AppConfigurationComponent implements OnInit { xappMetadata: any; xappConfigSchema: any; xappConfigData: any; - xappLayout:any; + xappLayout: any; ngOnInit() { this.loadingSubject.next(true); this.appMgrService.getConfig() @@ -58,10 +58,10 @@ export class AppConfigurationComponent implements OnInit { finalize(() => this.loadingSubject.next(false)) ) .subscribe( - (allConfig: any) => { - this.loadConfigForm(this.data.name, allConfig) - } - ) + (allConfig: any) => { + this.loadConfigForm(this.data.name, allConfig) + } + ); } updateconfig(event) { @@ -78,7 +78,7 @@ export class AppConfigurationComponent implements OnInit { this.loadingDialogService.stopLoading(); this.dialogRef.close(); }) - ) + ) .subscribe( (response: HttpResponse) => { this.notificationService.success('Configuration update succeeded!'); @@ -99,7 +99,7 @@ export class AppConfigurationComponent implements OnInit { this.xappMetadata = xappConfig.metadata this.xappConfigSchema = xappConfig.descriptor; this.xappConfigData = xappConfig.config; - this.xappLayout= xappConfig.layout; + this.xappLayout = xappConfig.layout; } else { this.errorDiaglogService.displayError("Cannot find configration data for " + name); this.dialogRef.close(); diff --git a/webapp-frontend/src/app/ran-control/ran-connection-dialog.component.ts b/webapp-frontend/src/app/ran-control/ran-connection-dialog.component.ts index 4065f44a..c10d97eb 100644 --- a/webapp-frontend/src/app/ran-control/ran-connection-dialog.component.ts +++ b/webapp-frontend/src/app/ran-control/ran-connection-dialog.component.ts @@ -73,11 +73,11 @@ export class RanControlConnectDialogComponent implements OnInit { } this.processing = true; const setupRequest: E2SetupRequest = { - ranName: ranFormValue.ranName, - ranIp: ranFormValue.ranIp, - ranPort: ranFormValue.ranPort + ranName: ranFormValue.ranName.trim(), + ranIp: ranFormValue.ranIp.trim(), + ranPort: ranFormValue.ranPort.trim() }; - this.loadingDialogService.startLoading("Setting up connection "); + this.loadingDialogService.startLoading('Setting up connection'); let observable: Observable>; if (ranFormValue.ranType === 'endc') { observable = this.service.endcSetup(setupRequest); @@ -91,7 +91,7 @@ export class RanControlConnectDialogComponent implements OnInit { .subscribe( (response: any) => { this.processing = false; - this.notifService.success('Connect succeeded!'); + this.notifService.success('Connect request sent!'); this.dialogRef.close(true); }, ((her: HttpErrorResponse) => { @@ -101,7 +101,7 @@ export class RanControlConnectDialogComponent implements OnInit { if (her.error && her.error.message) { msg = her.error.message; } - this.errorService.displayError('Connect failed: ' + msg); + this.errorService.displayError('Connect request failed: ' + msg); // keep the dialog open }) ); diff --git a/webapp-frontend/src/app/services/e2-mgr/e2-mgr.service.ts b/webapp-frontend/src/app/services/e2-mgr/e2-mgr.service.ts index e40ee607..a5fe9e98 100644 --- a/webapp-frontend/src/app/services/e2-mgr/e2-mgr.service.ts +++ b/webapp-frontend/src/app/services/e2-mgr/e2-mgr.service.ts @@ -30,7 +30,7 @@ import { DashboardSuccessTransport } from '../../interfaces/dashboard.types'; export class E2ManagerService { - private basePath = 'api/e2mgr/'; + private basePath = 'api/e2mgr/nodeb/'; constructor(private httpClient: HttpClient) { // injects to variable httpClient @@ -61,7 +61,7 @@ export class E2ManagerService { * @returns Observable. On success there is no data, only a code. */ endcSetup(req: E2SetupRequest): Observable> { - return this.httpClient.post(this.basePath + 'endcSetup', req, { observe: 'response' }); + return this.httpClient.post(this.basePath + 'endc-setup', req, { observe: 'response' }); } /** @@ -69,7 +69,7 @@ export class E2ManagerService { * @returns Observable. On success there is no data, only a code. */ x2Setup(req: E2SetupRequest): Observable> { - return this.httpClient.post(this.basePath + 'x2Setup', req, { observe: 'response' }); + return this.httpClient.post(this.basePath + 'x2-setup', req, { observe: 'response' }); } /** @@ -77,7 +77,7 @@ export class E2ManagerService { * @returns Observable with body. */ nodebPut(): Observable { - return this.httpClient.put((this.basePath + 'nodebShutdownPut'), { observe: 'body' }); + return this.httpClient.put((this.basePath + 'shutdown'), { observe: 'body' }); } } diff --git a/webapp-frontend/src/app/user/edit-dashboard-user-dialog/edit-dashboard-user-dialog.component.ts b/webapp-frontend/src/app/user/edit-dashboard-user-dialog/edit-dashboard-user-dialog.component.ts index f8f50de8..9933a66b 100644 --- a/webapp-frontend/src/app/user/edit-dashboard-user-dialog/edit-dashboard-user-dialog.component.ts +++ b/webapp-frontend/src/app/user/edit-dashboard-user-dialog/edit-dashboard-user-dialog.component.ts @@ -26,7 +26,7 @@ import { ErrorDialogService } from '../../services/ui/error-dialog.service'; @Component({ - selector: 'edit-app-dashboard-user-dialog', + selector: 'rd-edit-app-dashboard-user-dialog', templateUrl: './edit-dashboard-user-dialog.component.html', styleUrls: ['./edit-dashboard-user-dialog.component.scss'] }) -- 2.16.6