Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hrms create and search #1361

Merged
merged 6 commits into from
Sep 5, 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
2 changes: 1 addition & 1 deletion micro-ui/web/micro-ui-internals/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@egovernments/digit-ui-module-dss": "1.8.1",
"@egovernments/digit-ui-module-core": "1.8.2-beta.18",
"@egovernments/digit-ui-module-common": "1.8.0",
"@egovernments/digit-ui-module-hrms": "1.8.0",
"@egovernments/digit-ui-module-hrms": "1.8.1-beta.1",
"@egovernments/digit-ui-module-utilities": "1.0.1-beta.39",
"@egovernments/digit-ui-module-open-payment":"0.0.1",
"@egovernments/digit-ui-module-engagement": "1.5.20",
Expand Down
2 changes: 1 addition & 1 deletion micro-ui/web/micro-ui-internals/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"dev:example": "cd example && yarn start",
"dev:core": "cd packages/modules/core && yarn start",
"devD:dss": "cd packages/modules/dss && yarn start",
"devD:hrms": "cd packages/modules/hrms && yarn start",
"dev:hrms": "cd packages/modules/hrms && yarn start",
"devD:common": "cd packages/modules/common && yarn start",
"devD:utilities": "cd packages/modules/utilities && yarn start",
"dev:workbench": "cd packages/modules/workbench && yarn start",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ const receiptsAccess = () => {
const RECEIPTS_ACCESS = userRoles?.filter((role) => receiptsRoles?.includes(role));
return RECEIPTS_ACCESS?.length > 0;
};
const hrmsRoles = ["HRMS_ADMIN"];
const hrmsRoles = ["HRMS_ADMIN","SUPERUSER"];
const hrmsAccess = () => {
const userInfo = Digit.UserService.getUser();
const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"prepublish": "yarn build"
},
"dependencies": {
"@egovernments/digit-ui-react-components": "1.5.22",
"@egovernments/digit-ui-react-components": "1.8.2-beta.12",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-hook-form": "6.15.8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const HRMSModule = ({ stateCode, userType, tenants }) => {
const { path, url } = useRouteMatch();
if (!Digit.Utils.hrmsAccess()) {
return null;
}
}
if (userType === "employee") {
return <EmployeeApp path={path} url={url} />;
} else return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const Filter = ({ searchParams, onFilterChange, onSearch, removeParam, ...props
});

useEffect(() => {
if (tenantId.code) {
if (tenantId?.code) {
setSearchParams({ ..._searchParams, tenantId: tenantId.code });
}
}, [tenantId]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ export const getCityThatUserhasAccess = (cities = []) => {
let roleObject = {};
userInfo?.info?.roles.map((roleData) => { roleObject[roleData?.code] = roleObject[roleData?.code] ? [...roleObject[roleData?.code], roleData?.tenantId] : [roleData?.tenantId] });
const tenant = Digit.ULBService.getCurrentTenantId();
if (roleObject[Digit.Utils?.hrmsRoles?.[0]].includes(Digit.ULBService.getStateId())) {
if (roleObject?.[Digit.Utils?.hrmsRoles?.[0]]?.includes(Digit.ULBService.getStateId())) {
return cities;
}
return cities.filter(city => roleObject[Digit.Utils?.hrmsRoles?.[0]]?.includes(city?.code));
return cities?.filter(city => roleObject?.[Digit.Utils?.hrmsRoles?.[0]]?.includes(city?.code));
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const HRMSCard = () => {
const ADMIN = Digit.Utils.hrmsAccess();
if (!ADMIN) {
return null;
}
}
const { t } = useTranslation();
const tenantId = Digit.ULBService.getCurrentTenantId();
const { isLoading, isError, error, data, ...rest } = Digit.Hooks.hrms.useHRMSCount(tenantId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const SelectEmployeeGender = ({ t, config, onSelect, formData = {}, userType, re
<div className="field">
<RadioButtons
style={{ display: "flex", justifyContent: "space-between" }}
/*options={[
/* options={[
{
code: "MALE",
name: "COMMON_GENDER_MALE",
Expand All @@ -60,7 +60,7 @@ const SelectEmployeeGender = ({ t, config, onSelect, formData = {}, userType, re
code: "TRANSGENDER",
name: "COMMON_GENDER_TRANSGENDER",
},
]}*/
]} */
options={HRMenu}
key={input.name}
optionsKey="name"
Expand Down