Skip to content

Commit

Permalink
[MOSIP-36426, MOSIP-35736]: Fixed the alignment issue in Upload Certi…
Browse files Browse the repository at this point in the history
…ficate & Updated the add device success message (#830)

Signed-off-by: SwethaKrish4 <[email protected]>
  • Loading branch information
SwethaKrish4 authored Oct 10, 2024
1 parent 5a836d5 commit 84ea238
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
3 changes: 2 additions & 1 deletion pmp-reactjs-ui/public/i18n/ara.json
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,8 @@
"addDevice": "إضافة جهاز",
"backToSBIList": "العودة إلى قائمة SBI",
"backToViewDevices": "العودة إلى عرض الأجهزة",
"successMsg": "تم إرسال الجهاز بنجاح وهو معلق لدى المشرف للموافقة.",
"successMsgForNewDeviceMapping": "تم إرسال الجهاز بنجاح وهو معلق لدى المشرف للموافقة.",
"successMsgForExistingDeviceMapping": "تم إرسال الجهاز بنجاح وهو في انتظار موافقة المسؤول. كما تم ربطه بجهاز SBI آخر.",
"errorInDeviceSubType": "أثناء جلب أنواع فرعية للجهاز، واجهنا خطأً.",
"errorInDeviceType": "أثناء جلب أنواع الأجهزة، واجهنا خطأً.",
"limitExceedWarning": "يمكن إضافة 25 جهازًا كحد أقصى في المرة الواحدة. انقر فوق تأكيد لتحديث هذه الصفحة وإضافة المزيد من الأجهزة. يرجى ملاحظة أن جميع الأجهزة التي تم إرسالها مسبقًا لن تكون مرئية عند التحديث ولكن يمكن عرضها في صفحة قائمة الأجهزة",
Expand Down
3 changes: 2 additions & 1 deletion pmp-reactjs-ui/public/i18n/eng.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,8 @@
"addDevice": "Add Device",
"backToSBIList": "Back to SBI List",
"backToViewDevices": "Back to View Devices",
"successMsg": "Device has been successfully submitted and is pending with admin for approval.",
"successMsgForNewDeviceMapping": "Device has been successfully submitted and is pending with admin for approval.",
"successMsgForExistingDeviceMapping": "The device has been successfully submitted and is pending admin approval. It has also been mapped to another SBI.",
"errorInDeviceSubType": "While fetching device sub types, we have encountered with an error.",
"errorInDeviceType": "While fetching device types, we have encountered with an error.",
"limitExceedWarning": "Maximum of 25 devices can be added at a time. Click Confirm to refresh this page and add more devices. Please note that all the previously submitted devices will not be visible upon refreshing but can be viewed in List of Devices Page.",
Expand Down
3 changes: 2 additions & 1 deletion pmp-reactjs-ui/public/i18n/fra.json
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,8 @@
"addDevice": "Ajouter un appareil",
"backToSBIList": "Retour à la liste des SBI",
"backToViewDevices": "Retour aux appareils d'affichage",
"successMsg": "L'appareil a été soumis avec succès et est en attente de administrateur pour approbation.",
"successMsgForNewDeviceMapping": "L'appareil a été soumis avec succès et est en attente de administrateur pour approbation.",
"successMsgForExistingDeviceMapping": "L'appareil a été soumis avec succès et est en attente d'approbation de l'administrateur. Il a également été mappé à un autre SBI.",
"errorInDeviceSubType": "Lors de la récupération des sous-types d'appareils, nous avons rencontré une erreur.",
"errorInDeviceType": "Lors de la récupération des types d'appareils, nous avons rencontré une erreur.",
"limitExceedWarning": "Vous pouvez ajouter jusqu'à 25 appareils à la fois. Cliquez sur Confirmer pour actualiser cette page et ajouter d'autres appareils. Veuillez noter que tous les appareils précédemment soumis ne seront pas visibles lors de l'actualisation, mais pourront être consultés dans la page Liste des appareils.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ function UploadCertificate({ closePopup, popupData, request }) {
return (
<div className="fixed inset-0 flex items-center justify-center bg-black bg-opacity-[30%] z-50 !mx-0">
<FocusTrap focusTrapOptions={{ initialFocus: false, allowOutsideClick: true }}>
<div className={`bg-white md:w-[25rem] w-[60%] mx-auto ${popupData.isCertificateAvailable ? 'min-h-[28rem]' : 'min-h-[27rem]'} rounded-lg shadow-lg h-fit`}>
<div className={`bg-white break-normal md:w-[25rem] w-[60%] mx-auto ${popupData.isCertificateAvailable ? 'min-h-[28rem]' : 'min-h-[27rem]'} rounded-lg shadow-lg h-fit`}>
{!dataLoaded && (
<div className="flex items-center h-[30rem]">
<LoadingIcon></LoadingIcon>
Expand Down Expand Up @@ -246,10 +246,10 @@ function UploadCertificate({ closePopup, popupData, request }) {
<div id='upload_certificate_card' className={`flex flex-col items-center justify-center w-full min-h-36 cursor-pointer`}>
<label htmlFor="fileInput" tabIndex={0} onKeyPress={(e) => (e.key === 'Enter' || e.key === ' ') && document.getElementById('fileInput').click()} className="flex flex-col items-center w-full min-h-36 justify-center cursor-pointer">
<img src={fileUploadImg} alt="" className="mb-2 w-10 h-10"/>
<h5 className="text-charcoal-gray text-base font-normal">
<h5 className="text-charcoal-gray text-base font-normal px-2">
{t('uploadCertificate.selectCertificate')}
</h5>
<p className="text-xs text-light-gray">
<p className="text-xs text-light-gray px-2">
{t('uploadCertificate.certificateFormat')}
</p>
</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,13 @@ function AddDevices() {
const response = await HttpService.post(getPartnerManagerUrl(`/devicedetail`, process.env.NODE_ENV), request);

if (response?.data?.response?.id) {
inactiveMappingDeviceToSbi(response.data.response.id, index);
inactiveMappingDeviceToSbi(response.data.response.id, index, false);
} else {
const errorCode = response.data.errors[0].errorCode;
if (errorCode === "PMS_AUT_003") {
const deviceDetails = await searchDeviceDetails(entry, index);
if (deviceDetails && deviceDetails.id) {
inactiveMappingDeviceToSbi(deviceDetails.id, index);
inactiveMappingDeviceToSbi(deviceDetails.id, index, true);
} else {
newEntries[index].errorMsg = t('addDevices.errorInAddDevice');
setDeviceEntries(newEntries);
Expand Down Expand Up @@ -307,7 +307,7 @@ function AddDevices() {
setDataLoaded(true);
};

const inactiveMappingDeviceToSbi = async (deviceDetailId, index) => {
const inactiveMappingDeviceToSbi = async (deviceDetailId, index, isDeviceAlreadyMapped) => {
const newEntries = [...deviceEntries];
setDataLoaded(false);
try {
Expand All @@ -325,7 +325,7 @@ function AddDevices() {

if (response?.data?.response) {
newEntries[index].isSubmitted = true;
newEntries[index].successMsg = t('addDevices.successMsg');
newEntries[index].successMsg = isDeviceAlreadyMapped ? t('addDevices.successMsgForExistingDeviceMapping') : t('addDevices.successMsgForNewDeviceMapping');
setDeviceEntries(newEntries);
updateButtonStates();
} else {
Expand Down

0 comments on commit 84ea238

Please sign in to comment.