From c98dae3c92213c251e70ef878b8068dd53c58ef6 Mon Sep 17 00:00:00 2001 From: Tulika-eGov Date: Wed, 6 Nov 2024 14:14:39 +0530 Subject: [PATCH 1/2] UCEM-765 : updated the logic for wageseeker --- .../micro-ui/web/micro-ui-internals/example/package.json | 2 +- .../packages/modules/Masters/package.json | 2 +- .../WageSeeker/ModifyWageSeeker/ModifyWageSeekerForm.js | 2 +- .../packages/modules/Masters/src/utils/index.js | 9 ++++++--- frontend/micro-ui/web/package.json | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/example/package.json b/frontend/micro-ui/web/micro-ui-internals/example/package.json index 6e7eb98f80..36937fc203 100644 --- a/frontend/micro-ui/web/micro-ui-internals/example/package.json +++ b/frontend/micro-ui/web/micro-ui-internals/example/package.json @@ -19,7 +19,7 @@ "@egovernments/digit-ui-module-contracts": "0.4.15", "@egovernments/digit-ui-module-measurement":"0.2.18", "@egovernments/digit-ui-module-estimate": "0.4.22", - "@egovernments/digit-ui-module-masters": "0.4.22", + "@egovernments/digit-ui-module-masters": "0.4.23", "@egovernments/digit-ui-module-project": "0.4.17", "@egovernments/digit-ui-module-expenditure": "0.4.27", "@egovernments/digit-ui-customisation-mukta": "0.2.14", diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/Masters/package.json b/frontend/micro-ui/web/micro-ui-internals/packages/modules/Masters/package.json index adbeefbdd2..ec7572b5b3 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/Masters/package.json +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/Masters/package.json @@ -1,6 +1,6 @@ { "name": "@egovernments/digit-ui-module-masters", - "version": "0.4.22", + "version": "0.4.23", "description": "Masters Module UI", "main": "dist/index.js", "module": "dist/index.modern.js", diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/Masters/src/pages/employee/WageSeeker/ModifyWageSeeker/ModifyWageSeekerForm.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/Masters/src/pages/employee/WageSeeker/ModifyWageSeeker/ModifyWageSeekerForm.js index da82be7dd4..c7922568b2 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/Masters/src/pages/employee/WageSeeker/ModifyWageSeeker/ModifyWageSeekerForm.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/Masters/src/pages/employee/WageSeeker/ModifyWageSeeker/ModifyWageSeekerForm.js @@ -149,7 +149,7 @@ const requestCriteria = { let validateCheckPass = true const countSkillsInCategory = {} formData.skillDetails_skill.map(skill => { - countSkillsInCategory[skill.code.split('.')[1]] = countSkillsInCategory[skill.code.split('.')[1]] ? countSkillsInCategory[skill.code.split('.')[1]] + 1 : 1 + countSkillsInCategory[skill.code.split('.')[1]?skill.code.split('.')[1]:skill.code.split('.')[0]] = countSkillsInCategory[skill.code.split('.')[1]?skill.code.split('.')[1]:skill.code.split('.')[0]] ? countSkillsInCategory[skill.code.split('.')[1]?skill.code.split('.')[1]:skill.code.split('.')[0]] + 1 : 1 }); if(Object.keys(countSkillsInCategory)?.length <= 0) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/Masters/src/utils/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/Masters/src/utils/index.js index 1b062315f4..7d31e76306 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/Masters/src/utils/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/Masters/src/utils/index.js @@ -66,7 +66,7 @@ export const updateWageSeekerFormDefaultValues = async ({configs, isModify, sess const getSkillsToUpdate = (formData, wageSeekerDataFromAPI) => { let updatedSkills = formData?.skillDetails_skill //added code field in existing skills to find difference - let existingSkills = wageSeekerDataFromAPI?.individual?.skills?.map(item => ({ ...item, code : `${item?.level}.${item?.type}`})) + let existingSkills = wageSeekerDataFromAPI?.individual?.skills?.map(item => ({ ...item, code : `${item?.level}`})) let set1 = new Set(updatedSkills.map(({ code }) => code)) let set2 = new Set(existingSkills.map(({ code }) => code)) @@ -85,8 +85,10 @@ const getSkillsToUpdate = (formData, wageSeekerDataFromAPI) => { }) let skillsTobeAdded = extraSkillsTobeAdded?.map(item => { - const separator = item?.code.includes('.') ? '.' : '_'; - const [level, type] = item?.code.split(separator); + //const separator = item?.code.includes('.') ? '.' : '_'; + //const [level, type] = item?.code.split(separator); + const level = item?.code; + const type = item?.code; return { level, type }; }); let skillsTobeRemoved = extraSkillsTobeRemoved?.map(item => ({ ...item, isDeleted: true })) @@ -186,6 +188,7 @@ export const getWageSeekerSkillDeletePayload = ({wageSeekerDataFromAPI, tenantId Individual.name = wageSeekerDataFromAPI?.Individual?.name Individual.rowVersion = parseInt(wageSeekerDataFromAPI?.Individual?.rowVersion) Individual.skills = skillsTobeRemoved + Individual.additionalFields = wageSeekerDataFromAPI?.Individual?.additionalFields return { Individual } diff --git a/frontend/micro-ui/web/package.json b/frontend/micro-ui/web/package.json index 12fbbf10a6..93679c37c3 100644 --- a/frontend/micro-ui/web/package.json +++ b/frontend/micro-ui/web/package.json @@ -26,7 +26,7 @@ "@egovernments/digit-ui-module-contracts": "0.4.15", "@egovernments/digit-ui-module-measurement":"0.2.18", "@egovernments/digit-ui-module-estimate": "0.4.22", - "@egovernments/digit-ui-module-masters": "0.4.22", + "@egovernments/digit-ui-module-masters": "0.4.23", "@egovernments/digit-ui-module-project": "0.4.17", "@egovernments/digit-ui-module-expenditure": "0.4.27", "@egovernments/digit-ui-customisation-mukta": "0.2.14", From 64b9a4b42ee416a3d945a576535a7131fe83e6f8 Mon Sep 17 00:00:00 2001 From: Tulika-eGov Date: Wed, 6 Nov 2024 14:30:14 +0530 Subject: [PATCH 2/2] UCEM-765 : updating delete payload --- .../packages/modules/Masters/src/utils/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/Masters/src/utils/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/Masters/src/utils/index.js index 7d31e76306..967e02c1f7 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/Masters/src/utils/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/Masters/src/utils/index.js @@ -182,7 +182,7 @@ export const getWageSeekerUpdatePayload = ({formData, wageSeekerDataFromAPI, ten } export const getWageSeekerSkillDeletePayload = ({wageSeekerDataFromAPI, tenantId, skillsTobeRemoved}) => { - let Individual = {} + let Individual = {...wageSeekerDataFromAPI?.Individual} Individual.id = wageSeekerDataFromAPI?.Individual?.id Individual.tenantId = tenantId Individual.name = wageSeekerDataFromAPI?.Individual?.name @@ -190,7 +190,7 @@ export const getWageSeekerSkillDeletePayload = ({wageSeekerDataFromAPI, tenantId Individual.skills = skillsTobeRemoved Individual.additionalFields = wageSeekerDataFromAPI?.Individual?.additionalFields return { - Individual + Individual } }