From a80c49bb451d8a7b26982386b3e9fee86efe7452 Mon Sep 17 00:00:00 2001 From: Chad Elliott Date: Thu, 9 Jan 2025 13:25:34 -0600 Subject: [PATCH] Send null for externalScore if not provided and handle null extern score values in the pulse report. --- web-ui/src/pages/PulsePage.jsx | 2 +- web-ui/src/pages/PulseReportPage.jsx | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/web-ui/src/pages/PulsePage.jsx b/web-ui/src/pages/PulsePage.jsx index 3690410e2..e9a247c1c 100644 --- a/web-ui/src/pages/PulsePage.jsx +++ b/web-ui/src/pages/PulsePage.jsx @@ -84,7 +84,7 @@ const PulsePage = () => { const myId = currentUser?.id; const data = { externalFeelings: externalComment, - externalScore: externalScore + 1, // converts to 1-based + externalScore: externalScore == null ? null : externalScore + 1, // converts to 1-based internalFeelings: internalComment, internalScore: internalScore + 1, // converts to 1-based submissionDate: today, diff --git a/web-ui/src/pages/PulseReportPage.jsx b/web-ui/src/pages/PulseReportPage.jsx index 4a4a9a9a3..73355b17f 100644 --- a/web-ui/src/pages/PulseReportPage.jsx +++ b/web-ui/src/pages/PulseReportPage.jsx @@ -197,7 +197,9 @@ const PulseReportPage = () => { } frequencies[internalScore - 1].internal++; - frequencies[externalScore - 1].external++; + if (externalScore != null) { + frequencies[externalScore - 1].external++; + } let memberIdToUse; if (memberId) { @@ -256,7 +258,9 @@ const PulseReportPage = () => { ]; for(let day of scoreChartDataPoints) { day.datapoints.forEach(datapoint => { - externalPieCounts[datapoint.externalScore - 1].value++; + if (datapoint.externalScore != null) { + externalPieCounts[datapoint.externalScore - 1].value++; + } }); } // Filter out data with a zero value so that the pie chart does not attempt