Bug fixes
This commit is contained in:
parent
bb16e2abd0
commit
6929a4802c
@ -1284,7 +1284,10 @@ setAdditionalForecastMonths([
|
|||||||
>
|
>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th rowSpan="2" className="bg-[#F2ECCF] text-[#92722A] px-4 py-1 text-xs font-semibold uppercase align-middle border-r border-[#E5E7EB]">
|
<th
|
||||||
|
rowSpan="2"
|
||||||
|
className="w-[140px] bg-[#F2ECCF] text-[#92722A] px-4 py-1 text-xs font-semibold uppercase align-middle border-r border-[#E5E7EB]"
|
||||||
|
>
|
||||||
Metric
|
Metric
|
||||||
</th>
|
</th>
|
||||||
|
|
||||||
@ -1453,8 +1456,13 @@ setAdditionalForecastMonths([
|
|||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr className="border-t border-[#E5E7EB]">
|
<tr className="border-t border-[#E5E7EB]">
|
||||||
<td className="bg-[#FFFCF2] px-4 py-3 font-medium text-[#232528] border border-[#E5E7EB]">
|
<td className="w-[180px] bg-[#FFFCF2] px-4 py-3 font-medium text-[#232528] border border-[#E5E7EB] align-top">
|
||||||
Quantity ({product?.unit?.uom || 'units'})
|
<div className="flex flex-col leading-5">
|
||||||
|
<span>Quantity</span>
|
||||||
|
<span className="text-sm">
|
||||||
|
({product?.unit?.uom || 'units'})
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
{showPreviousNext ? (
|
{showPreviousNext ? (
|
||||||
|
|||||||
@ -92,7 +92,7 @@ const ManageSubmissions = () => {
|
|||||||
const [isRejecting, setIsRejecting] = React.useState(false);
|
const [isRejecting, setIsRejecting] = React.useState(false);
|
||||||
const [rejectReason, setRejectReason] = React.useState('');
|
const [rejectReason, setRejectReason] = React.useState('');
|
||||||
const [showRejectError, setShowRejectError] = React.useState(false);
|
const [showRejectError, setShowRejectError] = React.useState(false);
|
||||||
const pageSize = 10;
|
const [pageSize, setPageSize] = React.useState(10);
|
||||||
const [isInitialLoad, setIsInitialLoad] = React.useState(true);
|
const [isInitialLoad, setIsInitialLoad] = React.useState(true);
|
||||||
const [filters, setFilters] = React.useState({
|
const [filters, setFilters] = React.useState({
|
||||||
search: '',
|
search: '',
|
||||||
@ -699,6 +699,11 @@ const summaryCounts = React.useMemo(
|
|||||||
onPageChange: setCurrentPage,
|
onPageChange: setCurrentPage,
|
||||||
pageSize,
|
pageSize,
|
||||||
totalItems: filtered.length,
|
totalItems: filtered.length,
|
||||||
|
pageSizeOptions: [10, 20, 50, 100],
|
||||||
|
onPageSizeChange: (size) => {
|
||||||
|
setPageSize(size);
|
||||||
|
setCurrentPage(1);
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
renderCell={(value, _, columnIndex) => {
|
renderCell={(value, _, columnIndex) => {
|
||||||
if (columnIndex === 7)
|
if (columnIndex === 7)
|
||||||
|
|||||||
@ -58,7 +58,7 @@ const ManufacturingIndex = () => {
|
|||||||
const [monthlyOverviewData, setMonthlyOverviewData] = useState(null);
|
const [monthlyOverviewData, setMonthlyOverviewData] = useState(null);
|
||||||
const [isPopupOpen, setIsPopupOpen] = useState(false);
|
const [isPopupOpen, setIsPopupOpen] = useState(false);
|
||||||
const [apiLoading, setApiLoading] = useState(false);
|
const [apiLoading, setApiLoading] = useState(false);
|
||||||
const [quarter, setQuarter] = useState('');
|
const [quarter, setQuarter] = useState('All');
|
||||||
const [surveySubmitLoading, setSurveySubmitLoading] = useState(false);
|
const [surveySubmitLoading, setSurveySubmitLoading] = useState(false);
|
||||||
const [surveySubmitStatus, setSurveySubmitStatus] = useState('');
|
const [surveySubmitStatus, setSurveySubmitStatus] = useState('');
|
||||||
const [surveySubmitError, setSurveySubmitError] = useState(null);
|
const [surveySubmitError, setSurveySubmitError] = useState(null);
|
||||||
@ -72,6 +72,10 @@ const ManufacturingIndex = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
applyFilters(year, searchMonth, allMonths, quarter);
|
||||||
|
}, [year, quarter, searchMonth, allMonths]);
|
||||||
|
|
||||||
// Fetch data from API
|
// Fetch data from API
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
@ -303,6 +307,7 @@ const ManufacturingIndex = () => {
|
|||||||
|
|
||||||
// Apply year, quarter and search filters
|
// Apply year, quarter and search filters
|
||||||
const applyFilters = (selectedYear, searchTerm, monthsData = allMonths, selectedQuarter = quarter) => {
|
const applyFilters = (selectedYear, searchTerm, monthsData = allMonths, selectedQuarter = quarter) => {
|
||||||
|
|
||||||
const filtered = monthsData.filter(month => {
|
const filtered = monthsData.filter(month => {
|
||||||
const matchesYear = selectedYear === 'All' || month.year.toString() === selectedYear;
|
const matchesYear = selectedYear === 'All' || month.year.toString() === selectedYear;
|
||||||
const matchesSearch = searchTerm === '' || month.month.toLowerCase().includes(searchTerm.toLowerCase());
|
const matchesSearch = searchTerm === '' || month.month.toLowerCase().includes(searchTerm.toLowerCase());
|
||||||
@ -319,19 +324,15 @@ const ManufacturingIndex = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleYearChange = (e) => {
|
const handleYearChange = (e) => {
|
||||||
const selectedYear = e.target.value;
|
setYear(e.target.value);
|
||||||
setYear(selectedYear);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleSearchMonth = (e) => {
|
|
||||||
const searchTerm = e.target.value;
|
|
||||||
setSearchMonth(searchTerm);
|
|
||||||
applyFilters(year, searchTerm);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleQuarterChange = (e) => {
|
const handleQuarterChange = (e) => {
|
||||||
const selectedQuarter = e.target.value;
|
setQuarter(e.target.value);
|
||||||
setQuarter(selectedQuarter);
|
};
|
||||||
|
|
||||||
|
const handleSearchMonth = (e) => {
|
||||||
|
setSearchMonth(e.target.value);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleTriggerData = async () => {
|
const handleTriggerData = async () => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user