-
Notifications
You must be signed in to change notification settings - Fork 49
V0.4.1 #3337
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
base: master
Are you sure you want to change the base?
V0.4.1 #3337
Changes from all commits
981a1d7
743eaaf
033b741
dc22bc7
8e1f890
d96a144
11e60c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -39,7 +39,7 @@ const UpdateCampaign = ({ hierarchyData, ...props }) => { | |||||||||||||||||||||||||||||||
| const { mutate } = Digit.Hooks.campaign.useCreateCampaign(tenantId); | ||||||||||||||||||||||||||||||||
| const { mutate: updateCampaign } = Digit.Hooks.campaign.useUpdateCampaign(tenantId); | ||||||||||||||||||||||||||||||||
| const searchParams = new URLSearchParams(location.search); | ||||||||||||||||||||||||||||||||
| const id = searchParams.get("id"); | ||||||||||||||||||||||||||||||||
| const [id,setId] = useState(searchParams.get("id")); | ||||||||||||||||||||||||||||||||
| const isDraftCampaign = searchParams.get("isDraftCampaign") === "true"; | ||||||||||||||||||||||||||||||||
| const parentId = searchParams.get("parentId"); | ||||||||||||||||||||||||||||||||
| const isPreview = searchParams.get("preview"); | ||||||||||||||||||||||||||||||||
|
|
@@ -86,7 +86,7 @@ const UpdateCampaign = ({ hierarchyData, ...props }) => { | |||||||||||||||||||||||||||||||
| body: { | ||||||||||||||||||||||||||||||||
| CampaignDetails: { | ||||||||||||||||||||||||||||||||
| tenantId: tenantId, | ||||||||||||||||||||||||||||||||
| ids: [parentId], | ||||||||||||||||||||||||||||||||
| ids: [id?id:parentId], | ||||||||||||||||||||||||||||||||
| ...(isDraftCampaign && { status: ["drafted"] }), | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
|
|
@@ -267,6 +267,15 @@ const UpdateCampaign = ({ hierarchyData, ...props }) => { | |||||||||||||||||||||||||||||||
| payloadData.action = "create"; | ||||||||||||||||||||||||||||||||
| payloadData.parentId = CampaignData?.CampaignDetails?.[0]?.parentId; | ||||||||||||||||||||||||||||||||
| payloadData.campaignName = CampaignData?.CampaignDetails?.[0]?.campaignName; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| if(parentId){ | ||||||||||||||||||||||||||||||||
| payloadData.parentId =parentId; | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| if(id){ | ||||||||||||||||||||||||||||||||
| payloadData.id =id; | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
Comment on lines
+270
to
+277
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Improve formatting of conditional blocks. The conditional assignments for Apply this diff: -
- if(parentId){
- payloadData.parentId =parentId;
- }
-
- if(id){
- payloadData.id =id;
- }
-
+ if (parentId) {
+ payloadData.parentId = parentId;
+ }
+
+ if (id) {
+ payloadData.id = id;
+ }📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| if (totalFormData?.HCM_CAMPAIGN_SELECTING_BOUNDARY_DATA?.boundaryType?.selectedData) { | ||||||||||||||||||||||||||||||||
| const temp = restructureBoundaryData( | ||||||||||||||||||||||||||||||||
| totalFormData?.HCM_CAMPAIGN_SELECTING_BOUNDARY_DATA?.boundaryType?.selectedData, | ||||||||||||||||||||||||||||||||
|
|
@@ -336,7 +345,10 @@ const UpdateCampaign = ({ hierarchyData, ...props }) => { | |||||||||||||||||||||||||||||||
| payloadData.startDate = CampaignData?.CampaignDetails?.[0]?.startDate; | ||||||||||||||||||||||||||||||||
| payloadData.tenantId = tenantId; | ||||||||||||||||||||||||||||||||
| payloadData.action = "draft"; | ||||||||||||||||||||||||||||||||
| payloadData.parentId = CampaignData?.CampaignDetails?.[0]?.id; | ||||||||||||||||||||||||||||||||
| payloadData.parentId = parentId; | ||||||||||||||||||||||||||||||||
| if(id){ | ||||||||||||||||||||||||||||||||
| payloadData.id =id; | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
Comment on lines
+348
to
+351
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Improve formatting of conditional block. The conditional assignment for Apply this diff: payloadData.action = "draft";
payloadData.parentId = parentId;
- if(id){
- payloadData.id =id;
- }
+ if (id) {
+ payloadData.id = id;
+ }📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||
| payloadData.campaignName = CampaignData?.CampaignDetails?.[0]?.campaignName; | ||||||||||||||||||||||||||||||||
| if (totalFormData?.HCM_CAMPAIGN_SELECTING_BOUNDARY_DATA?.boundaryType?.selectedData) { | ||||||||||||||||||||||||||||||||
| const temp = restructureBoundaryData( | ||||||||||||||||||||||||||||||||
|
|
@@ -379,7 +391,9 @@ const UpdateCampaign = ({ hierarchyData, ...props }) => { | |||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| onSuccess: async (data) => { | ||||||||||||||||||||||||||||||||
| updateUrlParams({ id: data?.CampaignDetails?.id }); | ||||||||||||||||||||||||||||||||
| setId(data?.CampaignDetails?.id); | ||||||||||||||||||||||||||||||||
| setIsDraftCreated(true); | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| draftRefetch(); | ||||||||||||||||||||||||||||||||
| if (filteredConfig?.[0]?.form?.[0]?.body?.[0]?.mandatoryOnAPI) { | ||||||||||||||||||||||||||||||||
| setCurrentKey(currentKey + 1); | ||||||||||||||||||||||||||||||||
|
|
@@ -404,6 +418,14 @@ const UpdateCampaign = ({ hierarchyData, ...props }) => { | |||||||||||||||||||||||||||||||
| payloadData.action = "draft"; | ||||||||||||||||||||||||||||||||
| payloadData.parentId = CampaignData?.CampaignDetails?.[0]?.parentId; | ||||||||||||||||||||||||||||||||
| payloadData.campaignName = CampaignData?.CampaignDetails?.[0]?.campaignName; | ||||||||||||||||||||||||||||||||
| if(parentId){ | ||||||||||||||||||||||||||||||||
| payloadData.parentId =parentId; | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| if(id){ | ||||||||||||||||||||||||||||||||
| payloadData.id =id; | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
Comment on lines
+421
to
+427
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Improve formatting of conditional blocks. The conditional assignments for Apply this diff: payloadData.campaignName = CampaignData?.CampaignDetails?.[0]?.campaignName;
- if(parentId){
- payloadData.parentId =parentId;
- }
-
- if(id){
- payloadData.id =id;
- }
-
+ if (parentId) {
+ payloadData.parentId = parentId;
+ }
+
+ if (id) {
+ payloadData.id = id;
+ }📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| if (totalFormData?.HCM_CAMPAIGN_SELECTING_BOUNDARY_DATA?.boundaryType?.selectedData) { | ||||||||||||||||||||||||||||||||
| const temp = restructureBoundaryData( | ||||||||||||||||||||||||||||||||
| totalFormData?.HCM_CAMPAIGN_SELECTING_BOUNDARY_DATA?.boundaryType?.selectedData, | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,17 +78,39 @@ const EmployeeDetailScreen = () => { | |
| }; | ||
|
|
||
| const deActivateUser = async (comment, date, reason, order) => { | ||
| let employeeData = { | ||
| ...data?.Employees[0], // Keep existing data | ||
| isActive: false, // Update isActive to false | ||
| deactivationDetails: [ | ||
| let updatedDeactivationDetails = []; | ||
|
|
||
| const existingEmployee = data?.Employees[0]; | ||
|
|
||
| if (existingEmployee.deactivationDetails && existingEmployee.deactivationDetails.length > 0) { | ||
| // Update the first object | ||
| updatedDeactivationDetails = existingEmployee.deactivationDetails.map((item, index) => | ||
| index === 0 | ||
| ? { | ||
| ...item, | ||
| effectiveFrom: Date.now(), | ||
| reasonForDeactivation: reason, | ||
| remarks: order, | ||
| orderNo: comment, | ||
| } | ||
| : item | ||
| ); | ||
| } else { | ||
| // Create a new object if no existing objects | ||
| updatedDeactivationDetails = [ | ||
| { | ||
| effectiveFrom: Date.now(), // Use the current timestamp | ||
| effectiveFrom: Date.now(), | ||
| reasonForDeactivation: reason, | ||
| remarks: order, | ||
| orderNo: comment, | ||
| }, | ||
| ], | ||
| ]; | ||
| } | ||
|
|
||
| let employeeData = { | ||
| ...data?.Employees[0], // Keep existing data | ||
| isActive: false, // Update isActive to false | ||
| deactivationDetails: updatedDeactivationDetails, | ||
| }; | ||
|
|
||
|
Comment on lines
80
to
115
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: find . -type f -name "employeeDetails.js" | grep -E "health-hrms|health/micro-ui"Repository: egovernments/DIGIT-Frontend Length of output: 178 🏁 Script executed: wc -l ./health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/pages/employee/employeeDetails.jsRepository: egovernments/DIGIT-Frontend Length of output: 182 🏁 Script executed: sed -n '60,130p' ./health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/pages/employee/employeeDetails.js | cat -nRepository: egovernments/DIGIT-Frontend Length of output: 3007 🏁 Script executed: sed -n '1,60p' ./health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/pages/employee/employeeDetails.js | cat -nRepository: egovernments/DIGIT-Frontend Length of output: 2988 🏁 Script executed: grep -n "deActivateUser" ./health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/pages/employee/employeeDetails.jsRepository: egovernments/DIGIT-Frontend Length of output: 202 🏁 Script executed: sed -n '500,545p' ./health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/pages/employee/employeeDetails.js | cat -nRepository: egovernments/DIGIT-Frontend Length of output: 1705 🏁 Script executed: grep -n "setOpenModal(true)" ./health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/pages/employee/employeeDetails.jsRepository: egovernments/DIGIT-Frontend Length of output: 114 🏁 Script executed: sed -n '450,500p' ./health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/pages/employee/employeeDetails.js | cat -nRepository: egovernments/DIGIT-Frontend Length of output: 2073 🏁 Script executed: sed -n '200,250p' ./health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/pages/employee/employeeDetails.js | cat -nRepository: egovernments/DIGIT-Frontend Length of output: 1850 🏁 Script executed: sed -n '215,225p' ./health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/pages/employee/employeeDetails.js | cat -nRepository: egovernments/DIGIT-Frontend Length of output: 398 Add defensive null-check and reuse The
A safer version: + const existingEmployee = data?.Employees?.[0];
+ if (!existingEmployee) {
+ return;
+ }
+
let updatedDeactivationDetails = [];
-
- const existingEmployee = data?.Employees[0];
if (existingEmployee.deactivationDetails && existingEmployee.deactivationDetails.length > 0) {
// Update the first object
updatedDeactivationDetails = existingEmployee.deactivationDetails.map((item, index) =>
index === 0
? {
...item,
effectiveFrom: Date.now(),
reasonForDeactivation: reason,
remarks: order,
orderNo: comment,
}
: item
);
} else {
// Create a new object if no existing objects
updatedDeactivationDetails = [
{
effectiveFrom: Date.now(),
reasonForDeactivation: reason,
remarks: order,
orderNo: comment,
},
];
}
let employeeData = {
- ...data?.Employees[0],
+ ...existingEmployee,
isActive: false,
deactivationDetails: updatedDeactivationDetails,
};🤖 Prompt for AI Agents |
||
| try { | ||
|
|
@@ -179,7 +201,19 @@ const EmployeeDetailScreen = () => { | |
| }; | ||
|
|
||
| if (isLoading || isMDMSLoading) { | ||
| return <Loader />; | ||
| return ( | ||
| <div | ||
| style={{ | ||
| display: "flex", | ||
| justifyContent: "center", // horizontal center | ||
| alignItems: "center", // vertical center | ||
| height: "100vh", // take full viewport height | ||
| width: "100%", // full width | ||
| }} | ||
| > | ||
| <Loader /> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| return ( | ||
|
|
@@ -407,7 +441,7 @@ const EmployeeDetailScreen = () => { | |
| } | ||
| /> | ||
| ) : ( | ||
| <NoResultsFound/> | ||
| <NoResultsFound /> | ||
| ); | ||
| }, | ||
| }, | ||
|
|
@@ -492,6 +526,7 @@ const EmployeeDetailScreen = () => { | |
| onSubmit={(comment, date, reason, order) => { | ||
| deActivateUser(comment, date, reason, order); | ||
| }} | ||
| reasonMsg={false} | ||
| /> | ||
| )} | ||
|
|
||
|
|
@@ -505,6 +540,7 @@ const EmployeeDetailScreen = () => { | |
| onSubmit={(comment, date, reason, order) => { | ||
| activateUser(comment, date, reason, order); | ||
| }} | ||
| reasonMsg={true} | ||
| /> | ||
| )} | ||
| </React.Fragment> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,10 +7,22 @@ | |
| <link | ||
| href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;500;700&family=Roboto:wght@400;500;700&display=swap" | ||
| rel="stylesheet" type="text/css" /> | ||
| <link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.8.30/dist/index.css" /> | ||
| <link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected].0-beta.14/dist/index.css" /> | ||
| <link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.9.0/dist/index.css" /> | ||
| <link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected].3/dist/index.css" /> | ||
|
Comment on lines
+10
to
+11
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainVerify CSS package versions for compatibility and breaking changes. The CSS packages have been updated to newer versions. Please ensure:
🌐 Web query: 💡 Result: I couldn’t find any published release notes or a CHANGELOG entry specifically for @egovernments/digit-ui-css v1.9.0. The package index (jsDelivr) lists a 1.9.0 release (release date shown Oct 23, 2025) but there’s no accompanying changelog or breaking-changes notes on npm/jsDelivr pages. [1][2] If you want, I can:
Which would you like me to do? 🌐 Web query: 💡 Result: I couldn't find a published 0.2.3 release for @egovernments/digit-ui-components-css. The npm package shows latest published version 0.2.0 (with its changelog) — no 0.2.3 release notes or breaking-change entry are available. [1] If you want, I can:
Sources: Correct CSS package version: [email protected] doesn't exist on npm. The @egovernments/digit-ui-components-css package shows latest published version as 0.2.0, not 0.2.3. The version specified in line 11 will fail to resolve. Update to an available version (e.g., 0.2.0 or verify if 0.2.3 exists in an internal registry). Additionally, @egovernments/digit-ui-css v1.9.0 has no published release notes or CHANGELOG entry, so ensure compatibility with the application code through testing. 🤖 Prompt for AI Agents |
||
| <!-- added below css for hcm-workbench module inclusion--> | ||
| <link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" /> | ||
| <style> | ||
| /* Original rule you provided */ | ||
| .main.digit-home-main{ | ||
| margin-top: 1rem; | ||
| } | ||
| /* Optional: tweak for small screens */ | ||
| @media (max-width: 480px) { | ||
| .main.digit-home-main { | ||
| margin-top: 0.75rem; | ||
| } | ||
| } | ||
| </style> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
| <meta name="theme-color" content="#00bcd1" /> | ||
| <title>DIGIT HCM</title> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Fix ternary operator formatting for consistency.
The ternary operator lacks proper spacing, which is inconsistent with common JavaScript style guidelines.
Apply this diff:
📝 Committable suggestion
🤖 Prompt for AI Agents