aboutsummaryrefslogtreecommitdiffstats
path: root/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts
diff options
context:
space:
mode:
authorAhmedeldeeb50 <ahmed.eldeeb.ext@orange.com>2020-12-27 14:50:56 +0200
committerAhmed Eldeeb <ahmed.eldeeb.ext@orange.com>2020-12-27 14:03:00 +0000
commit4ecc0b9bd5892f80c86cb9415c58213121eb425d (patch)
treee720ff4d0d1420bcb4b5e18bf90895b9096a6534 /cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts
parent0b225997f9ad4ca12b47900b701ca6edaa425718 (diff)
Add create script modal in script tab.
Issue-ID: CCSDK-3051 Signed-off-by: Ahmedeldeeb50 <ahmed.eldeeb.ext@orange.com> Change-Id: I34f5e40a9871c003df03028a17f7c2f237c76fca
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts')
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts
index 8780621ea..a86ade0fa 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts
@@ -139,7 +139,7 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy {
if (inputs) {
for (const [key, value] of Object.entries(inputs)) {
console.log(key + ' - ' + value);
- if (this.isValidJson(value)) {
+ if (typeof value === 'object' || this.isValidJson(value)) {
this.currentFuncion.inputs[key] = JSON.stringify(value);
} else {
this.currentFuncion.inputs[key] = value;
@@ -156,10 +156,13 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy {
}
isValidJson(val) {
+ console.log(val);
try {
- JSON.parse(val);
+ JSON.parse(val + '');
return true;
- } catch (e) { }
+ } catch (e) {
+ console.log(e);
+ }
return false;
}