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