Changes in filter panel.

This commit is contained in:
Kartik Sharma 2025-10-16 10:17:12 +05:30
parent 798ea24088
commit 2a0f7794b5
5 changed files with 17 additions and 19 deletions

View File

@ -78,14 +78,14 @@ const DocumentFilterPanel = forwardRef(
? moment.utc(values.endDate, "DD-MM-YYYY").toISOString()
: null,
});
closePanel();
// closePanel();
};
const onClear = () => {
reset(DocumentFilterDefaultValues);
setResetKey((prev) => prev + 1);
onApply(DocumentFilterDefaultValues);
closePanel();
// closePanel();
};
if (isLoading) return <div>Loading...</div>;

View File

@ -140,9 +140,7 @@ const ExpenseList = ({ filters, groupBy = "transactionDate", searchText }) => {
align: "text-start",
getValue: (e) =>
`${e.createdBy?.firstName ?? ""} ${e.createdBy?.lastName ?? ""
}`.trim() || "N/A",
`${e.createdBy?.firstName ?? ""} ${e.createdBy?.lastName ?? ""
}`.trim() || "N/A",
}`.trim() || "N/A",
customRender: (e) => (
<div className="d-flex align-items-center cursor-pointer"
onClick={() => navigate(`/employee/${e.createdBy?.id}`)}>
@ -380,8 +378,6 @@ const ExpenseList = ({ filters, groupBy = "transactionDate", searchText }) => {
)}
</tbody>
</table>
</div>
</div>
{data?.data?.length > 0 && (
<Pagination
currentPage={currentPage}
@ -389,6 +385,8 @@ const ExpenseList = ({ filters, groupBy = "transactionDate", searchText }) => {
onPageChange={paginate}
/>
)}
</div>
</div>
</div>
</>
);

View File

@ -37,13 +37,13 @@ const GalleryFilterPanel = ({ onApply }) => {
startDate: localToUtc(formData.startDate),
endDate: localToUtc(formData.endDate),
});
closePanel()
// closePanel()
};
const onClear=()=>{
reset(defaultGalleryFilterValue);
setResetKey((prev) => prev + 1);
closePanel()
// closePanel()
}
if (isLoading) return <div>Loading....</div>;

View File

@ -67,13 +67,13 @@ const ContactFilterPanel = forwardRef(
const onSubmit = (formData) => {
onApply(formData);
closePanel();
// closePanel();
};
const handleClose = () => {
reset(defaultContactFilter);
onApply(defaultContactFilter);
closePanel();
// closePanel();
};
if (isLoading || isFetching) return <ExpenseFilterSkeleton />;
@ -99,16 +99,16 @@ const ContactFilterPanel = forwardRef(
valueKey="id"
/>
</div>
<div className="d-flex justify-content-end py-3 gap-2">
<button
type="button"
className="btn btn-label-secondary btn-xs"
className="btn btn-label-secondary btn-sm"
onClick={handleClose}
>
Clear
</button>
<button type="submit" className="btn btn-primary btn-xs">
<button type="submit" className="btn btn-primary btn-sm" >
Apply
</button>
</div>

View File

@ -39,13 +39,13 @@ const NoteFilterPanel = forwardRef(({ onApply, clearFilter, setFilterdata }, ref
const onSubmit = (formData) => {
onApply(formData);
closePanel();
// closePanel();
};
const handleClose = () => {
reset(defaultNotesFilter);
onApply(defaultNotesFilter);
closePanel();
// closePanel();
};
//Add this for Filter chip remover
@ -93,17 +93,17 @@ const NoteFilterPanel = forwardRef(({ onApply, clearFilter, setFilterdata }, ref
labelKey={(item) => item.name}
valueKey="id"
/>
</div>
</div>
<div className="d-flex justify-content-end py-3 gap-2">
<button
type="button"
className="btn btn-label-secondary btn-sm"
onClick={handleClose}
>
Clear
</button>
<button type="submit" className="btn btn-primary btn-sm">
<button type="submit" className="btn btn-primary btn-sm" >
Apply
</button>
</div>