From 02f1c3483703be12aaa8a44b38a5c693a9f61568 Mon Sep 17 00:00:00 2001 From: Courtney Myers Date: Wed, 27 Nov 2024 10:05:11 -0500 Subject: [PATCH 1/2] Update formio field name configs for each rebate year and form --- app/client/src/config.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/client/src/config.tsx b/app/client/src/config.tsx index 2ec1f993..33ef4bc5 100644 --- a/app/client/src/config.tsx +++ b/app/client/src/config.tsx @@ -159,12 +159,12 @@ export const formioNameField = { 2023: { frf: "_user_name", prf: "_user_name", - crf: "", // TODO + crf: "_user_name", // TODO: confirm when the 2023 CRF is created }, 2024: { frf: "_user_name", - prf: "", // TODO - crf: "", // TODO + prf: "_user_name", + crf: "_user_name", // TODO: confirm when the 2024 CRF is created }, }; @@ -180,12 +180,12 @@ export const formioEmailField = { 2023: { frf: "_user_email", prf: "_user_email", - crf: "", // TODO + crf: "_user_email", // TODO: confirm when the 2023 CRF is created }, 2024: { frf: "_user_email", - prf: "", // TODO - crf: "", // TODO + prf: "_user_email", + crf: "_user_email", // TODO: confirm when the 2024 CRF is created }, }; @@ -205,7 +205,7 @@ export const formioBapRebateIdField = { }, 2024: { frf: "", // NOTE: no BAP rebate ID in the FRF - prf: "", // TODO - crf: "", // TODO + prf: "_bap_rebate_id", + crf: "_bap_rebate_id", }, }; From 997e4442ec4990bad9d78387418d0c42d2beebf8 Mon Sep 17 00:00:00 2001 From: Courtney Myers Date: Wed, 27 Nov 2024 10:09:23 -0500 Subject: [PATCH 2/2] Update fetchPRFSubmission() to support local development (modifies the datasource components to use the local endpoints version when developing locally) --- app/server/app/utilities/formio.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/server/app/utilities/formio.js b/app/server/app/utilities/formio.js index 0a4235fd..4363d483 100644 --- a/app/server/app/utilities/formio.js +++ b/app/server/app/utilities/formio.js @@ -1479,6 +1479,12 @@ function fetchPRFSubmission({ rebateYear, req, res }) { return res.status(errorStatus).json({ message: errorMessage }); } + /** Modify 2024 PRF's NCES API endpoint URL for local development */ + const formSchemaJson = + NODE_ENV === "development" && rebateYear === "2024" + ? modifyDatasourceComponentsUrl(schema) + : schema; + /** * NOTE: We can't just use the returned submission data here because * Formio returns the string literal 'YES' instead of a base64 encoded @@ -1493,7 +1499,7 @@ function fetchPRFSubmission({ rebateYear, req, res }) { .then((submission) => { return res.json({ userAccess: true, - formSchema: { url: formioFormUrl, json: schema }, + formSchema: { url: formioFormUrl, json: formSchemaJson }, submission, }); });