Skip to content

Commit

Permalink
Changes for kpis (#1960)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashish-egov authored Dec 2, 2024
1 parent 4108c50 commit cff5b4b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ const FacilityCatchmentMapping = () => {


return (
<div style={{ marginBottom: isRootApprover && data?.TotalCount === 0 && planObject?.status === "CENSUS_DATA_APPROVED" ? "2.5rem" : "0rem" }}>
<div style={{ marginBottom: (isRootApprover && data?.TotalCount === 0 && planObject?.status === "CENSUS_DATA_APPROVED") || ((!isRootApprover && data?.TotalCount === 0) || disabledAction) ? "2.5rem" : "0rem" }}>
<Header styles={{ marginBottom: "1rem" }}>{t("MICROPLAN_ASSIGN_CATCHMENT_VILLAGES")}</Header>
<div className="role-summary-sub-heading" style={{ marginBottom: "1.5rem" }}>
<div className="mp-heading-bold">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const PlanInbox = () => {
const [currentPage, setCurrentPage] = useState(1);
const [rowsPerPage, setRowsPerPage] = useState(50);
const [totalRows, setTotalRows] = useState(0);
const [refetchTrigger, setRefetchTrigger] = useState(0);
const [perPage, setPerPage] = useState(10);
const [assignedToMeCount, setAssignedToMeCount] = useState(0);
const [assignedToAllCount, setAssignedToAllCount] = useState(0);
Expand Down Expand Up @@ -836,7 +837,7 @@ const PlanInbox = () => {
<div>{`${t("LOGGED_IN_AS")} ${userName} - ${t(userRole)}`}</div>
</div>
</div>
<GenericKpiFromDSS module="MICROPLAN" status={selectedFilter} planId={microplanId} campaignType={campaignObject?.projectType} planEmployee={planEmployee} boundariesForKpi={defaultBoundaries}/>
<GenericKpiFromDSS module="MICROPLAN" status={selectedFilter} planId={microplanId} refetchTrigger={refetchTrigger} campaignType={campaignObject?.projectType} planEmployee={planEmployee} boundariesForKpi={defaultBoundaries}/>
<SearchJurisdiction
boundaries={boundaries}
defaultHierarchy={defaultHierarchy}
Expand Down Expand Up @@ -959,7 +960,7 @@ const PlanInbox = () => {
url="/plan-service/plan/bulk/_update"
requestPayload={{ Plans: updateWorkflowForSelectedRows() }}
commentPath="workflow.comments"
onSuccess={(data) => {
onSuccess={async (data) => {
closePopUp();
setShowToast({ key: "success", label: t(`PLAN_INBOX_WORKFLOW_FOR_${workFlowPopUp}_UPDATE_SUCCESS`), transitionTime: 5000 });
setCurrentPage(1);
Expand All @@ -972,6 +973,9 @@ const PlanInbox = () => {
refetchPlanWithCensusCount();
refetchPlanWithCensus();
fetchStatusCount();
// wait for 5 seconds
await new Promise((resolve) => setTimeout(resolve, 5000));
setRefetchTrigger(prev => prev + 1);
}}
onError={(data) => {
closePopUp();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ const PopInbox = () => {
url="/census-service/bulk/_update"
requestPayload={{ Census: updateWorkflowForSelectedRows() }}
commentPath="workflow.comments"
onSuccess={(data) => {
onSuccess={async (data) => {
closePopUp();
setShowToast({ key: "success", label: t(`POP_INBOX_WORKFLOW_FOR_${workFlowPopUp}_UPDATE_SUCCESS`), transitionTime: 5000 });
setLimitAndOffset((prev)=>{
Expand All @@ -748,6 +748,9 @@ const PopInbox = () => {
refetchCensus();
refetchPlan();
fetchStatusCount();
// wait for 5 seconds
await new Promise((resolve) => setTimeout(resolve, 5000));
setRefetchTrigger(prev => prev + 1);
}}
onError={(data) => {
setShowToast({ key: "error", label: t(error?.response?.data?.Errors?.[0]?.code) });
Expand Down

0 comments on commit cff5b4b

Please sign in to comment.