Changes in Expensfilter panel at on apply and clear fitler is closed.
This commit is contained in:
parent
a8ae0fac70
commit
78b721dad7
@ -78,14 +78,14 @@ const DocumentFilterPanel = forwardRef(
|
|||||||
? moment.utc(values.endDate, "DD-MM-YYYY").toISOString()
|
? moment.utc(values.endDate, "DD-MM-YYYY").toISOString()
|
||||||
: null,
|
: null,
|
||||||
});
|
});
|
||||||
closePanel();
|
// closePanel();
|
||||||
};
|
};
|
||||||
|
|
||||||
const onClear = () => {
|
const onClear = () => {
|
||||||
reset(DocumentFilterDefaultValues);
|
reset(DocumentFilterDefaultValues);
|
||||||
setResetKey((prev) => prev + 1);
|
setResetKey((prev) => prev + 1);
|
||||||
onApply(DocumentFilterDefaultValues);
|
onApply(DocumentFilterDefaultValues);
|
||||||
closePanel();
|
// closePanel();
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isLoading) return <div>Loading...</div>;
|
if (isLoading) return <div>Loading...</div>;
|
||||||
|
@ -43,7 +43,7 @@ const ExpenseFilterPanel = forwardRef(({ onApply, handleGroupBy, setFilterdata }
|
|||||||
return {
|
return {
|
||||||
...defaultFilter,
|
...defaultFilter,
|
||||||
statusIds: status ? [status] : defaultFilter.statusIds || [],
|
statusIds: status ? [status] : defaultFilter.statusIds || [],
|
||||||
projectIds: selectedProjectId ? [selectedProjectId] : [],
|
projectIds: defaultFilter.projectIds || [],
|
||||||
createdByIds: defaultFilter.createdByIds || [],
|
createdByIds: defaultFilter.createdByIds || [],
|
||||||
paidById: defaultFilter.paidById || [],
|
paidById: defaultFilter.paidById || [],
|
||||||
ExpenseTypeIds: defaultFilter.ExpenseTypeIds || [],
|
ExpenseTypeIds: defaultFilter.ExpenseTypeIds || [],
|
||||||
@ -96,7 +96,7 @@ const ExpenseFilterPanel = forwardRef(({ onApply, handleGroupBy, setFilterdata }
|
|||||||
endDate: moment.utc(formData.endDate, "DD-MM-YYYY").toISOString(),
|
endDate: moment.utc(formData.endDate, "DD-MM-YYYY").toISOString(),
|
||||||
});
|
});
|
||||||
handleGroupBy(selectedGroup.id);
|
handleGroupBy(selectedGroup.id);
|
||||||
closePanel();
|
// closePanel();
|
||||||
};
|
};
|
||||||
|
|
||||||
const onClear = () => {
|
const onClear = () => {
|
||||||
@ -105,7 +105,7 @@ const ExpenseFilterPanel = forwardRef(({ onApply, handleGroupBy, setFilterdata }
|
|||||||
setSelectedGroup(groupByList[0]);
|
setSelectedGroup(groupByList[0]);
|
||||||
onApply(defaultFilter);
|
onApply(defaultFilter);
|
||||||
handleGroupBy(groupByList[0].id);
|
handleGroupBy(groupByList[0].id);
|
||||||
closePanel();
|
// closePanel();
|
||||||
if (status) {
|
if (status) {
|
||||||
navigate("/expenses", { replace: true });
|
navigate("/expenses", { replace: true });
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user