diff --git a/src/ops-console/pages/SidebarPage.tsx b/src/ops-console/pages/SidebarPage.tsx index 6271ba65e8..390fec8aeb 100644 --- a/src/ops-console/pages/SidebarPage.tsx +++ b/src/ops-console/pages/SidebarPage.tsx @@ -129,7 +129,7 @@ const SidebarPage: React.FC = () => { const canAccessCampaignPage = userRoles.some((role) => CAMPAIGN_ACCESS_ROLES.includes(role as RoleType), ); - const canAccessRequestPage = userRoles.includes(RoleType.FIELD_COORDINATOR); + const canAccessFieldCoordinatorPages = userRoles.includes(RoleType.FIELD_COORDINATOR); useEffect(() => { fetchData(); @@ -147,6 +147,7 @@ const SidebarPage: React.FC = () => { const requestDetailsPrefix = `${requestListPath}/`; const devicesPath = `${path}${PAGES.ADMIN_DEVICES}`; const resourcesPath = `${path}${PAGES.ADMIN_RESOURCES}`; + const dashboardPath = `${path}${PAGES.ADMIN_DASHBOARD}`; const isAllowedPath = location.pathname === schoolListPath || location.pathname.startsWith(schoolDetailsPrefix) || @@ -154,11 +155,12 @@ const SidebarPage: React.FC = () => { (location.pathname === campaignsPath || location.pathname === campaignCreatePath || location.pathname.startsWith(campaignDetailsPrefix))) || - (canAccessRequestPage && + (canAccessFieldCoordinatorPages && (location.pathname === requestListPath || - location.pathname.startsWith(requestDetailsPrefix))) || - location.pathname === devicesPath || - location.pathname === resourcesPath; + location.pathname.startsWith(requestDetailsPrefix) || + location.pathname === devicesPath || + location.pathname === resourcesPath || + location.pathname === dashboardPath)); if (!isAllowedPath) { history.replace(schoolListPath); @@ -166,7 +168,7 @@ const SidebarPage: React.FC = () => { }, [ canAccessCampaignPage, canAccessProgramPage, - canAccessRequestPage, + canAccessFieldCoordinatorPages, history, isExternalUser, location.pathname,