fix: show responses in summary that doesn't fit the current schema (#2318)

Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
This commit is contained in:
Dhruwang Jariwala
2024-03-28 21:57:00 +05:30
committed by GitHub
parent 6004505502
commit dfb1f86ddb
2 changed files with 8 additions and 9 deletions
@@ -77,7 +77,7 @@ export default function MultipleChoiceSummary({
{result.others && result.others.length > 0 && (
<div className="mt-4 rounded-lg border border-slate-200">
<div className="grid h-12 grid-cols-2 content-center rounded-t-lg bg-slate-100 text-left text-sm font-semibold text-slate-900">
<div className="col-span-1 pl-6 ">Specified &quot;Other&quot; answers</div>
<div className="col-span-1 pl-6 ">Other values found</div>
<div className="col-span-1 pl-6 ">{surveyType === "web" && "User"}</div>
</div>
{result.others
+7 -8
View File
@@ -733,14 +733,13 @@ export const getQuestionWiseSummary = (
});
});
if (isOthersEnabled) {
values.push({
value: getLocalizedValue(lastChoice.label, "default") || "Other",
count: otherValues.length,
percentage: convertFloatTo2Decimal((otherValues.length / totalResponseCount) * 100),
others: otherValues.slice(0, VALUES_LIMIT),
});
}
// Push all other values
values.push({
value: "Other",
count: otherValues.length,
percentage: convertFloatTo2Decimal((otherValues.length / totalResponseCount) * 100),
others: otherValues.slice(0, VALUES_LIMIT),
});
summary.push({
type: question.type,