mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 15:55:48 +00:00
refactor(FE): Ensure filter modal closes on reset across components
This commit is contained in:
@@ -159,6 +159,7 @@ const ClosingsTable = () => {
|
|||||||
onReset: () => {
|
onReset: () => {
|
||||||
updateFilter('location_id', '');
|
updateFilter('location_id', '');
|
||||||
updateFilter('project_status', '');
|
updateFilter('project_status', '');
|
||||||
|
filterModal.closeModal();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -493,6 +493,7 @@ const UniformityTable = () => {
|
|||||||
updateFilter('kandang_id', '');
|
updateFilter('kandang_id', '');
|
||||||
|
|
||||||
filterFormik.resetForm();
|
filterFormik.resetForm();
|
||||||
|
filterModal.closeModal();
|
||||||
}, [filterFormik, updateFilter]);
|
}, [filterFormik, updateFilter]);
|
||||||
|
|
||||||
const selectedRowIds = useMemo(() => {
|
const selectedRowIds = useMemo(() => {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import {
|
|||||||
import ExpenseStatusBadge from '@/components/pages/expense/ExpenseStatusBadge';
|
import ExpenseStatusBadge from '@/components/pages/expense/ExpenseStatusBadge';
|
||||||
import RealizationStatusBadge from '@/components/pages/expense/RealizationStatusBadge';
|
import RealizationStatusBadge from '@/components/pages/expense/RealizationStatusBadge';
|
||||||
import Table from '@/components/Table';
|
import Table from '@/components/Table';
|
||||||
import { cn, formatCurrency, formatDate } from '@/lib/helper';
|
import { formatCurrency, formatDate } from '@/lib/helper';
|
||||||
import { ReportExpense } from '@/types/api/report/report-expense';
|
import { ReportExpense } from '@/types/api/report/report-expense';
|
||||||
import { ReportExpenseApi } from '@/services/api/report';
|
import { ReportExpenseApi } from '@/services/api/report';
|
||||||
import { isResponseSuccess } from '@/lib/api-helper';
|
import { isResponseSuccess } from '@/lib/api-helper';
|
||||||
@@ -145,6 +145,7 @@ const ReportExpenseTab = ({ tabId }: ReportExpenseTabProps) => {
|
|||||||
setFilterParams({});
|
setFilterParams({});
|
||||||
setIsSubmitted(false);
|
setIsSubmitted(false);
|
||||||
setPage(1);
|
setPage(1);
|
||||||
|
filterModal.closeModal();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ const CustomerPaymentTab = ({ tabId }: CustomerPaymentTabProps) => {
|
|||||||
toast.dismiss();
|
toast.dismiss();
|
||||||
setDateErrorShown(false);
|
setDateErrorShown(false);
|
||||||
}
|
}
|
||||||
|
filterModal.closeModal();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -142,6 +142,7 @@ const DebtSupplierTab = ({ tabId }: DebtSupplierTabProps) => {
|
|||||||
filter_by: undefined,
|
filter_by: undefined,
|
||||||
});
|
});
|
||||||
setIsSubmitted(false);
|
setIsSubmitted(false);
|
||||||
|
filterModal.closeModal();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -147,6 +147,7 @@ const PurchasesPerSupplierTab = ({ tabId }: PurchasesPerSupplierTabProps) => {
|
|||||||
toast.dismiss();
|
toast.dismiss();
|
||||||
setDateErrorShown(false);
|
setDateErrorShown(false);
|
||||||
}
|
}
|
||||||
|
filterModal.closeModal();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -142,6 +142,7 @@ const DailyMarketingTab = ({ tabId }: DailyMarketingTabProps) => {
|
|||||||
onReset: () => {
|
onReset: () => {
|
||||||
setFilterParams({});
|
setFilterParams({});
|
||||||
setIsSubmitted(false);
|
setIsSubmitted(false);
|
||||||
|
filterModal.closeModal();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ const HppPerKandangTab = ({ tabId }: HppPerKandangTabProps) => {
|
|||||||
toast.dismiss();
|
toast.dismiss();
|
||||||
setDateErrorShown(false);
|
setDateErrorShown(false);
|
||||||
}
|
}
|
||||||
|
filterModal.closeModal();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+1
@@ -238,6 +238,7 @@ const ProductionResultContent = ({ tabId }: ProductionResultTabProps) => {
|
|||||||
setFilterParams({});
|
setFilterParams({});
|
||||||
setIsSubmitted(false);
|
setIsSubmitted(false);
|
||||||
setPage(1);
|
setPage(1);
|
||||||
|
filterModal.closeModal();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user