diff options
author | KAPIL SINGAL <ks220y@att.com> | 2020-12-07 14:36:54 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-12-07 14:36:54 +0000 |
commit | 0ac5e3da98031d71388328ae519ee5ce4db8269c (patch) | |
tree | d2b0a8111fae2ce96355478d46c459375506df18 /cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.ts | |
parent | 7d36b29aaaa5422fbddef542ffde62dbdf9deb5e (diff) | |
parent | 02500e451d68cf3e05bc4927bdf5ef9a3edc66e0 (diff) |
Merge "fixing bugs import inputs and outputs from functions into actions"
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.ts')
-rw-r--r-- | cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.ts | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.ts index 1c5a387d0..97ab4411e 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.ts @@ -285,12 +285,14 @@ export class ActionAttributesComponent implements OnInit { /* tslint:disable:no-string-literal */ this.suggestedInputs = Object.keys(nodeTemplate['interfaces'] [interfaceName]['operations']['process']['inputs']); + this.filterTwoCollections(this.suggestedInputs, this.inputs); + } if (nodeTemplate['interfaces'][interfaceName]['operations']['process']['outputs']) { /* tslint:disable:no-string-literal */ this.suggestedOutputs = Object.keys(nodeTemplate['interfaces'] [interfaceName]['operations']['process']['outputs']); - console.log(this.suggestedInputs); + this.filterTwoCollections(this.suggestedOutputs, this.outputs); } } @@ -300,8 +302,18 @@ export class ActionAttributesComponent implements OnInit { console.log(nodeTemplate); } + private filterTwoCollections(suggestedInputs: string[], inputs: any[]) { + inputs.forEach(input => { + if (suggestedInputs.includes(input.name)) { + this.deleteAttribute(suggestedInputs, input.name); + } + }); + } + printSomethings() { - console.log('something'); + this.setInputAndOutputs( + this.designerState.template.workflows[this.actionName]['steps'][this.steps[0]]['target'] + ); } addTempInput(suggestedInput: string) { @@ -319,6 +331,7 @@ export class ActionAttributesComponent implements OnInit { deleteAttribute(container: string[], suggestedAttribute: string) { if (container && suggestedAttribute && container.includes(suggestedAttribute)) { const index: number = container.indexOf(suggestedAttribute); + console.log(index); if (index !== -1) { container.splice(index, 1); } |