From 917a31c1f5fbeca67b0888071b10922a5d1962d2 Mon Sep 17 00:00:00 2001 From: "Mohd. Shariq" Date: Fri, 20 Jan 2023 14:53:26 +0530 Subject: [PATCH 1/2] double quote empty string check in file content when creating file content Signed-off-by: Mohd. Shariq --- .../view-config-item/view-config-item.component.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/components/core/configuration-manager/view-config-item/view-config-item.component.ts b/src/app/components/core/configuration-manager/view-config-item/view-config-item.component.ts index a195a91b3..c5b05fc9f 100644 --- a/src/app/components/core/configuration-manager/view-config-item/view-config-item.component.ts +++ b/src/app/components/core/configuration-manager/view-config-item/view-config-item.component.ts @@ -215,7 +215,8 @@ export class ViewConfigItemComponent implements OnInit, OnChanges, OnDestroy { }) : []; this.filesToUpload = changedConfigValues.map((d) => { - if (d.type === 'script') { + // validate empty value + if (d.type === 'script' && !(/^(""|''|)$/.test(d.value))) { return this.createFileToUpload(d); } }).filter(f => f !== undefined); @@ -342,6 +343,8 @@ export class ViewConfigItemComponent implements OnInit, OnChanges, OnDestroy { } public uploadScript() { + console.log(this.filesToUpload); + this.filesToUpload.forEach(data => { let configItem: any; configItem = Object.keys(data)[0]; From 05803c1ca995f1977ad85d590adf8cb1f039456e Mon Sep 17 00:00:00 2001 From: "Mohd. Shariq" Date: Fri, 20 Jan 2023 15:11:25 +0530 Subject: [PATCH 2/2] removed extra log message Signed-off-by: Mohd. Shariq --- .../view-config-item/view-config-item.component.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/app/components/core/configuration-manager/view-config-item/view-config-item.component.ts b/src/app/components/core/configuration-manager/view-config-item/view-config-item.component.ts index c5b05fc9f..d897ae7f8 100644 --- a/src/app/components/core/configuration-manager/view-config-item/view-config-item.component.ts +++ b/src/app/components/core/configuration-manager/view-config-item/view-config-item.component.ts @@ -343,8 +343,6 @@ export class ViewConfigItemComponent implements OnInit, OnChanges, OnDestroy { } public uploadScript() { - console.log(this.filesToUpload); - this.filesToUpload.forEach(data => { let configItem: any; configItem = Object.keys(data)[0];