diff options
author | 2023-02-15 17:14:59 +0000 | |
---|---|---|
committer | 2023-05-16 15:05:13 +0000 | |
commit | 8183ade590e367f28e13484201d2c9526be221dc (patch) | |
tree | 735d600ec26ed9caea7657f7224a7e5f6f05cb62 /catalog-ui/src/app/ng2/pages/service-dependencies-editor/service-dependencies-editor.component.html | |
parent | 5768f2e5a056df6b23f7f8a87529d5ca00063c68 (diff) |
Support additional operands for node filters
Issue-ID: SDC-4395
Signed-off-by: franciscovila <javier.paradela.vila@est.tech>
Change-Id: I66b172d100ffd2757de88bc7640761f31fd20c28
Diffstat (limited to 'catalog-ui/src/app/ng2/pages/service-dependencies-editor/service-dependencies-editor.component.html')
-rw-r--r-- | catalog-ui/src/app/ng2/pages/service-dependencies-editor/service-dependencies-editor.component.html | 96 |
1 files changed, 89 insertions, 7 deletions
diff --git a/catalog-ui/src/app/ng2/pages/service-dependencies-editor/service-dependencies-editor.component.html b/catalog-ui/src/app/ng2/pages/service-dependencies-editor/service-dependencies-editor.component.html index 8024eb1615..c90cfd8210 100644 --- a/catalog-ui/src/app/ng2/pages/service-dependencies-editor/service-dependencies-editor.component.html +++ b/catalog-ui/src/app/ng2/pages/service-dependencies-editor/service-dependencies-editor.component.html @@ -51,7 +51,10 @@ <label class="i-sdc-form-label required">{{"OPERATOR_LABEL" | translate}}</label> <ui-element-dropdown class="i-sdc-form-select" data-tests-id="constraintOperator" [testId]="'constraintOperator'" - [values]="operatorTypes" [(value)]="currentRule.constraintOperator"></ui-element-dropdown> + (change)="onSourceTypeChange()" + [values]="operatorTypes" [(value)]="currentRule.constraintOperator" + > + </ui-element-dropdown> </div> </div> <div class="rule-builder-content"> @@ -61,17 +64,28 @@ data-tests-id="value-type-static" [(ngModel)]="selectedSourceType" [value]="SOURCE_TYPES.STATIC.value" - (ngModelChange)="onSourceTypeChange()"/> {{"VALUE_LABEL" | translate}} + (ngModelChange)="onSourceTypeChange($event)"/> {{"VALUE_LABEL" | translate}} <input type="radio" name="sourceType" data-tests-id="value-type-tosca-function" [(ngModel)]="selectedSourceType" - [value]="SOURCE_TYPES.TOSCA_FUNCTION.value" - (ngModelChange)="onSourceTypeChange()"/> {{"VALUE_EXPRESSION_LABEL" | translate}} + [value]="isValidValuesOperator() || isRangeType() || isInRangeOperator() ? SOURCE_TYPES.TOSCA_FUNCTION_LIST.value: SOURCE_TYPES.TOSCA_FUNCTION.value" + (ngModelChange)="onSourceTypeChange($event)"/> {{"VALUE_EXPRESSION_LABEL" | translate}} </div> </div> <div class="rule-builder-content" *ngIf="isToscaFunctionSource() && selectedProperty"> <div class="i-sdc-form-item rule-input-field"> <tosca-function [property]="selectedProperty" + [overridingType] = "isLengthOperator() ? overridingType : undefined" + [componentInstanceMap]="componentInstanceMap" + [allowClear]="false" + (onValidityChange)="onToscaFunctionValidityChange($event)" + > + </tosca-function> + </div> + </div> + <div class="rule-builder-content" *ngIf="isToscaFunctionSource() && selectedProperty && (isRangeType() || isInRangeOperator())"> + <div class="i-sdc-form-item rule-input-field"> + <tosca-function [property]="selectedProperty" [componentInstanceMap]="componentInstanceMap" [customToscaFunctions]="customToscaFunctions" [allowClear]="false" @@ -80,29 +94,97 @@ </tosca-function> </div> </div> + + <div class="rule-builder-content" *ngIf="isToscaFunctionListSource() && selectedProperty && (isRangeType() || isInRangeOperator())"> + + <div class="i-sdc-form-item rule-input-field"> + <div class="w-sdc-form-columns-wrapper" *ngFor="let val of rangeToscaFunctionList; let valueIndex = index; trackBy:trackByFn"> + <div class="w-sdc-form-column" style="border-width:3px; border-style:solid; border-color:#009fdb; padding: 1em;"> + <tosca-function [property]="selectedProperty" + [inToscaFunction]="val" + [componentInstanceMap]="componentInstanceMap" + [allowClear]="false" + (onValidityChange)="onToscaRangeFunctionListValidityChange($event, valueIndex)" + > + </tosca-function> + </div> + </div> + </div> + </div> + + <div class="rule-builder-content" *ngIf="isToscaFunctionListSource() && selectedProperty && isValidValuesOperator()"> + + <div class="i-sdc-form-item rule-input-field"> + <div class="add-btn" + (click)="addToList()">Add to List + </div> + <div class="w-sdc-form-columns-wrapper" *ngFor="let val of this.validValuesToscaFunctionList; let valueIndex = index; trackBy:trackByFn"> + <div class="w-sdc-form-column" style="border-width:3px; border-style:solid; border-color:#009fdb; padding: 1em;"> + <tosca-function [property]="selectedProperty" + [inToscaFunction]="val" + [componentInstanceMap]="componentInstanceMap" + [allowClear]="false" + (onValidityChange)="onToscaFunctionListValidityChange($event, valueIndex)" + > + </tosca-function> + </div> + <div class="w-sdc-form-column"> + <span class="sprite-new delete-btn" (click)="removeFromList(valueIndex)"></span> + </div> + </div> + </div> + </div> <div *ngIf="isToscaFunctionSource() && !selectedProperty"> {{"NODE_FILTER_SELECT_PROPERTY" | translate}} </div> <div class="rule-builder-content" *ngIf="isStaticSource()"> <div class="i-sdc-form-item rule-input-field complex-input-field"> <dynamic-property - *ngIf="isComplexListMapType()" + *ngIf="isComplexListMapType() && !isRangeType() && !isValidValuesOperator() && !isLengthOperator()" [selectedPropertyId]="selectedProperty.uniqueId" [property]="selectedProperty" [expandedChildId]="selectedProperty.expandedChildPropertyId ? selectedProperty.expandedChildPropertyId : selectedProperty.name" [canBeDeclared]="true" + [hideCheckBox]="true" (propertyChanged)="updateComplexListMapTypeRuleValue()" [rootProperty]="selectedProperty" (expandChild)="selectedProperty.updateExpandedChildPropertyId($event)"> </dynamic-property> <dynamic-element - *ngIf="!isComplexListMapType()" + *ngIf="!isComplexListMapType() && !isValidValuesOperator()" [(value)]="currentRule.value" class="rule-assigned-value" data-tests-id="ruleAssignedValue" (elementChanged)="onValueChange($event.isValid)" - [type]="selectedProperty ? selectedProperty.type : 'string'"> + [type]="isLengthOperator() ? 'integer' : selectedProperty ? selectedProperty.type : 'string'" + [operator]="currentRule.constraintOperator"> + </dynamic-element> + <dynamic-element + *ngIf="isComplexListMapType() && isLengthOperator()" + [(value)]="currentRule.value" + class="rule-assigned-value" + data-tests-id="ruleAssignedValue" + (elementChanged)="onValueChange($event.isValid)" + [type]="isLengthOperator() ? 'integer' : selectedProperty ? selectedProperty.type : 'string'" + [operator]="currentRule.constraintOperator"> + </dynamic-element> + <dynamic-element + *ngIf="isRangeType()" + [(value)]="currentRule.value" + class="rule-assigned-value" + data-tests-id="ruleAssignedValue" + (elementChanged)="onValueChange($event.isValid)" + [type]="selectedProperty ? selectedProperty.type : 'string'"> + </dynamic-element> + <dynamic-element + *ngIf="isValidValuesOperator()" + [(value)]="currentRule.value" + class="rule-assigned-value" + data-tests-id="ruleAssignedValue" + (elementChanged)="onValueChange($event.isValid)" + [type]="selectedProperty ? selectedProperty.type : 'string'" + [operator]="currentRule.constraintOperator"> </dynamic-element> </div> </div> |