From 46fe9f1246e64131fa838cb7be4e80ebdaea87c3 Mon Sep 17 00:00:00 2001 From: Abishek Date: Tue, 17 Dec 2024 17:09:57 +0530 Subject: [PATCH] Null check for Hierarchy level --- .../microplan/src/pages/employee/FacilityCatchmentMapping.js | 4 ++-- .../modules/microplan/src/pages/employee/PlanInbox.js | 4 +++- .../modules/microplan/src/pages/employee/PopInbox.js | 5 ++++- 3 files changed, 9 insertions(+), 4 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 d2a8d87638..15da661044 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 @@ -191,8 +191,8 @@ const FacilityCatchmentMapping = () => { {`${t("HCM_MICROPLAN_MICROPLAN_NAME_LABEL")}: ${planObject?.name || t("NO_NAME_AVAILABLE")}`}
- {`${t("LOGGED_IN_AS")} ${userName} - ${t(userRole)}(${t(planEmployee?.planData[0].hierarchyLevel.toUpperCase())})`} - + {`${t("LOGGED_IN_AS")} ${userName} - ${t(userRole)}${planEmployee?.planData?.[0]?.hierarchyLevel ? + ` (${t(planEmployee.planData[0].hierarchyLevel.toUpperCase())})` : ""}`}
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 4c12789dd1..aed5750444 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 @@ -836,7 +836,9 @@ const PlanInbox = () => {
{`${t("HCM_MICROPLAN_MICROPLAN_NAME_LABEL")}: ${campaignObject?.campaignName || t("NO_NAME_AVAILABLE")}`}
-
{`${t("LOGGED_IN_AS")} ${userName} - ${t(userRole)}(${t(planEmployee?.planData[0].hierarchyLevel.toUpperCase())})`}
+
{`${t("LOGGED_IN_AS")} ${userName} - ${t(userRole)}${planEmployee?.planData?.[0]?.hierarchyLevel ? + ` (${t(planEmployee.planData[0].hierarchyLevel.toUpperCase())})` : ""}`} +
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 caf703b922..53b574fe3a 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 @@ -611,7 +611,10 @@ const PopInbox = () => { {`${t("HCM_MICROPLAN_MICROPLAN_NAME_LABEL")}: ${planObject?.name || t("NO_NAME_AVAILABLE")}`}
- {`${t("LOGGED_IN_AS")} ${userName} - ${t(userRole)}(${t(planEmployee?.planData[0].hierarchyLevel.toUpperCase())})`} + {`${t("LOGGED_IN_AS")} ${userName} - ${t(userRole)}${planEmployee?.planData + ? ` (${t(planEmployee.planData[0].hierarchyLevel.toUpperCase())})` : ""}` + } +