Change typescript variables to snake_case 66/766/1
authorLott, Christopher (cl778h) <cl778h@att.com>
Wed, 21 Aug 2019 22:27:30 +0000 (18:27 -0400)
committerLott, Christopher (cl778h) <cl778h@att.com>
Wed, 21 Aug 2019 22:27:30 +0000 (18:27 -0400)
The AC data schema specifies keys like blocking_rate,
but the form was sending keys like blockingRate

Change-Id: I4ab923be48b67f69319b5bec44bc6c1c7b2e9feb
Issue-Id:  RICPLT-1994
Signed-off-by: Lott, Christopher (cl778h) <cl778h@att.com>
docs/release-notes.rst
webapp-frontend/package-lock.json
webapp-frontend/src/app/ac-xapp/ac-xapp.component.html
webapp-frontend/src/app/ac-xapp/ac-xapp.component.ts

index 7ae186c..d4211c8 100644 (file)
@@ -45,6 +45,7 @@ Version 1.2.0, 21 Aug 2019
 * Repair app manager undeploy-app method
 * Display AC xAPP metrics data via Kibana source (metrics.url.ac) on dashboard
 * Pass AC policy parameter without parsing as JSON
+* Use snake_case (not camelCase) names in AC policy front end
 
 Version 1.0.5, 5 July 2019
 --------------------------
index c03ccd4..912bc54 100644 (file)
       "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==",
       "dev": true
     },
+    "lodash-es": {
+      "version": "4.17.15",
+      "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.15.tgz",
+      "integrity": "sha512-rlrc3yU3+JNOpZ9zj5pQtxnx2THmvRykwL4Xlxoa8I9lHBlVbbyPhgyPMioxVZ4NqyxaVVtaJnzsyOidQIhyyQ=="
+    },
     "lodash.assign": {
       "version": "4.2.0",
       "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz",
index f8125f5..d6081b0 100644 (file)
       <mat-checkbox formControlName="enforce">Enforce</mat-checkbox>
     </div>
     <mat-form-field class="input-display-block">
-      <input matInput type="text" placeholder="Window length" formControlName="windowLength">
+      <input matInput type="text" placeholder="Window length" formControlName="window_length">
       <mat-hint align="end">Sliding window length in minutes for measurement, range 1..60.</mat-hint>
-      <mat-error *ngIf="validateControl('windowLength') && hasError('windowLength', 'required')">Number is required
+      <mat-error *ngIf="validateControl('window_length') && hasError('window_length', 'required')">Number is required
       </mat-error>
-      <mat-error *ngIf="hasError('windowLength', 'pattern')">Valid number is required</mat-error>
+      <mat-error *ngIf="hasError('window_length', 'pattern')">Valid number is required</mat-error>
     </mat-form-field>
     <mat-form-field class="input-display-block">
-      <input matInput type="text" placeholder="Blocking rate" formControlName="blockingRate">
+      <input matInput type="text" placeholder="Blocking rate" formControlName="blocking_rate">
       <mat-hint align="end">Connections to block if above trigger threshold, range 1..100.</mat-hint>
-      <mat-error *ngIf="validateControl('blockingRate') && hasError('blockingRate', 'required')">Number is required
+      <mat-error *ngIf="validateControl('blocking_rate') && hasError('blocking_rate', 'required')">Number is required
       </mat-error>
-      <mat-error *ngIf="hasError('blockingRate', 'pattern')">Valid number is required</mat-error>
+      <mat-error *ngIf="hasError('blocking_rate', 'pattern')">Valid number is required</mat-error>
     </mat-form-field>
     <mat-form-field class="input-display-block">
-      <input matInput type="text" placeholder="Trigger threshold" formControlName="triggerThreshold">
+      <input matInput type="text" placeholder="Trigger threshold" formControlName="trigger_threshold">
       <mat-hint align="end">Number of events in window to trigger blocking, minimum 1.</mat-hint>
-      <mat-error *ngIf="validateControl('triggerThreshold') && hasError('triggerThreshold', 'required')">Number is
+      <mat-error *ngIf="validateControl('trigger_threshold') && hasError('trigger_threshold', 'required')">Number is
         required</mat-error>
-      <mat-error *ngIf="hasError('triggerThreshold', 'pattern')">Valid number is required</mat-error>
+      <mat-error *ngIf="hasError('trigger_threshold', 'pattern')">Valid number is required</mat-error>
     </mat-form-field>
     <div class="input-display-block">
       <button class="mat-raised-button mat-primary update-button" [disabled]="!acForm.valid">Update</button>
index 9b9f23c..f7c360c 100644 (file)
@@ -48,10 +48,11 @@ export class AcXappComponent implements OnInit {
     const triggerPattern = /^([0-9]+)$/;
     // No way to fetch current settings via A1 at present
     this.acForm = new FormGroup({
+      // Names must match the ACAdmissionIntervalControl interface
       enforce: new FormControl(true,  [Validators.required]),
-      windowLength: new FormControl('', [Validators.required, Validators.pattern(windowLengthPattern)]),
-      blockingRate: new FormControl('', [Validators.required, Validators.pattern(blockingRatePattern)]),
-      triggerThreshold: new FormControl('', [Validators.required, Validators.pattern(triggerPattern)])
+      window_length: new FormControl('', [Validators.required, Validators.pattern(windowLengthPattern)]),
+      blocking_rate: new FormControl('', [Validators.required, Validators.pattern(blockingRatePattern)]),
+      trigger_threshold: new FormControl('', [Validators.required, Validators.pattern(triggerPattern)])
     });
     this.acXappService.getVersion().subscribe((res: string) => this.acVersion = res);
   }