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

Develop #946

Merged
merged 6 commits into from
Sep 13, 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 @@ -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
Loading