From de8aa128a2c2d7f822c196ddda5441c7a4524ae7 Mon Sep 17 00:00:00 2001 From: NicolaSDPR1 Date: Wed, 29 Oct 2025 13:52:04 -0700 Subject: [PATCH 1/8] kiln v1 form_definition check in validation --- validate.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/validate.js b/validate.js index cd538d9..4c66e10 100644 --- a/validate.js +++ b/validate.js @@ -17,7 +17,9 @@ function validateJson(jsonData) { * Kiln V1 uses data: { items: []} * Kiln V2 uses dataSources [] */ - const kilnVersion = Object.keys(jsonData["data"]).includes("items") ? 1 : 2; + const kilnVersion = Object.keys(jsonData["data"]).includes("items") ? 1 + : Object.keys(jsonData?.["form_definition"]["data"]).includes("items") ? 1 + : 2; const schema = loadSchema("schema/saved_json.yaml"); const formDefinitionSchema = kilnVersion === 1 ? loadSchema("schema/form_definition.yaml") : loadSchema("schema/form_definitionV2.yaml"); From 4b9712e9d61b41b6d1ac26cf324d13fdc090f1c1 Mon Sep 17 00:00:00 2001 From: NicolaSDPR1 Date: Tue, 4 Nov 2025 10:44:59 -0800 Subject: [PATCH 2/8] (ADO-3477) fixing form defiinition for kiln v2 based on template repo changes --- schema/form_definitionV2.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/schema/form_definitionV2.yaml b/schema/form_definitionV2.yaml index fd49672..c5a1ee1 100644 --- a/schema/form_definitionV2.yaml +++ b/schema/form_definitionV2.yaml @@ -33,6 +33,8 @@ properties: type: object default: [] data: + type: array + form_data: type: object properties: form_id: From 78e83df45c73b784d89a88f36df76dfc954d3368 Mon Sep 17 00:00:00 2001 From: David Okulski Date: Tue, 4 Nov 2025 15:25:53 -0800 Subject: [PATCH 3/8] Update pod count and use HPA for pod scaling --- helm/templates/hpa.yaml | 24 +++++++++++++++++++ helm/values.yaml | 52 ++++++++++++++++++++--------------------- 2 files changed, 50 insertions(+), 26 deletions(-) create mode 100644 helm/templates/hpa.yaml diff --git a/helm/templates/hpa.yaml b/helm/templates/hpa.yaml new file mode 100644 index 0000000..cf69bd9 --- /dev/null +++ b/helm/templates/hpa.yaml @@ -0,0 +1,24 @@ +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: communication-layer-hpa +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: communication-layer + minReplicas: 1 + maxReplicas: 3 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 75 + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: 75 diff --git a/helm/values.yaml b/helm/values.yaml index 56ee505..eaab3d8 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -1,26 +1,26 @@ -replicaCount: 2 - -image: - repository: ghcr.io/bcgov/communication-layer - tag: latest - pullPolicy: Always - -service: - type: ClusterIP - port: 3030 - -configMapName: commlayer - -resources: - requests: - memory: "128Mi" - cpu: "50m" - limits: - memory: "512Mi" - cpu: "250m" - -nodeSelector: {} - -tolerations: [] - -affinity: {} +replicaCount: 1 + +image: + repository: ghcr.io/bcgov/communication-layer + tag: latest + pullPolicy: Always + +service: + type: ClusterIP + port: 3030 + +configMapName: commlayer + +resources: + requests: + memory: "128Mi" + cpu: "50m" + limits: + memory: "512Mi" + cpu: "250m" + +nodeSelector: {} + +tolerations: [] + +affinity: {} From aa5b34c5c46db968ff699719d3c8475562ba07f4 Mon Sep 17 00:00:00 2001 From: NicolaSDPR1 Date: Wed, 5 Nov 2025 13:32:16 -0800 Subject: [PATCH 4/8] (ADO-3514) field id and field uuid --- databindingsHandler.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/databindingsHandler.js b/databindingsHandler.js index a43298d..f948dd3 100644 --- a/databindingsHandler.js +++ b/databindingsHandler.js @@ -141,9 +141,10 @@ function bindDataToFields(formJson, fetchedData, params = {}) { function processItemsForDatabinding(items) { items.forEach(field => { + const fieldId = field?.id ? field.id : field?.uuid; // containers - if (field.type === 'container' && field.containerItems) { - return processItemsForDatabinding(field.containerItems); + if (field.type === 'container' && (field.containerItems || field.children)) { + return field.containerItems ? processItemsForDatabinding(field.containerItems) : processItemsForDatabinding(field.children); } // groups @@ -152,12 +153,12 @@ function bindDataToFields(formJson, fetchedData, params = {}) { // repeatable group const binding = Array.isArray(field.databindings) ? field.databindings[0] : field.databindings || null; const rows = binding ? JSONPath({ path: binding.path, json: fetchedData }) || [] : []; - formData[field.id] = bindRowsToGroup(field, rows); + formData[fieldId] = bindRowsToGroup(field, rows); } else { // single-instance group const binding = Array.isArray(field.databindings) ? field.databindings[0]: field.databindings || null; const rows = binding? (JSONPath({ path: binding.path, json: fetchedData }) || []).slice(0, 1) : [{}]; - formData[field.id] = bindRowsToGroup(field, rows); + formData[fieldId] = bindRowsToGroup(field, rows); } return; } @@ -165,7 +166,7 @@ function bindDataToFields(formJson, fetchedData, params = {}) { //Single fields if (field.databindings) { const raw = getBindingValue(field.databindings, fetchedData, params); - formData[field.id] = raw != null ? transformValueToBindIfNeeded(field, raw) : null; + formData[fieldId] = raw != null ? transformValueToBindIfNeeded(field, raw) : null; } }); }; From 0fbf1b868c63f3dc77b7c084dac558391af538cc Mon Sep 17 00:00:00 2001 From: saranyaviswam Date: Wed, 5 Nov 2025 15:16:13 -0800 Subject: [PATCH 5/8] Update interfaces for Caregiver --- dictionary/interfaces.js | 56 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/dictionary/interfaces.js b/dictionary/interfaces.js index 6a21be3..3376455 100644 --- a/dictionary/interfaces.js +++ b/dictionary/interfaces.js @@ -73,6 +73,62 @@ const interfaces = { ] + }, + CAREGIVER: { + interface: [ + { + mode: [ + "portalNew", + "portalEdit" + ], + type: "button", + label: "Save", + style: "", + actions: [ + { + script: "setFormErrors({});if (!validateAllFields()){ setModalTitle(\"Validation Error\"); setModalMessage(\"There are errors in form.The form will be saved in draft form\"); setModalOpen(true); return true; }", + action_type: "javascript" + }, + { + body: "tokenId: params[\"id\"],savedForm: JSON.stringify(createSavedData())", + path: "/application-forms/saveDraft", + type: "POST", + api_path: "API.saveButtonAction", + action_type: "endpoint" + }, + { + script: "const isErrorEmpty = Object.keys(formErrors).length === 0;if(!isErrorEmpty){setModalTitle(\"Validation Error\"); setModalMessage(\"There are errors in form.The form will be saved in draft form\"); setModalOpen(true); return true;}else {setModalTitle(\"Success ✅\");setModalMessage(\"Form Saved Successfully as draft.\"); setModalOpen(true);}", + action_type: "javascript" + } + ] + }, + { + mode: [ + "portalNew", + "portalEdit" + ], + type: "button", + label: "Complete", + style: "", + actions: [ + { + script: "setFormErrors({});if (!validateAllFields()){ setModalTitle(\"Validation Error\"); setModalMessage(\"There are errors in form.Please clear them before saving.\"); setModalOpen(true); return false; }", + action_type: "javascript" + }, + { + body: "tokenId: params[\"id\"],savedForm: JSON.stringify(createSavedData())", + path: "/application-forms/submit", + type: "POST", + api_path: "API.saveButtonAction", + action_type: "endpoint" + }, + { + script: "setModalTitle(\"Success ✅\");setModalMessage(\"Form Submitted Successfully.\"); setModalOpen(true);await handleSubmit();", + action_type: "javascript" + } + ] + } + ] } }; From 74ed55f17c56232c568ab8950d0f336314950b16 Mon Sep 17 00:00:00 2001 From: David Okulski Date: Thu, 6 Nov 2025 15:19:19 -0800 Subject: [PATCH 6/8] Logging to for save error --- saveICMdataHandler.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/saveICMdataHandler.js b/saveICMdataHandler.js index d512b26..cd21527 100644 --- a/saveICMdataHandler.js +++ b/saveICMdataHandler.js @@ -68,6 +68,7 @@ async function getICMAttachmentStatus(attachment_id, username, params) { async function saveICMdata(req, res) { try { let params = req.body; + console.log("Req for Save:",params); const rawHost = (req.get("X-Original-Server") || req.hostname); const configOpt = appCfg[rawHost] || Object.values(appCfg).find(cfg => { try { @@ -77,6 +78,7 @@ async function saveICMdata(req, res) { } }) || {}; params = { ...params,...configOpt }; + console.log("Params for Save:",params); const attachment_id = params["attachmentId"]; const savedFormParam = params["savedForm"]; From 955b9d967d6a22191c1c01ce9d0fd413522da3aa Mon Sep 17 00:00:00 2001 From: saranyaviswam Date: Mon, 10 Nov 2025 10:09:51 -0800 Subject: [PATCH 7/8] Change for removing modals in the button action. Change for removing modals in the button action. Portal will handle with the messages passed --- dictionary/interfaces.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/dictionary/interfaces.js b/dictionary/interfaces.js index 3376455..895076d 100644 --- a/dictionary/interfaces.js +++ b/dictionary/interfaces.js @@ -86,7 +86,7 @@ const interfaces = { style: "", actions: [ { - script: "setFormErrors({});if (!validateAllFields()){ setModalTitle(\"Validation Error\"); setModalMessage(\"There are errors in form.The form will be saved in draft form\"); setModalOpen(true); return true; }", + script: "setFormErrors({});if (!validateAllFields()){ window.parent.postMessage(JSON.stringify({ \"event\": \"error\" }), \"*\"); return true; }", action_type: "javascript" }, { @@ -95,11 +95,7 @@ const interfaces = { type: "POST", api_path: "API.saveButtonAction", action_type: "endpoint" - }, - { - script: "const isErrorEmpty = Object.keys(formErrors).length === 0;if(!isErrorEmpty){setModalTitle(\"Validation Error\"); setModalMessage(\"There are errors in form.The form will be saved in draft form\"); setModalOpen(true); return true;}else {setModalTitle(\"Success ✅\");setModalMessage(\"Form Saved Successfully as draft.\"); setModalOpen(true);}", - action_type: "javascript" - } + } ] }, { @@ -112,7 +108,7 @@ const interfaces = { style: "", actions: [ { - script: "setFormErrors({});if (!validateAllFields()){ setModalTitle(\"Validation Error\"); setModalMessage(\"There are errors in form.Please clear them before saving.\"); setModalOpen(true); return false; }", + script: "setFormErrors({});if (!validateAllFields()){ window.parent.postMessage(JSON.stringify({ \"event\": \"error\" }), \"*\"); return false; }", action_type: "javascript" }, { @@ -123,7 +119,7 @@ const interfaces = { action_type: "endpoint" }, { - script: "setModalTitle(\"Success ✅\");setModalMessage(\"Form Submitted Successfully.\"); setModalOpen(true);await handleSubmit();", + script: "await handleSubmit();", action_type: "javascript" } ] From 01d53a5b3a8cb005cac53f472fe72917a0e571c9 Mon Sep 17 00:00:00 2001 From: saranyaviswam Date: Mon, 10 Nov 2025 10:35:04 -0800 Subject: [PATCH 8/8] Changes for error message to post --- dictionary/interfaces.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dictionary/interfaces.js b/dictionary/interfaces.js index 895076d..2b709f1 100644 --- a/dictionary/interfaces.js +++ b/dictionary/interfaces.js @@ -86,7 +86,7 @@ const interfaces = { style: "", actions: [ { - script: "setFormErrors({});if (!validateAllFields()){ window.parent.postMessage(JSON.stringify({ \"event\": \"error\" }), \"*\"); return true; }", + script: "setFormErrors({});if (!validateAllFields()){ window.parent.postMessage(JSON.stringify({ \"event\": \"errorOnSave\" }), \"*\"); return true; }", action_type: "javascript" }, { @@ -108,7 +108,7 @@ const interfaces = { style: "", actions: [ { - script: "setFormErrors({});if (!validateAllFields()){ window.parent.postMessage(JSON.stringify({ \"event\": \"error\" }), \"*\"); return false; }", + script: "setFormErrors({});if (!validateAllFields()){ window.parent.postMessage(JSON.stringify({ \"event\": \"errorOnComplete\" }), \"*\"); return false; }", action_type: "javascript" }, {