diff --git a/ipi-survey-platform/src/pages/ManufacturingIndex/ManufacturingIndex.jsx b/ipi-survey-platform/src/pages/ManufacturingIndex/ManufacturingIndex.jsx index 5c990fc..00c238a 100644 --- a/ipi-survey-platform/src/pages/ManufacturingIndex/ManufacturingIndex.jsx +++ b/ipi-survey-platform/src/pages/ManufacturingIndex/ManufacturingIndex.jsx @@ -56,6 +56,7 @@ const ManufacturingIndex = () => { const [monthlyOverviewData, setMonthlyOverviewData] = useState(null); const [isPopupOpen, setIsPopupOpen] = useState(false); const [apiLoading, setApiLoading] = useState(false); + const [nextScheduledRun, setNextScheduledRun] = useState(''); // Default value const [pagination, setPagination] = useState({ currentPage: 1, @@ -181,6 +182,40 @@ const ManufacturingIndex = () => { ...prev, totalItems: formattedData.length })); + + // Log the full response for debugging + console.log('Full API Response:', response); + + // Extract next scheduled run date from response + // The API response has the date in response.data.next_scheduled_run + const nextRunDateString = response?.data?.nextScheduleDate; + console.log('Extracted next_scheduled_run:', nextRunDateString); + + if (nextRunDateString) { + const nextRunDate = new Date(nextRunDateString); + if (!isNaN(nextRunDate.getTime())) { + const formattedDate = nextRunDate.toLocaleString('en-US', { + day: '2-digit', + month: 'short', + year: 'numeric', + hour: '2-digit', + minute: '2-digit', + timeZone: 'Asia/Dubai', + timeZoneName: 'short' + }).replace(',', ''); // Remove comma after the day for cleaner format + + console.log('Formatted next run date:', formattedDate); + setNextScheduledRun(formattedDate); + } else { + console.error('Invalid date format from API:', nextRunDateString); + // Set a default value or empty string if date is invalid + setNextScheduledRun(''); + } + } else { + console.warn('No next_scheduled_run found in response.data'); + // Set a default value or empty string if no date is found + setNextScheduledRun(''); + } } catch (err) { console.error('Error fetching manufacturing index:', err); console.error('Error details:', { @@ -478,7 +513,7 @@ const ManufacturingIndex = () => {
- Next scheduled run: 11 Nov 2025, 02:00 GST + Next scheduled run: {nextScheduledRun}
@@ -611,7 +646,7 @@ const ManufacturingIndex = () => { onPageChange: (page) => setPagination(prev => ({ ...prev, currentPage: page })), pageSize: pagination.pageSize, totalItems: filteredMonths.length, - pageSizeOptions: [10, 20, 50, 100], + pageSizeOptions: [10, 25, 50, 100], onPageSizeChange: (size) => { setPagination(prev => ({ ...prev, diff --git a/ipi-survey-platform/src/pages/ManufacturingIndex/ManufacturingIndexPopup/ISIC2Digit.jsx b/ipi-survey-platform/src/pages/ManufacturingIndex/ManufacturingIndexPopup/ISIC2Digit.jsx index 8b00d40..d15cbe7 100644 --- a/ipi-survey-platform/src/pages/ManufacturingIndex/ManufacturingIndexPopup/ISIC2Digit.jsx +++ b/ipi-survey-platform/src/pages/ManufacturingIndex/ManufacturingIndexPopup/ISIC2Digit.jsx @@ -197,6 +197,16 @@ const ISIC2Digit = ({ setActiveTab, apiData }) => { )} + {/* Operational Notes */} +
+

Operational notes

+
    +
  • Manufacturing indices are auto-generated on the 11th using the latest validated item-level data for the previous reference month.
  • +
  • If an automated run fails, the status for that month will show as Error; admins can re-trigger the calculation from the technical tools page.
  • +
  • All drill-down views (ISIC 2-digit and ISIC 3 & 4-digit) use the same Laspeyres weights and base year as the headline manufacturing index.
  • +
+
+ {/* Back and Next Buttons */}