Bug fixes

This commit is contained in:
Swetha-Josh 2026-06-18 11:25:49 +05:30
parent bb16e2abd0
commit 6929a4802c
3 changed files with 40 additions and 26 deletions

View File

@ -1284,9 +1284,12 @@ 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
Metric rowSpan="2"
</th> 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 ? ( {showPreviousNext ? (
<> <>
@ -1453,9 +1456,14 @@ 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">
</td> <span>Quantity</span>
<span className="text-sm">
({product?.unit?.uom || 'units'})
</span>
</div>
</td>
{showPreviousNext ? ( {showPreviousNext ? (
<> <>

View File

@ -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: '',
@ -694,12 +694,17 @@ const summaryCounts = React.useMemo(
rows={tableRows} rows={tableRows}
separated separated
columnWidths={columnWidths} columnWidths={columnWidths}
pagination={{ pagination={{
currentPage, currentPage,
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)
return ( return (

View File

@ -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,20 +324,16 @@ const ManufacturingIndex = () => {
}; };
const handleYearChange = (e) => { const handleYearChange = (e) => {
const selectedYear = e.target.value; setYear(e.target.value);
setYear(selectedYear); };
};
const handleSearchMonth = (e) => { const handleQuarterChange = (e) => {
const searchTerm = e.target.value; setQuarter(e.target.value);
setSearchMonth(searchTerm); };
applyFilters(year, searchTerm);
};
const handleQuarterChange = (e) => { const handleSearchMonth = (e) => {
const selectedQuarter = e.target.value; setSearchMonth(e.target.value);
setQuarter(selectedQuarter); };
};
const handleTriggerData = async () => { const handleTriggerData = async () => {
setError(null); setError(null);