Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patch fix #1868

Merged
merged 3 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const ChooseActivity = () => {
// // Watch for campaignId or microplanId changes to trigger the fetch
useEffect(() => {
refetchPlanObject();
refetchProcessInstance();
rachana-egov marked this conversation as resolved.
Show resolved Hide resolved
}, [microplanId, campaignId]);

const { isLoading: isBusinessServiceLoading, data: workflowData, } = Digit.Hooks.useCustomAPIHook({
Expand All @@ -47,7 +48,7 @@ const ChooseActivity = () => {
});

// fetch the process instance for the current microplan to check if current process is done or not
const { isLoading:isProcessLoading, data: processData, revalidate } = Digit.Hooks.useCustomAPIHook({
const { isLoading:isProcessLoading, data: processData, revalidate, refetch:refetchProcessInstance } = Digit.Hooks.useCustomAPIHook({
url: "/egov-workflow-v2/egov-wf/process/_search",
params: {
tenantId: tenantId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ const PlanInbox = () => {
<ActionBar
actionFields={[
<Button label={t(`HCM_MICROPLAN_PLAN_INBOX_BACK_BUTTON`)} onClick={()=> {
history.push(`/${window.contextPath}/employee/microplan/select-activity?microplanId=${url?.microplanId}&campaignId=${url?.campaignId}`);
history.push(`/${window.contextPath}/employee`);
rachana-egov marked this conversation as resolved.
Show resolved Hide resolved
}} type="button" variation="primary" />,
]}
className=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ const PopInbox = () => {
},
];

if (isPlanEmpSearchLoading || isLoadingCampaignObject || isLoading || isWorkflowLoading || isEmployeeLoading || mutation.isLoading) {
if (isPlanEmpSearchLoading || isLoadingCampaignObject || isLoading || isWorkflowLoading || isEmployeeLoading || mutation.isLoading || isFetching) {
rachana-egov marked this conversation as resolved.
Show resolved Hide resolved
return <Loader />;
}

Expand All @@ -535,7 +535,6 @@ const PopInbox = () => {
}
});


return (
<div className="pop-inbox-wrapper">
<div>
Expand All @@ -560,60 +559,59 @@ const PopInbox = () => {
onClear={onClear}
/>

<div className="pop-inbox-wrapper-filter-table-wrapper" style={{ marginBottom: (isRootApprover && isStatusConditionMet(totalStatusCount) && planObject?.status === "CENSUS_DATA_APPROVAL_IN_PROGRESS") || (!isRootApprover && isStatusConditionMet(totalStatusCount)) || disabledAction ? "2.5rem" : "0rem" }}>
<InboxFilterWrapper
options={activeFilter}
onApplyFilters={onFilter}
clearFilters={clearFilters}
defaultValue={
selectedFilter === Object.entries(activeFilter)?.[0]?.[0] ? { [Object.entries(activeFilter)?.[0]?.[0]]: Object.entries(activeFilter)?.[0]?.[1] } : null
}
></InboxFilterWrapper>

<div className={"pop-inbox-table-wrapper"}>
{showTab && (
<Tab
activeLink={activeLink?.code}
configItemKey="code"
configDisplayKey="name"
itemStyle={{ width: "290px" }}
configNavItems={[
{
code: "ASSIGNED_TO_ME",
name: `${`${t(`ASSIGNED_TO_ME`)} (${assignedToMeCount})`}`,
},
{
code: "ASSIGNED_TO_ALL",
name: `${`${t(`ASSIGNED_TO_ALL`)} (${assignedToAllCount})`}`,
},
]}
navStyles={{}}
onTabClick={(e) => {
setActiveLink(e);
}}
setActiveLink={setActiveLink}
showNav={showTab}
style={{}}
/>
)}
<Card className="microPlanBulkTable" type={"primary"}>
{villagesSlected !== 0 && (
<div className="selection-state-wrapper">
<div className="svg-state-wrapper">
<SVG.DoneAll width={"1.5rem"} height={"1.5rem"} fill={"#C84C0E"}></SVG.DoneAll>
<div className={"selected-state"}>{`${villagesSlected} ${t("MICROPLAN_VILLAGES_SELECTED")}`}</div>
</div>

<div className={`table-actions-wrapper`}>
{actionsMain?.filter((action) => !actionsToHide.includes(action.action)).length > 1 ? (
<ButtonsGroup
buttonsArray={actionsMain
?.filter((action) => !actionsToHide.includes(action.action))
?.map((action, index) => {

const isPrimary = getButtonState(action.action);

return (
<div className="pop-inbox-wrapper-filter-table-wrapper" style={{ marginBottom: (isRootApprover && isStatusConditionMet(totalStatusCount) && planObject?.status === "CENSUS_DATA_APPROVAL_IN_PROGRESS") || (!isRootApprover && isStatusConditionMet(totalStatusCount)) || disabledAction ? "2.5rem" : "0rem" }}>
<InboxFilterWrapper
options={activeFilter}
onApplyFilters={onFilter}
clearFilters={clearFilters}
defaultValue={ { [selectedFilter]: activeFilter[selectedFilter]}
}
></InboxFilterWrapper>
rachana-egov marked this conversation as resolved.
Show resolved Hide resolved

<div className={"pop-inbox-table-wrapper"}>
{showTab && (
<Tab
activeLink={activeLink?.code}
configItemKey="code"
configDisplayKey="name"
itemStyle={{ width: "290px" }}
configNavItems={[
{
code: "ASSIGNED_TO_ME",
name: `${`${t(`ASSIGNED_TO_ME`)} (${assignedToMeCount})`}`,
},
{
code: "ASSIGNED_TO_ALL",
name: `${`${t(`ASSIGNED_TO_ALL`)} (${assignedToAllCount})`}`,
},
]}
navStyles={{}}
onTabClick={(e) => {
setActiveLink(e);
}}
setActiveLink={setActiveLink}
showNav={showTab}
style={{}}
/>
)}
<Card className="microPlanBulkTable" type={"primary"}>
{villagesSlected !== 0 && (
<div className="selection-state-wrapper">
<div className="svg-state-wrapper">
<SVG.DoneAll width={"1.5rem"} height={"1.5rem"} fill={"#C84C0E"}></SVG.DoneAll>
<div className={"selected-state"}>{`${villagesSlected} ${t("MICROPLAN_VILLAGES_SELECTED")}`}</div>
</div>

<div className={`table-actions-wrapper`}>
{actionsMain?.filter((action) => !actionsToHide.includes(action.action)).length > 1 ? (
<ButtonsGroup
buttonsArray={actionsMain
?.filter((action) => !actionsToHide.includes(action.action))
?.map((action, index) => {

const isPrimary = getButtonState(action.action);

return (
<Button
key={index}
variation={isPrimary ? "primary" : "secondary"}
Expand Down Expand Up @@ -682,13 +680,13 @@ const PopInbox = () => {
{showComment && (
<WorkflowCommentPopUp
onClose={onCommentLogClose}
heading={t(`POP_INBOX_HCM_MICROPLAN_EDIT_POPULATION_COMMENT_LABEL`)}
submitLabel={t(`${isRootApprover ? 'ROOT_' : ''}POP_INBOX_HCM_MICROPLAN_EDIT_POPULATION_COMMENT_SUBMIT_LABEL`)}
url="/census-service/_update"
requestPayload={{ Census: updatedCensus }}
commentPath="workflow.comments"
onSuccess={(data) => {
setShowToast({ key: "success", label: t("HCM_MICROPLAN_EDIT_WORKFLOW_UPDATED_SUCCESSFULLY"), transitionTime: 5000 });
heading={t(`${isRootApprover ? 'ROOT_' : ''}POP_INBOX_HCM_MICROPLAN_EDIT_POPULATION_COMMENT_HEADING_LABEL`)}
submitLabel={t(`${isRootApprover ? 'ROOT_' : ''}POP_INBOX_HCM_MICROPLAN_EDIT_POPULATION_COMMENT_SUBMIT_LABEL`)}
url="/census-service/_update"
requestPayload={{ Census: updatedCensus }}
commentPath="workflow.comments"
onSuccess={(data) => {
setShowToast({ key: "success", label: t(`${isRootApprover ? 'ROOT_' : ''}POP_INBOX_HCM_MICROPLAN_EDIT_WORKFLOW_UPDATED_SUCCESSFULLY`), transitionTime: 5000 });
rachana-egov marked this conversation as resolved.
Show resolved Hide resolved
onCommentLogClose();
refetch();
}}
Expand Down Expand Up @@ -726,8 +724,8 @@ const PopInbox = () => {
{((!isRootApprover && isStatusConditionMet(totalStatusCount)) || disabledAction) &&
<ActionBar
actionFields={[
<Button label={t(`HCM_MICROPLAN_POP_INBOX_BACK_BUTTON`)} onClick={() => {
history.push(`/${window.contextPath}/employee/microplan/select-activity?microplanId=${url?.microplanId}&campaignId=${url?.campaignId}`);
<Button label={t(`HCM_MICROPLAN_POP_INBOX_BACK_BUTTON`)} onClick={()=> {
history.push(`/${window.contextPath}/employee`);
}} type="button" variation="primary" />,
rachana-egov marked this conversation as resolved.
Show resolved Hide resolved
]}
className=""
Expand Down