Commit 1219a1cd authored by Diogo Santos's avatar Diogo Santos
Browse files

ValueFrom and valueTo showing for INTEGER, SMALLINT and LONGINT characteristic...

ValueFrom and valueTo showing for INTEGER, SMALLINT and LONGINT characteristic values in Edit Service Characteristic Screen
parent 7cb9bcb1
Loading
Loading
Loading
Loading
Loading
+32 −5
Original line number Diff line number Diff line
@@ -131,6 +131,20 @@
                                </div>
                            </div>

                            <ng-container *ngIf="editFormCharacteristic.controls.valueType.value === 'INTEGER'  ||
                                                 editFormCharacteristic.controls.valueType.value === 'SMALLINT' ||
                                                 editFormCharacteristic.controls.valueType.value === 'LONGINT'">
                                <mat-form-field class="col-lg-2 mt-2">
                                    <mat-label>Value From</mat-label>
                                    <input matInput formControlName="valueFrom">
                                </mat-form-field>

                                <mat-form-field class="col-lg-2 mt-2">
                                    <mat-label>Value To</mat-label>
                                    <input matInput formControlName="valueTo">
                                </mat-form-field>
                            </ng-container>
                    
                            <mat-form-field class="col-lg-2 mt-2">
                                <mat-label>Unit Of Measure</mat-label>
                                <input matInput formControlName="unitOfMeasure">
@@ -159,7 +173,6 @@
                                    </div>
                                </div>
                            </div>

                        </ng-template>
                    
                        <ng-template #blockExpanded>
@@ -172,19 +185,33 @@
                                </mat-form-field>
                            </div>

                            <mat-form-field class="col-lg-2 mt-2 order-3 order-md-2">
                            <ng-container *ngIf="editFormCharacteristic.controls.valueType.value === 'INTEGER'  ||
                                                 editFormCharacteristic.controls.valueType.value === 'SMALLINT' ||
                                                 editFormCharacteristic.controls.valueType.value === 'LONGINT'">
                                <mat-form-field class="col-lg-2 mt-2 order-2 order-md-3">
                                    <mat-label>Value From</mat-label>
                                    <input matInput formControlName="valueFrom">
                                </mat-form-field>

                                <mat-form-field class="col-lg-2 mt-2 order-2 order-md-3">
                                    <mat-label>Value To</mat-label>
                                    <input matInput formControlName="valueTo">
                                </mat-form-field>
                            </ng-container>

                            <mat-form-field class="col-lg-2 mt-2 order-4 order-md-2">
                                <mat-label>Unit Of Measure</mat-label>
                                <input matInput formControlName="unitOfMeasure">
                            </mat-form-field>
                    
                            <div class="col-lg-2 text-center mt-2 order-4">
                            <div class="col-lg-2 text-center mt-2 order-5">
                                <mat-checkbox color="primary" formControlName="isDefault" (change)="isDefaultCheckboxChanged(i, $event)">Is
                                    Default
                                </mat-checkbox>
                            </div>


                            <div class="col-lg-2  order-5">
                            <div class="col-lg-2  order-6">
                                <div class="row">
                                    <div class="col-6">
                                        <div class="text-left text-lg-center mt-1">
+1 −1
Original line number Diff line number Diff line
@@ -193,7 +193,7 @@ export class EditServiceSpecCharacteristicsComponent implements OnInit {
    
    if (this.newSpec) {
      const specChar = this.editFormCharacteristic.getRawValue();
      // rangeInterval defaults to closed for INTEGER characteristics in order to be validated by the API. 
      // rangeInterval should not be null for integer characteristics in order to be validated by the API.
      // Without this code rangeInterval would be null and therefore no validation would be done.
      specChar.serviceSpecCharacteristicValue.forEach(value => {
        if (value.valueFrom != null || value.valueTo != null) {