From e11d4ba097fecec99e69448af963c92883f67f2c Mon Sep 17 00:00:00 2001 From: Nipun Arora Date: Tue, 22 Oct 2024 17:45:13 +0530 Subject: [PATCH] adhoc changes (#1621) updates --- .../src/configs/MyMicroplanSearchConfig.js | 4 ++-- .../hooks/services/createUpdatePlanProject.js | 20 ++++++++++++++++--- .../services/searchSavedPlansWithCampaign.js | 5 ++++- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/MyMicroplanSearchConfig.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/MyMicroplanSearchConfig.js index d23389984b2..a2c6b0ce859 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/MyMicroplanSearchConfig.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/MyMicroplanSearchConfig.js @@ -43,8 +43,8 @@ const defaultSearchValues = { type: "text", populators: { name: "microplanName", - error: "Required", - validation: { pattern: /^[A-Za-z]+$/i }, + // error: "Required", + // validation: { pattern: /^[A-Za-z]+$/i }, }, }, // { diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/hooks/services/createUpdatePlanProject.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/hooks/services/createUpdatePlanProject.js index c923d07de2e..bbdb892535a 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/hooks/services/createUpdatePlanProject.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/hooks/services/createUpdatePlanProject.js @@ -360,7 +360,15 @@ const createUpdatePlanProject = async (req) => { }) const formulasToUpdate = totalFormData?.FORMULA_CONFIGURATION?.formulaConfiguration?.formulaConfigValues?.filter(row => { return (row.category && row.output && row.input && row.operatorName && row.assumptionValue) + })?.map((row)=>{ + const updatedRow = {...row} + const operatorName = row?.operatorName + delete updatedRow?.operatorName + updatedRow.operator = state?.RuleConfigureOperators?.find(operation => operation. + operatorName === operatorName)?.operatorCode + return updatedRow; }) + const updatedPlanObjFormula = { ...fetchedPlanForFormula, operations:[ @@ -382,9 +390,7 @@ const createUpdatePlanProject = async (req) => { }else { setShowToast({ key: "error", label: "ERR_ASSUMPTIONS_FORM_UPDATE" }); } - - - + case "UPLOADBOUNDARYDATA": const fetchedPlanForBoundary = await searchPlanConfig({ PlanConfigurationSearchCriteria: { @@ -515,6 +521,14 @@ const createUpdatePlanProject = async (req) => { } else { setShowToast({ key: "error", label: "ERR_FAILED_TO_COMPLETE_SETUP" }); } + + case "ROLE_ACCESS_CONFIGURATION": + //run any api validations if any/ + setCurrentKey((prev) => prev + 1); + setCurrentStep((prev) => prev + 1); + return { + triggeredFrom, + }; default: setShowToast({ key: "error", label: "ERROR_UNHANDLED_NEXT_OPERATION" }); return { diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/hooks/services/searchSavedPlansWithCampaign.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/hooks/services/searchSavedPlansWithCampaign.js index 0cde7cf244c..a3fe83c0908 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/hooks/services/searchSavedPlansWithCampaign.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/hooks/services/searchSavedPlansWithCampaign.js @@ -42,6 +42,9 @@ const SearchSavedPlansWithCampaign = async (body) => { }); const listOfPlans = planEmployeeSearch?.PlanEmployeeAssignment?.map((i) => i.planConfigurationId); + if(listOfPlans.length===0){ + return [] + } //here get response from both apis and process data and return const responsePlan = await Digit.CustomService.getResponse({ @@ -55,7 +58,7 @@ const SearchSavedPlansWithCampaign = async (body) => { status: body?.PlanConfigurationSearchCriteria?.status, limit: body?.PlanConfigurationSearchCriteria?.limit, offset: body?.PlanConfigurationSearchCriteria?.offset, - id: listOfPlans?.[0], + ids: listOfPlans, }, }, });