From 462f304e905e48ef068ddd0e23f9253568c4012c Mon Sep 17 00:00:00 2001 From: Eltanany Shaaban Date: Wed, 13 Jan 2021 11:29:44 +0200 Subject: fixing bugs import inputs and outputs from functions into actions Issue-ID: CCSDK-2779 Issue-ID: CCSDK-3025 Signed-off-by: Eltanany Shaaban Change-Id: Ic70fc13f782ef9594bfa2ce3e21c1d17ce4001c6 --- .../action-attributes/action-attributes.component.ts | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages') 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 15f2ce456..6873f8948 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 @@ -120,7 +120,9 @@ export class ActionAttributesComponent implements OnInit { console.log(input); if (input && input.type && input.name) { const insertedInputActionAttribute = Object.assign({}, input); - this.newInputs.push(insertedInputActionAttribute); + if (!this.newInputs.includes(insertedInputActionAttribute)) { + this.newInputs.push(insertedInputActionAttribute); + } } } @@ -166,7 +168,7 @@ export class ActionAttributesComponent implements OnInit { this.storeOutputs(this.newOutputs); this.storeInputs((this.newInputs)); this.newInputs.forEach(input => { - if (!this.inputs.includes(input)) { + if (!this.inputs.includes(input.name)) { this.inputs.push(input); } }); @@ -392,16 +394,7 @@ export class ActionAttributesComponent implements OnInit { this.convertToObject(originalAttributes.substr(0, originalAttributes.length - 1) + newAttributes + '}'); } - const action = this.designerState.template.workflows[this.actionName] as Action; - this.inputs = []; - if (action.inputs) { - const namesOfInput = Object.keys(action.inputs); - this.inputs = this.extractFields(namesOfInput, action.inputs); - } - /* console.log(originalAttributes.substr(0, originalAttributes.length - 1) + ',' + newAttributes + '}'); - this.designerState.template.workflows[this.actionName][attributeType] = - this.convertToObject(originalAttributes.substr(0, originalAttributes.length - 1) - + ',' + newAttributes + '}');*/ + } private removeTheLastComma(newInputs: string): string { -- cgit 1.2.3-korg