fixing bugs import inputs and outputs from functions into actions 80/116780/1
authorEltanany Shaaban <shaaban.eltanany.ext@orange.com>
Wed, 13 Jan 2021 09:29:44 +0000 (11:29 +0200)
committerEltanany Shaaban <shaaban.eltanany.ext@orange.com>
Wed, 13 Jan 2021 09:29:44 +0000 (11:29 +0200)
Issue-ID: CCSDK-2779
Issue-ID: CCSDK-3025

Signed-off-by: Eltanany Shaaban <shaaban.eltanany.ext@orange.com>
Change-Id: Ic70fc13f782ef9594bfa2ce3e21c1d17ce4001c6

cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.ts

index 15f2ce4..6873f89 100644 (file)
@@ -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 {