Skip to content
Open
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.12",
"@egovernments/digit-ui-module-core": "1.8.44",
"@egovernments/digit-ui-module-common": "1.8.10",
"@egovernments/digit-ui-module-hrms": "1.8.13",
"@egovernments/digit-ui-module-hrms": "1.8.15",
"@egovernments/digit-ui-module-utilities": "1.0.15",
"@egovernments/digit-ui-module-open-payment": "0.0.2",
"@egovernments/digit-ui-module-engagement": "1.5.20",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [1.8.15] [25-July-2025]
- DatePicker HRMS Maxwidth Added,

Comment on lines +1 to +3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Fix markdown formatting issues.

The changelog entry has several formatting issues that should be addressed:

+
 ## [1.8.15]  [25-July-2025]
-- DatePicker HRMS Maxwidth Added, 
+- DatePicker HRMS Maxwidth Added
+

Also consider using a consistent date format with other entries (some use DD-MMM-YYYY, others use DD-Month-YYYY).

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## [1.8.15] [25-July-2025]
- DatePicker HRMS Maxwidth Added,
## [1.8.15] [25-July-2025]
- DatePicker HRMS Maxwidth Added
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

1-1: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


1-1: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)


2-2: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)


2-2: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)

🤖 Prompt for AI Agents
In micro-ui/web/micro-ui-internals/packages/modules/hrms/CHANGELOG.md at lines 1
to 3, fix the markdown formatting by removing the trailing comma after the entry
description and ensure consistent spacing and punctuation. Also, standardize the
date format to match other entries, preferably using a consistent style like
DD-MMM-YYYY or DD-Month-YYYY throughout the file.

