Skip to content

Commit

Permalink
MOSIP-35934, MOSIP-36403, MOSIP-39206: removed reload after partner r…
Browse files Browse the repository at this point in the history
…egistration & updated keymanger error (#1147)

* MOSIP-35934: removed reload after partner registration

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

* MOSIP-36403: Updated API accessible error msg for all keymanager endpoints

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

* MOSIP-39206: updated column name as Valid To

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

* MOSIP-39206: updated column name as Valid To

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 Jan 24, 2025
1 parent 9bbcab5 commit 97898f9
Show file tree
Hide file tree
Showing 14 changed files with 62 additions and 37 deletions.
8 changes: 5 additions & 3 deletions pmp-revamp-ui/public/i18n/ara.json
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@
"issuedTo": "صدر ل",
"issuedBy": "صادرة عن",
"validFrom": "صالح من",
"validTill": "صالح حتى",
"validTo": "صالح ل",
"timeOfUpload": "تم التحميل على",
"validityStatus": "حالة الصلاحية",
"action": "فعل",
Expand Down Expand Up @@ -746,7 +746,9 @@
},
"activeAndDraftPoliciesDetectedMsg": {
"header": "خطأ: تم اكتشاف سياسات في حالة مفعلة ومسودة!",
"description": "توجد {{noOfActivePolicies}} مسودة سياسات نشطة و{{noOfDraftPolicies}} مرتبطة بمجموعة السياسات هذه. لمتابعة إلغاء تنشيط مجموعة السياسات، يرجى التأكد مما يلي: 1. قم بإلغاء تنشيط كافة السياسات النشطة. 2. قم بنشر كافة مسودات السياسات ثم قم بإلغاء تنشيطها."
"description": "توجهناك {{noOfActivePolicies}} سياسة نشطة و{{noOfDraftPolicies}} سياسة مسودة مرتبطة بمجموعة السياسات هذه. للمتابعة في إلغاء تنشيط مجموعة السياسات، يرجى التأكد مما يلي:" ,
"descriptionMsg1": "1. قم بإلغاء تنشيط جميع السياسات النشطة.",
"descriptionMsg2": "2. نشر كافة مسودات السياسات ثم إلغاء تنشيطها."
},
"viewAuthPoliciesList": {
"viewAuthPolicy": "عرض سياسة المصادقة",
Expand Down Expand Up @@ -921,7 +923,7 @@
},
"consentPopup": {
"title": "الأحكام والشروط",
"description": "سيتم استخدام البيانات المقدمة أثناء التسجيل، بما في ذلك اسمك ورقم هاتفك وعنوان بريدك الإلكتروني واسم المنظمة والعنوان، بواسطة بوابة إدارة الشركاء (PMP). سيتم أيضًا استخدام عنوان بريدك الإلكتروني لإعادة تعيين كلمة المرور والتحقق من البريد الإلكتروني والإشعارات في حالة انتهاء صلاحية شهادة الشريك أو المواقف المماثلة. سيتم استخدام هذه المعلومات فقط لإنشاء بيانات الاعتماد الخاصة بك، وتسهيل استخدامك لـ MOSIP. من خلال تحديد المربع أدناه، فإنك توافق على إرسال بياناتك ليتم تخزينها ومعالجتها للغرض المذكور أعلاه.",
"description": "سيتم استخدام البيانات المقدمة أثناء التسجيل، بما في ذلك اسمك ورقم هاتفك وعنوان بريدك الإلكتروني واسم مؤسستك وعنوانك، بواسطة بوابة إدارة الشركاء (PMP). سيتم أيضًا استخدام عنوان بريدك الإلكتروني لإعادة تعيين كلمة المرور. سيتم استخدام هذه المعلومات فقط لإنشاء بيانات الاعتماد الخاصة بك، مما يسهل عليك استخدام MOSIP. من خلال تحديد المربع أدناه، فإنك توافق على إرسال بياناتك للتخزين والمعالجة للغرض المذكور أعلاه.",
"checkBoxDesc": "لقد قرأت الشروط والأحكام وأوافق على تقديم بياناتي ليتم تخزينها ومعالجتها للغرض المذكور.",
"proceed": "يتابع",
"logoutMsg": "إذا كنت لا ترغب في المتابعة، يمكنك النقر على",
Expand Down
8 changes: 5 additions & 3 deletions pmp-revamp-ui/public/i18n/eng.json
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@
"issuedTo": "Issued To",
"issuedBy": "Issued By",
"validFrom": "Valid From",
"validTill": "Valid Till",
"validTo": "Valid To",
"timeOfUpload": "Uploaded On",
"validityStatus": "Validity Status",
"action": "Action",
Expand Down Expand Up @@ -741,7 +741,9 @@
},
"activeAndDraftPoliciesDetectedMsg": {
"header": "Error: Policies in Activated and Draft Status Detected!",
"description": "There are {{noOfActivePolicies}} active and {{noOfDraftPolicies}} draft policies associated with this policy group. To proceed with deactivating the policy group, please ensure the following: 1. Deactivate all active policies. 2. Publish and then deactivate all draft policies."
"description": "There are {{noOfActivePolicies}} active and {{noOfDraftPolicies}} draft policies associated with this policy group. To proceed with deactivating the policy group, please ensure the following:",
"descriptionMsg1": "1. Deactivate all active policies.",
"descriptionMsg2": "2. Publish and then deactivate all draft policies."
},
"viewAuthPoliciesList": {
"viewAuthPolicy": "View Authentication Policy",
Expand Down Expand Up @@ -916,7 +918,7 @@
},
"consentPopup": {
"title": "Terms and Conditions",
"description": "The data provided during registration, including your Name, Phone Number, Email Address, Organisation Name, and Address, will be used by the Partner Management Portal (PMP). Your email address will also be used for password resets, email verification, and notifications in the event of Partner Certificate expiration or similar situations. This information will be used solely to create your credentials, facilitating your use of MOSIP. By ticking the box below, you consent to submitting your data to be stored and processed for the above purpose.",
"description": "The data provided during registration, including your Name, Phone Number, Email Address, Organisation Name, and Address, will be used by the Partner Management Portal (PMP). Your email address will also be used for password resets. This information will be used solely to create your credentials, facilitating your use of MOSIP. By ticking the box below, you consent to submitting your data to be stored and processed for the above purpose.",
"checkBoxDesc": "I have read the terms & conditions and consent to submitting my data to be stored and processed for the stated purpose.",
"proceed": "Proceed",
"logoutMsg": "If you do not wish to proceed, you can click on ",
Expand Down
8 changes: 5 additions & 3 deletions pmp-revamp-ui/public/i18n/fra.json
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@
"issuedTo": "Délivré à",
"issuedBy": "Délivré par",
"validFrom": "Valable à partir de",
"validTill": "Valable jusqu'à",
"validTo": "Valable jusqu'aue",
"timeOfUpload": "Téléchargé le",
"validityStatus": "Statut de validité",
"action": "Action",
Expand Down Expand Up @@ -746,7 +746,9 @@
},
"activeAndDraftPoliciesDetectedMsg": {
"header": "Erreur : Politiques en statut activé et brouillon détectées !",
"description": "Il existe {{noOfActivePolicies}} stratégies actives et {{noOfDraftPolicies}} projets de stratégies associés à ce groupe de stratégies. Pour procéder à la désactivation du groupe de stratégies, veuillez vous assurer de ce qui suit : 1. Désactivez toutes les stratégies actives. 2. Publiez puis désactivez tous les projets de politiques."
"description": "Il existe {{noOfActivePolicies}} politiques actives et {{noOfDraftPolicies}} projets de politiques associés à ce groupe de politiques. Pour procéder à la désactivation du groupe de politiques, veuillez vous assurer des points suivants :",
"descriptionMsg1": "1. Désactivez toutes les politiques actives.",
"descriptionMsg2": "2. Publiez puis désactivez tous les projets de politiques."
},
"viewAuthPoliciesList": {
"viewAuthPolicy": "Afficher la politique d'authentification",
Expand Down Expand Up @@ -921,7 +923,7 @@
},
"consentPopup": {
"title": "Termes et conditions",
"description": "Les données fournies lors de l'inscription, y compris votre nom, votre numéro de téléphone, votre adresse e-mail, le nom de votre organisation et votre adresse, seront utilisées par le portail de gestion des partenaires (PMP). Votre adresse e-mail sera également utilisée pour la réinitialisation du mot de passe, la vérification des e-mails et les notifications en cas d'expiration du certificat partenaire ou de situations similaires. Ces informations seront utilisées uniquement pour créer vos informations d'identification, facilitant ainsi votre utilisation de MOSIP. En cochant la case ci-dessous, vous consentez à ce que vos données soient stockées et traitées aux fins ci-dessus.",
"description": "Les données fournies lors de l'inscription, notamment votre nom, votre numéro de téléphone, votre adresse e-mail, le nom de votre organisation et votre adresse, seront utilisées par le portail de gestion des partenaires (PMP). Votre adresse e-mail sera également utilisée pour réinitialiser votre mot de passe. Ces informations seront utilisées uniquement pour créer vos identifiants, facilitant ainsi votre utilisation de MOSIP. En cochant la case ci-dessous, vous consentez à ce que vos données soient stockées et traitées aux fins susmentionnées.",
"checkBoxDesc": "J'ai lu les conditions générales et j'accepte que mes données soient stockées et traitées aux fins indiquées.",
"proceed": "Procéder",
"logoutMsg": "Si vous ne souhaitez pas continuer, vous pouvez cliquer sur",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function CertificatesList({ certificateType, viewCertificateDetails, uploadCerti
{ id: "issuedTo", headerNameKey: "certificatesList.issuedTo" },
{ id: "issuedBy", headerNameKey: "certificatesList.issuedBy" },
{ id: "validFrom", headerNameKey: "certificatesList.validFrom" },
{ id: "validTill", headerNameKey: "certificatesList.validTill" },
{ id: "validTill", headerNameKey: "certificatesList.validTo" },
{ id: "uploadedDateTime", headerNameKey: "certificatesList.timeOfUpload" },
{ id: "validityStatus", headerNameKey: "certificatesList.validityStatus" },
{ id: "action", headerNameKey: "certificatesList.action" },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useState, } from 'react';
import { useTranslation } from 'react-i18next';
import { createRequest, getPartnerManagerUrl, isLangRTL, handleServiceErrors, getErrorMessage } from "../../../utils/AppUtils";
import { createRequest, getPartnerManagerUrl, isLangRTL, getErrorMessage, handleKeymanagerErrors } from "../../../utils/AppUtils";
import { getUserProfile } from '../../../services/UserProfileService';
import Title from '../../common/Title'; import DropdownComponent from "../../common/fields/DropdownComponent";
import fileUploadImg from '../../../svg/file_upload_certificate.svg';
Expand All @@ -20,7 +20,6 @@ function UploadTrustCertificate() {
const [dataLoaded, setDataLoaded] = useState(true);
const [errorCode, setErrorCode] = useState("");
const [errorMsg, setErrorMsg] = useState("");
const [successMsg, setSuccessMsg] = useState("");
const [uploading, setUploading] = useState(false);
const [selectedDomain, setSelectedDomain] = useState("");
const [certificateData, setCertificateData] = useState("");
Expand Down Expand Up @@ -129,7 +128,7 @@ function UploadTrustCertificate() {
setConfirmationData(requiredData);
setUploadSuccess(true);
} else {
handleServiceErrors(responseData, setErrorCode, setErrorMsg);
handleKeymanagerErrors(responseData, setErrorCode, setErrorMsg, t);
}
} else {
setErrorMsg(t('uploadCertificate.errorWhileUploadingCertificate'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function ViewAdminFtmChipDetails() {
if (response.data.errors && response.data.errors.length > 0) {
const errorCode = response.data.errors[0].errorCode;
if (errorCode === 'PMS_KKS_001') {
setErrorMsg(t('viewAdminFtmDetails.errorWhileGettingFtmDetails'));
setErrorMsg(t('certificatesList.errorAccessingApi'));
} else {
handleServiceErrors(response.data, setErrorCode, setErrorMsg);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ function DeactivatePolicyPopup({ header, description, popupData, headerKeyName,
const [showAlertErrorMessage, setShowAlertErrorMessage] = useState(false);
const [errorHeaderMsg, setErrorHeaderMsg] = useState('');
const [errorDescriptionMsg, setErrorDescriptionMsg] = useState('');
const [activeDraftPoliciesDescr1, setActiveDraftPoliciesDescr1] = useState('');
const [activeDraftPoliciesDescr2, setActiveDraftPoliciesDescr2] = useState('');

const cancelErrorMsg = () => {
setErrorMsg("");
Expand Down Expand Up @@ -106,6 +108,8 @@ function DeactivatePolicyPopup({ header, description, popupData, headerKeyName,
draftPoliciesCount = resData.filter(policy => !policy.is_Active && !policy.schema).length;
setErrorHeaderMsg(t('activeAndDraftPoliciesDetectedMsg.header'));
setErrorDescriptionMsg(t('activeAndDraftPoliciesDetectedMsg.description', { noOfActivePolicies: activePoliciesCount, noOfDraftPolicies: draftPoliciesCount }));
setActiveDraftPoliciesDescr1(t('activeAndDraftPoliciesDetectedMsg.descriptionMsg1'));
setActiveDraftPoliciesDescr2(t('activeAndDraftPoliciesDetectedMsg.descriptionMsg2'));
} else if (errorCode === 'PMS_POL_070') {
// Count draft policies
draftPoliciesCount = resData.filter(policy => !policy.is_Active && !policy.schema).length;
Expand Down Expand Up @@ -151,14 +155,26 @@ function DeactivatePolicyPopup({ header, description, popupData, headerKeyName,
<div className="relative">
{showAlertErrorMessage
? (
<div className={`flex-col space-y-3 text-center justify-center p-[1rem] items-center place-self-center`}>
<div className={`flex-col text-center justify-center p-[1rem] items-center place-self-center`}>
<img src={errorIcon} alt="" className={`h-[5.5rem] ${isLoginLanguageRTL ? "mr-[8.5rem]" : "ml-[8.5rem]"}`} />
<p className="text-[1rem] leading-snug font-semibold text-black break-normal">
{errorHeaderMsg}
</p>
<p className="text-sm text-center text-[#666666] break-normal p-2">
{errorDescriptionMsg}
</p>
<div className='p-2'>
<p className="text-sm text-center text-[#666666] break-normal">
{errorDescriptionMsg}
</p>
{activeDraftPoliciesDescr1 && activeDraftPoliciesDescr2 && (
<>
<p className="text-sm text-center text-[#666666] break-normal">
{activeDraftPoliciesDescr1}
</p>
<p className="text-sm text-center text-[#666666] break-normal">
{activeDraftPoliciesDescr2}
</p>
</>
)}
</div>
<button id="alert_error_popup_okay_btn" onClick={closeErrorPopUp} type="button" className={`w-36 h-10 border-[#1447B2] border rounded-md bg-tory-blue text-white text-sm font-semibold my-1`}>
{t('commons.okay')}
</button>
Expand Down
2 changes: 1 addition & 1 deletion pmp-revamp-ui/src/pages/common/EmptyList.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function EmptyList({tableHeaders, showCustomButton, customButtonName,buttonId, o
<div className="flex justify-between mt-5">
<div className="flex w-full justify-between text-sm font-semibold text-[#6F6E6E] px-2 m-auto overflow-x-auto no-scrollbar">
{ tableHeaders.map((header) => (
<h6 id='columnheaderName' key={header.id} className="mx-[0.7rem]">
<h6 id={header.id} key={header.id} className="mx-[0.7rem]">
{t(header.headerNameKey)}
</h6>
))}
Expand Down
20 changes: 12 additions & 8 deletions pmp-revamp-ui/src/pages/dashboard/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,19 +120,13 @@ function Dashboard() {
const registerUserResponse = await HttpService.post(getPartnerManagerUrl('/partners', process.env.NODE_ENV), registerUserRequest);
const registerUserResponseData = registerUserResponse.data;
if (registerUserResponseData && registerUserResponseData.response) {
window.location.reload();
callUserConsentPopup();
} else {
handleServiceErrors(registerUserResponseData, setErrorCode, setErrorMsg);
}
}
}
if (!isSelectPolicyPopupVisible) {
await fetchUserConsent();
if (!isUserConsentGiven) {
setShowConsentPopup(true);
document.body.style.overflow = "hidden";
}
}
callUserConsentPopup();
//if email exists then do nothing
if (
resData.policyRequiredPartnerTypes.indexOf(userProfile.partnerType) > -1) {
Expand All @@ -152,6 +146,16 @@ function Dashboard() {

}, []);

const callUserConsentPopup = async () => {
if (!isSelectPolicyPopupVisible) {
await fetchUserConsent();
if (!isUserConsentGiven) {
setShowConsentPopup(true);
document.body.style.overflow = "hidden";
}
}
}

useEffect(() => {
const fetchPartnerPolicyMappingRequestCount = async () => {
const queryParams = new URLSearchParams();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getUserProfile } from "../../../services/UserProfileService";
import ErrorMessage from "../../common/ErrorMessage";
import SuccessMessage from "../../common/SuccessMessage";
import LoadingIcon from "../../common/LoadingIcon";
import { downloadFile, getCertificate, handleServiceErrors, isLangRTL, formatDate, getPartnerTypeDescription, handleMouseClickForDropdown, getPartnerManagerUrl, getPartnerDomainType } from "../../../utils/AppUtils";
import { downloadFile, getCertificate, isLangRTL, formatDate, getPartnerTypeDescription, handleMouseClickForDropdown, getPartnerManagerUrl, getPartnerDomainType, handleKeymanagerErrors } from "../../../utils/AppUtils";
import { useTranslation } from "react-i18next";

import rectangleBox from '../../../svg/rectangle_box.svg';
Expand Down Expand Up @@ -93,7 +93,6 @@ function PartnerCertificatesList() {
const resData = responseData.response;
return resData;
} else {
setErrorMsg(t('partnerCertificatesList.errorWhileDownloadingCertificate'));
return null;
}
} catch (err) {
Expand All @@ -110,7 +109,7 @@ function PartnerCertificatesList() {
if (response != null) {
const responseData = response.data;
if (responseData.errors && responseData.errors.length > 0) {
handleServiceErrors(responseData, setErrorCode, setErrorMsg);
handleKeymanagerErrors(responseData, setErrorCode, setErrorMsg, t);
} else {
const resData = responseData.response;
setCertificatesData(resData);
Expand Down
Loading

0 comments on commit 97898f9

Please sign in to comment.