From d5edf5274286e9808dfabf2f49a03a1ba235b70c Mon Sep 17 00:00:00 2001 From: aribeiro Date: Thu, 18 Nov 2021 10:29:39 +0000 Subject: Add node filter with getInput function Support get_input functions for creating node and substitution filters Issue-ID: SDC-3793 Signed-off-by: aribeiro Change-Id: Ie00f621be8418b4a9c88afcbbc07d80c22165e9b --- .../components/validation/NodeFilterValidator.java | 33 ++++- .../service-dependencies.component.ts | 7 +- .../substitution-filter.component.ts | 13 +- .../substitution-filter-tab.component.html | 5 +- .../substitution-filter-tab.component.ts | 23 ++-- .../service-dependencies-editor.component.html | 10 +- .../service-dependencies-editor.component.ts | 136 ++++++++++++++------- .../topology-template.service.ts | 6 +- .../ci/tests/pages/ServiceDependenciesEditor.java | 14 +-- 9 files changed, 162 insertions(+), 85 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 6bfe26aab0..eddc8ffcee 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 @@ -28,6 +28,7 @@ import java.util.Objects; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.openecomp.sdc.be.components.impl.ResponseFormatManager; import org.openecomp.sdc.be.components.impl.utils.NodeFilterConstraintAction; @@ -40,6 +41,7 @@ import org.openecomp.sdc.be.model.CapabilityDefinition; import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.ComponentInstance; import org.openecomp.sdc.be.model.ComponentInstanceProperty; +import org.openecomp.sdc.be.model.InputDefinition; import org.openecomp.sdc.be.model.PropertyDefinition; import org.openecomp.sdc.be.model.jsonjanusgraph.operations.ToscaOperationFacade; import org.openecomp.sdc.be.model.tosca.ToscaPropertyType; @@ -48,7 +50,6 @@ import org.openecomp.sdc.exception.ResponseFormat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.CollectionUtils; @org.springframework.stereotype.Component("NodeFilterValidator") public class NodeFilterValidator { @@ -100,7 +101,15 @@ public class NodeFilterValidator { if (booleanResponseFormatEither.isRight()) { return booleanResponseFormatEither; } - } else if (ConstraintConvertor.STATIC_CONSTRAINT.equals(constraint.getSourceType())) { + } + else if (ConstraintConvertor.SERVICE_INPUT_CONSTRAINT.equals(constraint.getSourceType())) { + final Either booleanResponseFormatEither = validateInputConstraint(parentComponent, + componentInstanceId, constraint); + if (booleanResponseFormatEither.isRight()) { + return booleanResponseFormatEither; + } + } + else if (ConstraintConvertor.STATIC_CONSTRAINT.equals(constraint.getSourceType())) { Either booleanResponseFormatEither; if (NodeFilterConstraintType.PROPERTIES.equals(nodeFilterConstraintType)) { booleanResponseFormatEither = isComponentPropertyFilterValid(parentComponent, componentInstanceId, constraint); @@ -148,7 +157,7 @@ public class NodeFilterValidator { sourcePropertyDefinition = componentInstanceProperties == null ? new ArrayList<>() : componentInstanceProperties; } } - if (!CollectionUtils.isEmpty(sourcePropertyDefinition)) { + if (CollectionUtils.isNotEmpty(sourcePropertyDefinition)) { final Optional sourceSelectedProperty = sourcePropertyDefinition.stream() .filter(property -> uiConstraint.getValue().equals(property.getName())).findFirst(); final Optional targetComponentInstanceProperty = parentComponent.getComponentInstancesProperties() @@ -162,6 +171,22 @@ public class NodeFilterValidator { return Either.right(componentsUtils.getResponseFormat(ActionStatus.MAPPED_PROPERTY_NOT_FOUND, source, missingProperty)); } + private Either validateInputConstraint(final Component parentComponent, final String componentInstanceId, + final UIConstraint uiConstraint) { + final List sourceInputDefinition = parentComponent.getInputs(); + if (CollectionUtils.isNotEmpty(sourceInputDefinition)) { + final Optional sourceSelectedProperty = sourceInputDefinition.stream() + .filter(input -> uiConstraint.getValue().equals(input.getName())).findFirst(); + final Optional targetComponentInstanceProperty = parentComponent.getComponentInstancesProperties() + .get(componentInstanceId).stream().filter(property -> uiConstraint.getServicePropertyName().equals(property.getName())).findFirst(); + if (sourceSelectedProperty.isPresent() && targetComponentInstanceProperty.isPresent()) { + return validatePropertyData(uiConstraint, sourceSelectedProperty, targetComponentInstanceProperty); + } + } + LOGGER.debug("Parent component does not have inputs", parentComponent); + return Either.right(componentsUtils.getResponseFormat(ActionStatus.INPUTS_NOT_FOUND)); + } + private Either validatePropertyData(UIConstraint uiConstraint, Optional sourceSelectedProperty, Optional targetComponentInstanceProperty) { @@ -292,7 +317,7 @@ public class NodeFilterValidator { final List propertyDefinitions = component.getProperties(); List sourcePropertyDefinition = component.getName().equals(uiConstraint.getSourceName()) && propertyDefinitions != null ? propertyDefinitions : Collections.emptyList(); - if (!CollectionUtils.isEmpty(sourcePropertyDefinition)) { + if (CollectionUtils.isNotEmpty(sourcePropertyDefinition)) { final Optional sourceSelectedProperty = sourcePropertyDefinition.stream() .filter(property -> uiConstraint.getValue().equals(property.getName())).findFirst(); final Optional targetComponentProperty = component.getProperties().stream() diff --git a/catalog-ui/src/app/ng2/components/logic/service-dependencies/service-dependencies.component.ts b/catalog-ui/src/app/ng2/components/logic/service-dependencies/service-dependencies.component.ts index f9f9286fe5..35e80dc70a 100644 --- a/catalog-ui/src/app/ng2/components/logic/service-dependencies/service-dependencies.component.ts +++ b/catalog-ui/src/app/ng2/components/logic/service-dependencies/service-dependencies.component.ts @@ -134,6 +134,7 @@ export class ServiceDependenciesComponent { isDependent: boolean; isLoading: boolean; parentServiceInputs: InputBEModel[] = []; + parentServiceProperties: PropertyBEModel[] = []; constraintProperties: ConstraintObject[] = []; constraintCapabilities: CapabilitiesConstraintObject[] = []; operatorTypes: any[]; @@ -167,8 +168,10 @@ export class ServiceDependenciesComponent { {label: '<', value: OPERATOR_TYPES.LESS_THAN}, {label: '=', value: OPERATOR_TYPES.EQUAL} ]; - this.topologyTemplateService.getComponentInputsWithProperties(this.compositeService.componentType, this.compositeService.uniqueId).subscribe((result: ComponentGenericResponse) => { + this.topologyTemplateService.getComponentInputsWithProperties(this.compositeService.componentType, this.compositeService.uniqueId) + .subscribe((result: ComponentGenericResponse) => { this.parentServiceInputs = result.inputs; + this.parentServiceProperties = result.properties; }); this.loadNodeFilter(); this.translateService.languageChangedObservable.subscribe((lang) => { @@ -300,6 +303,7 @@ export class ServiceDependenciesComponent { operatorTypes: this.operatorTypes, compositeServiceName: this.compositeService.name, parentServiceInputs: this.parentServiceInputs, + parentServiceProperties: this.parentServiceProperties, selectedInstanceProperties: this.selectedInstanceProperties, selectedInstanceSiblings: this.selectedInstanceSiblings } @@ -406,6 +410,7 @@ export class ServiceDependenciesComponent { operatorTypes: this.operatorTypes, compositeServiceName: this.compositeService.name, parentServiceInputs: this.parentServiceInputs, + parentServiceProperties: this.parentServiceProperties, selectedInstanceProperties: this.selectedInstanceProperties, selectedInstanceSiblings: this.selectedInstanceSiblings } diff --git a/catalog-ui/src/app/ng2/components/logic/substitution-filter/substitution-filter.component.ts b/catalog-ui/src/app/ng2/components/logic/substitution-filter/substitution-filter.component.ts index e0754af549..7671d653e4 100644 --- a/catalog-ui/src/app/ng2/components/logic/substitution-filter/substitution-filter.component.ts +++ b/catalog-ui/src/app/ng2/components/logic/substitution-filter/substitution-filter.component.ts @@ -30,7 +30,6 @@ import {ServiceDependenciesEditorComponent} from 'app/ng2/pages/service-dependen import {ModalService} from 'app/ng2/services/modal.service'; import {TranslateService} from 'app/ng2/shared/translator/translate.service'; import {ComponentMetadata} from '../../../../models/component-metadata'; -import {ServiceInstanceObject} from '../../../../models/service-instance-properties-and-interfaces'; import {TopologyTemplateService} from '../../../services/component-services/topology-template.service'; import {ToscaFilterConstraintType} from "../../../../models/tosca-filter-constraint-type.enum"; @@ -112,7 +111,6 @@ class I18nTexts { export class SubstitutionFilterComponent { modalInstance: ComponentRef; isLoading: boolean; - parentServiceInputs: InputBEModel[] = []; operatorTypes: any[]; constraintProperties: ConstraintObject[] = []; PROPERTIES: string = ToscaFilterConstraintType.PROPERTIES; @@ -120,9 +118,10 @@ export class SubstitutionFilterComponent { @Input() readonly: boolean; @Input() compositeService: ComponentMetadata; @Input() currentServiceInstance: ComponentInstance; - @Input() selectedInstanceSiblings: ServiceInstanceObject[]; @Input() selectedInstanceConstraints: ConstraintObject[] = []; @Input() selectedInstanceProperties: PropertyBEModel[] = []; + @Input() parentServiceProperties: PropertyBEModel[] = []; + @Input() parentServiceInputs: InputBEModel[] = []; @Output() updateSubstitutionFilterProperties: EventEmitter = new EventEmitter(); @Output() updateConstraintListEvent: EventEmitter = new EventEmitter(); @Output() loadConstraintListEvent: EventEmitter = new EventEmitter(); @@ -176,8 +175,8 @@ export class SubstitutionFilterComponent { operatorTypes: this.operatorTypes, compositeServiceName: this.compositeService.name, parentServiceInputs: this.parentServiceInputs, - selectedInstanceProperties: this.selectedInstanceProperties, - selectedInstanceSiblings: this.selectedInstanceSiblings + parentServiceProperties: this.parentServiceProperties, + selectedInstanceProperties: this.parentServiceProperties, } ); this.modalInstance.instance.open(); @@ -216,8 +215,8 @@ export class SubstitutionFilterComponent { operatorTypes: this.operatorTypes, compositeServiceName: this.compositeService.name, parentServiceInputs: this.parentServiceInputs, - selectedInstanceProperties: this.selectedInstanceProperties, - selectedInstanceSiblings: this.selectedInstanceSiblings + parentServiceProperties: this.parentServiceProperties, + selectedInstanceProperties: this.parentServiceProperties, } ); this.modalInstance.instance.open(); diff --git a/catalog-ui/src/app/ng2/pages/composition/panel/panel-tabs/substitution-filter-tab/substitution-filter-tab.component.html b/catalog-ui/src/app/ng2/pages/composition/panel/panel-tabs/substitution-filter-tab/substitution-filter-tab.component.html index c8845deece..a9fad5a733 100644 --- a/catalog-ui/src/app/ng2/pages/composition/panel/panel-tabs/substitution-filter-tab/substitution-filter-tab.component.html +++ b/catalog-ui/src/app/ng2/pages/composition/panel/panel-tabs/substitution-filter-tab/substitution-filter-tab.component.html @@ -23,8 +23,9 @@ { - this.topologyTemplateService.getComponentPropertiesSubstitutionFilter(this.metaData.componentType, this.metaData.uniqueId).subscribe((genericResponse: ComponentGenericResponse) => { - this.selectedInstanceProperties = genericResponse.properties; - this.updateInstanceAttributes(); + this.topologyTemplateService.getComponentPropertiesAndInputsForSubstitutionFilter(this.metaData.componentType, this.metaData.uniqueId) + .subscribe((genericResponse: ComponentGenericResponse) => { + this.parentServiceProperties = genericResponse.properties; + this.parentServiceInputs = genericResponse.inputs; }); } - private updateInstanceAttributes = (): void => { - if (this.isComponentInstanceSelected && this.componentInstanceProperties) { - const instancesMappedList = this.compositionService.componentInstances.map((coInstance) => new ServiceInstanceObject({ - id: coInstance.uniqueId, - name: coInstance.name, - properties: this.componentInstanceProperties[coInstance.uniqueId] || [] - })); - this.selectedInstanceProperties = this.componentInstanceProperties[this.component.uniqueId]; - this.selectedInstanceSiblings = instancesMappedList.filter((coInstance) => coInstance.id !== this.component.uniqueId); - } - } } 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 f84214e4ce..8a577aef77 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 @@ -6,7 +6,7 @@
- +
+ + +
+ +
- +
+
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 cb3e87c8d1..c6b3b65512 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 @@ -56,6 +56,7 @@ export class ServiceDependenciesEditorComponent { compositeServiceName: string, currentServiceName: string, parentServiceInputs: InputBEModel[], + parentServiceProperties: PropertyBEModel[]; selectedInstanceProperties: PropertyBEModel[], operatorTypes: DropdownValue[], selectedInstanceSiblings: ServiceInstanceObject[] @@ -65,6 +66,7 @@ export class ServiceDependenciesEditorComponent { selectedPropertyObj: PropertyFEModel; ddValueSelectedServicePropertiesNames: DropdownValue[]; operatorTypes: DropdownValue[]; + functionTypes: DropdownValue[]; sourceTypes: UIDropDownSourceTypesElement[] = []; currentRule: ConstraintObjectUI; currentIndex: number; @@ -75,7 +77,8 @@ export class ServiceDependenciesEditorComponent { SOURCE_TYPES = { STATIC: {label: 'Static', value: 'static'}, - SERVICE_PROPERTY: {label: 'Service Property', value: 'property'} + SERVICE_PROPERTY: {label: 'Service Property', value: 'property'}, + SERVICE_INPUT: {label: 'Service Input', value: 'service_input'} }; constructor(private propertiesUtils: PropertiesUtils) {} @@ -83,6 +86,19 @@ export class ServiceDependenciesEditorComponent { ngOnInit() { this.currentIndex = this.input.serviceRuleIndex; this.serviceRulesList = this.input.serviceRules; + this.initCurrentRule(); + this.currentServiceName = this.input.currentServiceName; + this.operatorTypes = this.input.operatorTypes; + this.selectedServiceProperties = this.input.selectedInstanceProperties; + this.ddValueSelectedServicePropertiesNames = _.map(this.input.selectedInstanceProperties, (prop) => new DropdownValue(prop.name, prop.name)); + this.initFunctionTypes(); + if (this.SOURCE_TYPES.STATIC.value !== this.currentRule.sourceType) { + this.loadSourceTypesData(); + } + this.syncRuleData(); + } + + private initCurrentRule() { this.currentRule = this.serviceRulesList && this.input.serviceRuleIndex >= 0 ? this.serviceRulesList[this.input.serviceRuleIndex] : new ConstraintObjectUI({ @@ -91,39 +107,73 @@ export class ServiceDependenciesEditorComponent { value: '', constraintOperator: OPERATOR_TYPES.EQUAL }); - this.currentServiceName = this.input.currentServiceName; - this.operatorTypes = this.input.operatorTypes; - this.selectedServiceProperties = this.input.selectedInstanceProperties; - this.ddValueSelectedServicePropertiesNames = _.map(this.input.selectedInstanceProperties, (prop) => new DropdownValue(prop.name, prop.name)); - this.initSourceTypes(); - this.syncRuleData(); + if (this.currentRule && this.currentRule.sourceType === this.SOURCE_TYPES.SERVICE_INPUT.value) { + this.currentRule.sourceName = this.input.compositeServiceName; + } + } + + private initFunctionTypes() { + this.functionTypes = [ + {label: this.SOURCE_TYPES.STATIC.label, value: this.SOURCE_TYPES.STATIC.value}, + {label: this.SOURCE_TYPES.SERVICE_PROPERTY.label, value: this.SOURCE_TYPES.SERVICE_PROPERTY.value}, + {label: this.SOURCE_TYPES.SERVICE_INPUT.label, value: this.SOURCE_TYPES.SERVICE_INPUT.value}]; + } + + onServicePropertyChanged() { + this.updateSelectedPropertyObj(); + this.updateOperatorTypesList(); + this.currentRule.sourceName = ""; + this.currentRule.value = ""; + } + + onSelectFunctionType() { + this.currentRule.value = ""; + this.currentRule.sourceName = ""; + this.listOfValuesToAssign = []; + this.currentRule.sourceType = this.updateCurrentSourceType(this.currentRule.sourceType); + this.loadSourceTypesData(); this.updateSourceTypesRelatedValues(); } - initSourceTypes() { - this.sourceTypes.push({ - label: this.SOURCE_TYPES.STATIC.label, - value: this.SOURCE_TYPES.STATIC.value, - options: [], - assignedLabel: this.SOURCE_TYPES.STATIC.label, - type: this.SOURCE_TYPES.STATIC.value - }); + onSelectSourceType() { + this.currentRule.value = ""; + this.updateSourceTypesRelatedValues(); + } + + loadSourceTypesData() { + this.sourceTypes = []; this.sourceTypes.push({ label: this.input.compositeServiceName, value: this.input.compositeServiceName, - assignedLabel: this.SOURCE_TYPES.SERVICE_PROPERTY.label, - type: this.SOURCE_TYPES.SERVICE_PROPERTY.value, - options: this.input.parentServiceInputs + assignedLabel: this.currentRule.sourceType == this.SOURCE_TYPES.SERVICE_PROPERTY.value + ? this.SOURCE_TYPES.SERVICE_PROPERTY.label : this.SOURCE_TYPES.SERVICE_INPUT.label, + type: this.currentRule.sourceType == this.SOURCE_TYPES.SERVICE_PROPERTY.value + ? this.SOURCE_TYPES.SERVICE_PROPERTY.value : this.SOURCE_TYPES.SERVICE_INPUT.value, + options: this.loadSourceTypeBySelectedFunction().get(this.currentRule.sourceType) }); - _.forEach(this.input.selectedInstanceSiblings, (sib) => - this.sourceTypes.push({ - label: sib.name, - value: sib.name, - options: sib.properties || [], - assignedLabel: this.SOURCE_TYPES.SERVICE_PROPERTY.label, - type: this.SOURCE_TYPES.SERVICE_PROPERTY.value - }) - ); + + if (this.currentRule.sourceType === this.SOURCE_TYPES.SERVICE_INPUT.value) { + this.currentRule.sourceName = this.input.compositeServiceName; + } else { + if (this.input.selectedInstanceSiblings && this.isPropertyFunctionSelected) { + _.forEach(this.input.selectedInstanceSiblings, (sib) => + this.sourceTypes.push({ + label: sib.name, + value: sib.name, + options: sib.properties || [], + assignedLabel: this.SOURCE_TYPES.SERVICE_PROPERTY.label, + type: this.SOURCE_TYPES.SERVICE_PROPERTY.value + }) + ); + } + } + } + + loadSourceTypeBySelectedFunction = (): any => { + let parentDataMap = new Map(); + parentDataMap.set(this.SOURCE_TYPES.SERVICE_PROPERTY.value, this.input.parentServiceProperties); + parentDataMap.set(this.SOURCE_TYPES.SERVICE_INPUT.value , this.input.parentServiceInputs); + return parentDataMap; } syncRuleData() { @@ -151,6 +201,7 @@ export class ServiceDependenciesEditorComponent { (t) => t.value === this.currentRule.sourceName && t.type === this.currentRule.sourceType ); if (selectedSourceType) { + this.listOfSourceOptions = []; this.listOfSourceOptions = selectedSourceType.options || []; this.assignedValueLabel = selectedSourceType.assignedLabel || this.SOURCE_TYPES.STATIC.label; this.filterOptionsByType(); @@ -166,19 +217,15 @@ export class ServiceDependenciesEditorComponent { } } - onServicePropertyChanged() { - this.currentRule.value = ''; - this.updateSelectedPropertyObj(); - this.updateOperatorTypesList(); - this.filterOptionsByType(); - } - - onSelectSourceType() { - this.currentRule.value = ''; - this.currentRule.sourceType = this.currentRule.sourceName === this.SOURCE_TYPES.STATIC.value ? - this.SOURCE_TYPES.STATIC.value : - this.SOURCE_TYPES.SERVICE_PROPERTY.value; - this.updateSourceTypesRelatedValues(); + private updateCurrentSourceType = (sourceType: string): string => { + switch (sourceType) { + case this.SOURCE_TYPES.STATIC.value: + return this.SOURCE_TYPES.STATIC.value; + case this.SOURCE_TYPES.SERVICE_PROPERTY.value: + return this.SOURCE_TYPES.SERVICE_PROPERTY.value; + case this.SOURCE_TYPES.SERVICE_INPUT.value: + return this.SOURCE_TYPES.SERVICE_INPUT.value; + } } filterOptionsByType() { @@ -214,7 +261,9 @@ export class ServiceDependenciesEditorComponent { newProp.value = JSON.stringify(this.currentRule.value); this.propertiesUtils.initValueObjectRef(newProp); console.log("TEST" + newProp.value); - setTimeout(() => {this.selectedPropertyObj = newProp}) + setTimeout(() => { + this.selectedPropertyObj = newProp}) + this.selectedPropertyObj = newProp; } } @@ -222,6 +271,10 @@ export class ServiceDependenciesEditorComponent { return this.currentRule.sourceType === this.SOURCE_TYPES.STATIC.value } + isPropertyFunctionSelected(): boolean { + return this.currentRule.sourceType === this.SOURCE_TYPES.SERVICE_PROPERTY.value; + } + isComplexListMapType(): boolean { return this.selectedPropertyObj && this.selectedPropertyObj.derivedDataType > 0; } @@ -231,4 +284,5 @@ export class ServiceDependenciesEditorComponent { this.currentRule.value = JSON.stringify(value); this.onValueChange(this.selectedPropertyObj.valueObjIsValid); } + } diff --git a/catalog-ui/src/app/ng2/services/component-services/topology-template.service.ts b/catalog-ui/src/app/ng2/services/component-services/topology-template.service.ts index 7b726e4172..20425f810a 100644 --- a/catalog-ui/src/app/ng2/services/component-services/topology-template.service.ts +++ b/catalog-ui/src/app/ng2/services/component-services/topology-template.service.ts @@ -483,8 +483,8 @@ export class TopologyTemplateService { return this.http.delete(this.baseUrl + this.getServerTypeUrl(componentType) + componentMetaDataId + '/componentInstance/' + componentInstanceId + '/' + constraintType + '/' + constraintIndex + '/nodeFilter') } - getComponentPropertiesSubstitutionFilter(componentType: string, componentId: string): Observable { - return this.getComponentDataByFieldsName(componentType, componentId, [COMPONENT_FIELDS.COMPONENT_PROPERTIES]); + getComponentPropertiesAndInputsForSubstitutionFilter(componentType: string, componentId: string): Observable { + return this.getComponentDataByFieldsName(componentType, componentId, [COMPONENT_FIELDS.COMPONENT_PROPERTIES, COMPONENT_FIELDS.COMPONENT_INPUTS]); } createSubstitutionFilterConstraints(componentMetaDataId: string, constraint: ConstraintObject, componentType: string, constraintType: string): Observable { @@ -536,7 +536,6 @@ export class TopologyTemplateService { } protected getComponentDataByFieldsName(componentType: string, componentId: string, fields: string[]): Observable { - console.info("Topology template -> getComponentDataByFieldsName with id:", componentId) let params: HttpParams = new HttpParams(); _.forEach(fields, (field: string): void => { params = params.append(API_QUERY_PARAMS.INCLUDE, field); @@ -544,7 +543,6 @@ export class TopologyTemplateService { // tslint:disable-next-line:object-literal-shorthand return this.http.get(this.baseUrl + this.getServerTypeUrl(componentType) + componentId + '/filteredDataByParams', {params: params}) .map((res) => { - console.info("Topology template -> getComponentDataByFieldsName response:", res); return componentType === ComponentType.SERVICE ? new ServiceGenericResponse().deserialize(res) : new ComponentGenericResponse().deserialize(res); }); diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ServiceDependenciesEditor.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ServiceDependenciesEditor.java index 969854b214..aba5f74063 100644 --- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ServiceDependenciesEditor.java +++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/ServiceDependenciesEditor.java @@ -21,22 +21,19 @@ package org.onap.sdc.frontend.ci.tests.pages; import static org.junit.jupiter.api.Assertions.fail; +import com.fasterxml.jackson.databind.json.JsonMapper; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.stream.Collectors; - +import lombok.AllArgsConstructor; +import lombok.Getter; import org.onap.sdc.frontend.ci.tests.datatypes.ServiceDependencyProperty; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.Select; -import com.fasterxml.jackson.databind.json.JsonMapper; - -import lombok.AllArgsConstructor; -import lombok.Getter; - /** * Represents the Service Dependencies Editor */ @@ -65,8 +62,8 @@ public class ServiceDependenciesEditor extends AbstractPageObject { properties.selectByVisibleText(property.getName()); final Select logicalOperator = new Select(webDriver.findElement(By.xpath(XpathSelector.CONSTRAINT_OPERATOR.xPath))); logicalOperator.selectByVisibleText(property.getLogicalOperator().getOperator()); - final Select sourceType = new Select(webDriver.findElement(By.xpath(XpathSelector.SOURCE_TYPE.xPath))); - sourceType.selectByVisibleText(property.getSource()); + final Select functionType = new Select(webDriver.findElement(By.xpath(XpathSelector.FUNCTION_TYPE.xPath))); + functionType.selectByVisibleText(property.getSource()); try { addRuleAssignedValue(property); } catch (Exception e) { @@ -126,6 +123,7 @@ public class ServiceDependenciesEditor extends AbstractPageObject { SERVICE_DEPENDENCIES_EDITOR("//service-dependencies-editor"), SERVICE_PROPERTY_NAME("//*[@data-tests-id='servicePropertyName']/select"), CONSTRAINT_OPERATOR("//*[@data-tests-id='constraintOperator']/select"), + FUNCTION_TYPE("//*[@data-tests-id='functionType']/select"), SOURCE_TYPE("//*[@data-tests-id='sourceType']/select"), RULE_ASSIGNED_VALUE("//*[@data-tests-id='ruleAssignedValue']//*[self::input or self::select]"), RULE_ASSIGNED_VALUE_ADD_TO_LIST("//a[@data-tests-id = 'add-to-list-%s']"), -- cgit 1.2.3-korg