Skip to content

Commit

Permalink
hrms create and search
Browse files Browse the repository at this point in the history
  • Loading branch information
mithunhegde-egov committed Sep 5, 2024
1 parent e075450 commit c4e5ee3
Show file tree
Hide file tree
Showing 10 changed files with 79 additions and 20 deletions.
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
69 changes: 63 additions & 6 deletions micro-ui/web/micro-ui-internals/example/public/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8" />
<link rel="icon" href="https://egov-dev-assets.s3.ap-south-1.amazonaws.com/browser-icon.png" />
Expand All @@ -11,17 +11,74 @@
<meta name="theme-color" content="#00bcd1" />
<title>DIGIT</title>
<!-- <link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" /> -->

<!-- <link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css/dist/index.css"/> -->
<!-- <script src="https://s3.ap-south-1.amazonaws.com/egov-dev-assets/globalConfigs.js"></script> -->
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" />
<script src="%REACT_APP_GLOBAL%"></script>

<script>
var globalConfigs = (function () {
var stateTenantId = "pg";
var gmaps_api_key = 'AIzaSyCslxyiD1nuQuoshbu_E3WkIV8J2SUA6KI';
var contextPath = 'sandbox-ui';
var configModuleName = 'commonUiConfig';
var centralInstanceEnabled = false;
var localeRegion = "IN";
var multiRootTenant = true;
var isOTPBasedLogin = true;
var localeDefault = "en";
var mdmsContextV1 = "egov-mdms-service";
var mdmsContextV2 = "mdms-v2";
var footerBWLogoURL = 'https://s3.ap-south-1.amazonaws.com/egov-uat-assets/digit-footer-bw.png';
var footerLogoURL = 'https://unified-dev.digit.org/egov-dev-assets/digit-footer.png';
var digitHomeURL = 'https://www.digit.org/';
var assetS3Bucket = 'works-qa-asset';
var invalidEmployeeRoles = []
var getConfig = function (key) {
if (key === 'STATE_LEVEL_TENANT_ID') {
return stateTenantId;
}
else if (key === 'GMAPS_API_KEY') {
return gmaps_api_key;
}
else if (key === 'ENABLE_SINGLEINSTANCE') {
return centralInstanceEnabled;
} else if (key === 'MULTI_ROOT_TENANT') {
return multiRootTenant;
} else if (key === 'OTP_BASED_LOGIN') {
return isOTPBasedLogin;
} else if (key === 'DIGIT_FOOTER_BW') {
return footerBWLogoURL;
} else if (key === 'DIGIT_FOOTER') {
return footerLogoURL;
} else if (key === 'DIGIT_HOME_URL') {
return digitHomeURL;
} else if (key === 'xstate-webchat-services') {
return xstateWebchatServices;
} else if (key === 'S3BUCKET') {
return assetS3Bucket;
} else if (key === 'CONTEXT_PATH') {
return contextPath;
} else if (key === 'UICONFIG_MODULENAME') {
return configModuleName;
} else if (key === "LOCALE_REGION") {
return localeRegion;
} else if (key === "LOCALE_DEFAULT") {
return localeDefault;
} else if (key === "MDMS_V1_CONTEXT_PATH") {
return mdmsContextV2;
} else if (key === "MDMS_V2_CONTEXT_PATH") {
return mdmsContextV2;
} if (key === 'INVALIDROLES') {
return invalidEmployeeRoles;
}
};
return {
getConfig
};
}());
</script>
</head>

<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>

</html>
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 @@ -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 @@ -29,9 +29,9 @@ export const HRMSModule = ({ stateCode, userType, tenants }) => {

Digit.SessionStorage.set("HRMS_TENANTS", tenants);
const { path, url } = useRouteMatch();
if (!Digit.Utils.hrmsAccess()) {
/*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 @@ -4,9 +4,9 @@ import { useTranslation } from "react-i18next";

const HRMSCard = () => {
const ADMIN = Digit.Utils.hrmsAccess();
if (!ADMIN) {
/*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,8 +60,8 @@ const SelectEmployeeGender = ({ t, config, onSelect, formData = {}, userType, re
code: "TRANSGENDER",
name: "COMMON_GENDER_TRANSGENDER",
},
]}*/
options={HRMenu}
]}
/*options={HRMenu} */
key={input.name}
optionsKey="name"
selectedOption={formData && formData[config.key] ? formData[config.key][input.name] : null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ const CreateEmployee = () => {


const onSubmit = (data) => {
if (data.Jurisdictions.filter(juris => juris.tenantId == tenantId).length == 0) {
// data.Jurisdictions?.
console.log("SKSKSKS", data)
if (data.Jurisdictions.filter(juris => juris.tenantId == "pg.citya").length == 0) {
setShowToast({ key: true, label: "ERR_BASE_TENANT_MANDATORY" });
return;
}
Expand Down

0 comments on commit c4e5ee3

Please sign in to comment.