summaryrefslogtreecommitdiffstats
path: root/catalog-ui
diff options
context:
space:
mode:
authorvasraz <vasyl.razinkov@est.tech>2023-02-01 20:18:39 +0000
committerVasyl Razinkov <vasyl.razinkov@est.tech>2023-02-01 20:22:28 +0000
commit41451b67d83608fbc4004b869c53d8d1d2d4d9e0 (patch)
treeafe88c45fe51fe4d0f9861cf3f54e3072b04b3da /catalog-ui
parent4a515db8b5a959798518fe4a90654118874b4e91 (diff)
Show boolean-type constraint as drop-down list
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Change-Id: I76dc00a232f8e9b45d6599c801ea46f5c415c473 Issue-ID: SDC-4365
Diffstat (limited to 'catalog-ui')
-rw-r--r--catalog-ui/src/app/ng2/pages/properties-assignment/constraints/constraints.component.html34
1 files changed, 29 insertions, 5 deletions
diff --git a/catalog-ui/src/app/ng2/pages/properties-assignment/constraints/constraints.component.html b/catalog-ui/src/app/ng2/pages/properties-assignment/constraints/constraints.component.html
index cbe858fbd4..46d4114250 100644
--- a/catalog-ui/src/app/ng2/pages/properties-assignment/constraints/constraints.component.html
+++ b/catalog-ui/src/app/ng2/pages/properties-assignment/constraints/constraints.component.html
@@ -39,10 +39,10 @@
</select>
</div>
-
<div class="w-sdc-form-columns-wrapper">
<div class="w-sdc-form-column">
+ <!-- ConstraintTypes.in_range-->
<div class="w-sdc-form-columns-wrapper" *ngIf="constraint.type == 'inRange'">
<div class="w-sdc-form-column">
<input type="text" class="i-sdc-form-input myClass"
@@ -58,6 +58,7 @@
</div>
</div>
+ <!-- ConstraintTypes.valid_values-->
<div *ngIf="constraint.type == 'validValues'">
<div class="w-sdc-form-columns-wrapper-block">
<div class="add-btn add-list-item w-sdc-form-column-block"
@@ -66,9 +67,17 @@
</div>
<div class="w-sdc-form-columns-wrapper" *ngFor="let value of constraint.value; let valueIndex = index; trackBy:trackByFn">
<div class="w-sdc-form-column">
- <input type="text" class="i-sdc-form-input" [value]="value"
- [disabled]="isViewOnly"
+ <input type="text" class="i-sdc-form-input" *ngIf="propertyType !== 'boolean'"
+ [disabled]="isViewOnly"
+ [value]="value"
(input)="onChangeConstrainValueIndex(constraintIndex, $event.target.value, valueIndex)"/>
+ <select class="i-sdc-form-select" *ngIf="propertyType == 'boolean'"
+ [disabled]="isViewOnly"
+ [value]="value"
+ (input)="onChangeConstrainValueIndex(constraintIndex, $event.target.value, valueIndex)">
+ <option ngValue="true">true</option>
+ <option ngValue="false">false</option>
+ </select>
</div>
<div class="w-sdc-form-column">
<span class="sprite-new delete-btn" [ngClass]="{'disabled': isViewOnly}" (click)="removeFromList(constraintIndex, valueIndex)"></span>
@@ -76,7 +85,23 @@
</div>
</div>
- <div *ngIf="constraint.type != 'inRange' && constraint.type != 'validValues'">
+ <!-- ConstraintTypes.equal-->
+ <div *ngIf="constraint.type == 'equal'">
+ <input type="text" class="i-sdc-form-input" *ngIf="propertyType !== 'boolean'"
+ [disabled]="isViewOnly"
+ (input)="onChangeConstraintValue(constraintIndex, $event.target.value)"
+ [value]="constraint.value"/>
+ <select class="i-sdc-form-select" *ngIf="propertyType == 'boolean'"
+ [disabled]="isViewOnly"
+ [value]="constraint.value"
+ (input)="onChangeConstraintValue(constraintIndex, $event.target.value)">
+ <option ngValue="true">true</option>
+ <option ngValue="false">false</option>
+ </select>
+ </div>
+
+ <!-- all other ConstraintTypes-->
+ <div *ngIf="constraint.type != 'inRange' && constraint.type != 'validValues' && constraint.type != 'equal'">
<input type="text" class="i-sdc-form-input myClass"
[disabled]="isViewOnly"
(input)="onChangeConstraintValue(constraintIndex, $event.target.value)"
@@ -89,7 +114,6 @@
</div>
</div>
-
</div>
<div class="w-sdc-form-columns-wrapper-small" *ngIf="!isViewOnly">
<div class="add-btn add-list-item w-sdc-form-column-small" *ngIf="!isViewOnly" [ngClass]="{'disabled': isViewOnly}"