From 3822313644e18e577454be49a8d1adb46fea715d Mon Sep 17 00:00:00 2001 From: Abishek Date: Mon, 18 Nov 2024 15:26:35 +0530 Subject: [PATCH 01/32] changes localizations --- .../micro-ui-internals/example/src/UICustomizations.js | 9 +++++---- .../microplan/src/components/FormulaConfigWrapper.js | 2 +- .../microplan/src/components/FormulaConfiguration.js | 2 ++ .../microplan/src/pages/employee/MicroplanSearch.js | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js b/health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js index 9987b72e092..b3e670a0189 100644 --- a/health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js +++ b/health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js @@ -794,6 +794,7 @@ export const UICustomizations = { return data; }, additionalCustomizations: (row, key, column, value, t, searchResult) => { + switch (key) { case "ACTIONS": // TODO : Replace dummy file id with real file id when API is ready @@ -859,7 +860,7 @@ export const UICustomizations = { case "MICROPLAN_STATUS": if (value && value != "NA") { - return t(value); + return

{t(Digit.Utils.locale.getTransformedLocale("MICROPLAN_STATUS_" + value))}

; } else { return (
@@ -870,7 +871,7 @@ export const UICustomizations = { case "CAMPAIGN_DISEASE": if (value && value != "NA") { - return t(value); + return

{t(Digit.Utils.locale.getTransformedLocale("MICROPLAN_DISEASE_" + value))}

; } else { return (
@@ -881,7 +882,7 @@ export const UICustomizations = { case "CAMPAIGN_TYPE": if (value && value != "NA") { - return t(value); + return

{t(Digit.Utils.locale.getTransformedLocale("MICROPLAN_TYPE_" + value))}

; } else { return (
@@ -892,7 +893,7 @@ export const UICustomizations = { case "DISTIRBUTION_STRATEGY": if (value && value != "NA") { - return t(value); + return

{t(Digit.Utils.locale.getTransformedLocale("MICROPLAN_DISTRIBUTION_" + value))}

; } else { return (
diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfigWrapper.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfigWrapper.js index b0dc35001fe..9e034d1bc28 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfigWrapper.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfigWrapper.js @@ -499,7 +499,7 @@ const FormulaConfigWrapper = ({ onSelect, props: customProps }) => {
!deletedFormulas?.includes(item.output)), ...customFormula]} onSelect={onSelect} customProps={customProps} diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js index 77f00b54293..ba634ad5062 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js @@ -272,7 +272,9 @@ const FormulaConfiguration = ({ onSelect, category, customProps, formulas: initi <>
{t(category)}
+ {(category==="FORMULA_CAMPAIGN_VEHICLES")?

{t(`FORMULA_VEHICLE_DESCRIPTION`)}

:

{t(`FORMULA_CONFIGURATION_DESCRIPTION`)}

+ }
{filteredFormulas.map((formula, index) => { diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/MicroplanSearch.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/MicroplanSearch.js index 4a58c7ea454..2b892093e82 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/MicroplanSearch.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/MicroplanSearch.js @@ -33,7 +33,7 @@ const MicroplanSearch = () => { return ( -
{t(config?.label)}
+
{ `SEARCH_${t(config?.label)}` }
{/* Pass defaultValues as props to InboxSearchComposer */} Date: Mon, 18 Nov 2024 17:46:08 +0530 Subject: [PATCH 02/32] Adding userName and their roles --- .../css/src/components/microplan.scss | 13 + .../employee/FacilityCatchmentMapping.js | 28 +- .../microplan/src/pages/employee/PlanInbox.js | 27 +- .../microplan/src/pages/employee/PopInbox.js | 315 ++++++++++-------- 4 files changed, 228 insertions(+), 155 deletions(-) diff --git a/health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplan.scss b/health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplan.scss index a44871c7239..04c2a734560 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplan.scss +++ b/health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplan.scss @@ -347,4 +347,17 @@ text-align: -webkit-center; gap: 24px; margin-right: 3rem; +} + +.role-summary-sub-heading { + + color: theme(digitv2.lightTheme.primary-2) !important; + margin-bottom: 0rem; + font-size: 1rem; + display:flex; + justify-content: space-between; + + + + } \ No newline at end of file diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/FacilityCatchmentMapping.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/FacilityCatchmentMapping.js index b0749ac870c..252012224db 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/FacilityCatchmentMapping.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/FacilityCatchmentMapping.js @@ -152,12 +152,34 @@ const FacilityCatchmentMapping = () => { if (isPlanEmpSearchLoading || isLoading || isLoadingPlanObject || isLoadingCampaignObject || isProcessLoading) return + //role and name of User extracted + + const roles=Digit.UserService.getUser().info.roles; + const userName=Digit.UserService.getUser().info.userName; + let userRole = ""; + + roles.forEach(role => { + if (role.code === "ROOT_FACILITY_CATCHMENT_MAPPER") { + userRole = "ROOT_FACILITY_CATCHMENT_MAPPER"; + } else if (userRole!== "ROOT_FACILITY_CATCHMENT_MAPPER" && role.code === "FACILITY_CATCHMENT_MAPPER") { + userRole = "FACILITY_CATCHMENT_MAPPER"; + + }}); + + + return (
{t("MICROPLAN_ASSIGN_CATCHMENT_VILLAGES")}
-
- {`${t("HCM_MICROPLAN_MICROPLAN_NAME_LABEL")}: ${planObject?.name || t("NO_NAME_AVAILABLE")}`} -
+
+
+ {`${t("HCM_MICROPLAN_MICROPLAN_NAME_LABEL")}: ${planObject?.name || t("NO_NAME_AVAILABLE")}`} +
+
+ {`Logged in as ${t(userName)} - ${t(userRole)}`} +
+ +
{ if (isPlanEmpSearchLoading || isLoadingCampaignObject || isWorkflowLoading || isProcessLoading) { return ; } - + // campaignObject?.campaignName + //role and name of User extracted + + const roles=Digit.UserService.getUser().info.roles; + const userName=Digit.UserService.getUser().info.userName; + let userRole = ""; + + roles.forEach(role => { + if (role.code === "ROOT_PLAN_ESTIMATION_APPROVER") { + userRole = "ROOT_PLAN_ESTIMATION_APPROVER"; + } else if (userRole!== "ROOT_PLAN_ESTIMATION_APPROVER" && role.code === "PLAN_ESTIMATION_APPROVER") { + userRole = "PLAN_ESTIMATION_APPROVER"; + + }}); return (
{t(`HCM_MICROPLAN_VALIDATE_AND_APPROVE_MICROPLAN_ESTIMATIONS`)}
-
- {`${t("HCM_MICROPLAN_MICROPLAN_NAME_LABEL")}: ${campaignObject?.campaignName || t("NO_NAME_AVAILABLE")}`} -
+
+
+ {`${t("HCM_MICROPLAN_MICROPLAN_NAME_LABEL")}: ${campaignObject?.campaignName || t("NO_NAME_AVAILABLE")}`} +
+
+ {`Logged in as ${t(userName)} - ${t(userRole)}`} +
+ +
{ source: microplanId, ...(isRootApprover ? {} - : {jurisdiction: jurisdiction }), + : { jurisdiction: jurisdiction }), }, } }, @@ -108,34 +108,34 @@ const PopInbox = () => { url: "/census-service/_search", }); -// // fetch the total census data for showing footer action -// const { isLoading:isLoadingTotalCensus, data: totalCensusData, } = Digit.Hooks.useCustomAPIHook({ -// url: `/census-service/_search`, -// body: { -// CensusSearchCriteria: { -// tenantId: tenantId, -// source: microplanId, -// }, -// }, -// config: { -// enabled: triggerTotalCensus, -// }, -// queryKey: 'totalData' -// }); + // // fetch the total census data for showing footer action + // const { isLoading:isLoadingTotalCensus, data: totalCensusData, } = Digit.Hooks.useCustomAPIHook({ + // url: `/census-service/_search`, + // body: { + // CensusSearchCriteria: { + // tenantId: tenantId, + // source: microplanId, + // }, + // }, + // config: { + // enabled: triggerTotalCensus, + // }, + // queryKey: 'totalData' + // }); // fetch the process instance for the current microplan to check if we need to disabled actions or not - const { isLoading:isProcessLoading, data: processData, } = Digit.Hooks.useCustomAPIHook({ + const { isLoading: isProcessLoading, data: processData, } = Digit.Hooks.useCustomAPIHook({ url: "/egov-workflow-v2/egov-wf/process/_search", params: { - tenantId: tenantId, - history: true, - businessIds: microplanId, + tenantId: tenantId, + history: true, + businessIds: microplanId, }, config: { - enabled: true, - select: (data) => { - return data?.ProcessInstances; + enabled: true, + select: (data) => { + return data?.ProcessInstances; }, }, }); @@ -441,16 +441,16 @@ const PopInbox = () => { }; - // Function to check the status count condition -const isStatusConditionMet = (statusCount) => { - // Return false if statusCount is null or an empty object - if (!statusCount || Object.keys(statusCount).length === 0) return false; + // Function to check the status count condition + const isStatusConditionMet = (statusCount) => { + // Return false if statusCount is null or an empty object + if (!statusCount || Object.keys(statusCount).length === 0) return false; - // Check if all statuses except "VALIDATED" are 0, and "VALIDATED" is more than 0 - return Object.keys(statusCount).every( - (key) => (key === "VALIDATED" ? statusCount[key] > 0 : statusCount[key] === 0) - ); -}; + // Check if all statuses except "VALIDATED" are 0, and "VALIDATED" is more than 0 + return Object.keys(statusCount).every( + (key) => (key === "VALIDATED" ? statusCount[key] > 0 : statusCount[key] === 0) + ); + }; // This function will update the workflow action for every selected row @@ -489,7 +489,7 @@ const isStatusConditionMet = (statusCount) => { } const getButtonState = (action) => { - + if (selectedFilter === "PENDING_FOR_VALIDATION" && action === "VALIDATE") { return true; } @@ -521,15 +521,34 @@ const isStatusConditionMet = (statusCount) => { return ; } + //role and name of User extracted + const roles=Digit.UserService.getUser().info.roles; + const userName=Digit.UserService.getUser().info.userName; + let userRole = ""; + + roles.forEach(role => { + if (role.code === "ROOT_POPULATION_DATA_APPROVER") { + userRole = "ROOT_POPULATION_DATA_APPROVER"; + } else if (userRole!== "ROOT_POPULATION_DATA_APPROVER" && role.code === "POPULATION_DATA_APPROVER") { + userRole = "POPULATION_DATA_APPROVER"; + + }}); + return (
-
{t(`VALIDATE_APPROVE_POPULATIONDATA`)}
-
- {`${t("HCM_MICROPLAN_MICROPLAN_NAME_LABEL")}: ${planObject?.name || t("NO_NAME_AVAILABLE")}`} -
-
+
{t(`VALIDATE_APPROVE_POPULATIONDATA`)}
+
+
+ {`${t("HCM_MICROPLAN_MICROPLAN_NAME_LABEL")}: ${planObject?.name || t("NO_NAME_AVAILABLE")}`} +
+
+ {`Logged in as ${t(userName)} - ${t(userRole)}`} +
+ +
+
{ onClear={onClear} /> -
- - -
- {showTab && ( - { - setActiveLink(e); - }} - setActiveLink={setActiveLink} - showNav={showTab} - style={{}} - /> - )} - - {villagesSlected !== 0 && ( -
-
- -
{`${villagesSlected} ${t("MICROPLAN_VILLAGES_SELECTED")}`}
-
- -
- {actionsMain?.filter((action) => !actionsToHide.includes(action.action)).length > 1 ? ( - !actionsToHide.includes(action.action)) - ?.map((action, index) => { - - const isPrimary = getButtonState(action.action); - - return ( +
+ + +
+ {showTab && ( + { + setActiveLink(e); + }} + setActiveLink={setActiveLink} + showNav={showTab} + style={{}} + /> + )} + + {villagesSlected !== 0 && ( +
+
+ +
{`${villagesSlected} ${t("MICROPLAN_VILLAGES_SELECTED")}`}
+
+ +
+ {actionsMain?.filter((action) => !actionsToHide.includes(action.action)).length > 1 ? ( + !actionsToHide.includes(action.action)) + ?.map((action, index) => { + + const isPrimary = getButtonState(action.action); + + return (
- - {workFlowPopUp !== '' && ( - { - closePopUp(); - setShowToast({ key: "success", label: t(`POP_INBOX_WORKFLOW_FOR_${workFlowPopUp}_UPDATE_SUCCESS`), transitionTime: 5000 }); - refetch(); - refetchPlan(); - fetchStatusCount(); - }} - onError={(data) => { - setShowToast({ key: "error", label: t(error?.response?.data?.Errors?.[0]?.code) }); - }} - /> )}
- )} - {isLoading || isFetching ? : censusData.length===0 ? : 0} employeeNameData={employeeNameMap} - onSuccessEdit={(data) => { - setUpdatedCensus(data); - setShowComment(true); - }} - conditionalRowStyles={conditionalRowStyles} disabledAction={disabledAction}/>} -
- {showComment && ( - { - setShowToast({ key: "success", label: t("HCM_MICROPLAN_EDIT_WORKFLOW_UPDATED_SUCCESSFULLY"), transitionTime: 5000 }); - onCommentLogClose(); - refetch(); - }} - onError={(error) => { - setShowToast({ key: "error", label: t(error?.response?.data?.Errors?.[0]?.code) }); - }} - /> + + {workFlowPopUp !== '' && ( + { + closePopUp(); + setShowToast({ key: "success", label: t(`POP_INBOX_WORKFLOW_FOR_${workFlowPopUp}_UPDATE_SUCCESS`), transitionTime: 5000 }); + refetch(); + refetchPlan(); + fetchStatusCount(); + }} + onError={(data) => { + setShowToast({ key: "error", label: t(error?.response?.data?.Errors?.[0]?.code) }); + }} + /> + )} +
)} -
+ {isLoading || isFetching ? : censusData.length === 0 ? : 0} employeeNameData={employeeNameMap} + onSuccessEdit={(data) => { + setUpdatedCensus(data); + setShowComment(true); + }} + conditionalRowStyles={conditionalRowStyles} disabledAction={disabledAction} />} + + {showComment && ( + { + setShowToast({ key: "success", label: t("HCM_MICROPLAN_EDIT_WORKFLOW_UPDATED_SUCCESSFULLY"), transitionTime: 5000 }); + onCommentLogClose(); + refetch(); + }} + onError={(error) => { + setShowToast({ key: "error", label: t(error?.response?.data?.Errors?.[0]?.code) }); + }} + /> + )}
+
{/* { {((!isRootApprover && isStatusConditionMet(totalStatusCount)) || disabledAction) && { +
diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/UICustomizations.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/UICustomizations.js index 42cc5219319..446268f9511 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/UICustomizations.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/UICustomizations.js @@ -86,9 +86,9 @@ export const UICustomizations = { let options = []; if (row?.status == "DRAFT") { - options = [{ code: "1", name: "Edit Setup" }]; + options = [{ code: "1", name: "MP_ACTIONS_EDIT_SETUP" }]; } else { - options = [{ code: "1", name: "View Summary" }]; + options = [{ code: "1", name: "MP_ACTIONS_VIEW_SUMMARY" }]; } const handleDownload = () => { @@ -113,7 +113,7 @@ export const UICustomizations = { } }} optionKey={"name"} - selected={{ code: "1", name: "Actions" }} + selected={{ code: "1", name: "MP_ACTIONS_FOR_MICROPLAN_SEARCH" }} /> )}
From 3d5b7706d07c5878b4a957416d5eaf6130f3a3c9 Mon Sep 17 00:00:00 2001 From: Abishek Date: Tue, 19 Nov 2024 10:25:27 +0530 Subject: [PATCH 06/32] pop-inbox changes --- .../microplan/src/pages/employee/PopInbox.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PopInbox.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PopInbox.js index 0a8dcd8db67..28c05d18506 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PopInbox.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PopInbox.js @@ -521,18 +521,18 @@ const PopInbox = () => { return ; } - //role and name of User extracted - const roles=Digit.UserService.getUser().info.roles; - const userName=Digit.UserService.getUser().info.userName; + const roles = Digit.UserService.getUser().info.roles; + const userName = Digit.UserService.getUser().info.userName; let userRole = ""; roles.forEach(role => { if (role.code === "ROOT_POPULATION_DATA_APPROVER") { userRole = "ROOT_POPULATION_DATA_APPROVER"; - } else if (userRole!== "ROOT_POPULATION_DATA_APPROVER" && role.code === "POPULATION_DATA_APPROVER") { + } else if (userRole !== "ROOT_POPULATION_DATA_APPROVER" && role.code === "POPULATION_DATA_APPROVER") { userRole = "POPULATION_DATA_APPROVER"; - - }}); + + } + }); return ( @@ -747,7 +747,7 @@ const PopInbox = () => { requestPayload={{ PlanConfiguration: updateWorkflowForFooterAction() }} onSuccess={(data) => { history.push(`/${window.contextPath}/employee/microplan/population-finalise-success`, { - info:"MP_PLAN_MICROPLAN_NAME", + info: "MP_PLAN_MICROPLAN_NAME", fileName: data?.PlanConfiguration?.[0]?.name, message: t(`POPULATION_FINALISED_SUCCESSFUL`), back: t(`GO_BACK_TO_HOME`), @@ -771,4 +771,4 @@ const PopInbox = () => { ); }; -export default PopInbox; +export default PopInbox; \ No newline at end of file From 1b6d69190601dab0823c2bc876199a0a7e89f7b6 Mon Sep 17 00:00:00 2001 From: Abishek Date: Tue, 19 Nov 2024 10:28:23 +0530 Subject: [PATCH 07/32] package update --- .../micro-ui/web/micro-ui-internals/example/public/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/health/micro-ui/web/micro-ui-internals/example/public/index.html b/health/micro-ui/web/micro-ui-internals/example/public/index.html index 6638007a825..04f887f442d 100644 --- a/health/micro-ui/web/micro-ui-internals/example/public/index.html +++ b/health/micro-ui/web/micro-ui-internals/example/public/index.html @@ -12,7 +12,7 @@ DIGIT - + From 19b744aa1d5b55ce210088566f9ed6487eecb163 Mon Sep 17 00:00:00 2001 From: Abishek Date: Tue, 19 Nov 2024 11:12:46 +0530 Subject: [PATCH 08/32] loc added --- .../microplan/src/pages/employee/FacilityCatchmentMapping.js | 3 ++- .../packages/modules/microplan/src/pages/employee/PlanInbox.js | 2 +- .../packages/modules/microplan/src/pages/employee/PopInbox.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/FacilityCatchmentMapping.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/FacilityCatchmentMapping.js index fbd41bc326c..b758e20484e 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/FacilityCatchmentMapping.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/FacilityCatchmentMapping.js @@ -176,7 +176,8 @@ const FacilityCatchmentMapping = () => { {`${t("HCM_MICROPLAN_MICROPLAN_NAME_LABEL")}: ${planObject?.name || t("NO_NAME_AVAILABLE")}`}
- {`Logged in as ${t(userName)} - ${t(userRole)}`} + {`${t("LOGGED_IN_AS")} ${t(userName)} - ${t(userRole)}`} +
diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PlanInbox.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PlanInbox.js index 4214e0125da..9891dbfacaf 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PlanInbox.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PlanInbox.js @@ -580,7 +580,7 @@ const PlanInbox = () => { {`${t("HCM_MICROPLAN_MICROPLAN_NAME_LABEL")}: ${campaignObject?.campaignName || t("NO_NAME_AVAILABLE")}`}
- {`Logged in as ${t(userName)} - ${t(userRole)}`} + {`${t("LOGGED_IN_AS")} ${t(userName)} - ${t(userRole)}`}
diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PopInbox.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PopInbox.js index 28c05d18506..7d85c2b517d 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PopInbox.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PopInbox.js @@ -544,7 +544,7 @@ const PopInbox = () => { {`${t("HCM_MICROPLAN_MICROPLAN_NAME_LABEL")}: ${planObject?.name || t("NO_NAME_AVAILABLE")}`}
- {`Logged in as ${t(userName)} - ${t(userRole)}`} + {`${t("LOGGED_IN_AS")} ${t(userName)} - ${t(userRole)}`}
From 8ef6e83078e0abfd5026993c8f3aaa6895013397 Mon Sep 17 00:00:00 2001 From: Abishek Date: Tue, 19 Nov 2024 11:50:18 +0530 Subject: [PATCH 09/32] loc changes --- .../microplan/src/pages/employee/FacilityCatchmentMapping.js | 2 +- .../packages/modules/microplan/src/pages/employee/PlanInbox.js | 2 +- .../packages/modules/microplan/src/pages/employee/PopInbox.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/FacilityCatchmentMapping.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/FacilityCatchmentMapping.js index b758e20484e..1bef7f590e2 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/FacilityCatchmentMapping.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/FacilityCatchmentMapping.js @@ -176,7 +176,7 @@ const FacilityCatchmentMapping = () => { {`${t("HCM_MICROPLAN_MICROPLAN_NAME_LABEL")}: ${planObject?.name || t("NO_NAME_AVAILABLE")}`}
- {`${t("LOGGED_IN_AS")} ${t(userName)} - ${t(userRole)}`} + {`${t("LOGGED_IN_AS")} ${userName} - ${t(userRole)}`}
diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PlanInbox.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PlanInbox.js index 9891dbfacaf..ad2af29e002 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PlanInbox.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PlanInbox.js @@ -580,7 +580,7 @@ const PlanInbox = () => { {`${t("HCM_MICROPLAN_MICROPLAN_NAME_LABEL")}: ${campaignObject?.campaignName || t("NO_NAME_AVAILABLE")}`}
- {`${t("LOGGED_IN_AS")} ${t(userName)} - ${t(userRole)}`} + {`${t("LOGGED_IN_AS")} ${userName} - ${t(userRole)}`}
diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PopInbox.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PopInbox.js index 7d85c2b517d..0d91a7516cc 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PopInbox.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PopInbox.js @@ -544,7 +544,7 @@ const PopInbox = () => { {`${t("HCM_MICROPLAN_MICROPLAN_NAME_LABEL")}: ${planObject?.name || t("NO_NAME_AVAILABLE")}`}
- {`${t("LOGGED_IN_AS")} ${t(userName)} - ${t(userRole)}`} + {`${t("LOGGED_IN_AS")} ${userName} - ${t(userRole)}`}
From 9dc0f60e1f69c3279fde0c2cf6f2160bfcd0c93d Mon Sep 17 00:00:00 2001 From: Abishek Date: Tue, 19 Nov 2024 11:55:59 +0530 Subject: [PATCH 10/32] dropdown options changed --- .../modules/microplan/src/configs/UICustomizations.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/UICustomizations.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/UICustomizations.js index 446268f9511..50164ddfec7 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/UICustomizations.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/UICustomizations.js @@ -105,10 +105,10 @@ export const UICustomizations = { { - if (e.name == "Edit Setup") { + if (e.name == "MP_ACTIONS_EDIT_SETUP") { window.location.href = `/${window.contextPath}/employee/microplan/setup-microplan?key=${1}µplanId=${row.id}&campaignId=${row.campaignDetails.id}`; } - if (e.name == "View Summary") { + if (e.name == "MP_ACTIONS_VIEW_SUMMARY") { window.location.href = `/${window.contextPath}/employee/microplan/setup-microplan?key=${10}µplanId=${row.id}&campaignId=${row.campaignDetails.id}&setup-completed=true`; } }} From 67bb03f9639a3dbffd24706218f5a17253ef277f Mon Sep 17 00:00:00 2001 From: Abishek Date: Tue, 19 Nov 2024 11:57:02 +0530 Subject: [PATCH 11/32] UICust making same as in example --- .../web/micro-ui-internals/example/src/UICustomizations.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js b/health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js index 3d67578578d..07078c78590 100644 --- a/health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js +++ b/health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js @@ -822,10 +822,10 @@ export const UICustomizations = { { - if (e.name == "Edit Setup") { + if (e.name == "MP_ACTIONS_EDIT_SETUP") { window.location.href = `/${window.contextPath}/employee/microplan/setup-microplan?key=${1}µplanId=${row.id}&campaignId=${row.campaignDetails.id}`; } - if (e.name == "View Summary") { + if (e.name == "MP_ACTIONS_VIEW_SUMMARY") { window.location.href = `/${window.contextPath}/employee/microplan/setup-microplan?key=${10}µplanId=${row.id}&campaignId=${row.campaignDetails.id}&setup-completed=true`; } }} From 51a7dca40f4583db13f6e9b98f532de4b1d60b72 Mon Sep 17 00:00:00 2001 From: Abishek Date: Tue, 19 Nov 2024 12:34:12 +0530 Subject: [PATCH 12/32] UnassignPopup --- .../microplan/src/components/UserAccess.js | 51 ++++++++++++++++--- 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/UserAccess.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/UserAccess.js index 746536e4fc5..53d8fc406eb 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/UserAccess.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/UserAccess.js @@ -1,4 +1,4 @@ -import { Button, Card, Chip, Header, Loader, PopUp, Toast } from "@egovernments/digit-ui-components"; +import { Button, Card, Chip, Header, Loader, PopUp, Toast, CardText } from "@egovernments/digit-ui-components"; import React, { Fragment, useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import RoleTableComposer, { CustomLoader } from "./RoleTableComposer"; @@ -41,7 +41,7 @@ function UserAccess({ category, setData, nationalRoles }) { const queryClient = useQueryClient(); const [showPopUp, setShowPopUp] = useState(null); const [chipPopUp, setChipPopUp] = useState(null); - const [chipPopUpRowId, setChipPopUpRowId] = useState(null); + const [chipPopUpRowId, setChipPopUpRowId] = useState(null); const [showToast, setShowToast] = useState(null); const [currentPage, setCurrentPage] = useState(1); const [rowsPerPage, setRowsPerPage] = useState(5); @@ -107,7 +107,6 @@ function UserAccess({ category, setData, nationalRoles }) { }; const handleUpdateAssignEmployee = (row) => { - setIsLoading(true); const payload = { PlanEmployeeAssignment: { ...row?.planData, @@ -118,12 +117,12 @@ function UserAccess({ category, setData, nationalRoles }) { onSuccess: (data) => { queryClient.invalidateQueries("PLAN_SEARCH_EMPLOYEE_WITH_TAGGING"); refetchPlanEmployee(); + setUnassignPopup(false) setShowToast({ key: "success", label: t("UNASSIGNED_SUCCESSFULLY") }); - setIsLoading(false); }, onError: (error, variables) => { + setUnassignPopup(false) setShowToast({ key: "error", label: error?.message ? error.message : t("FAILED_TO_UPDATE_RESOURCE") }); - setIsLoading(false); }, }); }; @@ -216,7 +215,8 @@ function UserAccess({ category, setData, nationalRoles }) { style={{ padding: "1rem" }} icon={"Close"} isSuffix={false} - onClick={(value) => handleUpdateAssignEmployee(row)} + onClick={(value) => setUnassignPopup(row)} + // onClick={(value) => handleUpdateAssignEmployee(row)} /> ); }, @@ -225,13 +225,15 @@ function UserAccess({ category, setData, nationalRoles }) { const handleSearch = (query) => { // if (query?.length >= 2) { - setSearchQuery(query); + setSearchQuery(query); // } else { - // setSearchQuery(null); + // setSearchQuery(null); // } // Handle search logic, such as filtering or API calls }; + const [unassignPopup, setUnassignPopup] = useState(false); + return ( <> @@ -316,6 +318,39 @@ function UserAccess({ category, setData, nationalRoles }) { isDleteBtn={true} /> )} + + {unassignPopup && ( + + {t("FOR_PERMANENT_DELETE")} + , + ]} + onOverlayClick={() => { + setUnassignPopup(false); + }} + footerChildren={[ +