Skip to content

Commit a80c49b

Browse files
committed
Send null for externalScore if not provided and handle null extern score values in the pulse report.
1 parent 6f060dc commit a80c49b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

web-ui/src/pages/PulsePage.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const PulsePage = () => {
8484
const myId = currentUser?.id;
8585
const data = {
8686
externalFeelings: externalComment,
87-
externalScore: externalScore + 1, // converts to 1-based
87+
externalScore: externalScore == null ? null : externalScore + 1, // converts to 1-based
8888
internalFeelings: internalComment,
8989
internalScore: internalScore + 1, // converts to 1-based
9090
submissionDate: today,

web-ui/src/pages/PulseReportPage.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ const PulseReportPage = () => {
197197
}
198198

199199
frequencies[internalScore - 1].internal++;
200-
frequencies[externalScore - 1].external++;
200+
if (externalScore != null) {
201+
frequencies[externalScore - 1].external++;
202+
}
201203

202204
let memberIdToUse;
203205
if (memberId) {
@@ -256,7 +258,9 @@ const PulseReportPage = () => {
256258
];
257259
for(let day of scoreChartDataPoints) {
258260
day.datapoints.forEach(datapoint => {
259-
externalPieCounts[datapoint.externalScore - 1].value++;
261+
if (datapoint.externalScore != null) {
262+
externalPieCounts[datapoint.externalScore - 1].value++;
263+
}
260264
});
261265
}
262266
// Filter out data with a zero value so that the pie chart does not attempt

0 commit comments

Comments
 (0)