Skip to content

Commit

Permalink
Pop inbox Pagination fix (#1907)
Browse files Browse the repository at this point in the history
Co-authored-by: rachana-egov <[email protected]>
  • Loading branch information
rachana-egov and rachana-egov authored Nov 27, 2024
1 parent 3e214a9 commit 6fe9381
Showing 1 changed file with 41 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const PopInbox = () => {
source: microplanId,
...(isRootApprover
? {}
: { jurisdiction: jurisdiction }),
: { assignee: user.info.uuid }),
},
}
},
Expand Down Expand Up @@ -164,6 +164,12 @@ const PopInbox = () => {
code: "ASSIGNED_TO_ME",
name: "ASSIGNED_TO_ME"
});
setLimitAndOffset((prev)=>{
return {
limit: prev.limit,
offset: 0
}
});

setDefaultSelectedHierarchy(selectedHierarchy);
setDefaultBoundaries(selectedBoundaries);
Expand Down Expand Up @@ -244,6 +250,12 @@ const PopInbox = () => {
const onClear = () => {
setDefaultBoundaries([]);
setDefaultSelectedHierarchy(null);
setLimitAndOffset((prev)=>{
return {
limit: prev.limit,
offset: 0
}
});
setCensusJurisdiction(planEmployee?.planData?.[0]?.jurisdiction);
};

Expand Down Expand Up @@ -415,6 +427,13 @@ const PopInbox = () => {
}, [selectedFilter]);

const onFilter = (selectedStatus) => {
setLimitAndOffset((prev)=>{
return {
limit: prev.limit,
offset: 0
}
});
setCurrentPage(1);
setSelectedFilter(selectedStatus?.code);
setActiveLink({
code: "ASSIGNED_TO_ME",
Expand All @@ -437,6 +456,13 @@ const PopInbox = () => {
if (selectedFilter !== Object.entries(activeFilter)?.[0]?.[0]) {
setSelectedFilter(Object.entries(activeFilter)?.[0]?.[0]);
}
setLimitAndOffset((prev)=>{
return {
limit: prev.limit,
offset: 0
}
});
setCurrentPage(1);
};

const handleActionClick = (action) => {
Expand Down Expand Up @@ -596,6 +622,13 @@ const PopInbox = () => {
]}
navStyles={{}}
onTabClick={(e) => {
setLimitAndOffset((prev)=>{
return {
limit: prev.limit,
offset: 0
}
});
setCurrentPage(1);
setActiveLink(e);
}}
setActiveLink={setActiveLink}
Expand Down Expand Up @@ -668,6 +701,13 @@ const PopInbox = () => {
onSuccess={(data) => {
closePopUp();
setShowToast({ key: "success", label: t(`POP_INBOX_WORKFLOW_FOR_${workFlowPopUp}_UPDATE_SUCCESS`), transitionTime: 5000 });
setLimitAndOffset((prev)=>{
return {
limit: prev.limit,
offset: 0
}
});
setCurrentPage(1);
refetch();
refetchPlan();
fetchStatusCount();
Expand Down

0 comments on commit 6fe9381

Please sign in to comment.