Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #946 from egovernments/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
pradeepkumarcm-egov authored Sep 13, 2024
2 parents 7c80d63 + b087198 commit bf7902c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import CitizenApp from "./pages/citizen";
import EmployeeApp from "./pages/employee";
import CommonApp from "./pages/common";

export const DigitApp = ({ stateCode, modules, appTenants, logoUrl, initData, defaultLanding = "citizen" }) => {
export const DigitApp = ({ stateCode, modules, appTenants, logoUrl, initData, defaultLanding = "employee" }) => {
const history = useHistory();
const { pathname } = useLocation();
const innerWidth = window.innerWidth;
Expand Down Expand Up @@ -65,13 +65,22 @@ export const DigitApp = ({ stateCode, modules, appTenants, logoUrl, initData, de
pathname,
initData,
};

// Do not redirect if it's a payment route under citizen
const shouldRedirectToEmployee = () => {
if (pathname.startsWith(`/${window?.contextPath}/citizen/payment`)) {
return false;
}
return true;
};

return (
<Switch>
<Route path={`/${window?.contextPath}/employee`}>
<EmployeeApp {...commonProps} />
</Route>
<Route path={`/${window?.contextPath}/citizen`}>
<CitizenApp {...commonProps} />
{shouldRedirectToEmployee() ? <Redirect to={`/${window?.contextPath}/employee`} /> : <CitizenApp {...commonProps} />}
</Route>
<Route path={`/${window?.contextPath}/common`}>
<CommonApp {...commonProps} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,13 @@ const SearchUserForm = ({ uniqueTenants, setUniqueTenants, roles, setUniqueRoles
const filteredResult = filterKeys(result, requiredKeys);
const resultInTree = buildTree(filteredResult, hierarchy);
const excludeCodes = ["HRMS_ADMIN", "LOC_ADMIN", "MDMS_ADMIN", "EMPLOYEE", "SYSTEM"];
const DIV_ADMIN = Digit.UserService.hasAccess(["DIV_ADMIN"]);

setRolesOptions(
data?.MdmsRes?.["ws-services-masters"]?.["WSServiceRoles"]?.filter(
(row) =>
!excludeCodes.includes(row?.code) &&
(row?.name === "Secretary" || row?.name === "Sarpanch" || row?.name === "Revenue Collector" || row?.name === "DIVISION ADMIN")
(row?.name === "Secretary" || row?.name === "Sarpanch" || row?.name === "Revenue Collector" || !DIV_ADMIN && row?.name === "DIVISION ADMIN")
)
);
//updating to state roles as requested
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ const HRMSCard = () => {
category: t("SEARCH_USER_HEADER"),
},

DIV_ADMIN
? {}
: {
{
label: t("HR_STATE_ REPORTS"),
link: `/${window?.contextPath}/employee/hrms/dashboard?moduleName=dashboard&pageName=state`,
category: t("HR_DASHBOARD_HEADER"),
Expand All @@ -100,6 +98,11 @@ const HRMSCard = () => {
link: `/${window?.contextPath}/employee/hrms/dashboard?moduleName=dashboard&pageName=rate-master`,
category: t("HR_DASHBOARD_HEADER"),
},
{
label: t("HR_ROLLOUT_DASHBOARD"),
link: `/${window?.contextPath}/employee/hrms/dashboard?moduleName=dashboard&pageName=rollout`,
category: t("HR_DASHBOARD_HEADER"),
},
...moduleForSomeDIVAdmin,
...moduleForSomeSTATEUser,
...moduleForDivisionUser,
Expand Down

0 comments on commit bf7902c

Please sign in to comment.