change the backgrounf
This commit is contained in:
parent
59927c28be
commit
1a7e8113b3
@ -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 = () => {
|
||||
<div className="mt-5 flex flex-col items-end gap-2">
|
||||
<div className="flex items-center text-sm text-green-600">
|
||||
<FiberManualRecordIcon className="text-xs mr-1" />
|
||||
Next scheduled run: 11 Nov 2025, 02:00 GST
|
||||
Next scheduled run: {nextScheduledRun}
|
||||
</div>
|
||||
<div className="flex text-sm text-gray-600">
|
||||
<InfoOutlinedIcon className="text-gray-400 mr-1 mt-0.5 flex-shrink-0" style={{ fontSize: '1rem' }} />
|
||||
@ -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,
|
||||
|
||||
@ -197,6 +197,16 @@ const ISIC2Digit = ({ setActiveTab, apiData }) => {
|
||||
</>
|
||||
)}
|
||||
|
||||
{/* Operational Notes */}
|
||||
<div className="mt-6 ml-2 p-4 bg-yellow-50 rounded-md text-sm text-gray-700 w-full -mx-6 px-6">
|
||||
<p className="font-medium mb-2">Operational notes</p>
|
||||
<ul className="text-xs text-gray-600 space-y-1.5 list-disc pl-5">
|
||||
<li>Manufacturing indices are auto-generated on the 11th using the latest validated item-level data for the previous reference month.</li>
|
||||
<li>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.</li>
|
||||
<li>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.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{/* Back and Next Buttons */}
|
||||
<div className="mt-8 flex flex-col sm:flex-row justify-between gap-3">
|
||||
<button
|
||||
|
||||
@ -6,7 +6,7 @@ const ISIC3Digit = ({ setActiveTab, apiData }) => {
|
||||
const [currentPage, setCurrentPage] = useState(1);
|
||||
const [pageSize, setPageSize] = useState(10);
|
||||
|
||||
// API-லிருந்து வந்த data-ஐ பயன்படுத்தவும்
|
||||
|
||||
const isicData = Array.isArray(apiData) ? apiData : [];
|
||||
|
||||
// Filter data based on search term
|
||||
@ -176,6 +176,16 @@ const ISIC3Digit = ({ setActiveTab, apiData }) => {
|
||||
</>
|
||||
)}
|
||||
|
||||
{/* Operational Notes */}
|
||||
<div className="mt-6 ml-2 p-4 bg-yellow-50 rounded-md text-sm text-gray-700 w-full -mx-6 px-6">
|
||||
<p className="font-medium mb-2">Operational notes</p>
|
||||
<ul className="text-xs text-gray-600 space-y-1.5 list-disc pl-5">
|
||||
<li>Manufacturing indices are auto-generated on the 11th using the latest validated item-level data for the previous reference month.</li>
|
||||
<li>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.</li>
|
||||
<li>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.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{/* Back and Next Buttons */}
|
||||
<div className="mt-8 flex flex-col sm:flex-row justify-between gap-3">
|
||||
<button
|
||||
|
||||
@ -6,7 +6,7 @@ const ISIC4Digit = ({ setActiveTab, apiData }) => {
|
||||
const [currentPage, setCurrentPage] = useState(1);
|
||||
const [pageSize, setPageSize] = useState(10);
|
||||
|
||||
// API-லிருந்து வந்த data-ஐ பயன்படுத்தவும்
|
||||
// API
|
||||
const isicData = Array.isArray(apiData) ? apiData : [];
|
||||
|
||||
// Filter data based on search term
|
||||
@ -176,6 +176,16 @@ const ISIC4Digit = ({ setActiveTab, apiData }) => {
|
||||
</>
|
||||
)}
|
||||
|
||||
{/* Operational Notes */}
|
||||
<div className="mt-6 ml-2 p-4 bg-yellow-50 rounded-md text-sm text-gray-700 w-full -mx-6 px-6">
|
||||
<p className="font-medium mb-2">Operational notes</p>
|
||||
<ul className="text-xs text-gray-600 space-y-1.5 list-disc pl-5">
|
||||
<li>Manufacturing indices are auto-generated on the 11th using the latest validated item-level data for the previous reference month.</li>
|
||||
<li>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.</li>
|
||||
<li>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.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{/* Only Back Button for ISIC 4-digit (no Next button) */}
|
||||
<div className="mt-8 flex flex-col sm:flex-row justify-start gap-3">
|
||||
<button
|
||||
|
||||
@ -97,7 +97,7 @@ const ManufacturingTotal = ({ selectedMonthData, setActiveTab, monthlyOverviewDa
|
||||
the same month last year.
|
||||
</p>
|
||||
|
||||
<div className="mt-4 p-4 bg-gray-50 rounded-md text-sm text-gray-700 max-w-3xl">
|
||||
<div className="mt-4 p-4 bg-yellow-50 rounded-md text-sm text-gray-700 max-w-3xl">
|
||||
<p className="font-medium mb-2">Laspeyres reminder</p>
|
||||
<p className="font mb-2">Manufacturing index<sub>t</sub> = Σ (weight<sub>j</sub> × group_index<sub>j,t</sub>)</p>
|
||||
<p className="text-xs text-gray-600 mb-4">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user