private Either<Boolean, ResponseFormat> validateComponentPropertyConstraint(final Component component, final UIConstraint uiConstraint) {
String source = SOURCE;
final List<PropertyDefinition> propertyDefinitions = component.getProperties();
- List<? extends PropertyDefinition> sourcePropertyDefinition =
- component.getName().equals(uiConstraint.getSourceName()) && propertyDefinitions != null ? propertyDefinitions : Collections.emptyList();
- if (CollectionUtils.isNotEmpty(sourcePropertyDefinition)) {
- final Optional<? extends PropertyDefinition> sourceSelectedProperty = sourcePropertyDefinition.stream()
+ if (CollectionUtils.isNotEmpty(propertyDefinitions)) {
+ final Optional<? extends PropertyDefinition> sourceSelectedProperty = propertyDefinitions.stream()
.filter(property -> uiConstraint.getValue().equals(property.getName())).findFirst();
final Optional<? extends PropertyDefinition> targetComponentProperty = component.getProperties().stream()
.filter(property -> uiConstraint.getServicePropertyName().equals(property.getName())).findFirst();
<div class="i-sdc-form-item rule-input-field" *ngIf="isPropertyFunctionSelected()">
<label class="i-sdc-form-label required">Source</label>
- <ui-element-dropdown class="i-sdc-form-select" data-tests-id="sourceType" [values]="sourceTypes" [(value)]="currentRule.sourceName" (elementChanged)="onSelectSourceType($event.value)"></ui-element-dropdown>
+ <input class="i-sdc-form-select" data-tests-id="sourceType" [disabled]="true" [(value)]="currentRule.sourceName" type="text">
</div>
<div [ngClass]="isComplexListMapType() && isStaticSource() ? 'complex-input-field' : ''"
}
onServicePropertyChanged() {
+ if(this.SOURCE_TYPES.SERVICE_INPUT.value === this.currentRule.sourceType || this.SOURCE_TYPES.SERVICE_PROPERTY.value === this.currentRule.sourceType){
+ this.currentRule.sourceName = "SELF";
+ } else {
+ this.currentRule.sourceName = "";
+ }
this.updateSelectedPropertyObj();
this.updateOperatorTypesList();
- this.currentRule.sourceName = "";
+ this.updateSourceTypesRelatedValues();
this.currentRule.value = "";
}
this.updateSourceTypesRelatedValues();
}
- onSelectSourceType(value: any) {
- this.currentRule.sourceName = value;
- this.updateSourceTypesRelatedValues();
- if (this.listOfValuesToAssign) {
- this.currentRule.value = this.listOfValuesToAssign[0].value
- }
- }
-
private loadSourceTypesData() {
const SELF = "SELF";
- if (this.SOURCE_TYPES.SERVICE_INPUT.value === this.currentRule.sourceType) {
+ if (this.SOURCE_TYPES.SERVICE_INPUT.value === this.currentRule.sourceType || this.SOURCE_TYPES.SERVICE_PROPERTY.value === this.currentRule.sourceType) {
this.currentRule.sourceName = SELF;
}
this.sourceTypes = [];