From 75fe863d6d2fb2f8f9353a9042b8c69c71f51b98 Mon Sep 17 00:00:00 2001 From: Joshua Chapman <30293265+jchapman68@users.noreply.github.com> Date: Wed, 23 Aug 2023 11:10:26 +0100 Subject: [PATCH 1/3] Revert "Revert "EAR 1948 add option values for rad cb sel answers"" --- src/eq_schema/schema/Answer/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/eq_schema/schema/Answer/index.js b/src/eq_schema/schema/Answer/index.js index 1e8b0170..61852392 100644 --- a/src/eq_schema/schema/Answer/index.js +++ b/src/eq_schema/schema/Answer/index.js @@ -241,13 +241,14 @@ class Answer { } static buildOption( - { label, description, additionalAnswer, qCode: q_code }, + { label, description, additionalAnswer, qCode: q_code, value }, { properties, type }, ctx ) { + const optionValue = value ? value : label; const option = { label: buildContents(label, ctx, true), - value: buildContents(label, ctx, true), + value: buildContents(optionValue, ctx, true), }; if (q_code) { @@ -272,6 +273,7 @@ class Answer { } } } + return option; } } From ba405935dcfc1345f8518b2b99866b2acc96ded7 Mon Sep 17 00:00:00 2001 From: Farhanam76 Date: Thu, 18 Apr 2024 10:03:23 +0100 Subject: [PATCH 2/3] Ensure there's a condition where option value routing is value when it is presence --- .../builders/routing2/newRoutingDestination/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/eq_schema/builders/routing2/newRoutingDestination/index.js b/src/eq_schema/builders/routing2/newRoutingDestination/index.js index 98a43227..c923de4f 100644 --- a/src/eq_schema/builders/routing2/newRoutingDestination/index.js +++ b/src/eq_schema/builders/routing2/newRoutingDestination/index.js @@ -23,9 +23,10 @@ const getOptionsFromQuestionaire = (questionnaire) => { const getOptionValues = (optionIds, questionnaire) => { const options = getOptionsFromQuestionaire(questionnaire); - const optionResults = optionIds.map((id) => - filter(options, { id })[0].label.trim() - ); + const optionResults = optionIds.map((id) => { + const option = filter(options, { id })[0]; + return option.value ? option.value.trim() : option.label.trim(); + }); if (optionResults === undefined || optionResults.length < 0) { return null; From 028cb63f2a56af9b78001ef044c21a50cea1d7e1 Mon Sep 17 00:00:00 2001 From: farres1 Date: Wed, 30 Oct 2024 08:10:01 +0000 Subject: [PATCH 3/3] Add line space --- src/eq_schema/builders/routing2/newRoutingDestination/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/eq_schema/builders/routing2/newRoutingDestination/index.js b/src/eq_schema/builders/routing2/newRoutingDestination/index.js index 68ccd24d..6a949767 100644 --- a/src/eq_schema/builders/routing2/newRoutingDestination/index.js +++ b/src/eq_schema/builders/routing2/newRoutingDestination/index.js @@ -30,6 +30,7 @@ const getOptionValues = (optionIds, questionnaire) => { const optionContent = option.value ? option.value.trim() : option.label.trim(); + const updatedContent = optionContent .replace(/'/g, `\u2019`) .replace(/'/g, `\u2019`)