summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJvD_Ericsson <jeff.van.dam@est.tech>2022-03-15 08:16:40 +0000
committerMichael Morris <michael.morris@est.tech>2022-03-22 07:53:38 +0000
commit46222aaa75ad7ebe957c06e05abe2b0e7ce579de (patch)
tree62e91111d80fdf9672dfd901c2c7fcb19f2dccd5
parentfe5660d653c8f2fa39e5946d2c9e30aac6acdb19 (diff)
Fix assigning substitution filter property to service property
Issue-ID: SDC-3916 Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech> Change-Id: I313c3ca7ef2492ee686bd7351d9477631665c722
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/NodeFilterValidator.java6
-rw-r--r--catalog-ui/src/app/ng2/pages/service-dependencies-editor/service-dependencies-editor.component.html2
-rw-r--r--catalog-ui/src/app/ng2/pages/service-dependencies-editor/service-dependencies-editor.component.ts17
3 files changed, 10 insertions, 15 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/NodeFilterValidator.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/NodeFilterValidator.java
index c1eaf60ad0..e62893a148 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/NodeFilterValidator.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/NodeFilterValidator.java
@@ -342,10 +342,8 @@ public class NodeFilterValidator {
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();
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 5f9fac5f09..2765fcce25 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
@@ -27,7 +27,7 @@
<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' : ''"
diff --git a/catalog-ui/src/app/ng2/pages/service-dependencies-editor/service-dependencies-editor.component.ts b/catalog-ui/src/app/ng2/pages/service-dependencies-editor/service-dependencies-editor.component.ts
index 1aea85a618..eddebc999d 100644
--- a/catalog-ui/src/app/ng2/pages/service-dependencies-editor/service-dependencies-editor.component.ts
+++ b/catalog-ui/src/app/ng2/pages/service-dependencies-editor/service-dependencies-editor.component.ts
@@ -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 = [];