-
-
+
-
+ {/*
@@ -1144,9 +1143,11 @@ const IsicHsCodes = () => {
-
+
*/}
+
+
{/* Footer */}
{modalMode !== 'view' && (
diff --git a/ipi-survey-platform/src/pages/Admin/configuration/QuarterlyWindows.jsx b/ipi-survey-platform/src/pages/Admin/configuration/QuarterlyWindows.jsx
index 7a9cabd..5dc3bc3 100644
--- a/ipi-survey-platform/src/pages/Admin/configuration/QuarterlyWindows.jsx
+++ b/ipi-survey-platform/src/pages/Admin/configuration/QuarterlyWindows.jsx
@@ -20,8 +20,8 @@ const createEmptyQuarterForm = () => ({
quarter: '',
startDate: '',
endDate: '',
- gracePeriod: '0 days',
- submissionCount: '0',
+ gracePeriod: '',
+ submissionCount: '',
status: 'Active', // Default to Active
});
@@ -71,6 +71,9 @@ const QuarterlyWindows = () => {
endDate: item.end_date || '',
gracePeriod: item.grace_periods_days ? `${item.grace_periods_days} days` : '0 days',
submissionCount: item.submission_count?.toString() || '-',
+ assigned: item.assigned?.toString() || '0',
+ responded: item.responded?.toString() || '0',
+ not_responded: item.not_responded?.toString() || '0',
status: item.is_active ? 'Active' : 'Inactive'
}));
setQuarterData(formattedData);
@@ -89,8 +92,36 @@ const QuarterlyWindows = () => {
fetchQuarterlyWindows();
}, []);
- const headers = ['Survey Name', 'Year', 'Quarter', 'Start Date', 'End Date', 'Grace Period', 'Submission Count', 'Status', 'Actions'];
- const columnwidth = [300, 100, 100, 100, 100, 100, 100, 100, 100];
+ // Table headers with whitespace-nowrap to prevent line breaks
+ const headers = [
+ { name: 'Survey Name', className: 'whitespace-nowrap' },
+ { name: 'Year', className: 'whitespace-nowrap' },
+ { name: 'Quarter', className: 'whitespace-nowrap' },
+ { name: 'Start Date', className: 'whitespace-nowrap' },
+ { name: 'End Date', className: 'whitespace-nowrap' },
+ { name: 'Grace Period', className: 'whitespace-nowrap' },
+ { name: 'Assigned', className: 'whitespace-nowrap' },
+ { name: 'Responded', className: 'whitespace-nowrap' },
+ { name: 'Not Responded', className: 'whitespace-nowrap' },
+ { name: 'Submission Count', className: 'whitespace-nowrap' },
+ { name: 'Status', className: 'whitespace-nowrap' },
+ { name: 'Actions', className: 'whitespace-nowrap' },
+ ];
+ // Column widths significantly increased for better content visibility
+ const columnwidth = [
+ 550, // Survey Name
+ 150, // Year
+ 180, // Quarter
+ 220, // Start Date
+ 220, // End Date
+ 250, // Grace Period (increased from 200 to 250)
+ 180, // Assigned
+ 200, // Responded
+ 220, // Not Responded
+ 240, // Submission Count
+ 180, // Status
+ 160 // Actions
+];
const filteredRows = React.useMemo(() => {
const term = searchTerm.trim().toLowerCase();
const statusValue = statusFilter.toLowerCase();
@@ -107,6 +138,9 @@ const QuarterlyWindows = () => {
item.startDate,
item.endDate,
item.gracePeriod,
+ item.assigned,
+ item.responded,
+ item.not_responded,
item.submissionCount,
item.status,
]
@@ -116,6 +150,20 @@ const QuarterlyWindows = () => {
});
}, [quarterData, searchTerm, statusFilter]);
+ const Tooltip = ({ children, text }) => (
+
+
{children}
+
+

+
+
+ );
+
const rows = filteredRows.map((item) => [
item.survey_name || '-',
item.year,
@@ -123,11 +171,21 @@ const QuarterlyWindows = () => {
item.startDate ? formatDateForDisplay(item.startDate) : '-',
item.endDate ? formatDateForDisplay(item.endDate) : '-',
item.gracePeriod,
+
+ {item.assigned || '0'}
+ ,
+
+ {item.responded || '0'}
+ ,
+
+ {item.not_responded || '0'}
+ ,
item.submissionCount,
-
,
+
,
'actions',
]);
+
const statusOptions = React.useMemo(
() => [
{ label: 'All', value: 'all' },
@@ -227,6 +285,10 @@ const QuarterlyWindows = () => {
start_date: startDate.toISOString().split('T')[0],
end_date: endDate.toISOString().split('T')[0],
grace_periods_days: form.gracePeriod ? parseInt(form.gracePeriod.split(' ')[0], 10) || 0 : 0,
+ assigned: form.assigned || 0,
+ responded: form.responded || 0,
+ not_responded: form.not_responded || 0,
+ // submission_count: form.submissionCount || 0,
is_active: form.status === 'Active',
establishment: form.establishment || '-',
};
@@ -296,7 +358,7 @@ const QuarterlyWindows = () => {
-
Quarterly Windows
+
Manage Surveys ({filteredRows.length})
{
-
{
- if (colIndex === headers.length - 1) {
- return (
-
-
-
- );
- }
- return value;
- }}
- pagination={{
- currentPage,
- onPageChange: setCurrentPage,
- pageSize,
- totalItems: filteredRows.length,
- }}
- />
+
+
{
+ if (colIndex === headers.length - 1) {
+ return (
+
+
+
+ );
+ }
+ return value;
+ }}
+ pagination={{
+ currentPage,
+ onPageChange: setCurrentPage,
+ pageSize,
+ totalItems: filteredRows.length,
+ }}
+ />
+
{modalMode && (
@@ -514,17 +593,9 @@ const QuarterlyWindows = () => {
onChange={(e) => setForm({ ...form, endDate: e.target.value })}
placeholder="Select Date"
/>
- setForm({ ...form, gracePeriod: e.target.value })}
- options={['5 days', '10 days', '15 days', '20 days', '30 days'].map((item) => ({
- label: item,
- value: item,
- }))}
- placeholder="Select Grace Period"
- />
-
+
+ {/* {
{ label: 'Inactive', value: 'Inactive' },
]}
placeholder="Select Status"
+ /> */}
+ {/*
*/}
+
+ setForm({ ...form, gracePeriod: e.target.value })}
+ options={['5 days', '10 days', '15 days', '20 days', '30 days'].map((item) => ({
+ label: item,
+ value: item,
+ }))}
+ placeholder="Select Grace Period"
/>
diff --git a/ipi-survey-platform/src/pages/History/History.jsx b/ipi-survey-platform/src/pages/History/History.jsx
index d961406..a7fdafd 100644
--- a/ipi-survey-platform/src/pages/History/History.jsx
+++ b/ipi-survey-platform/src/pages/History/History.jsx
@@ -885,7 +885,6 @@ const tableRows = auditHistory.map((entry, index) => {
{ width: 120, style: { whiteSpace: 'normal', wordWrap: 'break-word' } }, // HS Code
{ width: 200, style: { whiteSpace: 'normal', wordWrap: 'break-word' } }, // Product
{ width: 150, align: 'center', style: { whiteSpace: 'normal', wordWrap: 'break-word' } }, // Status
- { width: 100, style: { padding: 10, margin: 0 } }, // Gap between Status and Actors
{ width: 200, style: { whiteSpace: 'normal', wordWrap: 'break-word' } }, // Actors
{ width: 270, style: { whiteSpace: 'normal', wordWrap: 'break-word' } } // Details
]}