From ee2736f90b660d4daf858d8381d53e63b38d8678 Mon Sep 17 00:00:00 2001 From: SwethaKrish4 <110164892+SwethaKrish4@users.noreply.github.com> Date: Tue, 4 Jun 2024 11:35:00 +0530 Subject: [PATCH] MOSIP-32711: Ui fixes in request policy (#410) * MOSIP-32711: Ui fixes in request policy Signed-off-by: SwethaKrish4 <110164892+SwethaKrish4@users.noreply.github.com> * MOSIP-32711: Ui fixes in request policy Signed-off-by: SwethaKrish4 <110164892+SwethaKrish4@users.noreply.github.com> * MOSIP-32711: Ui fixes in request policy Signed-off-by: SwethaKrish4 <110164892+SwethaKrish4@users.noreply.github.com> * MOSIP-32711: Ui fixes in request policy Signed-off-by: SwethaKrish4 <110164892+SwethaKrish4@users.noreply.github.com> --------- Signed-off-by: SwethaKrish4 <110164892+SwethaKrish4@users.noreply.github.com> --- .../src/pages/policies/RequestPolicy.js | 21 +++------ .../policies/RequestPolicyConfirmation.js | 12 ++--- pmp-reactjs-ui/src/utils/AppUtils.js | 44 ------------------- 3 files changed, 9 insertions(+), 68 deletions(-) diff --git a/pmp-reactjs-ui/src/pages/policies/RequestPolicy.js b/pmp-reactjs-ui/src/pages/policies/RequestPolicy.js index 533573b02..2049fd2e7 100644 --- a/pmp-reactjs-ui/src/pages/policies/RequestPolicy.js +++ b/pmp-reactjs-ui/src/pages/policies/RequestPolicy.js @@ -1,7 +1,7 @@ import { useState, useEffect } from "react"; import { useNavigate } from "react-router-dom"; import { useTranslation } from "react-i18next"; -import { getPartnerManagerUrl, getPolicyManagerUrl, handleServiceErrors, moveToPolicies } from '../../utils/AppUtils'; +import { getPartnerManagerUrl, getPolicyManagerUrl, handleServiceErrors, moveToPolicies, getPartnerTypeDescription } from '../../utils/AppUtils'; import { HttpService } from '../../services/HttpService'; import LoadingIcon from "../common/LoadingIcon"; import ErrorMessage from "../common/ErrorMessage"; @@ -62,10 +62,6 @@ function RequestPolicy() { const createPartnerIdDropdownData = (fieldName, dataList) => { let dataArr = []; - dataArr.push({ - fieldCode: "", - fieldValue: "" - }); dataList.forEach(item => { let alreadyAdded = false; dataArr.forEach(item1 => { @@ -85,11 +81,6 @@ function RequestPolicy() { const createPoliciesDropdownData = (fieldName, dataList) => { let dataArr = []; - dataArr.push({ - fieldCode: "", - fieldValue: "", - fieldDescription: "" - }); dataList.forEach(item => { let alreadyAdded = false; dataArr.forEach(item1 => { @@ -113,18 +104,17 @@ function RequestPolicy() { // Find the selected partner data const selectedPartner = partnerData.find(item => item.partnerId === selectedValue); if (selectedPartner) { - setPartnerType(selectedPartner.partnerType); + setPartnerType(getPartnerTypeDescription(selectedPartner.partnerType, t)); setPolicyGroupName(selectedPartner.policyGroupName); - setPolicyName(""); await getListofPolicies(selectedPartner.policyGroupName); } }; const onChangePolicyName = (fieldName, selectedValue) => { - setPolicyId(selectedValue); const selectedPolicy = policiesDropdownData.find(item => item.fieldValue === selectedValue); if (selectedPolicy) { setPolicyName(selectedPolicy.fieldCode); + setPolicyId(selectedValue); } }; @@ -232,7 +222,7 @@ function RequestPolicy() { )}
- moveToHome()} className="mt-[1%] cursor-pointer" /> + moveToPolicies(navigate)} className="mt-[1%] cursor-pointer" />

{t('requestPolicy.requestPolicy')}

@@ -289,8 +279,7 @@ function RequestPolicy() { onDropDownChangeEvent={onChangePolicyName} fieldNameKey='requestPolicy.policyName*' placeHolderKey='requestPolicy.selectPolicyName' - selectedDropdownValue={policyName} - searchKey='commons.search' + searchKey='commons.search' styleSet={styleForSearch}>
diff --git a/pmp-reactjs-ui/src/pages/policies/RequestPolicyConfirmation.js b/pmp-reactjs-ui/src/pages/policies/RequestPolicyConfirmation.js index ec52981dd..340374078 100644 --- a/pmp-reactjs-ui/src/pages/policies/RequestPolicyConfirmation.js +++ b/pmp-reactjs-ui/src/pages/policies/RequestPolicyConfirmation.js @@ -2,7 +2,7 @@ import React from 'react' import { useNavigate } from "react-router-dom"; import { useTranslation } from "react-i18next"; import { getUserProfile } from '../../services/UserProfileService'; -import { isLangRTL } from '../../utils/AppUtils'; +import { isLangRTL, moveToPolicies } from '../../utils/AppUtils'; import backArrow from '../../svg/back_arrow.svg'; import successIcon from '../../svg/success_message_icon.svg'; @@ -17,22 +17,18 @@ function RequestPolicyConfirmation() { navigate('/partnermanagement') }; - const moveToPolicies = () => { - navigate('/partnermanagement/policies') - }; - return (
- + moveToPolicies(navigate)} alt="" className="mt-[1%] cursor-pointer" />

{t('requestPolicy.requestPolicy')}

moveToHome()} className="font-semibold text-tory-blue text-xs cursor-pointer"> {t('commons.home')} /

-

moveToPolicies()} className="font-semibold text-tory-blue text-xs cursor-pointer"> +

moveToPolicies(navigate)} className="font-semibold text-tory-blue text-xs cursor-pointer"> {t('requestPolicy.policies')}

@@ -49,7 +45,7 @@ function RequestPolicyConfirmation() { {t('requestPolicy.policySuccessMsg')}

-