X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=webapp-frontend%2Fsrc%2Fapp%2Fanr-xapp%2Fanr-edit-ncr-dialog.component.ts;h=2c3f2d0d8262b5c5d585016ac96bdd6814ec9a23;hb=refs%2Fchanges%2F91%2F991%2F2;hp=046a624b74a4ca7bf69e33c03b0428c07693f71d;hpb=b38f759a93759fca79cec46491639c935132d577;p=portal%2Fric-dashboard.git 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 046a624b..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 @@ -25,27 +25,26 @@ import { ErrorDialogService } from '../services/ui/error-dialog.service'; import { ANRNeighborCellRelation, ANRNeighborCellRelationMod } from '../interfaces/anr-xapp.types'; @Component({ - selector: 'app-ncr-edit-dialog', + selector: 'rd-ncr-edit-dialog', templateUrl: './anr-edit-ncr-dialog.component.html', styleUrls: ['./anr-edit-ncr-dialog.component.scss'] }) -export class ANREditNCRDialogComponent implements OnInit { +export class AnrEditNcrDialogComponent implements OnInit { private ncrDialogForm: FormGroup; constructor( - private dialogRef: MatDialogRef, + private dialogRef: MatDialogRef, private dataService: ANRXappService, private errorService: ErrorDialogService, @Inject(MAT_DIALOG_DATA) private data: ANRNeighborCellRelation) { } ngOnInit() { - const namePattern = /^([A-Z])+([0-9])+$/; this.ncrDialogForm = new FormGroup({ servingCellNrcgi: new FormControl(this.data.servingCellNrcgi), // readonly neighborCellNrpci: new FormControl(this.data.neighborCellNrpci), // readonly - neighborCellNrcgi: new FormControl(this.data.neighborCellNrcgi, [Validators.required, Validators.pattern(namePattern)]), + neighborCellNrcgi: new FormControl(this.data.neighborCellNrcgi, [Validators.required]), flagNoHo: new FormControl(this.data.flagNoHo), flagNoXn: new FormControl(this.data.flagNoXn), flagNoRemove: new FormControl(this.data.flagNoRemove) @@ -59,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); })