Skip to content

Commit

Permalink
MOSIP-37017: disabled download and upload buttons in view and manage …
Browse files Browse the repository at this point in the history
…ftm (#1068)

* MOSIP-37017: disabled download and upload buttons in view and manage ftm

Signed-off-by: Swetha K <swetha.k@technoforte.co.in>

* MOSIP-37017: disabled download and upload buttons in view and manage ftm

Signed-off-by: Swetha K <swetha.k@technoforte.co.in>

* MOSIP-37017: disabled download and upload buttons in view and manage ftm

Signed-off-by: Swetha K <swetha.k@technoforte.co.in>

---------

Signed-off-by: Swetha K <swetha.k@technoforte.co.in>
Co-authored-by: Swetha K <swetha.k@technoforte.co.in>
  • Loading branch information
SwethaKrish4 and Swetha K authored Jan 7, 2025
1 parent 2960401 commit 16e13ca
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pmp-revamp-ui/public/i18n/ara.json
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@
"PMS_ATH_401": "المصادقة فشلت",
"PMS_PRT_106": "حالة APIKeyReqID قيد التقدم",
"PMS_KKS_001": " API لا يمكن الوصول إليها",
"PMS_PRT_107": "الردود من API لاغي",
"PMS_PRT_107": "الرد من واجهة برمجة التطبيقات هو لا شيء",
"PMS_PRT_500": "غير قادر على معالجة الطلب",
"PMS_PMP_016": "لقد تم إلغاء تنشيط حساب الشريك الخاص بك لنوع شريك معين بواسطة المسؤول، ونتيجة لذلك لن تتمكن بعد الآن من أداء هذا النشاط",
"PMS_PRT_098": "السياسة المقدمة بموجب مجموعة سياسة الشريك غير موجودة.",
Expand Down
2 changes: 1 addition & 1 deletion pmp-revamp-ui/public/i18n/eng.json
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@
"PMS_ATH_401": "Authentication Failed",
"PMS_PRT_106": "APIKeyReqID status is In_progress",
"PMS_KKS_001": " API not accessible ",
"PMS_PRT_107": "Responese from the api is null",
"PMS_PRT_107": "Response from the api is null",
"PMS_PRT_500": "Unable to process the request.",
"PMS_PMP_016": "Your Partner account for given partner type has been deactivated by Admin, due to which you will no longer be able to perform this activity.",
"PMS_PRT_098": "Given policy under partner's policy group not exists.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ function ViewFtmChipDetails() {
setSuccessMsg("");
};

const showHoverMsg = () => {
return (
<div className={`absolute hidden group-hover:block text-center bg-gray-100 text-xs text-gray-500 font-semibold p-2 w-60 mt-1 z-10 ${isLoginLanguageRTL ? "left-0" : "right-0"} top-11 rounded-md shadow-md`}>
{t('partnerCertificatesList.disabledBtnHoverMsg')}
</div>
);
}

