changing json handling with function inputs 14/116714/1
authorEltanany Shaaban <shaaban.eltanany.ext@orange.com>
Sun, 10 Jan 2021 15:32:41 +0000 (17:32 +0200)
committerEltanany Shaaban <shaaban.eltanany.ext@orange.com>
Sun, 10 Jan 2021 15:32:41 +0000 (17:32 +0200)
Issue-ID: CCSDK-3051

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

cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.html
cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts

index f00878a..e619f3a 100644 (file)
@@ -81,7 +81,7 @@
                                     <div class="attribute-wrap"
                                         *ngFor="let requiredInput of getKeys(requiredInputs); let i=index">
                                         <!--string-->
-                                        <div *ngIf="getValue(requiredInput,requiredInputs).type=='string'"
+                                        <div *ngIf="getValue(requiredInput,requiredInputs).type=='string' || getValue(requiredInput,requiredInputs).type=='json'"
                                             class="form-group">
                                             <label for="exampleInputEmail1">{{ requiredInput }}<i
                                                     class="icon-required-star" type="button"
@@ -90,7 +90,7 @@
                                             <input [(ngModel)]="currentFuncion['inputs'][requiredInput]" type="text"
                                                 class="form-control">
                                         </div>
-                                        <!--JSON-->
+                                        <!--JSON
                                         <div *ngIf="getValue(requiredInput,requiredInputs).type=='json'"
                                             class="form-group">
                                             <label for="exampleInputEmail1">{{ requiredInput }}<i
                                             <textarea style="height: 120px;" (change)="bind(requiredInput,$event)"
                                                 [value]="currentFuncion['inputs'][requiredInput]"
                                                 class="form-control"></textarea>
-                                        </div>
+                                        </div>-->
                                         <!-- Integer -->
                                         <div class="form-group"
                                             *ngIf="getValue(requiredInput,requiredInputs).type=='integer'">
             </div>
         </div>
     </div>
-</div>
\ No newline at end of file
+</div>
index a86ade0..70ccb73 100644 (file)
@@ -139,11 +139,11 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy {
             if (inputs) {
                 for (const [key, value] of Object.entries(inputs)) {
                     console.log(key + ' - ' + value);
-                    if (typeof value === 'object' || this.isValidJson(value)) {
+                   /* if (typeof value === 'object' || this.isValidJson(value)) {
                         this.currentFuncion.inputs[key] = JSON.stringify(value);
-                    } else {
-                        this.currentFuncion.inputs[key] = value;
-                    }
+                    } else {*/
+                    this.currentFuncion.inputs[key] = value;
+                   // }
                 }
             }
             if (outputs) {