Fix assigning substitution filter property to service property
[sdc.git] / catalog-ui / src / app / ng2 / pages / service-dependencies-editor / service-dependencies-editor.component.ts
index 1aea85a..eddebc9 100644 (file)
@@ -125,9 +125,14 @@ export class ServiceDependenciesEditorComponent {
   }
 
   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 = "";
   }
 
@@ -139,17 +144,9 @@ export class ServiceDependenciesEditorComponent {
     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 = [];