From 02b8833420c5393aabfff48c223b5b4ceeb230b4 Mon Sep 17 00:00:00 2001 From: SwethaKrish4 <110164892+SwethaKrish4@users.noreply.github.com> Date: Wed, 9 Oct 2024 19:07:48 +0530 Subject: [PATCH] MOSIP-36405: Removed mosip signed certificate download option (#827) Signed-off-by: SwethaKrish4 <110164892+SwethaKrish4@users.noreply.github.com> --- pmp-reactjs-ui/public/i18n/ara.json | 3 +- pmp-reactjs-ui/public/i18n/eng.json | 3 +- pmp-reactjs-ui/public/i18n/fra.json | 3 +- pmp-reactjs-ui/src/nav/SideNav.js | 1 + .../src/pages/dashboard/Dashboard.js | 16 ++--- .../ftmProviderServices/ViewFtmChipDetails.js | 63 +++---------------- 6 files changed, 22 insertions(+), 67 deletions(-) diff --git a/pmp-reactjs-ui/public/i18n/ara.json b/pmp-reactjs-ui/public/i18n/ara.json index 1ad816ed..dac57288 100644 --- a/pmp-reactjs-ui/public/i18n/ara.json +++ b/pmp-reactjs-ui/public/i18n/ara.json @@ -507,8 +507,7 @@ "listOfFtmChipDetails": "قائمة تفاصيل شريحة FTM", "ftmChipProvider": "مزود رقاقة FTM", "ftmChipCertificate": " شهادة رقاقة FTM", - "originalCertSuccessMsg": "تم تنزيل الشهادة الأصلية بنجاح.", - "mosipSignedCertificateSuccessMsg": "تم تنزيل شهادة MOSIP الموقعة بنجاح." + "originalCertSuccessMsg": "تم تنزيل شهادة FTM Chip بنجاح." }, "manageFtmChipCertificate": { "manageFtmChipCertificate": "إدارة شهادة شريحة FTM", diff --git a/pmp-reactjs-ui/public/i18n/eng.json b/pmp-reactjs-ui/public/i18n/eng.json index 07595428..880c4807 100644 --- a/pmp-reactjs-ui/public/i18n/eng.json +++ b/pmp-reactjs-ui/public/i18n/eng.json @@ -502,8 +502,7 @@ "listOfFtmChipDetails": "List of FTM Chip details", "ftmChipProvider": "FTM Chip Provider", "ftmChipCertificate": " FTM Chip Certificate", - "originalCertSuccessMsg": "Original Certificate downloaded successfully.", - "mosipSignedCertificateSuccessMsg": "MOSIP Signed Certificate downloaded successfully." + "originalCertSuccessMsg": "FTM Chip certificate is downloaded successfully." }, "manageFtmChipCertificate": { "manageFtmChipCertificate": "Manage FTM Chip Certificate", diff --git a/pmp-reactjs-ui/public/i18n/fra.json b/pmp-reactjs-ui/public/i18n/fra.json index 90ecece6..8ed448bf 100644 --- a/pmp-reactjs-ui/public/i18n/fra.json +++ b/pmp-reactjs-ui/public/i18n/fra.json @@ -507,8 +507,7 @@ "listOfFtmChipDetails": "Liste des détails de la puce FTM", "ftmChipProvider": "Fournisseur de puces FTM", "ftmChipCertificate": " Certificat de puce FTM", - "originalCertSuccessMsg": "Certificat original téléchargé avec succès.", - "mosipSignedCertificateSuccessMsg": "Le certificat signé MOSIP a été téléchargé avec succès." + "originalCertSuccessMsg": "Le certificat de la puce FTM a été téléchargé avec succès." }, "manageFtmChipCertificate": { "manageFtmChipCertificate": "Gérer le certificat de puce FTM", diff --git a/pmp-reactjs-ui/src/nav/SideNav.js b/pmp-reactjs-ui/src/nav/SideNav.js index 5d259a27..3206fc32 100644 --- a/pmp-reactjs-ui/src/nav/SideNav.js +++ b/pmp-reactjs-ui/src/nav/SideNav.js @@ -85,6 +85,7 @@ function SideNav({ open, policyRequiredPartnerTypes, partnerType }) { setActiveIcon("pendingRequests"); }; const showRootOfTrustCertificate = () => { + navigate('/partnermanagement/admin/certificates/rootTrustCertificateList') setActiveIcon("rootOfTrustCertificate"); }; const showPartner = () => { diff --git a/pmp-reactjs-ui/src/pages/dashboard/Dashboard.js b/pmp-reactjs-ui/src/pages/dashboard/Dashboard.js index e74f1b0f..3d56f665 100644 --- a/pmp-reactjs-ui/src/pages/dashboard/Dashboard.js +++ b/pmp-reactjs-ui/src/pages/dashboard/Dashboard.js @@ -265,7 +265,7 @@ function Dashboard() { )} {isPartnerAdmin && ( <> -
onPressEnterKey(e, partnerCertificatesList())}> +
@@ -279,7 +279,7 @@ function Dashboard() {
-
onPressEnterKey(e, partnerCertificatesList())}> +
onPressEnterKey(e, rootTrustCertificateList())}>
@@ -293,7 +293,7 @@ function Dashboard() {
-
onPressEnterKey(e, partnerCertificatesList())}> +
@@ -307,7 +307,7 @@ function Dashboard() {
-
onPressEnterKey(e, partnerCertificatesList())}> +
@@ -321,7 +321,7 @@ function Dashboard() {
-
onPressEnterKey(e, partnerCertificatesList())}> +
@@ -335,7 +335,7 @@ function Dashboard() {
-
onPressEnterKey(e, partnerCertificatesList())}> +
@@ -349,7 +349,7 @@ function Dashboard() {
-
onPressEnterKey(e, partnerCertificatesList())}> +
@@ -363,7 +363,7 @@ function Dashboard() {
-
onPressEnterKey(e, partnerCertificatesList())}> +
diff --git a/pmp-reactjs-ui/src/pages/partner/ftmProviderServices/ViewFtmChipDetails.js b/pmp-reactjs-ui/src/pages/partner/ftmProviderServices/ViewFtmChipDetails.js index 5e33a592..a0bffc8d 100644 --- a/pmp-reactjs-ui/src/pages/partner/ftmProviderServices/ViewFtmChipDetails.js +++ b/pmp-reactjs-ui/src/pages/partner/ftmProviderServices/ViewFtmChipDetails.js @@ -1,8 +1,8 @@ -import React, { useState, useEffect, useRef } from "react"; +import React, { useState, useEffect } from "react"; import { useTranslation } from "react-i18next"; import { useNavigate } from "react-router-dom"; import { getUserProfile } from "../../../services/UserProfileService"; -import { bgOfStatus, formatDate, getStatusCode, isLangRTL, getPartnerDomainType, handleMouseClickForDropdown, getPartnerManagerUrl } from "../../../utils/AppUtils"; +import { bgOfStatus, formatDate, getStatusCode, isLangRTL, getPartnerDomainType, getPartnerManagerUrl } from "../../../utils/AppUtils"; import Title from "../../common/Title"; import fileUploadBlue from '../../../svg/file_upload_blue_icon.svg'; import fileUploadDisabled from '../../../svg/file_upload_disabled_icon.svg'; @@ -10,7 +10,6 @@ import somethingWentWrongIcon from '../../../svg/something_went_wrong_icon.svg'; import fileUpload from '../../../svg/file_upload_icon.svg'; import file from '../../../svg/file_icon.svg'; import UploadCertificate from "./../certificates/UploadCertificate"; -import DownloadCertificateButton from "../../common/DownloadCertificateButton"; import ErrorMessage from "../../common/ErrorMessage"; import SuccessMessage from "../../common/SuccessMessage"; import { HttpService } from "../../../services/HttpService"; @@ -26,13 +25,7 @@ function ViewFtmChipDetails() { const [errorCode, setErrorCode] = useState(""); const [errorMsg, setErrorMsg] = useState(""); const [successMsg, setSuccessMsg] = useState(""); - const [showDropDownOptions, setShowDropDownOptions] = useState(false); const [uploadCertificateData, setUploadCertificateData] = useState({}); - const dropdownRef = useRef(null); - - useEffect(() => { - handleMouseClickForDropdown(dropdownRef, () => setShowDropDownOptions(false)) - }, [dropdownRef]); useEffect(() => { const selectedFtm = localStorage.getItem('selectedFtmData'); @@ -88,20 +81,6 @@ function ViewFtmChipDetails() { } } - const getMosipSignedCertificate = async (ftmDetails) => { - if (ftmDetails.status === 'approved') { - const response = await getCertificate(ftmDetails.ftmId); - if (response !== null) { - if (response.isMosipSignedCertificateExpired) { - setErrorMsg(t('partnerCertificatesList.certificateExpired')); - } else { - setSuccessMsg(t('viewFtmChipDetails.mosipSignedCertificateSuccessMsg')); - downloadCertificate(response.mosipSignedCertificateData, 'mosip_signed_certificate.cer') - } - } - } - } - const downloadCertificate = (certificateData, fileName) => { const blob = new Blob([certificateData], { type: 'application/x-x509-ca-cert' }); const url = window.URL.createObjectURL(blob); @@ -158,14 +137,6 @@ function ViewFtmChipDetails() { setSuccessMsg(""); }; - const viewFtmDownloadButtonStyle = { - outerDiv: `w-[18%] min-w-fit absolute py-2 px-1 ${isLoginLanguageRTL ? "origin-bottom-right left-[5.6rem] ml-2" : "origin-bottom-left right-[5.6rem] mr-2"} rounded-md bg-white shadow-lg ring-gray-50 border duration-700 max-520:right-[3rem]` - }; - - const mangeFtmDownloadButtonStyle = { - outerDiv: `w-[18%] min-w-fit absolute py-2 px-1 ${isLoginLanguageRTL ? "origin-bottom-right left-[13rem] ml-2" : "origin-bottom-left right-[13rem] mr-2"} rounded-md bg-white shadow-lg ring-gray-50 border duration-700 max-640:right-[5.5rem] max-520:right-[3.5rem]` - }; - return ( <> {errorMsg && ( @@ -273,31 +244,17 @@ function ViewFtmChipDetails() {
{ftmDetails.isViewFtmChipDetails && ( - < DownloadCertificateButton - disableBtn={ftmDetails.status !== 'approved' && ftmDetails.status !== 'pending_approval'} - downloadDropdownRef={dropdownRef} - setShowDropDown={() => setShowDropDownOptions(!showDropDownOptions)} - showDropDown={showDropDownOptions} - onClickFirstOption={getOriginalCertificate} - onClickSecondOption={getMosipSignedCertificate} - requiredData={{ ...ftmDetails, disableSecondOption: ftmDetails.status !== 'approved' }} - styleSet={viewFtmDownloadButtonStyle} - id='download_btn' - /> + )} {ftmDetails.isManageFtmCertificate && (
- < DownloadCertificateButton - disableBtn={ftmDetails.isCertificateAvailable ? false : true} - downloadDropdownRef={dropdownRef} - setShowDropDown={() => setShowDropDownOptions(!showDropDownOptions)} - showDropDown={showDropDownOptions} - onClickFirstOption={getOriginalCertificate} - onClickSecondOption={getMosipSignedCertificate} - requiredData={{ ...ftmDetails, disableSecondOption: ftmDetails.status !== 'approved' }} - styleSet={mangeFtmDownloadButtonStyle} - id='download_btn' - /> +