return (
<div className={`mt-2 w-[100%] ${isLoginLanguageRTL ? "mr-28 ml-5" : "ml-28 mr-5"} font-inter relative`}>
{errorMsg && (
Expand Down Expand Up @@ -228,20 +236,35 @@ function ViewFtmChipDetails() {

<div className=" flex space-x-2">
{ftmDetails.isViewFtmChipDetails && (
<button id='download_btn' disabled={ftmDetails.status !== 'approved' && ftmDetails.status !== 'pending_approval'} onClick={() => getOriginalCertificate(ftmDetails)}
className={`flex items-center text-center w-fit h-10 ${isLoginLanguageRTL ? "ml-5" : "mr-5"} ${(ftmDetails.status !== 'approved' && ftmDetails.status !== 'pending_approval') ? 'text-[#6f7070] border-gray-300 bg-white' : 'text-tory-blue bg-white border-blue-800'} text-xs px-[1.5rem] py-[1%] border font-semibold rounded-lg text-center`}>
{t('commons.download')}
</button>
<div className="relative group">
<button id='download_btn' disabled={ftmDetails.partnerStatus === 'deactivated' || (ftmDetails.status !== 'approved' && ftmDetails.status !== 'pending_approval')} onClick={() => getOriginalCertificate(ftmDetails)}
className={`flex items-center text-center w-fit h-10 ${isLoginLanguageRTL ? "ml-5" : "mr-5"} ${(ftmDetails.partnerStatus === 'deactivated' || (ftmDetails.status !== 'approved' && ftmDetails.status !== 'pending_approval')) ? 'text-[#6f7070] border-gray-300 bg-white' : 'text-tory-blue bg-white border-blue-800'} text-xs px-[1.5rem] py-[1%] border font-semibold rounded-lg text-center`}>
{t('commons.download')}
</button>
{ftmDetails.partnerStatus === 'deactivated' && (
showHoverMsg()
)}
</div>
)}
{ftmDetails.isManageFtmCertificate && (
<div className="flex space-x-2 max-640:flex-col max-640:space-y-2 max-640:space-x-0">
<button id='download_btn' disabled={!ftmDetails.isCertificateAvailable} onClick={() => getOriginalCertificate(ftmDetails)}
className={`flex items-center text-center w-fit h-10 ${isLoginLanguageRTL ? "ml-5" : "mr-5"} ${!ftmDetails.isCertificateAvailable ? 'text-[#6f7070] border-gray-300 bg-white' : 'text-tory-blue bg-white border-blue-800'} text-xs px-[1.5rem] py-[1%] border font-semibold rounded-lg text-center`}>
{t('commons.download')}
</button>
<button id="certificate_reupload_btn" onClick={clickOnUpload} className={`h-10 w-28 text-xs p-3 py-2 ${ftmDetails.isCertificateAvailable ? 'text-tory-blue bg-white border-blue-800' : 'bg-tory-blue text-snow-white'} border font-semibold rounded-md text-center`}>
{ftmDetails.isCertificateAvailable ? t('partnerCertificatesList.reUpload') : t('partnerCertificatesList.upload')}
</button>
<div className="relative group">
<button id='download_btn' disabled={ftmDetails.partnerStatus === 'deactivated' || !ftmDetails.isCertificateAvailable} onClick={() => getOriginalCertificate(ftmDetails)}
className={`flex items-center text-center w-fit h-10 ${isLoginLanguageRTL ? "ml-5" : "mr-5"} ${(ftmDetails.partnerStatus === 'deactivated' || !ftmDetails.isCertificateAvailable) ? 'text-[#6f7070] border-gray-300 bg-white' : 'text-tory-blue bg-white border-blue-800'} text-xs px-[1.5rem] py-[1%] border font-semibold rounded-lg text-center`}>
{t('commons.download')}
</button>
{ftmDetails.partnerStatus === 'deactivated' && (
showHoverMsg()
)}
</div>
<div className="relative group">
<button id="certificate_reupload_btn" disabled={ftmDetails.partnerStatus === 'deactivated'} onClick={clickOnUpload} className={`h-10 w-28 text-xs p-3 py-2 ${ftmDetails.partnerStatus === 'deactivated' ? 'text-[#6f7070] border-gray-300 bg-white': ftmDetails.isCertificateAvailable ? 'text-tory-blue bg-white border-blue-800' : 'bg-tory-blue text-snow-white'} border font-semibold rounded-md text-center`}>
{ftmDetails.isCertificateAvailable ? t('partnerCertificatesList.reUpload') : t('partnerCertificatesList.upload')}
</button>
{ftmDetails.partnerStatus === 'deactivated' && (
showHoverMsg()
)}
</div>
{showPopup && (
<UploadCertificate header={t('addFtm.uploadFtmCertificate')} closePopup={closePopup} popupData={uploadCertificateData} request={uploadCertificateRequest} />
)}
Expand Down

0 comments on commit 16e13ca

Please sign in to comment.