summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/pages/composition/panel/panel-tabs/substitution-filter-tab/substitution-filter-tab.component.ts
diff options
context:
space:
mode:
authoraribeiro <anderson.ribeiro@est.tech>2021-11-18 10:29:39 +0000
committerMichael Morris <michael.morris@est.tech>2021-12-06 11:51:31 +0000
commitd5edf5274286e9808dfabf2f49a03a1ba235b70c (patch)
tree7e746ee88b36b19bdd91fb1c55a0bf97d0bfbca7 /catalog-ui/src/app/ng2/pages/composition/panel/panel-tabs/substitution-filter-tab/substitution-filter-tab.component.ts
parentfbc285a47209b763ef3bf7b64e7e0c6e3e1a5202 (diff)
Add node filter with getInput function
Support get_input functions for creating node and substitution filters Issue-ID: SDC-3793 Signed-off-by: aribeiro <anderson.ribeiro@est.tech> Change-Id: Ie00f621be8418b4a9c88afcbbc07d80c22165e9b
Diffstat (limited to 'catalog-ui/src/app/ng2/pages/composition/panel/panel-tabs/substitution-filter-tab/substitution-filter-tab.component.ts')
-rw-r--r--catalog-ui/src/app/ng2/pages/composition/panel/panel-tabs/substitution-filter-tab/substitution-filter-tab.component.ts23
1 files changed, 7 insertions, 16 deletions
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 c4101ab2bc..bf8d1e43b1 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
@@ -21,7 +21,7 @@ import { Component, Input } from '@angular/core';
import { Store } from '@ngxs/store';
import {
Component as TopologyTemplate,
- FullComponentInstance,
+ FullComponentInstance, InputBEModel,
PropertiesGroup,
PropertyBEModel,
} from 'app/models';
@@ -47,7 +47,8 @@ export class SubstitutionFilterTabComponent {
selectedInstanceSiblings: ServiceInstanceObject[];
componentInstancesConstraints: any[];
selectedInstanceConstraints: ConstraintObject[];
- selectedInstanceProperties: PropertyBEModel[];
+ parentServiceProperties: PropertyBEModel[];
+ parentServiceInputs: InputBEModel[];
componentInstanceProperties: PropertiesGroup;
metaData: ComponentMetadata;
@@ -85,21 +86,11 @@ export class SubstitutionFilterTabComponent {
}
private initInstancesWithProperties = (): void => {
- 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);
- }
- }
}