From 644a3322df9d03425b57787eb8cf28fd08d63b96 Mon Sep 17 00:00:00 2001 From: Malini Date: Thu, 11 Dec 2025 17:22:38 +0530 Subject: [PATCH] bug fixed --- .../Admin/configuration/QuarterlyWindows.jsx | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/ipi-survey-platform/src/pages/Admin/configuration/QuarterlyWindows.jsx b/ipi-survey-platform/src/pages/Admin/configuration/QuarterlyWindows.jsx index defe686..7bad12c 100644 --- a/ipi-survey-platform/src/pages/Admin/configuration/QuarterlyWindows.jsx +++ b/ipi-survey-platform/src/pages/Admin/configuration/QuarterlyWindows.jsx @@ -96,6 +96,19 @@ const QuarterlyWindows = () => { key: null, direction: 'asc' }); + const extractText = (node) => { + if (typeof node === "string") return node; + if (typeof node === "number") return String(node); + + if (node?.props?.children) { + if (Array.isArray(node.props.children)) { + return node.props.children.map(extractText).join(" "); + } + return extractText(node.props.children); + } + + return ""; +}; // Format date to yyyy-MM-dd for input fields const formatDateForInput = (dateString) => { @@ -709,10 +722,14 @@ const handleSave = async () => { type="button" onClick={() => { if (!filteredRows.length) return; + // const csvHeader = headers + // .filter((h) => h.name !== 'Actions') + // .map((h) => `"${h.name}"`) + // .join(','); const csvHeader = headers - .filter((h) => h.name !== 'Actions') - .map((h) => `"${h.name}"`) - .join(','); + .filter((h) => extractText(h.name) !== 'Actions') // remove Actions + .map((h) => `"${extractText(h.name)}"` ) // extract plain text + .join(','); const csvRows = filteredRows.map((item) => { const rowData = [ item.survey_name || '',