diff --git a/pmp-revamp-ui/src/pages/admin/authenticationServices/AdminApiKeysList.js b/pmp-revamp-ui/src/pages/admin/authenticationServices/AdminApiKeysList.js index c7e0113b8..f2eafdf50 100644 --- a/pmp-revamp-ui/src/pages/admin/authenticationServices/AdminApiKeysList.js +++ b/pmp-revamp-ui/src/pages/admin/authenticationServices/AdminApiKeysList.js @@ -168,13 +168,13 @@ function AdminApiKeysList() { status: "De-Active" }); setDeactivateRequest(request); - setActionId(-1); setShowDeactivatePopup(true); document.body.style.overflow = "hidden"; } }; const closeDeactivatePopup = () => { + setActionId(-1); setShowDeactivatePopup(false); document.body.style.overflow = "auto"; }; @@ -183,7 +183,6 @@ function AdminApiKeysList() { if (deactivationResponse !== "") { setActionId(-1); setShowDeactivatePopup(false); - // Update the specific row in the state with the new status setApiKeysList((prevList) => prevList.map(apiKey => (apiKey.apiKeyLabel === selectedApiKey.apiKeyLabel && apiKey.policyId === selectedApiKey.policyId && apiKey.partnerId === selectedApiKey.partnerId) ? { ...apiKey, status: "deactivated" } : apiKey @@ -309,19 +308,19 @@ function AdminApiKeysList() {

{t("partnerList.deActivate")}

+ {showDeactivatePopup && ( + onClickConfirmDeactivate(deactivationResponse, apiKey)} + popupData={apiKey} + request={deactivateRequest} + headerMsg="adminDeactivateApiKey.title" + descriptionMsg="adminDeactivateApiKey.description" + headerKeyName={apiKey.apiKeyLabel} + /> + )} )} - {showDeactivatePopup && ( - onClickConfirmDeactivate(deactivationResponse, apiKey)} - popupData={apiKey} - request={deactivateRequest} - headerMsg="adminDeactivateApiKey.title" - descriptionMsg="adminDeactivateApiKey.description" - headerKeyName={apiKey.apiKeyLabel} - /> - )} diff --git a/pmp-revamp-ui/src/pages/admin/authenticationServices/AdminOidcClientsList.js b/pmp-revamp-ui/src/pages/admin/authenticationServices/AdminOidcClientsList.js index f62e5f8d2..8231afedc 100644 --- a/pmp-revamp-ui/src/pages/admin/authenticationServices/AdminOidcClientsList.js +++ b/pmp-revamp-ui/src/pages/admin/authenticationServices/AdminOidcClientsList.js @@ -197,7 +197,6 @@ function AdminOidcClientsList() { }); setDeactivateRequest(request); setShowDeactivatePopup(true); - setActionId(-1); document.body.style.overflow = "hidden"; } else { setErrorMsg(t('deactivateOidc.errorInOidcDetails')); @@ -209,7 +208,6 @@ function AdminOidcClientsList() { if (deactivationResponse && deactivationResponse.status === "INACTIVE") { setActionId(-1); setShowDeactivatePopup(false); - // Update the specific row in the state with the new status setOidcClientsList((prevList) => prevList.map(client => client.clientId === selectedClient.clientId ? { ...client, status: "INACTIVE" } : client @@ -219,6 +217,7 @@ function AdminOidcClientsList() { }; const closeDeactivatePopup = () => { + setActionId(-1); setShowDeactivatePopup(false); document.body.style.overflow = "auto"; }; @@ -352,11 +351,11 @@ function AdminOidcClientsList() {

{t("partnerList.deActivate")}

+ {showDeactivatePopup && ( + onClickConfirmDeactivate(deactivationResponse, client)} popupData={client} request={deactivateRequest} headerMsg='deactivateOidc.header' descriptionMsg='deactivateOidc.description' headerKeyName={client.clientNameEng} /> + )} )} - {showDeactivatePopup && ( - onClickConfirmDeactivate(deactivationResponse, client)} popupData={client} request={deactivateRequest} headerMsg='deactivateOidc.header' descriptionMsg='deactivateOidc.description' headerKeyName={client.clientNameEng} /> - )} diff --git a/pmp-revamp-ui/src/pages/admin/deviceProviderServices/AdminDevicesList.js b/pmp-revamp-ui/src/pages/admin/deviceProviderServices/AdminDevicesList.js index 06fc055b9..a7f6ec132 100644 --- a/pmp-revamp-ui/src/pages/admin/deviceProviderServices/AdminDevicesList.js +++ b/pmp-revamp-ui/src/pages/admin/deviceProviderServices/AdminDevicesList.js @@ -169,7 +169,6 @@ function AdminDevicesList({ title, subTitle, isLinkedDevicesList }) { const approveRejectDeviceDetails = (device) => { if (device.status === 'pending_approval') { - setActionId(-1); setShowDeviceDetailApproveRejectPopup(true); document.body.style.overflow = "hidden"; } @@ -177,8 +176,8 @@ function AdminDevicesList({ title, subTitle, isLinkedDevicesList }) { const onClickApproveReject = (responseData, status, selectedDevice) => { if (responseData) { + setActionId(-1); setShowDeviceDetailApproveRejectPopup(false); - // Update the specific row in the state with the new status setDevicesList((prevList) => prevList.map(deviceItem => deviceItem.deviceId === selectedDevice.deviceId ? { ...deviceItem, status: getApproveRejectStatus(status), isActive: updateActiveState(status) } : deviceItem @@ -189,6 +188,7 @@ function AdminDevicesList({ title, subTitle, isLinkedDevicesList }) { }; const closeApproveRejectPopup = () => { + setActionId(-1); setShowDeviceDetailApproveRejectPopup(false); document.body.style.overflow = "auto"; }; @@ -199,7 +199,6 @@ function AdminDevicesList({ title, subTitle, isLinkedDevicesList }) { status: "De-Activate", }, "mosip.pms.deactivate.device.patch", true); setDeactivateRequest(request); - setActionId(-1); setShowDeactivatePopup(true); document.body.style.overflow = "hidden"; } @@ -219,6 +218,7 @@ function AdminDevicesList({ title, subTitle, isLinkedDevicesList }) { }; const closeDeactivatePopup = () => { + setActionId(-1); setShowDeactivatePopup(false); document.body.style.overflow = "auto"; }; @@ -285,10 +285,10 @@ function AdminDevicesList({ title, subTitle, isLinkedDevicesList }) { )}
- + <Title title={title} backLink='/partnermanagement' /> </div> <DeviceProviderServicesTab - activeSbi={isLinkedDevicesList ? true: false} + activeSbi={isLinkedDevicesList ? true : false} sbiListPath='/partnermanagement/admin/device-provider-services/sbi-list' activeDevice={isLinkedDevicesList ? false : true} devicesListPath='/partnermanagement/admin/device-provider-services/devices-list' @@ -379,6 +379,16 @@ function AdminDevicesList({ title, subTitle, isLinkedDevicesList }) { <p id="device_list_approve_reject_option" className={`py-1.5 px-4 ${device.status === 'pending_approval' ? 'text-[#3E3E3E] cursor-pointer' : 'text-[#A5A5A5] cursor-default'} ${isLoginLanguageRTL ? "pl-10" : "pr-10"}`}>{t("approveRejectPopup.approveReject")}</p> <img src={device.status === 'pending_approval' ? approveRejectIcon : disabledApproveRejectIcon} alt="" className={`${isLoginLanguageRTL ? "pl-2" : "pr-2"}`} /> </div> + {showDeviceDetailApproveRejectPopup && ( + <ApproveRejectPopup + popupData={{ ...device, isDeviceRequest: true }} + closePopUp={closeApproveRejectPopup} + approveRejectResponse={(responseData, status) => onClickApproveReject(responseData, status, device)} + title={`${device.make} | ${device.model}`} + header={t('deviceApproveRejectPopup.header')} + description={t('deviceApproveRejectPopup.description')} + /> + )} <hr className="h-px bg-gray-100 border-0 mx-1" /> <div role='button' className="flex justify-between hover:bg-gray-100" onClick={() => viewDeviceDetails(device)} tabIndex="0" onKeyDown={(e) => onPressEnterKey(e, () => viewDeviceDetails(device))}> <p id="device_list_view_option" className={`py-1.5 px-4 cursor-pointer text-[#3E3E3E] ${isLoginLanguageRTL ? "pl-10" : "pr-10"}`}>{t("partnerList.view")}</p> @@ -389,21 +399,11 @@ function AdminDevicesList({ title, subTitle, isLinkedDevicesList }) { <p id="device_list_deactivate_option" className={`py-1.5 px-4 ${isLoginLanguageRTL ? "pl-10" : "pr-10"} ${device.status === 'approved' ? "text-[#3E3E3E]" : "text-[#A5A5A5]"}`}>{t("partnerList.deActivate")}</p> <img src={device.status === 'approved' ? deactivateIcon : disableDeactivateIcon} alt="" className={`${isLoginLanguageRTL ? "pl-2" : "pr-2"}`} /> </div> + {showDeactivatePopup && ( + <DeactivatePopup closePopUp={closeDeactivatePopup} onClickConfirm={(deactivationResponse) => onClickConfirmDeactivate(deactivationResponse, device)} popupData={{ ...device, isDeactivateDevice: true }} request={deactivateRequest} headerMsg='deactivateDevicePopup.headerMsg' descriptionMsg='deactivateDevicePopup.descriptionForAdmin' /> + )} </div> )} - {showDeviceDetailApproveRejectPopup && ( - <ApproveRejectPopup - popupData={{ ...device, isDeviceRequest: true }} - closePopUp={closeApproveRejectPopup} - approveRejectResponse={(responseData, status) => onClickApproveReject(responseData, status, device)} - title={`${device.make} | ${device.model}`} - header={t('deviceApproveRejectPopup.header')} - description={t('deviceApproveRejectPopup.description')} - /> - )} - {showDeactivatePopup && ( - <DeactivatePopup closePopUp={closeDeactivatePopup} onClickConfirm={(deactivationResponse) => onClickConfirmDeactivate(deactivationResponse, device)} popupData={{ ...device, isDeactivateDevice: true }} request={deactivateRequest} headerMsg='deactivateDevicePopup.headerMsg' descriptionMsg='deactivateDevicePopup.descriptionForAdmin' /> - )} </div> </td> </tr> diff --git a/pmp-revamp-ui/src/pages/admin/deviceProviderServices/AdminSbiList.js b/pmp-revamp-ui/src/pages/admin/deviceProviderServices/AdminSbiList.js index 26d676c36..e150a5dbc 100644 --- a/pmp-revamp-ui/src/pages/admin/deviceProviderServices/AdminSbiList.js +++ b/pmp-revamp-ui/src/pages/admin/deviceProviderServices/AdminSbiList.js @@ -178,7 +178,6 @@ function AdminSbiList() { const approveRejectSbi = (selectedSbi) => { if (selectedSbi.status === 'pending_approval') { - setActionId(-1); setShowSbiApproveRejectPopUp(true); document.body.style.overflow = "hidden"; } @@ -187,7 +186,7 @@ function AdminSbiList() { const onClickApproveReject = (responseData, status, selectedSbi) => { if (responseData) { setShowSbiApproveRejectPopUp(false); - // Update the specific row in the state with the new status + setActionId(-1); setSbiList((prevList) => prevList.map(sbi => sbi.sbiId === selectedSbi.sbiId ? { ...sbi, status: getApproveRejectStatus(status), isActive: updateActiveState(status) } : sbi @@ -199,6 +198,7 @@ function AdminSbiList() { const closeApproveRejectPopup = () => { setShowSbiApproveRejectPopUp(false); + setActionId(-1); document.body.style.overflow = "auto"; }; @@ -229,6 +229,7 @@ function AdminSbiList() { const closeDeactivatePopup = () => { setShowDeactivatePopup(false); + setActionId(-1); document.body.style.overflow = "auto"; }; @@ -351,6 +352,16 @@ function AdminSbiList() { <p id="ftm_list_approve_reject_option" className={`py-1.5 px-4 ${sbi.status === 'pending_approval' ? 'text-[#3E3E3E] cursor-pointer' : 'text-[#A5A5A5] cursor-default'} ${isLoginLanguageRTL ? "pl-10" : "pr-10"}`}>{t("approveRejectPopup.approveReject")}</p> <img src={sbi.status === 'pending_approval' ? approveRejectIcon : disabledApproveRejectIcon} alt="" className={`${isLoginLanguageRTL ? "pl-2" : "pr-2"}`} /> </div> + {showSbiApproveRejectPopUp && ( + <ApproveRejectPopup + popupData={{ ...sbi, isSbiRequest: true }} + closePopUp={closeApproveRejectPopup} + approveRejectResponse={(responseData, status) => onClickApproveReject(responseData, status, sbi)} + title={sbi.sbiVersion} + header={t('sbiApproveRejectPopup.header')} + description={t('sbiApproveRejectPopup.description')} + /> + )} <hr className="h-px bg-gray-100 border-0 mx-1" /> <div role='button' className="flex justify-between hover:bg-gray-100" onClick={() => viewSbiDetails(sbi)} tabIndex="0" onKeyDown={(e) => onPressEnterKey(e, () => viewSbiDetails(sbi))}> <p id="sbi_list_view_btn" className={`py-1.5 px-4 cursor-pointer text-[#3E3E3E] ${isLoginLanguageRTL ? "pl-10" : "pr-10"}`}>{t("partnerList.view")}</p> @@ -361,21 +372,11 @@ function AdminSbiList() { <p id="sbi_list_deactivate_btn" className={`py-1.5 px-4 ${isLoginLanguageRTL ? "pl-10" : "pr-10"} ${sbi.status === 'approved' ? "text-[#3E3E3E]" : "text-[#A5A5A5]"}`}>{t("partnerList.deActivate")}</p> <img src={sbi.status === 'approved' ? deactivateIcon : disableDeactivateIcon} alt="" className={`${isLoginLanguageRTL ? "pl-2" : "pr-2"}`} /> </div> + {showDeactivatePopup && ( + <DeactivatePopup closePopUp={() => closeDeactivatePopup()} onClickConfirm={(deactivationResponse) => onClickConfirmDeactivate(deactivationResponse, sbi)} popupData={{ ...sbi, isDeactivateSbi: true }} request={deactivateRequest} headerMsg='deactivateSbi.headerMsg' descriptionMsg='deactivateSbi.descriptionForAdmin' headerKeyName={sbi.sbiVersion} /> + )} </div> )} - {showSbiApproveRejectPopUp && ( - <ApproveRejectPopup - popupData={{ ...sbi, isSbiRequest: true }} - closePopUp={closeApproveRejectPopup} - approveRejectResponse={(responseData, status) => onClickApproveReject(responseData, status, sbi)} - title={sbi.sbiVersion} - header={t('sbiApproveRejectPopup.header')} - description={t('sbiApproveRejectPopup.description')} - /> - )} - {showDeactivatePopup && ( - <DeactivatePopup closePopUp={() => closeDeactivatePopup()} onClickConfirm={(deactivationResponse) => onClickConfirmDeactivate(deactivationResponse, sbi)} popupData={{ ...sbi, isDeactivateSbi: true }} request={deactivateRequest} headerMsg='deactivateSbi.headerMsg' descriptionMsg='deactivateSbi.descriptionForAdmin' headerKeyName={sbi.sbiVersion} /> - )} </div> </td> </tr> diff --git a/pmp-revamp-ui/src/pages/admin/ftmProviderServices/AdminFtmList.js b/pmp-revamp-ui/src/pages/admin/ftmProviderServices/AdminFtmList.js index 44b7e2731..d4b6a8720 100644 --- a/pmp-revamp-ui/src/pages/admin/ftmProviderServices/AdminFtmList.js +++ b/pmp-revamp-ui/src/pages/admin/ftmProviderServices/AdminFtmList.js @@ -148,7 +148,6 @@ function AdminFtmList() { const approveRejectFtmDetails = (ftm) => { if (ftm.status === 'pending_approval') { - setActionId(-1); setShowFtmApproveRejectPopup(true); document.body.style.overflow = "hidden"; } @@ -157,6 +156,7 @@ function AdminFtmList() { const onClickApproveReject = (responseData, status, selectedFtm) => { if (responseData) { setShowFtmApproveRejectPopup(false); + setActionId(-1); // Update the specific row in the state with the new status setFtmList((prevList) => prevList.map(ftm => @@ -168,6 +168,7 @@ function AdminFtmList() { }; const closeApproveRejectPopup = () => { + setActionId(-1); setShowFtmApproveRejectPopup(false); document.body.style.overflow = "auto"; }; @@ -187,6 +188,7 @@ function AdminFtmList() { const onClickConfirmDeactivate = (deactivationResponse, selectedFtm) => { if (deactivationResponse && !deactivationResponse.isActive) { setShowDeactivatePopup(false); + setActionId(-1); // Update the specific row in the state with the new status setFtmList((prevList) => prevList.map(ftm => @@ -197,6 +199,7 @@ function AdminFtmList() { }; const closeDeactivatePopup = () => { + setActionId(-1); setShowDeactivatePopup(false); document.body.style.overflow = "auto"; }; @@ -322,6 +325,16 @@ function AdminFtmList() { <p id="ftm_list_approve_reject_option" className={`py-1.5 px-4 ${ftm.status === 'pending_approval' ? 'text-[#3E3E3E] cursor-pointer' : 'text-[#A5A5A5] cursor-default'} ${isLoginLanguageRTL ? "pl-10" : "pr-10"}`}>{t("approveRejectPopup.approveReject")}</p> <img src={ftm.status === 'pending_approval' ? approveRejectIcon : disabledApproveRejectIcon} alt="" className={`${isLoginLanguageRTL ? "pl-2" : "pr-2"}`} /> </div> + {showFtmApproveRejectPopup && + <ApproveRejectPopup + popupData={{ ...ftm, isFtmRequest: true }} + closePopUp={closeApproveRejectPopup} + approveRejectResponse={(responseData, status) => onClickApproveReject(responseData, status, ftm)} + title={`${ftm.make} | ${ftm.model}`} + header={t('ftmRequestApproveRejectPopup.header', { make: ftm.make, model: ftm.model })} + description={t('ftmRequestApproveRejectPopup.description')} + /> + } <hr className="h-px bg-gray-100 border-0 mx-1" /> <div role='button' className="flex justify-between hover:bg-gray-100" onClick={() => viewFtmChipDetails(ftm)} tabIndex="0" onKeyDown={(e) => onPressEnterKey(e, () => viewFtmChipDetails(ftm))}> <p id="ftm_list_view_option" className={`py-1.5 px-4 cursor-pointer text-[#3E3E3E] ${isLoginLanguageRTL ? "pl-10" : "pr-10"}`}>{t("partnerList.view")}</p> @@ -332,21 +345,11 @@ function AdminFtmList() { <p id="ftm_list_deactivate_option" className={`py-1.5 px-4 ${isLoginLanguageRTL ? "pl-10" : "pr-10"} ${ftm.status === 'approved' ? "text-[#3E3E3E]" : "text-[#A5A5A5]"}`}>{t("partnerList.deActivate")}</p> <img src={ftm.status === 'approved' ? deactivateIcon : disableDeactivateIcon} alt="" className={`${isLoginLanguageRTL ? "pl-2" : "pr-2"}`} /> </div> + {showDeactivatePopup && ( + <DeactivatePopup closePopUp={closeDeactivatePopup} onClickConfirm={(deactivationResponse) => onClickConfirmDeactivate(deactivationResponse, ftm)} popupData={{ ...ftm, isDeactivateFtm: true }} request={deactivateRequest} headerMsg='deactivateFtmPopup.headerMsg' descriptionMsg='deactivateFtmPopup.description' /> + )} </div> )} - {showFtmApproveRejectPopup && - <ApproveRejectPopup - popupData={{ ...ftm, isFtmRequest: true }} - closePopUp={closeApproveRejectPopup} - approveRejectResponse={(responseData, status) => onClickApproveReject(responseData, status, ftm)} - title={`${ftm.make} | ${ftm.model}`} - header={t('ftmRequestApproveRejectPopup.header', { make: ftm.make, model: ftm.model })} - description={t('ftmRequestApproveRejectPopup.description')} - /> - } - {showDeactivatePopup && ( - <DeactivatePopup closePopUp={closeDeactivatePopup} onClickConfirm={(deactivationResponse) => onClickConfirmDeactivate(deactivationResponse, ftm)} popupData={{ ...ftm, isDeactivateFtm: true }} request={deactivateRequest} headerMsg='deactivateFtmPopup.headerMsg' descriptionMsg='deactivateFtmPopup.description' /> - )} </div> </td> </tr> diff --git a/pmp-revamp-ui/src/pages/admin/partners/PartnersList.js b/pmp-revamp-ui/src/pages/admin/partners/PartnersList.js index df2c48e99..95757d75b 100644 --- a/pmp-revamp-ui/src/pages/admin/partners/PartnersList.js +++ b/pmp-revamp-ui/src/pages/admin/partners/PartnersList.js @@ -190,7 +190,6 @@ function PartnersList() { }); setDeactivateRequest(request); setShowDeactivatePopup(true); - setViewPartnersId(-1); document.body.style.overflow = "hidden"; } }; @@ -338,19 +337,19 @@ function PartnersList() { <p id="partner_deactive_btn" className={`py-1.5 px-4 ${isLoginLanguageRTL ? "pl-10" : "pr-10"} ${partner.isActive === true ? "text-[#3E3E3E]" : "text-[#A5A5A5]"}`}>{t("partnerList.deActivate")}</p> <img src={partner.isActive === true ? deactivateIcon : disableDeactivateIcon} alt="" className={`${isLoginLanguageRTL ? "pl-2" : "pr-2"}`} /> </div> + {showDeactivatePopup && ( + < DeactivatePopup + onClickConfirm={(deactivationResponse) => onClickConfirmDeactivate(deactivationResponse, partner)} + closePopUp={closeDeactivatePopup} + popupData={{ ...partner, isDeactivatePartner: true }} + request={deactivateRequest} + headerMsg={t('deactivatePartner.headerMsg', { partnerId: partner.partnerId, organisationName: partner.orgName })} + descriptionMsg='deactivatePartner.description' + headerKeyName={partner.orgName} + /> + )} </div> )} - {showDeactivatePopup && ( - < DeactivatePopup - onClickConfirm={(deactivationResponse) => onClickConfirmDeactivate(deactivationResponse, partner)} - closePopUp={closeDeactivatePopup} - popupData={{ ...partner, isDeactivatePartner: true }} - request={deactivateRequest} - headerMsg={t('deactivatePartner.headerMsg', { partnerId: partner.partnerId, organisationName: partner.orgName })} - descriptionMsg='deactivatePartner.description' - headerKeyName={partner.orgName} - /> - )} </div> </td> </tr> diff --git a/pmp-revamp-ui/src/pages/admin/policyManager/ClonePolicyPopup.js b/pmp-revamp-ui/src/pages/admin/policyManager/ClonePolicyPopup.js index 817fae17e..09b89597f 100644 --- a/pmp-revamp-ui/src/pages/admin/policyManager/ClonePolicyPopup.js +++ b/pmp-revamp-ui/src/pages/admin/policyManager/ClonePolicyPopup.js @@ -121,9 +121,9 @@ function ClonePolicyPopup ({policyDetails, closePopUp}) { } return ( - <div className="fixed inset-0 w-full flex items-center justify-center bg-black bg-opacity-[10%] z-50 font-inter cursor-default"> + <div className="fixed inset-0 w-full flex items-center justify-center bg-black bg-opacity-[50%] z-50 font-inter cursor-default"> <FocusTrap focusTrapOptions={{ initialFocus: false, allowOutsideClick: true }}> - <div className={`bg-white md:w-[25rem] w-[60%] h-fit rounded-xl shadow-sm`}> + <div className={`bg-white md:w-[25rem] w-[60%] h-fit rounded-xl shadow-lg`}> {!dataLoaded && ( <LoadingIcon styleSet={styles}></LoadingIcon> )} @@ -142,7 +142,7 @@ function ClonePolicyPopup ({policyDetails, closePopUp}) { )} <div className="py-2 px-6"> <p className="text-sm font-normal text-[#414141] break-words">{t('clonePolicyPopup.description1')} - <span className="font-bold"> {policyDetails.policyName}</span>, {t('clonePolicyPopup.description2')} + <span className="font-bold"> {policyDetails.policyName}</span> {t('clonePolicyPopup.description2')} </p> </div> <div className="w-full flex flex-col px-6 pb-6"> diff --git a/pmp-revamp-ui/src/pages/admin/policyManager/DeactivatePolicyPopup.js b/pmp-revamp-ui/src/pages/admin/policyManager/DeactivatePolicyPopup.js index 739a318bd..b1a69fd14 100644 --- a/pmp-revamp-ui/src/pages/admin/policyManager/DeactivatePolicyPopup.js +++ b/pmp-revamp-ui/src/pages/admin/policyManager/DeactivatePolicyPopup.js @@ -141,9 +141,9 @@ function DeactivatePolicyPopup({ header, description, popupData, headerKeyName, }; return ( - <div className="fixed inset-0 flex items-center justify-center bg-black bg-opacity-[10%] z-50 font-inter cursor-default"> + <div className="fixed inset-0 flex items-center justify-center bg-black bg-opacity-[50%] z-50 font-inter cursor-default"> <FocusTrap focusTrapOptions={{ initialFocus: false, allowOutsideClick: true }}> - <div className={`bg-white md:w-[390px] ${showAlertErrorMessage ? 'w-[22rem] h-[30rem]' : 'w-[55%]'} mx-auto rounded-lg shadow-sm h-fit`}> + <div className={`bg-white md:w-[390px] ${showAlertErrorMessage ? 'w-[22rem] h-[30rem]' : 'w-[55%]'} mx-auto rounded-lg shadow-lg h-fit`}> {!dataLoaded && ( <LoadingIcon styleSet={styles} /> )} diff --git a/pmp-revamp-ui/src/pages/admin/policyManager/PoliciesList.js b/pmp-revamp-ui/src/pages/admin/policyManager/PoliciesList.js index e05aa83bd..79938b37d 100644 --- a/pmp-revamp-ui/src/pages/admin/policyManager/PoliciesList.js +++ b/pmp-revamp-ui/src/pages/admin/policyManager/PoliciesList.js @@ -166,10 +166,8 @@ function PoliciesList({ policyType, createPolicyButtonName, createPolicy, subTit if (policy.status === 'activated') { setDeactivatePolicyHeader('deactivatePolicyPopup.headerMsg'); if (policyType === 'Auth') { - setActionId(-1); setDeactivatePolicyDescription('deactivatePolicyPopup.authPolicyDescriptionMsg'); } else if (policyType === 'DataShare') { - setActionId(-1); setDeactivatePolicyDescription('deactivatePolicyPopup.dataSharePolicyDescriptionMsg'); } const request = createRequest({ @@ -183,7 +181,6 @@ function PoliciesList({ policyType, createPolicyButtonName, createPolicy, subTit const onClickClone = (selectedPolicy) => { if (selectedPolicy.status !== 'draft') { - setActionId(-1); setShowClonePopup(true); document.body.style.overflow = "hidden"; } @@ -191,7 +188,6 @@ function PoliciesList({ policyType, createPolicyButtonName, createPolicy, subTit const onClickPublish = (selectedPolicy) => { if (selectedPolicy.status === "draft") { - setActionId(-1); setShowPublishPolicyPopup(true); document.body.style.overflow = "hidden"; } @@ -215,11 +211,13 @@ function PoliciesList({ policyType, createPolicyButtonName, createPolicy, subTit } const closePublishPolicyPopup = () => { + setActionId(-1); setShowPublishPolicyPopup(false); document.body.style.overflow = 'auto'; }; const closeClonePolicyPopup = () => { + setActionId(-1); setShowClonePopup(false); document.body.style.overflow = 'auto'; }; @@ -248,6 +246,7 @@ function PoliciesList({ policyType, createPolicyButtonName, createPolicy, subTit }; const closeDeactivatePopup = () => { + setActionId(-1); setShowDeactivatePopup(false); document.body.style.overflow = 'auto'; }; @@ -382,6 +381,13 @@ function PoliciesList({ policyType, createPolicyButtonName, createPolicy, subTit <p id="policy_publish_btn" className={`py-1.5 px-4 ${isLoginLanguageRTL ? "pl-10" : "pr-10"} ${policy.status === 'draft' ? "text-[#3E3E3E]" : "text-[#A5A5A5]"}`}>{t("policiesList.publish")}</p> <img src={policy.status === 'draft' ? publishPolicyIcon : disablePublishPolicyIcon} alt="" className={`${isLoginLanguageRTL ? "pl-2" : "pr-2"}`} /> </div> + {showPublishPolicyPopup && ( + <PublishPolicyPopup + policyDetails={policy} + closePopUp={closePublishPolicyPopup} + onClickPublish={() => publishSuccess(policy)} + /> + )} <hr className="h-px bg-gray-100 border-0 mx-1" /> <div role='button' className="flex justify-between hover:bg-gray-100" onClick={() => viewPolicy(policy)} tabIndex="0" onKeyDown={(e) => onPressEnterKey(e, () => viewPolicy(policy))}> <p id="policy_details_view_btn" className={`py-1.5 px-4 cursor-pointer text-[#3E3E3E] ${isLoginLanguageRTL ? "pl-10" : "pr-10"}`}>{t("partnerList.view")}</p> @@ -397,37 +403,30 @@ function PoliciesList({ policyType, createPolicyButtonName, createPolicy, subTit <p id="policy_replicate_btn" className={`py-1.5 px-4 ${isLoginLanguageRTL ? "pl-10" : "pr-10"} ${policy.status !== 'draft' ? "text-[#3E3E3E]" : "text-[#A5A5A5]"}`}>{t("policiesList.clone")}</p> <img src={policy.status !== 'draft' ? replicateIcon : disableReplicateIcon} alt="" className={`${isLoginLanguageRTL ? "pl-2" : "pr-2"}`} /> </div> + {showClonePopup && ( + <ClonePolicyPopup + policyDetails={policy} + closePopUp={closeClonePolicyPopup} + /> + )} <hr className="h-px bg-gray-100 border-0 mx-1" /> <div role='button' className={`flex justify-between hover:bg-gray-100 ${policy.status === 'activated' ? 'cursor-pointer' : 'cursor-default'}`} onClick={() => showDeactivatePolicy(policy)} tabIndex="0" onKeyDown={(e) => onPressEnterKey(e, () => showDeactivatePolicy(policy))}> <p id="policy_deactivate_btn" className={`py-1.5 px-4 ${isLoginLanguageRTL ? "pl-10" : "pr-10"} ${policy.status === 'activated' ? "text-[#3E3E3E]" : "text-[#A5A5A5]"}`}>{t("partnerList.deActivate")}</p> <img src={policy.status === 'activated' ? deactivateIcon : disableDeactivateIcon} alt="" className={`${isLoginLanguageRTL ? "pl-2" : "pr-2"}`} /> </div> + {showDeactivatePopup && ( + <DeactivatePolicyPopup + header={deactivatePolicyHeader} + description={deactivatePolicyDescription} + popupData={{ ...policy, isDeactivatePolicy: true }} + headerKeyName={policy.policyName} + closePopUp={closeDeactivatePopup} + onClickConfirm={(deactivationResponse) => onClickConfirmDeactivate(deactivationResponse, policy)} + request={deactivateRequest} + /> + )} </div> )} - {showPublishPolicyPopup && ( - <PublishPolicyPopup - policyDetails={policy} - closePopUp={closePublishPolicyPopup} - onClickPublish={() => publishSuccess(policy)} - /> - )} - {showClonePopup && ( - <ClonePolicyPopup - policyDetails={policy} - closePopUp={closeClonePolicyPopup} - /> - )} - {showDeactivatePopup && ( - <DeactivatePolicyPopup - header={deactivatePolicyHeader} - description={deactivatePolicyDescription} - popupData={{ ...policy, isDeactivatePolicy: true }} - headerKeyName={policy.policyName} - closePopUp={closeDeactivatePopup} - onClickConfirm={(deactivationResponse) => onClickConfirmDeactivate(deactivationResponse, policy)} - request={deactivateRequest} - /> - )} </div> </td> </tr> diff --git a/pmp-revamp-ui/src/pages/admin/policyManager/PolicyGroupList.js b/pmp-revamp-ui/src/pages/admin/policyManager/PolicyGroupList.js index 393be50f4..686acbcc6 100644 --- a/pmp-revamp-ui/src/pages/admin/policyManager/PolicyGroupList.js +++ b/pmp-revamp-ui/src/pages/admin/policyManager/PolicyGroupList.js @@ -220,6 +220,7 @@ function PolicyGroupList() { const closePopup = () => { setShowDeactivatePolicyGroupPopup(false); + setActionId(-1); document.body.style.overflow = 'auto'; }; @@ -229,7 +230,6 @@ function PolicyGroupList() { const showDeactivatePolicyGroup = (policyGroup) => { if (policyGroup.isActive) { - setActionId(-1); const request = createRequest({ status: "De-Activate", }, "mosip.pms.deactivate.policy.group.patch", true); @@ -242,6 +242,7 @@ function PolicyGroupList() { const onClickConfirmDeactivate = (deactivationResponse, selectedPolicyGroup) => { if (deactivationResponse && !deactivationResponse.isActive) { setShowDeactivatePolicyGroupPopup(false); + setActionId(-1); // Update the specific row in the state with the new status setPolicyGroupList((prevList) => prevList.map(policyGroup => @@ -361,19 +362,19 @@ function PolicyGroupList() { <p id="policy_group_deactivate_btn" className={`py-1.5 px-4 ${isLoginLanguageRTL ? "pl-10" : "pr-10"} ${policyGroup.isActive === true ? "text-[#3E3E3E]" : "text-[#A5A5A5]"}`}>{t("partnerList.deActivate")}</p> <img src={policyGroup.isActive === true ? deactivateIcon : disableDeactivateIcon} alt="" className={`${isLoginLanguageRTL ? "pl-2" : "pr-2"}`} /> </div> + {showDeactivatePolicyGroupPopup && ( + <DeactivatePolicyPopup + header={'deactivatePolicyGroup.headerMsg'} + description={'deactivatePolicyGroup.description'} + popupData={{ ...policyGroup, isDeactivatePolicyGroup: true }} + headerKeyName={policyGroup.name} + closePopUp={closePopup} + onClickConfirm={(deactivationResponse) => onClickConfirmDeactivate(deactivationResponse, policyGroup)} + request={deactivateRequest} + /> + )} </div> )} - {showDeactivatePolicyGroupPopup && ( - <DeactivatePolicyPopup - header={'deactivatePolicyGroup.headerMsg'} - description={'deactivatePolicyGroup.description'} - popupData={{ ...policyGroup, isDeactivatePolicyGroup: true }} - headerKeyName={policyGroup.name} - closePopUp={closePopup} - onClickConfirm={(deactivationResponse) => onClickConfirmDeactivate(deactivationResponse, policyGroup)} - request={deactivateRequest} - /> - )} </div> </td> </tr> diff --git a/pmp-revamp-ui/src/pages/admin/policyManager/PublishPolicyPopup.js b/pmp-revamp-ui/src/pages/admin/policyManager/PublishPolicyPopup.js index a85078ad2..ec930e0d3 100644 --- a/pmp-revamp-ui/src/pages/admin/policyManager/PublishPolicyPopup.js +++ b/pmp-revamp-ui/src/pages/admin/policyManager/PublishPolicyPopup.js @@ -74,9 +74,9 @@ function PublishPolicyPopup ({policyDetails, closePopUp, onClickPublish}) { cancelIcon: "!top-4 !mt-[3.25rem]" } return ( - <div className="fixed inset-0 w-full flex items-center justify-center bg-black bg-opacity-[10%] z-50 font-inter"> + <div className="fixed inset-0 w-full flex items-center justify-center bg-black bg-opacity-[50%] z-50 font-inter"> <FocusTrap focusTrapOptions={{ initialFocus: false, allowOutsideClick: true }}> - <div className={`bg-white md:w-[25rem] w-[50%] h-fit rounded-xl shadow-sm`}> + <div className={`bg-white md:w-[25rem] w-[50%] h-fit rounded-xl shadow-lg`}> {!dataLoaded && ( <LoadingIcon styleSet={styles} /> )} diff --git a/pmp-revamp-ui/src/pages/admin/policyRequests/PolicyRequestsList.js b/pmp-revamp-ui/src/pages/admin/policyRequests/PolicyRequestsList.js index a8f20b9c6..78bd88925 100644 --- a/pmp-revamp-ui/src/pages/admin/policyRequests/PolicyRequestsList.js +++ b/pmp-revamp-ui/src/pages/admin/policyRequests/PolicyRequestsList.js @@ -183,6 +183,7 @@ function PolicyRequestsList() { const onClickApproveReject = (responseData, status, selectedPolicyRequest) => { if (responseData !== "") { setShowPopup(false); + setViewPartnersId(-1); // Update the specific row in the state with the new status setPolicyRequestsData((prevList) => prevList.map(policyRequest => @@ -195,6 +196,7 @@ function PolicyRequestsList() { const closePolicyRequestPopup = () => { setShowPopup(false); + setViewPartnersId(-1); document.body.style.overflow = 'auto'; }; @@ -205,7 +207,6 @@ function PolicyRequestsList() { const approveRejectPolicyRequest = (policyRequest) => { if (policyRequest.status === 'InProgress') { setShowPopup(true); - setViewPartnersId(-1); document.body.style.overflow = "hidden"; } }; @@ -329,19 +330,19 @@ function PolicyRequestsList() { <p id="partner_details_view_btn" className={`py-1.5 px-4 cursor-pointer text-[#3E3E3E] ${isLoginLanguageRTL ? "pl-10" : "pr-10"}`}>{t("partnerPolicyMappingRequestList.view")}</p> <img src={viewIcon} alt="" className={`${isLoginLanguageRTL ? "pl-2" : "pr-2"}`} /> </div> + {showPopup && + <ApproveRejectPopup + popupData={{ ...policyRequest, isPartnerPolicyRequest: true }} + closePopUp={closePolicyRequestPopup} + approveRejectResponse={(responseData, status) => onClickApproveReject(responseData, status, policyRequest)} + title={policyRequest.policyName} + subtitle={`# ${policyRequest.policyId}`} + header={t('partnerPolicyRequestApproveRejectPopup.header')} + description={t('partnerPolicyRequestApproveRejectPopup.description')} + /> + } </div> )} - {showPopup && - <ApproveRejectPopup - popupData={{ ...policyRequest, isPartnerPolicyRequest: true }} - closePopUp={closePolicyRequestPopup} - approveRejectResponse={(responseData, status) => onClickApproveReject(responseData, status, policyRequest)} - title={policyRequest.policyName} - subtitle={`# ${policyRequest.policyId}`} - header={t('partnerPolicyRequestApproveRejectPopup.header')} - description={t('partnerPolicyRequestApproveRejectPopup.description')} - /> - } </div> </td> </tr> diff --git a/pmp-revamp-ui/src/pages/common/ApproveRejectPopup.js b/pmp-revamp-ui/src/pages/common/ApproveRejectPopup.js index b0e5df18a..9c146470d 100644 --- a/pmp-revamp-ui/src/pages/common/ApproveRejectPopup.js +++ b/pmp-revamp-ui/src/pages/common/ApproveRejectPopup.js @@ -96,9 +96,9 @@ function ApproveRejectPopup({ popupData, closePopUp, approveRejectResponse, titl } return ( - <div className="fixed inset-0 flex items-center justify-center bg-black bg-opacity-[10%] z-50 font-inter cursor-default mx-1 break-normal"> + <div className="fixed inset-0 flex items-center justify-center bg-black bg-opacity-[50%] z-50 font-inter cursor-default mx-1 break-normal"> <FocusTrap focusTrapOptions={{ initialFocus: false, allowOutsideClick: true }}> - <div className="bg-white md:w-[24rem] w-[55%] mx-auto rounded-lg shadow-sm h-fit"> + <div className="bg-white md:w-[24rem] w-[55%] mx-auto rounded-lg shadow-lg h-fit"> {!dataLoaded ? ( <LoadingIcon styleSet={{ loadingDiv: '!py-[35%]' }} /> ) : ( diff --git a/pmp-revamp-ui/src/pages/common/DeactivatePopup.js b/pmp-revamp-ui/src/pages/common/DeactivatePopup.js index 1262d79e4..9602fc633 100644 --- a/pmp-revamp-ui/src/pages/common/DeactivatePopup.js +++ b/pmp-revamp-ui/src/pages/common/DeactivatePopup.js @@ -99,9 +99,9 @@ function DeactivatePopup({ onClickConfirm, closePopUp, popupData, request, heade } return ( - <div className="fixed inset-0 flex items-center justify-center bg-black bg-opacity-[10%] z-50 font-inter cursor-default"> + <div className="fixed inset-0 flex items-center justify-center bg-black bg-opacity-[50%] z-50 font-inter cursor-default"> <FocusTrap focusTrapOptions={{ initialFocus: false, allowOutsideClick: true }}> - <div className={`bg-white md:w-[390px] w-[55%] mx-auto rounded-lg shadow-sm h-fit`}> + <div className={`bg-white md:w-[390px] w-[55%] mx-auto rounded-lg shadow-lg h-fit`}> {!dataLoaded && ( <LoadingIcon styleSet={styles} /> )} diff --git a/pmp-revamp-ui/src/pages/partner/authenticationServices/ApiKeysList.js b/pmp-revamp-ui/src/pages/partner/authenticationServices/ApiKeysList.js index b079df271..cd5c04e3c 100644 --- a/pmp-revamp-ui/src/pages/partner/authenticationServices/ApiKeysList.js +++ b/pmp-revamp-ui/src/pages/partner/authenticationServices/ApiKeysList.js @@ -112,7 +112,6 @@ function ApiKeysList() { label: selectedApiKeyData.apiKeyLabel, status: "De-Active" }); - setViewApiKeyId(-1); setDeactivateRequest(request); setShowDeactivatePopup(true); document.body.style.overflow = "hidden"; @@ -120,6 +119,7 @@ function ApiKeysList() { }; const closeDeactivatePopup = () => { + setViewApiKeyId(-1); setShowDeactivatePopup(false); }; @@ -278,11 +278,11 @@ function ApiKeysList() { <button id='api_key_deactivate' onClick={() => onClickDeactivate(apiKey)} className={`${isLoginLanguageRTL ? "pl-10" : "pr-10"} py-2 px-4 ${apiKey.status === "ACTIVE" ? 'text-[#3E3E3E] cursor-pointer' : 'text-[#A5A5A5] cursor-auto'} hover:bg-gray-100`}> <p> {t('oidcClientsList.deActivate')} </p> </button> + {showDeactivatePopup && ( + <DeactivatePopup closePopUp={closeDeactivatePopup} onClickConfirm={(deactivationResponse) => onClickConfirmDeactivate(deactivationResponse, apiKey)} popupData={apiKey} request={deactivateRequest} headerMsg='deactivateApiKey.apiKeyName' descriptionMsg='deactivateApiKey.description' headerKeyName={apiKey.apiKeyLabel} /> + )} </div> )} - {showDeactivatePopup && ( - <DeactivatePopup closePopUp={closeDeactivatePopup} onClickConfirm={(deactivationResponse) => onClickConfirmDeactivate(deactivationResponse, apiKey)} popupData={apiKey} request={deactivateRequest} headerMsg='deactivateApiKey.apiKeyName' descriptionMsg='deactivateApiKey.description' headerKeyName={apiKey.apiKeyLabel} /> - )} </div> </td> </tr> diff --git a/pmp-revamp-ui/src/pages/partner/authenticationServices/OidcClientsList.js b/pmp-revamp-ui/src/pages/partner/authenticationServices/OidcClientsList.js index 3c6e465ca..a64b7555a 100644 --- a/pmp-revamp-ui/src/pages/partner/authenticationServices/OidcClientsList.js +++ b/pmp-revamp-ui/src/pages/partner/authenticationServices/OidcClientsList.js @@ -132,7 +132,6 @@ function OidcClientsList() { clientAuthMethods: selectedClientdata.clientAuthMethods, clientNameLangMap: getClientNameLangMap(selectedClientdata.clientNameEng, selectedClientdata.clientNameJson) }); - setViewClientId(-1); setDeactivateRequest(request); setShowDeactivatePopup(true); document.body.style.overflow = "hidden"; @@ -140,6 +139,7 @@ function OidcClientsList() { }; const closeDeactivatePopup = () => { + setViewClientId(-1); setShowDeactivatePopup(false); }; @@ -189,8 +189,8 @@ function OidcClientsList() { const onClickConfirmDeactivate = (deactivationResponse, selectedClient) => { if (deactivationResponse && deactivationResponse.status === "INACTIVE") { - setViewClientId(-1); setShowDeactivatePopup(false); + setViewClientId(-1); // Update the specific row in the state with the new status setOidcClientsList((prevList) => prevList.map(client => @@ -326,11 +326,11 @@ function OidcClientsList() { <button id="oidc_deactive_btn" onClick={() => showDeactivateOidcClient(client)} className={`py-1.5 px-4 ${isLoginLanguageRTL ? "pl-10" : "pr-10"} ${client.status === "ACTIVE" ? 'text-[#3E3E3E] cursor-pointer' : 'text-[#A5A5A5] cursor-auto'} hover:bg-gray-100`} > {t('oidcClientsList.deActivate')} </button> + {showDeactivatePopup && ( + <DeactivatePopup closePopUp={closeDeactivatePopup} onClickConfirm={(deactivationResponse) => onClickConfirmDeactivate(deactivationResponse, client)} popupData={client} request={deactivateRequest} headerMsg='deactivateOidcClient.oidcClientName' descriptionMsg='deactivateOidcClient.description' headerKeyName={client.clientNameEng} /> + )} </div> )} - {showDeactivatePopup && ( - <DeactivatePopup closePopUp={closeDeactivatePopup} onClickConfirm={(deactivationResponse) => onClickConfirmDeactivate(deactivationResponse, client)} popupData={client} request={deactivateRequest} headerMsg='deactivateOidcClient.oidcClientName' descriptionMsg='deactivateOidcClient.description' headerKeyName={client.clientNameEng} /> - )} </div> </td> </tr> diff --git a/pmp-revamp-ui/src/pages/partner/deviceProviderServices/DevicesList.js b/pmp-revamp-ui/src/pages/partner/deviceProviderServices/DevicesList.js index 3613fd46f..0193ad607 100644 --- a/pmp-revamp-ui/src/pages/partner/deviceProviderServices/DevicesList.js +++ b/pmp-revamp-ui/src/pages/partner/deviceProviderServices/DevicesList.js @@ -178,7 +178,6 @@ function DevicesList() { const request = createRequest({ status: "De-Activate", }, "mosip.pms.deactivate.device.patch", true); - setViewDeviceId(-1); setDeactivateRequest(request); setShowDeactivatePopup(true); document.body.style.overflow = "hidden"; @@ -186,11 +185,13 @@ function DevicesList() { }; const closeDeactivatePopup = () => { + setViewDeviceId(-1); setShowDeactivatePopup(false); }; const onClickConfirmDeactivate = (deactivationResponse, selectedDevice) => { if (deactivationResponse && !deactivationResponse.isActive) { + setViewDeviceId(-1); setShowDeactivatePopup(false); // Update the specific row in the state with the new status setDevicesList((prevList) => @@ -330,11 +331,11 @@ function DevicesList() { <button id='device_list_deactivate_device' onClick={() => showDeactivateDevice(device)} className={`py-2 px-4 ${isLoginLanguageRTL ? "pl-10" : "pr-10"} ${device.status === "approved" ? 'text-[#3E3E3E] cursor-pointer' : 'text-[#A5A5A5] cursor-auto'} hover:bg-gray-100`}> <p> {t('devicesList.deActivate')}</p> </button> + {showDeactivatePopup && ( + <DeactivatePopup closePopUp={closeDeactivatePopup} onClickConfirm={(deactivationResponse) => onClickConfirmDeactivate(deactivationResponse, device)} popupData={{ ...device, isDeactivateDevice: true }} request={deactivateRequest} headerMsg='deactivateDevicePopup.headerMsg' descriptionMsg='deactivateDevicePopup.description' /> + )} </div> )} - {showDeactivatePopup && ( - <DeactivatePopup closePopUp={closeDeactivatePopup} onClickConfirm={(deactivationResponse) => onClickConfirmDeactivate(deactivationResponse, device)} popupData={{ ...device, isDeactivateDevice: true }} request={deactivateRequest} headerMsg='deactivateDevicePopup.headerMsg' descriptionMsg='deactivateDevicePopup.description' /> - )} </div> </td> </tr> diff --git a/pmp-revamp-ui/src/pages/partner/ftmProviderServices/FtmList.js b/pmp-revamp-ui/src/pages/partner/ftmProviderServices/FtmList.js index dcf07918c..9ccbcd425 100644 --- a/pmp-revamp-ui/src/pages/partner/ftmProviderServices/FtmList.js +++ b/pmp-revamp-ui/src/pages/partner/ftmProviderServices/FtmList.js @@ -174,12 +174,12 @@ function FtmList() { }, "mosip.pms.deactivate.ftm.patch", true); setDeactivateRequest(request); setShowDeactivatePopup(true); - setViewFtmId(-1); document.body.style.overflow = "hidden"; } }; const closeDeactivatePopup = () => { + setViewFtmId(-1); setShowDeactivatePopup(false); }; @@ -197,6 +197,7 @@ function FtmList() { const onClickConfirmDeactivate = (deactivationResponse, selectedFtm) => { if (deactivationResponse && !deactivationResponse.isActive) { + setViewFtmId(-1); setShowDeactivatePopup(false); // Update the specific row in the state with the new status setFtmList((prevList) => @@ -306,15 +307,15 @@ function FtmList() { <button id='ftm_list_manage_certificate' onClick={() => showManageCertificate(ftm)} className={`py-1 px-4 ${isLoginLanguageRTL ? "pl-10" : "pr-10"} ${(ftm.status === "approved" || ftm.status === "pending_cert_upload") ? 'text-[#3E3E3E] cursor-pointer' : 'text-[#A5A5A5] cursor-auto'} hover:bg-gray-100`}> <p> {t('ftmList.manageCertificate')} </p> </button> + {showDeactivatePopup && ( + <DeactivatePopup closePopUp={closeDeactivatePopup} onClickConfirm={(deactivationResponse) => onClickConfirmDeactivate(deactivationResponse, ftm)} popupData={{ ...ftm, isDeactivateFtm: true }} request={deactivateRequest} headerMsg='deactivateFtmPopup.headerMsg' descriptionMsg='deactivateFtmPopup.description' /> + )} <hr className="h-px bg-gray-200 border-0 mx-1" /> <button id='ftm_list_deactivate' onClick={() => showDeactivateFtm(ftm)} className={`py-1 px-4 ${isLoginLanguageRTL ? "pl-10" : "pr-10"} ${ftm.status === "approved" ? 'text-[#3E3E3E] cursor-pointer' : 'text-[#A5A5A5] cursor-auto'} hover:bg-gray-100`} > <p> {t('ftmList.deActivate')}</p> </button> </div> )} - {showDeactivatePopup && ( - <DeactivatePopup closePopUp={closeDeactivatePopup} onClickConfirm={(deactivationResponse) => onClickConfirmDeactivate(deactivationResponse, ftm)} popupData={{ ...ftm, isDeactivateFtm: true }} request={deactivateRequest} headerMsg='deactivateFtmPopup.headerMsg' descriptionMsg='deactivateFtmPopup.description' /> - )} </div> </td> </tr>