## [1.8.13] [15-July-2025]
- Publishing PGR Demo changes,
- Boudnary and locality chanages were added, Edit, Create and Inbox
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const initDigitUI = () => {
### Changelog

```bash
1.8.14 PRR-VALIDATIONS ADDED
1.8.1-beta.1 used new color constants
1.8.0 workbench v1.0 release
1.8.0-beta.3 republished due to some version issues
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-module-hrms",
"version": "1.8.13",
"version": "1.8.15",
"description": "HRMS",
"license": "MIT",
"main": "dist/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ export const newConfig = [
withoutLabel: true,
},

{
type: "component",
component: "HRBanner",
key: "Banner1",
withoutLabel: true,
texts: {
headerCaption: "Info",
header: "HR_EMP_ID_MESSAGE",
},
},
// {
// type: "component",
// component: "HRBanner",
// key: "Banner1",
// withoutLabel: true,
// texts: {
// headerCaption: "Info",
// header: "HR_EMP_ID_MESSAGE",
// },
// },
],
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ const SelectDateofBirthEmployment = ({ t, config, onSelect, formData = {}, userT
},
];

const fieldStyle = {
maxWidth: "36.25rem",
paddingRight: "2.5rem",
};

function setValue(value, input) {
onSelect(config.key, { ...formData[config.key], [input]: value });
}
Expand All @@ -31,7 +36,9 @@ const SelectDateofBirthEmployment = ({ t, config, onSelect, formData = {}, userT
{t(input.label)}
{input.isMandatory ? " * " : null}
</CardLabel>
<div className="field">
<div className="field" style={{
fieldStyle
}}>
Comment on lines +39 to +41
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix style application syntax error.

The style object is not being applied correctly. The current syntax creates a nested object instead of applying the fieldStyle directly.

-            <div className="field" style={{
-              fieldStyle
-            }}>
+            <div className="field" style={fieldStyle}>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div className="field" style={{
fieldStyle
}}>
<div className="field" style={fieldStyle}>
🤖 Prompt for AI Agents
In
micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/EmployeeDOB.js
around lines 39 to 41, the style attribute is incorrectly applying the
fieldStyle object by nesting it inside another object. To fix this, remove the
extra curly braces so that the style attribute directly receives the fieldStyle
object without nesting.

<DatePicker
key={input.name}
date={formData && formData[config.key] ? formData[config.key][input.name] : undefined}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Toast } from "@egovernments/digit-ui-components";

const CreateEmployee = () => {
const tenantId = Digit.ULBService.getCurrentTenantId();
const userInfo = Digit.UserService.getUser();
const [canSubmit, setSubmitValve] = useState(false);
const [mobileNumber, setMobileNumber] = useState(null);
const [showToast, setShowToast] = useState(null);
Expand Down Expand Up @@ -144,6 +145,34 @@ const CreateEmployee = () => {
};


const ToastOverlay = ({ showToast, t, onClose }) => {
if (!showToast) return null;
return (
<div style={{
position: "fixed",
bottom: "100px",
left: "50%",
transform: "translateX(-50%)",
zIndex: 9999,
maxWidth: "90%",
}}>
<Toast
type={showToast.key}
label={t(showToast.label)}
onClose={onClose}
/>
</div>
);
};
Comment on lines +148 to +166
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Consider extracting inline styles to a CSS class or styled component.

The ToastOverlay component improves code organization, but the inline styles could be better managed.

Consider creating a CSS class or using styled-components:

.toast-overlay {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  max-width: 90%;
}
-    <div style={{
-      position: "fixed",
-      bottom: "100px",
-      left: "50%",
-      transform: "translateX(-50%)",
-      zIndex: 9999,
-      maxWidth: "90%",
-    }}>
+    <div className="toast-overlay">
🤖 Prompt for AI Agents
In
micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/createEmployee.js
around lines 148 to 166, the ToastOverlay component uses inline styles for
positioning and layout. To improve code organization and maintainability,
extract these inline styles into a CSS class or a styled component. Create a CSS
class with the given style properties and apply it to the wrapping div instead
of inline styles, or define a styled component with these styles and use it in
place of the div.


function hasMatchingJurisdiction(jurisdictions = [], parentCity = "") {
if (!Array.isArray(jurisdictions) || !parentCity) return false;

return jurisdictions.some(j => j?.boundary === parentCity);
}




const onSubmit = async (data) => {
const hasCurrentAssignment = data?.Assignments?.some(assignment => assignment?.isCurrentAssignment === true);
Expand All @@ -155,10 +184,20 @@ const CreateEmployee = () => {
};
});


if(!hasMatchingJurisdiction(data?.Jurisdictions,userInfo.info.tenantId)){
setShowToast({ key: "error", label: "ERR_BASE_TENANT_MANDATORY" });
return;
}

if(!canSubmit){
setShowToast({ key: "error", label: "ERR_ALL_MANDATORY_FIELDS" });
return;
}




if (!hasCurrentAssignment) {
setShowToast({ key: "error", label: "ERR_NO_CURRENT_ASSIGNMENT" });
return;
Expand All @@ -167,9 +206,11 @@ const CreateEmployee = () => {
setShowToast({ key: "error", label: "ERR_BASE_TENANT_MANDATORY" });
return;
}


if (!Object.values(data.Jurisdictions.reduce((acc, sum) => {
if (sum && sum?.tenantId) {
acc[sum.tenantId] = acc[sum.tenantId] ? acc[sum.tenantId] + 1 : 1;
if (sum && sum?.boundary) {
acc[sum.boundary] = acc[sum.boundary] ? acc[sum.boundary] + 1 : 1;
}
return acc;
}, {})).every(s => s == 1)) {
Expand Down Expand Up @@ -281,15 +322,8 @@ const CreateEmployee = () => {
// isDisabled={!canSubmit}
label={t("HR_COMMON_BUTTON_SUBMIT")}
/>
{showToast && (
<Toast
type={showToast.key}
label={t(showToast.label)}
onClose={() => {
setShowToast(null);
}}
/>
)}

<ToastOverlay showToast={showToast} t={t} onClose={() => setShowToast(null)} />
</div>
);
};
Expand Down
2 changes: 1 addition & 1 deletion micro-ui/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@egovernments/digit-ui-module-dss": "1.8.12",
"@egovernments/digit-ui-module-core": "1.8.44",
"@egovernments/digit-ui-module-common": "1.8.10",
"@egovernments/digit-ui-module-hrms": "1.8.13",
"@egovernments/digit-ui-module-hrms": "1.8.15",
"@egovernments/digit-ui-module-utilities": "1.0.15",
"@egovernments/digit-ui-module-open-payment": "0.0.2",
"@egovernments/digit-ui-module-engagement": "1.5.20",
Expand Down
2 changes: 1 addition & 1 deletion micro-ui/web/sandbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@egovernments/digit-ui-module-dss": "1.8.12",
"@egovernments/digit-ui-module-core": "1.8.44",
"@egovernments/digit-ui-module-common": "1.8.10",
"@egovernments/digit-ui-module-hrms": "1.8.13",
"@egovernments/digit-ui-module-hrms": "1.8.15",
"@egovernments/digit-ui-module-utilities": "1.0.15",
"@egovernments/digit-ui-module-open-payment": "0.0.2",
"@egovernments/digit-ui-module-engagement": "1.5.20",
Expand Down