Skip to content

Commit

Permalink
MOSIP-37718: Integrated with new approve reject endpoints (#1005)
Browse files Browse the repository at this point in the history
* MOSIP-37718: Integrated with new approve reject endpoints

Signed-off-by: Swetha K <[email protected]>

* MOSIP-37718: added new errorcodes

Signed-off-by: Swetha K <[email protected]>

* MOSIP-37718: Changes in view devices

Signed-off-by: Swetha K <[email protected]>

---------

Signed-off-by: Swetha K <[email protected]>
Co-authored-by: Swetha K <[email protected]>
  • Loading branch information
SwethaKrish4 and Swetha K authored Dec 9, 2024
1 parent 86dac65 commit 7c44441
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 27 deletions.
6 changes: 5 additions & 1 deletion pmp-revamp-ui/public/i18n/ara.json
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,8 @@
},
"deactivateDevicePopup": {
"headerMsg": "هل تريد إلغاء تنشيط الجهاز",
"description": "عند النقر فوق تأكيد، سيتم إلغاء تنشيط تفاصيل جهازك"
"description": "عند النقر فوق تأكيد، سيتم إلغاء تنشيط تفاصيل جهازك",
"descriptionForAdmin": "عند النقر فوق تأكيد، سيتم إلغاء تنشيط الجهاز المحدد."
},
"addDevices": {
"addDevices": "إضافة أجهزة",
Expand Down Expand Up @@ -485,6 +486,7 @@
"deactivateSbi": {
"headerMsg": "هل تريد إلغاء تنشيط إصدار SBI ",
"description": "عند النقر فوق تأكيد، سيتم إلغاء تنشيط تفاصيل SBI الخاصة بك والأجهزة المعتمدة المعينة لها. سيتم رفض الأجهزة المعلقة للموافقة تلقائيًا.",
"descriptionForAdmin": "عند النقر فوق ، سيتم إلغاء تنشيط تفاصيل SBI والأجهزة المعتمدة المرتبطة بها. سيتم رفض الأجهزة المعلقة للموافقة تلقائيًا.",
"deactivateApprovedDevicesPlural": " {{devicesCount}} سيتم إلغاء تنشيط الأجهزة المعتمدة المرتبطة بهذا SBI ",
"deactivateApprovedDevicesSingular": "{{devicesCount}} سيتم إلغاء تنشيط الجهاز المعتمد المرتبط بهذا SBI ",
"deactivatePendingDevicesPlural": " {{devicesCount}} سيتم رفض الأجهزة التي تنتظر الموافقة تلقائيًا",
Expand Down Expand Up @@ -1125,6 +1127,8 @@
"PMS_DEVICE_ERROR_021": "انتهت صلاحية SBI التي تمت إضافة الجهاز إليها",
"PMS_DEVICE_ERROR_022": "الهيئة الفرعية للتنفيذ المحددة ليست في حالة معتمدة",
"PMS_DEVICE_ERROR_023": "الجهاز المحدد ليس في حالة معتمدة.",
"PMS_DEVICE_ERROR_024": "لا يمكن الموافقة على هذا الجهاز لأنه لا يوجد لديه أي SBI مرتبط به.",
"PMS_DEVICE_ERROR_025": "لا يمكن رفض هذا الجهاز لأنه لا يوجد لديه أي SBI مرتبط به.",
"PMS_SF_ERROR_001": "حدث خطأ أثناء جلب قائمة الأجهزة لـ SBI.",
"PMS_SBI_ERROR_001": "غير قادر على جلب تفاصيل الهيئة الفرعية للتنفيذ.",
"PMS_REQUEST_ERROR_001": "طلب غير صالح.",
Expand Down
6 changes: 5 additions & 1 deletion pmp-revamp-ui/public/i18n/eng.json
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,8 @@
},
"deactivateDevicePopup": {
"headerMsg": "Do you want to deactivate Device ",
"description": "On clicking Confirm, your device details will be deactivated."
"description": "On clicking Confirm, your device details will be deactivated.",
"descriptionForAdmin": "On clicking Confirm, the selected device will be deactivated."
},
"addDevices": {
"addDevices": "Add Devices",
Expand Down Expand Up @@ -480,6 +481,7 @@
"deactivateSbi": {
"headerMsg": "Do you want to deactivate SBI Version ",
"description": "On clicking Confirm, your SBI details and the approved devices mapped to it will be deactivated. Pending for approval devices will be auto- rejected.",
"descriptionForAdmin": "On clicking Confirm, the SBI details and the approved devices mapped to it will be deactivated. Pending for approval devices will be auto- rejected.",
"deactivateApprovedDevicesPlural": " {{devicesCount}} approved devices associated to this SBI will be deactivated ",
"deactivateApprovedDevicesSingular": "{{devicesCount}} approved device associated to this SBI will be deactivated ",
"deactivatePendingDevicesPlural": " {{devicesCount}} devices pending for approval will be auto-rejected",
Expand Down Expand Up @@ -1121,6 +1123,8 @@
"PMS_DEVICE_ERROR_021": "SBI for which device is being added is expired",
"PMS_DEVICE_ERROR_022": "The selected SBI is not in an approved status.",
"PMS_DEVICE_ERROR_023": "The selected Device is not in an approved status.",
"PMS_DEVICE_ERROR_024": "This device cannot be approved as it does not have any SBI associated to it.",
"PMS_DEVICE_ERROR_025": "This device cannot be rejected as it does not have any SBI associated to it.",
"PMS_SF_ERROR_001": "Error while fetching devices list for SBI.",
"PMS_SBI_ERROR_001": "Unable to fetch SBI details.",
"PMS_REQUEST_ERROR_001": "Invalid request.",
Expand Down
6 changes: 5 additions & 1 deletion pmp-revamp-ui/public/i18n/fra.json
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,8 @@
},
"deactivateDevicePopup": {
"headerMsg": "Voulez-vous désactiver l'appareil ",
"description": "En cliquant sur Confirmer, les détails de votre appareil seront désactivés."
"description": "En cliquant sur Confirmer, les détails de votre appareil seront désactivés.",
"descriptionForAdmin": "En cliquant sur Confirmer, l'appareil sélectionné sera désactivé."
},
"addDevices": {
"addDevices": "Ajouter des appareils",
Expand Down Expand Up @@ -485,6 +486,7 @@
"deactivateSbi": {
"headerMsg": "Voulez-vous désactiver la version SBI ",
"description": "En cliquant sur Confirmer, vos informations SBI et les appareils approuvés qui y sont associés seront désactivés. Les appareils en attente d'approbation seront automatiquement rejetés.",
"descriptionForAdmin": "En cliquant sur Confirmer, les détails SBI et les appareils approuvés qui y sont mappés seront désactivés. Les appareils en attente d'approbation seront automatiquement rejetés.",
"deactivateApprovedDevicesPlural": " {{devicesCount}} les appareils approuvés associés à ce SBI seront désactivés ",
"deactivateApprovedDevicesSingular": "{{devicesCount}} l'appareil approuvé associé à ce SBI sera désactivé ",
"deactivatePendingDevicesPlural": " {{devicesCount}} les appareils en attente d'approbation seront automatiquement rejetés",
Expand Down Expand Up @@ -1125,6 +1127,8 @@
"PMS_DEVICE_ERROR_021": "Le SBI pour lequel l'appareil est ajouté a expiré",
"PMS_DEVICE_ERROR_022": "Le SBI sélectionné n'est pas dans un statut approuvé",
"PMS_DEVICE_ERROR_023": "L'appareil sélectionné n'est pas dans un statut approuvé.",
"PMS_DEVICE_ERROR_024": "Cet appareil ne peut pas être approuvé car il n'a aucun SBI qui lui est associé.",
"PMS_DEVICE_ERROR_025": "Cet appareil ne peut pas être rejeté car aucun SBI ne lui est associé.",
"PMS_SF_ERROR_001": "Erreur lors de la récupération de la liste des appareils pour SBI.",
"PMS_SBI_ERROR_001": "Impossible de récupérer les détails SBI.",
"PMS_REQUEST_ERROR_001": "Requête invalide.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ function AdminDevicesList() {
<img src={deactivateIcon} alt="" className={`${isLoginLanguageRTL ? "pl-2" : "pr-2"}`}></img>
</div>
{showDeactivatePopup && (
<DeactivatePopup closePopUp={closeDeactivatePopup} onClickConfirm={(deactivationResponse) => onClickConfirmDeactivate(deactivationResponse, device)} popupData={{ ...device, isDeactivateDevice: true }} request={deactivateRequest} headerMsg='deactivateDevicePopup.headerMsg' descriptionMsg='deactivateDevicePopup.description' />
<DeactivatePopup closePopUp={closeDeactivatePopup} onClickConfirm={(deactivationResponse) => onClickConfirmDeactivate(deactivationResponse, device)} popupData={{ ...device, isDeactivateDevice: true }} request={deactivateRequest} headerMsg='deactivateDevicePopup.headerMsg' descriptionMsg='deactivateDevicePopup.descriptionForAdmin' />
)}
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ function AdminSbiList() {
<img src={deactivateIcon} alt="" className={`${isLoginLanguageRTL ? "pl-2" : "pr-2"}`}></img>
</div>
{showDeactivatePopup && (
<DeactivatePopup closePopUp={() => closeDeactivatePopup()} onClickConfirm={(deactivationResponse) => onClickConfirmDeactivate(deactivationResponse, sbi)} popupData={{ ...sbi, isDeactivateSbi: true }} request={deactivateRequest} headerMsg='deactivateSbi.headerMsg' descriptionMsg='deactivateSbi.description' headerKeyName={sbi.sbiVersion} />
<DeactivatePopup closePopUp={() => closeDeactivatePopup()} onClickConfirm={(deactivationResponse) => onClickConfirmDeactivate(deactivationResponse, sbi)} popupData={{ ...sbi, isDeactivateSbi: true }} request={deactivateRequest} headerMsg='deactivateSbi.headerMsg' descriptionMsg='deactivateSbi.descriptionForAdmin' headerKeyName={sbi.sbiVersion} />
)}
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ function DeviceProviderServiceTab ( {activeSbi, sbiListPath, activeDevice, devic
tabIndex="0" onKeyPress={(e) => onPressEnterKey(e, changeToSbi)}>
{t('deviceProviderServices.sbiDetails')}
</h6>
<div className={`h-1 w-24 ${activeSbi ? "bg-tory-blue" : "bg-transparent"} rounded-t-md`}></div>
<div className={`h-1 w-20 ${activeSbi ? "bg-tory-blue" : "bg-transparent"} rounded-t-md`}></div>
</div>
<div className={`flex-col justify-center`}>
<h6 id='devices_tab' onClick={changeToDevice}
className={`${activeDevice ? "text-[#1447b2]" : "text-[#031640]"} mb-[12%] cursor-pointer text-sm`}
className={`${activeDevice ? "text-[#1447b2]" : "text-[#031640]"} mb-[12%] ${isLoginLanguageRTL ? "mr-[10%]" : "ml-[10%]"} cursor-pointer text-sm`}
tabIndex="0" onKeyPress={(e) => onPressEnterKey(e, changeToDevice)}>
{t('deviceProviderServices.deviceDetails')}
</h6>
<div className={`h-1 w-24 ${activeDevice ? "bg-tory-blue" : "bg-transparent"} rounded-t-md`}></div>
<div className={`h-1 w-20 ${activeDevice ? "bg-tory-blue" : "bg-transparent"} rounded-t-md`}></div>
</div>
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function ViewAdminDeviceDetails() {
<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%]`}>
<div className="flex justify-between mb-3">
<Title title={'viewDeviceDetails.viewDeviceDetails'} subTitle='devicesList.listOfDevices' subTitle2='sbiList.listOfSbi' backLink='/partnermanagement/admin/device-provider-services/devices-list' backLink2='/partnermanagement/admin/device-provider-services/sbi-list'/>
<Title title={'viewDeviceDetails.viewDeviceDetails'} subTitle='devicesList.listOfDevices' backLink='/partnermanagement/admin/device-provider-services/devices-list'/>
</div>

{unexpectedError && (
Expand Down Expand Up @@ -71,7 +71,49 @@ function ViewAdminDeviceDetails() {
</div>
</div>
<div className={`${isLoginLanguageRTL ? "pr-8 ml-8" : "pl-8 mr-8"} pt-3 mb-2`}>
<div className="flex flex-wrap py-1 max-[450px]:flex-col">
<div className={`w-[48%] max-[600px]:w-[100%] mb-3 ${isLoginLanguageRTL ? "mr-1" : "ml-1"}`}>
<p className="text-suva-gray text-sm">
{t("sbiList.partnerId")}
</p>
<p className="text-vulcan text-md">
{deviceDetails.partnerId}
</p>
</div>
<div className={`mb-3 max-[600px]:w-[100%] w-[50%] ${isLoginLanguageRTL ? "mr-1" : "ml-1"}`}>
<p className="text-suva-gray text-sm">
{t("viewPolicyRequest.partnerType")}
</p>
<p className="text-vulcan text-md">
{t("partnerTypes.deviceProvider")}
</p>
</div>
<div className={`mb-3 max-[600px]:w-[100%] w-[48%] ${isLoginLanguageRTL ? "mr-1" : "ml-1"}`}>
<p className="text-suva-gray text-sm">
{t("sbiList.orgName")}
</p>
<p className="text-vulcan text-md">
{deviceDetails.orgName}
</p>
</div>
</div>
<div className="flex flex-wrap py-1 max-[450px]:flex-col">
<div className={`mb-5 max-[600px]:w-[100%] w-[48%] ${isLoginLanguageRTL ? "mr-1" : "ml-1"}`}>
<p className="text-suva-gray text-sm">
{t("sbiList.sbiId")}
</p>
<p className="text-vulcan text-md">
{deviceDetails.sbiId}
</p>
</div>
<div className={`mb-5 max-[600px]:w-[100%] w-[50%] ${isLoginLanguageRTL ? "mr-1" : "ml-1"}`}>
<p className="text-suva-gray text-sm">
{t("devicesList.deviceId")}
</p>
<p className="text-vulcan text-md">
{deviceDetails.deviceId}
</p>
</div>
<div className={`mb-5 max-[600px]:w-[100%] w-[48%] ${isLoginLanguageRTL ? "mr-1" : "ml-1"}`}>
<p className="text-suva-gray text-sm">
{t("devicesList.deviceType")}
Expand Down Expand Up @@ -104,14 +146,6 @@ function ViewAdminDeviceDetails() {
{deviceDetails.model}
</p>
</div>
<div className={`mb-5 max-[600px]:w-[100%] w-[50%] ${isLoginLanguageRTL ? "mr-1" : "ml-1"}`}>
<p className="text-suva-gray text-sm">
{t("devicesList.createdDate")}
</p>
<p className="text-vulcan text-md">
{formatDate(deviceDetails.createdDateTime, "date", false)}
</p>
</div>
</div>
</div>
<hr className="h-px w-full bg-gray-200 border-0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function ViewAdminSbiDetails() {
<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%]`}>
<div className="flex justify-between mb-3">
<Title title={'viewSbiDetails.viewSbiDetails'} subTitle='viewSbiDetails.listOfSbi' backLink='/partnermanagement/admin/device-provider-services/sbi-list' />
<Title title={'viewSbiDetails.viewSbiDetails'} subTitle='sbiList.listOfSbis' backLink='/partnermanagement/admin/device-provider-services/sbi-list' />
</div>

{unexpectedError && (
Expand Down
32 changes: 23 additions & 9 deletions pmp-revamp-ui/src/pages/common/ApproveRejectPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,30 @@ function ApproveRejectPopup({ popupData, closePopUp, approveRejectResponse, titl
);
}
if (popupData.isDeviceRequest) {
const request = createRequest({
id: popupData.deviceId,
approvalStatus: status === "approved" ? 'Activate' : 'De-activate'
});
response = await HttpService.patch(getPartnerManagerUrl(`/devicedetail`, process.env.NODE_ENV), request, {
headers: {
'Content-Type': 'application/json'
}
if (status === "approved") {
const request = createRequest({
partnerId: popupData.partnerId,
sbiId: popupData.sbiId,
deviceDetailId: popupData.deviceId
}, "mosip.pms.approve.mapping.device.to.sbi.post", true);
response = await HttpService.post(getPartnerManagerUrl(`/admin/approve-mapping-device-to-sbi`, process.env.NODE_ENV), request, {
headers: {
'Content-Type': 'application/json'
}
});

} else {
const request = createRequest({
partnerId: popupData.partnerId,
sbiId: popupData.sbiId,
deviceDetailId: popupData.deviceId
}, "mosip.pms.reject.mapping.device.to.sbi.post", true);
response = await HttpService.post(getPartnerManagerUrl(`/admin/reject-mapping-device-to-sbi`, process.env.NODE_ENV), request, {
headers: {
'Content-Type': 'application/json'
}
});
}
);
}
const responseData = response.data;
if (responseData && responseData.response) {
Expand Down

0 comments on commit 7c44441

Please sign in to comment.