diff --git a/pmp-revamp-ui/public/i18n/ara.json b/pmp-revamp-ui/public/i18n/ara.json index 708611bc..75acfbd9 100644 --- a/pmp-revamp-ui/public/i18n/ara.json +++ b/pmp-revamp-ui/public/i18n/ara.json @@ -451,7 +451,8 @@ "selectModelName": "حدد اسم النموذج", "selectStatus": "حدد الحالة", "unexpectedError": "لقد واجهنا خطأ غير متوقع. يرجى المحاولة مرة أخرى.", - "searchDeviceId": "البحث عن معرف الجهاز" + "searchDeviceId": "البحث عن معرف الجهاز", + "selectDeviceId": "حدد معرف الجهاز" }, "deactivateDevicePopup": { "headerMsg": "هل تريد إلغاء تنشيط الجهاز", @@ -525,7 +526,8 @@ "searchModel": "نموذج البحث", "expired": "منتهي الصلاحية", "errorInFtmList": "أثناء جلب تفاصيل شريحة FTM، واجهنا خطأً.", - "ftmId": "معرف FTM" + "ftmId": "معرف FTM", + "selectFtmId": "حدد معرف FTM" }, "addFtm": { "addFtmChipDetails": "إضافة تفاصيل شريحة FTM", @@ -846,7 +848,8 @@ "policyId": "معرف السياسة", "policyName": "اسم السياسة", "organisation": "اسم المنظمة", - "policyGroup": "مجموعة السياسات" + "policyGroup": "مجموعة السياسات", + "partnerStatus": "حالة الشريك" }, "deactivatePolicyPopup": { "headerMsg": "هل تريد تعطيل السياسة", diff --git a/pmp-revamp-ui/public/i18n/eng.json b/pmp-revamp-ui/public/i18n/eng.json index 92ab1ac7..7d38e7be 100644 --- a/pmp-revamp-ui/public/i18n/eng.json +++ b/pmp-revamp-ui/public/i18n/eng.json @@ -446,7 +446,8 @@ "selectModelName": "Select Model Name", "selectStatus": "Select Status", "unexpectedError": "We have encountered with an unexpected error. Please try again.", - "searchDeviceId": "Search Device Id" + "searchDeviceId": "Search Device Id", + "selectDeviceId": "Select Device ID" }, "deactivateDevicePopup": { "headerMsg": "Do you want to deactivate Device ", @@ -520,7 +521,8 @@ "searchModel": "Search Model", "expired": "Expired", "errorInFtmList": "While fetching FTM chip details, we have encountered with an error.", - "ftmId": "FTM ID" + "ftmId": "FTM ID", + "selectFtmId": "Select FTM ID" }, "addFtm": { "addFtmChipDetails": "Add FTM Chip details", @@ -841,7 +843,8 @@ "policyId": "Policy ID", "policyName": "Policy Name", "organisation": "Organisation Name", - "policyGroup": "Policy Group" + "policyGroup": "Policy Group", + "partnerStatus": "Partner Status" }, "deactivatePolicyPopup": { "headerMsg": "Do you want to deactivate Policy", diff --git a/pmp-revamp-ui/public/i18n/fra.json b/pmp-revamp-ui/public/i18n/fra.json index 05d3db92..0a592660 100644 --- a/pmp-revamp-ui/public/i18n/fra.json +++ b/pmp-revamp-ui/public/i18n/fra.json @@ -451,7 +451,8 @@ "selectModelName": "Sélectionnez le nom du modèle", "selectStatus": "Sélectionnez le statut", "unexpectedError": "Nous avons rencontré une erreur inattendue. Veuillez réessayer.", - "searchDeviceId": "Rechercher l'ID de l'appareil" + "searchDeviceId": "Rechercher l'ID de l'appareil", + "selectDeviceId": "Sélectionner l'ID de l'appareil" }, "deactivateDevicePopup": { "headerMsg": "Voulez-vous désactiver l'appareil ", @@ -525,7 +526,8 @@ "searchModel": "Rechercher un modèle", "expired": "Expiré", "errorInFtmList": "Lors de la récupération des détails de la puce FTM, nous avons rencontré une erreur.", - "ftmId": "Identifiant FTM" + "ftmId": "Identifiant FTM", + "selectFtmId": "Sélectionnez l'ID FTM" }, "addFtm": { "addFtmChipDetails": "Ajouter les détails de la puce FTM", @@ -846,7 +848,8 @@ "policyId": "ID de stratégie", "policyName": "Nom de la Politique", "organisation": "Nom de l'organisation", - "policyGroup": "Groupe de politiques" + "policyGroup": "Groupe de politiques", + "partnerStatus": "Statut de partenaire" }, "deactivatePolicyPopup": { "headerMsg": "Voulez-vous désactiver la politique", diff --git a/pmp-revamp-ui/src/pages/admin/deviceProviderServices/AdminDeviceDetailsFilter.js b/pmp-revamp-ui/src/pages/admin/deviceProviderServices/AdminDeviceDetailsFilter.js index 29220931..403ecbf4 100644 --- a/pmp-revamp-ui/src/pages/admin/deviceProviderServices/AdminDeviceDetailsFilter.js +++ b/pmp-revamp-ui/src/pages/admin/deviceProviderServices/AdminDeviceDetailsFilter.js @@ -6,7 +6,7 @@ import { createDropdownData, fetchDeviceTypeDropdownData, fetchDeviceSubTypeDrop import { isLangRTL } from '../../../utils/AppUtils.js'; import { getUserProfile } from '../../../services/UserProfileService.js'; -function AdminDeviceDetailsFilter({ onApplyFilter, setErrorCode, setErrorMsg}) { +function AdminDeviceDetailsFilter({ onApplyFilter, setErrorCode, setErrorMsg, preFilledFilters}) { const { t } = useTranslation(); const [status, setStatus] = useState([]); const isLoginLanguageRTL = isLangRTL(getUserProfile().langCode); @@ -32,6 +32,11 @@ function AdminDeviceDetailsFilter({ onApplyFilter, setErrorCode, setErrorMsg}) { }); useEffect(() => { + if (preFilledFilters) { + const newFilters = { ...filters, ...preFilledFilters }; + setFilters(newFilters); + onApplyFilter(newFilters); + } const fetchData = async () => { const deviceTypeData = await fetchDeviceTypeDropdownData(); setDeviceTypeDropdownData(createDropdownData("fieldCode", "", true, deviceTypeData, t, t("addDevices.selectDeviceType"))); @@ -54,6 +59,10 @@ function AdminDeviceDetailsFilter({ onApplyFilter, setErrorCode, setErrorMsg}) { setDeviceSubTypeDropdownData([]) // return if no deviceType is selected if(selectedFilter === ""){ + setFilters((prevFilters) => ({ + ...prevFilters, + ['deviceSubType']: "", + })); return; } try { @@ -111,6 +120,7 @@ function AdminDeviceDetailsFilter({ onApplyFilter, setErrorCode, setErrorMsg}) { /> { + const params = new URLSearchParams(location.search); + const sbiId = params.get('sbiId'); + const sbiVersion = params.get('sbiVersion'); + + if (sbiId || sbiVersion) { + setExpandFilter(true); + setPreFilledFilters((prev) => ({ + ...prev, + sbiId: sbiId, + sbiVersion: sbiVersion, + })); + setApplyFilter(true); + setIsViewLinkedDevices(true); + } fetchDeviceDetails(); }, [sortFieldName, sortType, pageNo, pageSize]); @@ -229,7 +249,11 @@ function AdminDevicesList() { }; const viewDeviceDetails = (selectedDevice) => { - localStorage.setItem('selectedDeviceAttributes', JSON.stringify(selectedDevice)); + const requiredData = { + ...selectedDevice, + isViewLinkedDevices: isViewLinkedDevices + } + localStorage.setItem('selectedDeviceAttributes', JSON.stringify(requiredData)); navigate("/partnermanagement/admin/device-provider-services/view-device-details"); }; @@ -285,7 +309,12 @@ function AdminDevicesList() { />
{expandFilter && ( - + )} {!tableDataLoaded && } {tableDataLoaded && applyFilter && devicesList.length === 0 ? diff --git a/pmp-revamp-ui/src/pages/admin/deviceProviderServices/AdminSbiList.js b/pmp-revamp-ui/src/pages/admin/deviceProviderServices/AdminSbiList.js index 8321e6d8..77e28dbf 100644 --- a/pmp-revamp-ui/src/pages/admin/deviceProviderServices/AdminSbiList.js +++ b/pmp-revamp-ui/src/pages/admin/deviceProviderServices/AdminSbiList.js @@ -167,6 +167,12 @@ function AdminSbiList() { navigate("/partnermanagement/admin/device-provider-services/view-sbi-details"); }; + const showLinkedDevices = (selectedSbi) => { + if (selectedSbi.countOfAssociatedDevices > 0) { + navigate(`/partnermanagement/admin/device-provider-services/devices-list?sbiId=${selectedSbi.sbiId}&sbiVersion=${selectedSbi.sbiVersion}`); + } + }; + const approveRejectSbi = (selectedSbi) => { if (selectedSbi.status === 'pending_approval') { setShowSbiApproveRejectPopUp(true); @@ -325,7 +331,7 @@ function AdminSbiList() { -
0 ? 'cursor-pointer' : 'cursor-default'}`}> +
showLinkedDevices(sbi)} className={`flex items-center justify-center ${sbi.countOfAssociatedDevices > 0 ? 'cursor-pointer' : 'cursor-default'}`} tabIndex="0" onKeyDown={(e) => onPressEnterKey(e, () => showLinkedDevices(sbi))}>

{sbi.countOfAssociatedDevices}

diff --git a/pmp-revamp-ui/src/pages/admin/deviceProviderServices/ViewAdminDeviceDetails.js b/pmp-revamp-ui/src/pages/admin/deviceProviderServices/ViewAdminDeviceDetails.js index ba3fdcbf..1660df92 100644 --- a/pmp-revamp-ui/src/pages/admin/deviceProviderServices/ViewAdminDeviceDetails.js +++ b/pmp-revamp-ui/src/pages/admin/deviceProviderServices/ViewAdminDeviceDetails.js @@ -23,15 +23,23 @@ function ViewAdminDeviceDetails() { setDeviceDetails(selectedDevice); }, []); + const backToDevicesList = () => { + if(deviceDetails.isViewLinkedDevices) { + return `/partnermanagement/admin/device-provider-services/devices-list?sbiId=${deviceDetails.sbiId}&sbiVersion=${deviceDetails.sbiVersion}`; + } else { + return '/partnermanagement/admin/device-provider-services/devices-list'; + } + } + const moveToDevicesList = () => { - navigate('/partnermanagement/admin/device-provider-services/devices-list'); + navigate(backToDevicesList()); }; return (
- + <Title title={'viewDeviceDetails.viewDeviceDetails'} subTitle='devicesList.listOfDevices' backLink={backToDevicesList()}/> </div> {unexpectedError && ( diff --git a/pmp-revamp-ui/src/pages/admin/deviceProviderServices/ViewAdminSbiDetails.js b/pmp-revamp-ui/src/pages/admin/deviceProviderServices/ViewAdminSbiDetails.js index e6199b55..82110791 100644 --- a/pmp-revamp-ui/src/pages/admin/deviceProviderServices/ViewAdminSbiDetails.js +++ b/pmp-revamp-ui/src/pages/admin/deviceProviderServices/ViewAdminSbiDetails.js @@ -27,6 +27,12 @@ function ViewAdminSbiDetails() { navigate('/partnermanagement/admin/device-provider-services/sbi-list'); }; + const showLinkedDevices = () => { + if (sbiDetails.countOfAssociatedDevices > 0) { + navigate(`/partnermanagement/admin/device-provider-services/devices-list?sbiId=${sbiDetails.sbiId}&sbiVersion=${sbiDetails.sbiVersion}`); + } + }; + return ( <div className={`mt-2 w-[100%] ${isLoginLanguageRTL ? "mr-28 ml-5" : "ml-28 mr-5"} font-inter relative`}> <div className={`flex-col mt-4 bg-anti-flash-white h-full font-inter break-words max-[450px]:text-sm mb-[2%]`}> @@ -100,7 +106,7 @@ function ViewAdminSbiDetails() { <p className="font-[600] text-suva-gray text-sm"> {t("sbiList.linkedDevices")} </p> - <p className="font-[600] text-vulcan text-md"> + <p className={`font-[600] text-vulcan text-md ${sbiDetails.countOfAssociatedDevices > 0 && 'cursor-pointer'}`} onClick={() => showLinkedDevices()}> {sbiDetails.countOfAssociatedDevices} </p> </div> diff --git a/pmp-revamp-ui/src/pages/admin/policyRequests/ViewPolicyRequestDetails.js b/pmp-revamp-ui/src/pages/admin/policyRequests/ViewPolicyRequestDetails.js index f79a38f5..e871df58 100644 --- a/pmp-revamp-ui/src/pages/admin/policyRequests/ViewPolicyRequestDetails.js +++ b/pmp-revamp-ui/src/pages/admin/policyRequests/ViewPolicyRequestDetails.js @@ -6,6 +6,7 @@ import { useNavigate } from 'react-router-dom'; import Title from '../../common/Title'; import adminImage from "../../../svg/admin.png"; import partnerImage from "../../../svg/partner.png"; +import dotImg from "../../../svg/dot.svg"; function ViewPolicyRequestDetails() { const { t } = useTranslation(); @@ -80,6 +81,7 @@ function ViewPolicyRequestDetails() { </div> <div className={`flex flex-wrap pt-3`}> <div className={`w-[50%] max-[600px]:w-[100%] mb-3 ${isLoginLanguageRTL ? "pl-[1%]" : "pr-[1%]"}`}> + <p className="font-[600] text-suva-gray text-sm"> {t("viewPolicyRequest.policyId")} </p> @@ -87,7 +89,7 @@ function ViewPolicyRequestDetails() { {policyRequestDetails.policyId} </p> </div> - <div className={`w-[50%] max-[600px]:w-[100%] px-2`}> + <div className={`w-[50%] max-[600px]:w-[100%] mb-3 px-2`}> <p className="font-[600] text-suva-gray text-sm"> {t("viewPolicyRequest.policyName")} </p> @@ -95,7 +97,9 @@ function ViewPolicyRequestDetails() { {policyRequestDetails.policyName} </p> </div> - <div className={`w-[49%] max-[600px]:w-[100%] my-3 ${isLoginLanguageRTL ? "ml[1%]" : "mr-[1%]"}`}> + </div> + <div className="flex flex-wrap py-1 max-[450px]:flex-col"> + <div className={`mb-3 w-[50%] max-[600px]:w-[100%]`}> <p className="font-[600] text-suva-gray text-sm"> {t("viewPolicyRequest.policyGroup")} </p> @@ -103,6 +107,15 @@ function ViewPolicyRequestDetails() { {policyRequestDetails.policyGroupName} </p> </div> + <div className={`w-[50%] max-[600px]:w-[100%] mb-3 px-2`}> + <p className="font-[600] text-suva-gray text-sm"> + {t("viewPolicyRequest.partnerStatus")} + </p> + <p className={`flex w-fit py-1 px-3 text-sm rounded-md my-1 font-semibold ${bgOfStatus(policyRequestDetails.partnerStatus)} text-md`}> + <img src={dotImg} alt="" /> + <span className={`${isLoginLanguageRTL ? 'pr-2' : 'pl-2'}`}>{getStatusCode(policyRequestDetails.partnerStatus, t)}</span> + </p> + </div> </div> <hr className="h-px mt-3 w-full bg-gray-200 border-0" /> <div className="py-3"> diff --git a/pmp-revamp-ui/src/svg/dot.svg b/pmp-revamp-ui/src/svg/dot.svg new file mode 100644 index 00000000..edf6b5d6 --- /dev/null +++ b/pmp-revamp-ui/src/svg/dot.svg @@ -0,0 +1,13 @@ +<svg height="5px" width="5px" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" + viewBox="0 0 31.955 31.955" xml:space="preserve"> + <g> + <path style="fill:#030104;" d="M27.25,4.655C20.996-1.571,10.88-1.546,4.656,4.706C-1.571,10.96-1.548,21.076,4.705,27.3 + c6.256,6.226,16.374,6.203,22.597-0.051C33.526,20.995,33.505,10.878,27.25,4.655z"/> + <path style="fill:#030104;" d="M13.288,23.896l-1.768,5.207c2.567,0.829,5.331,0.886,7.926,0.17l-0.665-5.416 + C17.01,24.487,15.067,24.5,13.288,23.896z M8.12,13.122l-5.645-0.859c-0.741,2.666-0.666,5.514,0.225,8.143l5.491-1.375 + C7.452,17.138,7.426,15.029,8.12,13.122z M28.763,11.333l-4.965,1.675c0.798,2.106,0.716,4.468-0.247,6.522l5.351,0.672 + C29.827,17.319,29.78,14.193,28.763,11.333z M11.394,2.883l1.018,5.528c2.027-0.954,4.356-1.05,6.442-0.288l1.583-5.137 + C17.523,1.94,14.328,1.906,11.394,2.883z"/> + <circle style="fill:#030104;" cx="15.979" cy="15.977" r="6.117"/> + </g> +</svg> \ No newline at end of file