Skip to content

Commit

Permalink
MOSIP-37707, MOSIP-37708:UI Development & Integration of View SBI Det…
Browse files Browse the repository at this point in the history
…ails. (#987)

* MOSIP-37699: SBI-Device (Partner Admin) View SBI Details.

Signed-off-by: Anil_Kumar_Majji <[email protected]>

* MOSIP-37707, MOSIP-37708:UI Development & Integration of View SBI Details.

Signed-off-by: Anil_Kumar_Majji <[email protected]>

* MOSIP-37707, MOSIP-37708:UI Development & Integration of View SBI Details.

Signed-off-by: Anil_Kumar_Majji <[email protected]>

* MOSIP-37707, MOSIP-37708:UI Development & Integration of View SBI Details.

Signed-off-by: Anil_Kumar_Majji <[email protected]>

* MOSIP-37707, MOSIP-37708: Resolved PR comments

Signed-off-by: Anil_Kumar_Majji <[email protected]>

* MOSIP-37707, MOSIP-37708: Resolved PR comments

Signed-off-by: Anil_Kumar_Majji <[email protected]>

---------

Signed-off-by: Anil_Kumar_Majji <[email protected]>
  • Loading branch information
Anil-kumar-Majji authored Dec 4, 2024
1 parent c5d009e commit 302a44b
Show file tree
Hide file tree
Showing 7 changed files with 168 additions and 7 deletions.
7 changes: 7 additions & 0 deletions pmp-reactjs-ui/public/i18n/ara.json
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,13 @@
"viewAdminFtmDetails": {
"errorWhileGettingFtmDetails": "أثناء جلب تفاصيل الشهادة، واجهنا خطأ"
},
"viewSbiDetails": {
"viewSbiDetails": "عرض تفاصيل الهيئة الفرعية للتنفيذ",
"listOfSbisAndDevices": "قائمة الهيئة الفرعية للتنفيذ",
"sbiVersion":"نسخة الهيئة الفرعية للتنفيذ",
"sbiCreatedDateTime": "تاريخ ووقت إنشاء الهيئة الفرعية للتنفيذ",
"sbiExpiryDateTime": "تاريخ ووقت انتهاء صلاحية الهيئة الفرعية للتنفيذ"
},
"consentPopup": {
"title": "الأحكام والشروط",
"description": "سيتم استخدام البيانات المقدمة أثناء التسجيل، بما في ذلك اسمك ورقم هاتفك وعنوان بريدك الإلكتروني واسم المنظمة والعنوان، بواسطة بوابة إدارة الشركاء (PMP). سيتم أيضًا استخدام عنوان بريدك الإلكتروني لإعادة تعيين كلمة المرور والتحقق من البريد الإلكتروني والإشعارات في حالة انتهاء صلاحية شهادة الشريك أو المواقف المماثلة. سيتم استخدام هذه المعلومات فقط لإنشاء بيانات الاعتماد الخاصة بك، وتسهيل استخدامك لـ MOSIP. من خلال تحديد المربع أدناه، فإنك توافق على إرسال بياناتك ليتم تخزينها ومعالجتها للغرض المذكور أعلاه.",
Expand Down
7 changes: 7 additions & 0 deletions pmp-reactjs-ui/public/i18n/eng.json
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,13 @@
"viewAdminFtmDetails": {
"errorWhileGettingFtmDetails": "While fetching Certificate details, we have encountered with an error."
},
"viewSbiDetails": {
"viewSbiDetails": "View SBI Details",
"listOfSbisAndDevices": "List Of SBI",
"sbiVersion":"SBI Version",
"sbiCreatedDateTime": "SBI Created Date & Time",
"sbiExpiryDateTime": "SBI Expiry Date & Time"
},
"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.",
Expand Down
7 changes: 7 additions & 0 deletions pmp-reactjs-ui/public/i18n/fra.json
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,13 @@
"viewAdminFtmDetails": {
"errorWhileGettingFtmDetails": "Lors de la récupération des détails du certificat, nous avons rencontré une erreur."
},
"viewSbiDetails": {
"viewSbiDetails": "Voir les détails du Sbi",
"listOfSbisAndDevices": "Liste des SBI",
"sbiVersion":"Version SBI",
"sbiCreatedDateTime": "Date et heure de création du SBI",
"sbiExpiryDateTime": "Date et heure d’expiration du SBI"
},
"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.",
Expand Down
5 changes: 5 additions & 0 deletions pmp-reactjs-ui/src/AppRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import AdminFtmList from './pages/admin/ftmProviderServices/AdminFtmList.js';
import ViewAdminFtmChipDetails from './pages/admin/ftmProviderServices/ViewAdminFtmChipDetails.js';
import AdminSbiList from './pages/admin/deviceProviderServices/AdminSbiList.js';
import AdminDevicesList from './pages/admin/deviceProviderServices/AdminDevicesList.js';
import ViewAdminSbiDetails from './pages/admin/deviceProviderServices/ViewAdminSbiDetails.js';

function AppRoutes() {

Expand Down Expand Up @@ -245,6 +246,10 @@ function AppRoutes() {
path: 'admin/device-provider-services/devices-list',
element: <GuardedRoute><MainLayout><AdminDevicesList /></MainLayout></GuardedRoute>
},
{
path: 'admin/device-provider-services/view-sbi-details',
element: <GuardedRoute><MainLayout><ViewAdminSbiDetails /></MainLayout></GuardedRoute>
},
{
path: 'runtimeError',
element: <RuntimeError />,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ function AdminSbiList () {
};

const viewSbiDetails = (selectedSbi) => {
localStorage.setItem('selectedSbiAttributes',JSON.stringify(selectedSbi));
navigate("/partnermanagement/admin/device-provider-services/view-sbi-details");
};

const approveRejectSbi = (selectedSbi) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
import React, { useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next';
import { bgOfStatus, formatDate, getStatusCode, isLangRTL, onPressEnterKey } from '../../../utils/AppUtils';
import { getUserProfile } from '../../../services/UserProfileService';
import { useNavigate } from 'react-router-dom';
import somethingWentWrongIcon from '../../../svg/something_went_wrong_icon.svg';
import Title from '../../common/Title';

function ViewAdminSbiDetails() {
const { t } = useTranslation();
const isLoginLanguageRTL = isLangRTL(getUserProfile().langCode);
const navigate = useNavigate();
const [unexpectedError, setUnexpectedError] = useState(false);
const [sbiDetails, setSbiDetails] = useState({});

useEffect(() => {
const selectedSbiAttributes = localStorage.getItem('selectedSbiAttributes');
if (!selectedSbiAttributes) {
setUnexpectedError(true);
return;
}
const selectedSbi = JSON.parse(selectedSbiAttributes);
console.log(selectedSbi);

setSbiDetails(selectedSbi);
}, []);

const moveToSbiList = () => {
navigate('/partnermanagement/admin/device-provider-services/sbi-list');
};

return (
<div className={`mt-2 w-[100%] ${isLoginLanguageRTL ? "mr-28 ml-5" : "ml-28 mr-5"} font-inter relative`}>
<div className={`flex-col mt-4 bg-anti-flash-white h-full font-inter break-words max-[450px]:text-sm mb-[2%]`}>
<div className="flex justify-between mb-3">
<Title title={'viewSbiDetails.viewSbiDetails'} subTitle='viewSbiDetails.listOfSbisAndDevices' backLink='/partnermanagement/admin/device-provider-services/sbi-list' />
</div>

{unexpectedError && (
<div className={`bg-[#FCFCFC] w-full mt-3 rounded-lg shadow-lg items-center`}>
<div className="flex items-center justify-center p-24">
<div className="flex flex-col justify-center items-center">
<img className="max-w-60 min-w-52 my-2" src={somethingWentWrongIcon} alt="" />
<p className="text-sm font-semibold text-[#6F6E6E] py-4">{t('devicesList.unexpectedError')}</p>
<button onClick={moveToSbiList} type="button"
className={`w-32 h-10 flex items-center justify-center font-semibold rounded-md text-sm mx-8 py-3 bg-tory-blue text-white`}>
{t('commons.goBack')}
</button>
</div>
</div>
</div>
)}
{!unexpectedError && (
<div className="bg-snow-white h-fit mt-1 rounded-md shadow-lg font-inter">
<div className="flex justify-between px-7 pt-3 border-b max-[450px]:flex-col">
<div className="flex-col">
<p className="font-semibold text-lg text-dark-blue mb-2">
{sbiDetails.version}
</p>
<div className="flex items-center justify-start mb-2 max-[400px]:flex-col max-[400px]:items-start">
<div className={`${bgOfStatus(sbiDetails.status)} flex w-fit py-1 px-5 text-sm rounded-md my-2 font-semibold`}>
{getStatusCode(sbiDetails.status, t)}
</div>
<div className={`font-semibold ${isLoginLanguageRTL ? "mr-3" : "ml-3"} text-sm text-dark-blue`}>
{t("viewOidcClientDetails.createdOn") + ' ' +
formatDate(sbiDetails.createdDateTime, "date", true)}
</div>
<div className="mx-2 text-gray-300">|</div>
<div className="font-semibold text-sm text-dark-blue">
{formatDate(sbiDetails.createdDateTime, "time", true)}
</div>
</div>
</div>
</div>
<div className={`${isLoginLanguageRTL ? "pr-8 ml-8" : "pl-8 mr-8"} pt-3 mb-2`}>
<div className="flex flex-wrap py-1 max-[450px]:flex-col">
<div className={`mb-5 max-[600px]:w-[100%] w-[48%] ${isLoginLanguageRTL ? "mr-1" : "ml-1"}`}>
<p className="text-suva-gray text-sm">
{t("viewPolicyRequest.partnerId")}
</p>
<p className="text-vulcan text-md">
{sbiDetails.partnerId}
</p>
</div>
<div className={`mb-5 max-[600px]:w-[100%] w-[50%] ${isLoginLanguageRTL ? "mr-1" : "ml-1"}`}>
<p className="text-suva-gray text-sm">
{t("viewPolicyRequest.partnerType")}
</p>
<p className="text-vulcan text-md">
{sbiDetails.partnerType}
</p>
</div>
<div className={`mb-5 w-[100%] ${isLoginLanguageRTL ? "mr-1" : "ml-1"}`}>
<p className="text-suva-gray text-sm">
{t("viewSbiDetails.sbiVersion")}
</p>
<p className="text-vulcan text-md">
{sbiDetails.version}
</p>
</div>
<div className={`mb-5 max-[600px]:w-[100%] w-[48%] ${isLoginLanguageRTL ? "mr-1" : "ml-1"}`}>
<p className="text-suva-gray text-sm">
{t("viewSbiDetails.sbiCreatedDateTime")}
</p>
<p className="text-vulcan text-md">
{formatDate(sbiDetails.sbicCreatedDateTime, "dateTime", false)}
</p>
</div>
<div className={`mb-5 max-[600px]:w-[100%] w-[50%] ${isLoginLanguageRTL ? "mr-1" : "ml-1"}`}>
<p className="text-suva-gray text-sm">
{t("viewSbiDetails.sbiExpiryDateTime")}
</p>
<p className="text-vulcan text-md">
{formatDate(sbiDetails.sbiExpiryDateTime, "dateTime", false)}
</p>
</div>
</div>
</div>
<hr className="h-px w-full bg-gray-200 border-0" />
<div className={`flex justify-end py-8 ${isLoginLanguageRTL ? "ml-8" : "mr-8"}`}>
<button id="view_admin_sbi_details_back_btn" onClick={moveToSbiList}
className="h-10 w-28 text-sm p-3 py-2 text-tory-blue bg-white border border-blue-800 font-semibold rounded-md text-center" onKeyPress={(e) => onPressEnterKey(e, moveToSbiList)}>
{t("commons.back")}
</button>
</div>
</div>
)}
</div>
</div>
)
}

export default ViewAdminSbiDetails;
14 changes: 7 additions & 7 deletions pmp-reactjs-ui/src/pages/dashboard/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function Dashboard() {
const [partnerPolicyMappingRequestCount, setPartnerPolicyMappingRequestCount] = useState();
const [sbiPendingApprovalRequestCount, setSbiPendingApprovalRequestCount] = useState();
const [devicePendingApprovalRequestCount, setDevicePendingApprovalRequestCount] = useState();
const [ftmPendingApprovalRequestCount, setFtmPendingApprovalRequestCount] = useState();
const [ftmPendingApprovalRequestCount, setFtmPendingApprovalRequestCount] = useState();
let isSelectPolicyPopupVisible = false;
let isUserConsentGiven = false;

Expand Down Expand Up @@ -342,7 +342,7 @@ function Dashboard() {
{!isPartnerAdmin &&
< div id='dashboard_partner_certificate_list_card' onClick={() => partnerCertificatesList()} className="w-[23.5%] min-h-[50%] p-6 mr-3 mb-4 pt-16 bg-white border border-gray-200 shadow cursor-pointer text-center rounded-xl" tabIndex="0" onKeyPress={(e) => onPressEnterKey(e, partnerCertificatesList())}>
<div className="flex justify-center mb-5">
<img src={partnerCertificateIcon} alt="" className="w-8 h-8" id='dashboard_partner_certificated_list_icon'/>
<img src={partnerCertificateIcon} alt="" className="w-8 h-8" id='dashboard_partner_certificated_list_icon' />
</div>
<div>
<h5 id='dashboard_partner_certificate_list_header' className="mb-2 text-sm font-semibold tracking-tight text-gray-600">
Expand All @@ -357,7 +357,7 @@ function Dashboard() {
{!isPartnerAdmin && showPolicies && (
<div id='dashboard_policies_card' onClick={() => policies()} className="w-[23.5%] min-h-[50%] p-6 mr-3 mb-4 pt-16 bg-white border border-gray-200 shadow cursor-pointer text-center rounded-xl" tabIndex="0" onKeyPress={(e) => onPressEnterKey(e, policies())}>
<div className="flex justify-center mb-5">
<img src={policiesIcon} alt="" className="w-8 h-8" id='dashboard_policies_card_icon'/>
<img src={policiesIcon} alt="" className="w-8 h-8" id='dashboard_policies_card_icon' />
</div>
<div>
<h5 id='dashboard_policies_card_header' className="mb-2 text-sm font-semibold tracking-tight text-gray-600 ">
Expand All @@ -372,7 +372,7 @@ function Dashboard() {
{!isPartnerAdmin && showAuthenticationServices && (
<div id='dashboard_authentication_clients_list_card' onClick={() => moveToOidcClientsList(navigate)} className="w-[23.5%] min-h-[50%] p-6 mr-3 mb-4 pt-16 bg-white border border-gray-200 shadow cursor-pointer text-center rounded-xl" tabIndex="0" onKeyPress={(e) => onPressEnterKey(e, moveToOidcClientsList(navigate))}>
<div className="flex justify-center mb-5">
<img src={authServiceIcon} alt="" className="w-8 h-8" id='dashboard_authentication_clients_list_icon'/>
<img src={authServiceIcon} alt="" className="w-8 h-8" id='dashboard_authentication_clients_list_icon' />
</div>
<div>
<h5 id='dashboard_authentication_clients_list_card_header' className="mb-2 text-sm font-semibold tracking-tight text-gray-600 ">
Expand All @@ -387,7 +387,7 @@ function Dashboard() {
{!isPartnerAdmin && showDeviceProviderServices && (
<div id='dashboard_device_provider_service_card' onClick={deviceProviderServices} className="w-[23.5%] min-h-[50%] p-6 mr-3 mb-4 pt-16 bg-white border border-gray-200 shadow cursor-pointer text-center rounded-xl" tabIndex="0" onKeyPress={(e) => onPressEnterKey(e, deviceProviderServices)}>
<div className="flex justify-center mb-5">
<img src={deviceProviderServices_icon} alt="" className="w-8 h-8" id='dashboard_device_provider_service_icon'/>
<img src={deviceProviderServices_icon} alt="" className="w-8 h-8" id='dashboard_device_provider_service_icon' />
</div>
<div>
<h5 id='dashboard_device_provider_service_card_header' className="mb-2 text-sm font-semibold tracking-tight text-gray-600">
Expand All @@ -402,7 +402,7 @@ function Dashboard() {
{!isPartnerAdmin && showFtmServices && (
<div id='dashboard_ftm_chip_provider_card' onClick={ftmChipProviderServices} className="w-[23.5%] min-h-[50%] p-6 mr-3 mb-4 pt-16 bg-white border border-gray-200 shadow cursor-pointer text-center rounded-xl" tabIndex="0" onKeyPress={(e) => onPressEnterKey(e, ftmChipProviderServices)}>
<div className="flex justify-center mb-5">
<img src={ftmServicesIcon} alt="" className="w-8 h-8" id='dashboard_ftm_chip_provider_icon'/>
<img src={ftmServicesIcon} alt="" className="w-8 h-8" id='dashboard_ftm_chip_provider_icon' />
</div>
<div>
<h5 id='dashboard_ftm_chip_provider_card_header' className="mb-2 text-sm font-semibold tracking-tight text-gray-600">
Expand Down Expand Up @@ -474,7 +474,7 @@ function Dashboard() {
count={partnerPolicyMappingRequestCount}
descriptionKey="dashboard.partnerPolicyMappingRequestCountDesc"
descriptionParams={{ partnerPolicyMappingRequestCount }}
/>
/>
</div>

<div onClick={adminDeviceProviderServices} className="relative w-[23.5%] min-h-[50%] p-6 mr-4 mb-4 pt-16 bg-white border border-gray-200 shadow cursor-pointer text-center rounded-xl" tabIndex="0" onKeyPress={(e) => onPressEnterKey(e, adminDeviceProviderServices)}>
Expand Down

0 comments on commit 302a44b

Please sign in to comment.