diff options
author | andre.schmid <andre.schmid@est.tech> | 2022-08-10 14:50:08 +0100 |
---|---|---|
committer | Vasyl Razinkov <vasyl.razinkov@est.tech> | 2022-09-08 18:24:44 +0000 |
commit | 92b18f188105d5ba4b2c469cdfaedc7d2953d593 (patch) | |
tree | df7c7562faa99a76b0e6b5bc079de8d514b35006 /catalog-ui/src/app/ng2/pages/composition | |
parent | c0c2637f201f488a74cb1916f05eece0cc207e9d (diff) |
Support TOSCA functions in Node Filters
Adds support to use tosca functions as value in the node property
filters and substitution filters
Change-Id: Id242691cc9ddd233245b58f052b9f0e2c7bbd66b
Issue-ID: SDC-4128
Signed-off-by: André Schmid <andre.schmid@est.tech>
Diffstat (limited to 'catalog-ui/src/app/ng2/pages/composition')
3 files changed, 26 insertions, 31 deletions
diff --git a/catalog-ui/src/app/ng2/pages/composition/capabilities-filter-properties-editor/capabilities-filter-properties-editor.component.ts b/catalog-ui/src/app/ng2/pages/composition/capabilities-filter-properties-editor/capabilities-filter-properties-editor.component.ts index 7e3bc69835..b59591bd06 100644 --- a/catalog-ui/src/app/ng2/pages/composition/capabilities-filter-properties-editor/capabilities-filter-properties-editor.component.ts +++ b/catalog-ui/src/app/ng2/pages/composition/capabilities-filter-properties-editor/capabilities-filter-properties-editor.component.ts @@ -21,12 +21,12 @@ import {Component} from '@angular/core'; import {InputBEModel, PropertyBEModel, PropertyModel} from 'app/models'; -import {OPERATOR_TYPES} from 'app/ng2/components/logic/service-dependencies/service-dependencies.component'; import {DropdownValue} from 'app/ng2/components/ui/form-components/dropdown/ui-element-dropdown.component'; import {ServiceServiceNg2} from 'app/ng2/services/component-services/service.service'; import {PROPERTY_DATA} from 'app/utils'; import {ServiceInstanceObject} from '../../../../models/service-instance-properties-and-interfaces'; -import {CapabilitiesConstraintObjectUI} from "../../../components/logic/capabilities-constraint/capabilities-constraint.component"; +import {CapabilityFilterConstraintUI} from "../../../../models/capability-filter-constraint"; +import {OPERATOR_TYPES} from "../../../../utils/filter-constraint-helper"; export class UIDropDownSourceTypesElement extends DropdownValue { options: any[]; @@ -53,7 +53,7 @@ export class CapabilitiesFilterPropertiesEditorComponent { input: { serviceRuleIndex: number, - serviceRules: CapabilitiesConstraintObjectUI[], + serviceRules: CapabilityFilterConstraintUI[], compositeServiceName: string, currentServiceName: string, parentServiceInputs: InputBEModel[], @@ -66,12 +66,12 @@ export class CapabilitiesFilterPropertiesEditorComponent { selectedServiceProperties: PropertyBEModel[]; operatorTypes: DropdownValue[]; sourceTypes: UIDropDownSourceTypesElement[] = []; - currentRule: CapabilitiesConstraintObjectUI; + currentRule: CapabilityFilterConstraintUI; currentIndex: number; listOfValuesToAssign: DropdownValue[]; listOfSourceOptions: PropertyBEModel[]; assignedValueLabel: string; - serviceRulesList: CapabilitiesConstraintObjectUI[]; + serviceRulesList: CapabilityFilterConstraintUI[]; capabilitiesNames: string[]; selectedPropertiesByCapabilityName: Array<PropertyModel>; @@ -92,7 +92,7 @@ export class CapabilitiesFilterPropertiesEditorComponent { this.serviceRulesList = this.input.serviceRules; this.currentRule = this.serviceRulesList && this.input.serviceRuleIndex >= 0 ? this.serviceRulesList[this.input.serviceRuleIndex] : - new CapabilitiesConstraintObjectUI({ + new CapabilityFilterConstraintUI({ capabilityName: this.SOURCE_TYPES.CAPABILITY_NAME.value, sourceName: this.SOURCE_TYPES.STATIC.value, sourceType: this.SOURCE_TYPES.STATIC.value, value: '', diff --git a/catalog-ui/src/app/ng2/pages/composition/panel/panel-tabs/service-dependencies-tab/service-dependencies-tab.component.ts b/catalog-ui/src/app/ng2/pages/composition/panel/panel-tabs/service-dependencies-tab/service-dependencies-tab.component.ts index f844dfae4c..ce1a43dd3b 100644 --- a/catalog-ui/src/app/ng2/pages/composition/panel/panel-tabs/service-dependencies-tab/service-dependencies-tab.component.ts +++ b/catalog-ui/src/app/ng2/pages/composition/panel/panel-tabs/service-dependencies-tab/service-dependencies-tab.component.ts @@ -11,13 +11,13 @@ import {DEPENDENCY_EVENTS} from 'app/utils/constants'; import {ComponentMetadata} from '../../../../../../models/component-metadata'; import {ServiceInstanceObject} from '../../../../../../models/service-instance-properties-and-interfaces'; import {EventListenerService} from '../../../../../../services/event-listener-service'; -import {ConstraintObject} from '../../../../../components/logic/service-dependencies/service-dependencies.component'; import {TopologyTemplateService} from '../../../../../services/component-services/topology-template.service'; import {ComponentGenericResponse} from '../../../../../services/responses/component-generic-response'; import {WorkspaceService} from '../../../../workspace/workspace.service'; import {SelectedComponentType} from '../../../common/store/graph.actions'; import {CompositionService} from '../../../composition.service'; -import {CapabilitiesConstraintObject} from "../../../../../components/logic/capabilities-constraint/capabilities-constraint.component"; +import {CapabilityFilterConstraint} from "../../../../../../models/capability-filter-constraint"; +import {FilterConstraint} from "../../../../../../models/filter-constraint"; @Component({ selector: 'service-dependencies-tab', @@ -29,7 +29,7 @@ export class ServiceDependenciesTabComponent { selectedInstanceSiblings: ServiceInstanceObject[]; componentInstancesConstraints: any[]; - selectedInstanceConstraints: ConstraintObject[]; + selectedInstanceConstraints: FilterConstraint[]; selectedInstanceProperties: PropertyBEModel[]; componentInstanceProperties: PropertiesGroup; componentInstanceCapabilityProperties: CapabilitiesGroup; @@ -68,12 +68,12 @@ export class ServiceDependenciesTabComponent { this.eventListenerService.notifyObservers(DEPENDENCY_EVENTS.ON_DEPENDENCY_CHANGE, isChecked); } - public updateSelectedInstanceConstraints = (constraintsList:Array<ConstraintObject>):void => { + public updateSelectedInstanceConstraints = (constraintsList:Array<FilterConstraint>):void => { this.componentInstancesConstraints[this.component.uniqueId].properties = constraintsList; this.selectedInstanceConstraints = this.componentInstancesConstraints[this.component.uniqueId].properties; } - public updateSelectedInstanceCapabilitiesConstraints = (constraintsList:Array<CapabilitiesConstraintObject>):void => { + public updateSelectedInstanceCapabilitiesConstraints = (constraintsList:Array<CapabilityFilterConstraint>):void => { this.componentInstancesConstraints[this.component.uniqueId].capabilities = constraintsList; this.selectedInstanceConstraints = this.componentInstancesConstraints[this.component.uniqueId].capabilities; } diff --git a/catalog-ui/src/app/ng2/pages/composition/panel/panel-tabs/substitution-filter-tab/substitution-filter-tab.component.ts b/catalog-ui/src/app/ng2/pages/composition/panel/panel-tabs/substitution-filter-tab/substitution-filter-tab.component.ts index bf8d1e43b1..ac497ee98e 100644 --- a/catalog-ui/src/app/ng2/pages/composition/panel/panel-tabs/substitution-filter-tab/substitution-filter-tab.component.ts +++ b/catalog-ui/src/app/ng2/pages/composition/panel/panel-tabs/substitution-filter-tab/substitution-filter-tab.component.ts @@ -17,24 +17,19 @@ * ============LICENSE_END========================================================= */ -import { Component, Input } from '@angular/core'; -import { Store } from '@ngxs/store'; -import { - Component as TopologyTemplate, - FullComponentInstance, InputBEModel, - PropertiesGroup, - PropertyBEModel, -} from 'app/models'; -import { SUBSTITUTION_FILTER_EVENTS } from 'app/utils/constants'; -import { ComponentMetadata } from '../../../../../../models/component-metadata'; -import { ServiceInstanceObject } from '../../../../../../models/service-instance-properties-and-interfaces'; -import { EventListenerService } from '../../../../../../services/event-listener-service'; -import { ConstraintObject } from '../../../../../components/logic/service-dependencies/service-dependencies.component'; -import { TopologyTemplateService } from '../../../../../services/component-services/topology-template.service'; -import { ComponentGenericResponse } from '../../../../../services/responses/component-generic-response'; -import { WorkspaceService } from '../../../../workspace/workspace.service'; -import { SelectedComponentType } from '../../../common/store/graph.actions'; -import { CompositionService } from '../../../composition.service'; +import {Component, Input} from '@angular/core'; +import {Store} from '@ngxs/store'; +import {Component as TopologyTemplate, FullComponentInstance, InputBEModel, PropertiesGroup, PropertyBEModel,} from 'app/models'; +import {SUBSTITUTION_FILTER_EVENTS} from 'app/utils/constants'; +import {ComponentMetadata} from '../../../../../../models/component-metadata'; +import {ServiceInstanceObject} from '../../../../../../models/service-instance-properties-and-interfaces'; +import {EventListenerService} from '../../../../../../services/event-listener-service'; +import {TopologyTemplateService} from '../../../../../services/component-services/topology-template.service'; +import {ComponentGenericResponse} from '../../../../../services/responses/component-generic-response'; +import {WorkspaceService} from '../../../../workspace/workspace.service'; +import {SelectedComponentType} from '../../../common/store/graph.actions'; +import {CompositionService} from '../../../composition.service'; +import {FilterConstraint} from "../../../../../../models/filter-constraint"; @Component({ selector: 'substitution-filter-tab', @@ -46,7 +41,7 @@ export class SubstitutionFilterTabComponent { selectedInstanceSiblings: ServiceInstanceObject[]; componentInstancesConstraints: any[]; - selectedInstanceConstraints: ConstraintObject[]; + selectedInstanceConstraints: FilterConstraint[]; parentServiceProperties: PropertyBEModel[]; parentServiceInputs: InputBEModel[]; componentInstanceProperties: PropertiesGroup; @@ -80,7 +75,7 @@ export class SubstitutionFilterTabComponent { this.eventListenerService.notifyObservers(SUBSTITUTION_FILTER_EVENTS.ON_SUBSTITUTION_FILTER_CHANGE, isChecked); } - public updateSelectedInstanceConstraints = (constraintsList:Array<ConstraintObject>):void => { + public updateSelectedInstanceConstraints = (constraintsList:Array<FilterConstraint>):void => { this.componentInstancesConstraints[this.component.uniqueId].properties = constraintsList; this.selectedInstanceConstraints = this.componentInstancesConstraints[this.component.uniqueId].properties; } |