Fix valid values constraints not showing 44/133644/2
authorMichaelMorris <michael.morris@est.tech>
Mon, 13 Mar 2023 17:04:38 +0000 (17:04 +0000)
committerVasyl Razinkov <vasyl.razinkov@est.tech>
Tue, 14 Mar 2023 13:31:03 +0000 (13:31 +0000)
Signed-off-by: MichaelMorris <michael.morris@est.tech>
Issue-ID: SDC-4432
Change-Id: I3bc0a2c05e241912872199e7462e7afaf5b4ab53

catalog-ui/src/app/ng2/pages/properties-assignment/constraints/constraints.component.html
catalog-ui/src/app/ng2/pages/properties-assignment/constraints/constraints.component.ts

index 3bbdaff..198bf53 100644 (file)
@@ -88,8 +88,9 @@
                 </div>
                 <div class="w-sdc-form-columns-wrapper" *ngFor="let value of constraintValuesArray(constraintIndex).controls; let valueIndex = index; trackBy:trackByFn">
                   <div class="w-sdc-form-column">
-                    <input type="text" class="i-sdc-form-input" required
+                    <input type="text" class="i-sdc-form-input" required 
                       [value]="value.value"
+                      [disabled]=isViewOnly
                       (input)="onChangeConstrainValueIndex(constraintIndex, $event.target.value, valueIndex)"/>
                   </div>
 
index 31dbead..f0c1d93 100644 (file)
@@ -350,14 +350,13 @@ export class ConstraintsComponent implements OnInit {
       });
 
       const valRef = newForm.get('value') as FormArray;
-
       if (constraint.hasOwnProperty(ConstraintTypes.valid_values)) {
         constraint.validValues.forEach((val) => {
-          valRef.push(new FormControl(val, this.constraintValidators));
+          valRef.push(new FormControl({value: val, disabled: this.isViewOnly}, this.constraintValidators));
         });
       } else {
         constraint.inRange.forEach((val) => {
-          valRef.push(new FormControl(val, this.constraintValidators));
+          valRef.push(new FormControl({value: val, disabled: this.isViewOnly}, this.constraintValidators));
         });
       }