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;fp=webapp-frontend%2Fsrc%2Fapp%2Fanr-xapp%2Fanr-edit-ncr-dialog.component.ts;h=046a624b74a4ca7bf69e33c03b0428c07693f71d;hb=52d66fff0881226fe6ae0b1a2cd6c2c2e2837af4;hp=2857f55d83910f49fbd117dab33cff281c6c1b7a;hpb=19570d54903b181469ee2806043d562dadc1d804;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 2857f55d..046a624b 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 @@ -23,7 +23,6 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { ANRXappService } from '../services/anr-xapp/anr-xapp.service'; import { ErrorDialogService } from '../services/ui/error-dialog.service'; import { ANRNeighborCellRelation, ANRNeighborCellRelationMod } from '../interfaces/anr-xapp.types'; -import { modelGroupProvider } from '@angular/forms/src/directives/ng_model_group'; @Component({ selector: 'app-ncr-edit-dialog', @@ -37,10 +36,9 @@ export class ANREditNCRDialogComponent implements OnInit { constructor( private dialogRef: MatDialogRef, - private dataService: ANRXappService, private errorService: ErrorDialogService, - @Inject(MAT_DIALOG_DATA) private data: ANRNeighborCellRelation) { - console.log('constructed with data ' + data); - } + private dataService: ANRXappService, + private errorService: ErrorDialogService, + @Inject(MAT_DIALOG_DATA) private data: ANRNeighborCellRelation) { } ngOnInit() { const namePattern = /^([A-Z])+([0-9])+$/; @@ -59,31 +57,31 @@ export class ANREditNCRDialogComponent implements OnInit { } modifyNcr = (ncrFormValue: ANRNeighborCellRelation) => { - if (this.ncrDialogForm.valid) { - const ncrm = {} as ANRNeighborCellRelationMod; - // there must be a btter way - 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[]) => {}, - (error => { - this.errorService.displayError('NCR update failed: ' + error.message); - }) - ); - this.dialogRef.close(); - } + if (this.ncrDialogForm.valid) { + const ncrm = {} as ANRNeighborCellRelationMod; + // there must be a better way + 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[]) => { }, + (error => { + this.errorService.displayError('NCR update failed: ' + error.message); + }) + ); + this.dialogRef.close(); + } } - public hasError(controlName: string, errorName: string) { + hasError(controlName: string, errorName: string) { if (this.ncrDialogForm.controls[controlName].hasError(errorName)) { - return true; + return true; } return false; } - public validateControl(controlName: string) { + validateControl(controlName: string) { if (this.ncrDialogForm.controls[controlName].invalid && this.ncrDialogForm.controls[controlName].touched) { return true; }