Skip to content

Commit

Permalink
MOSIP-37697: Added SBI expiry status column (#993)
Browse files Browse the repository at this point in the history
Signed-off-by: Swetha K <[email protected]>
Co-authored-by: Swetha K <[email protected]>
  • Loading branch information
SwethaKrish4 and Swetha K authored Dec 5, 2024
1 parent eb6fa28 commit 60614d1
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 23 deletions.
10 changes: 7 additions & 3 deletions pmp-reactjs-ui/public/i18n/ara.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@
"expired": "منتهي الصلاحية",
"uploaded": "تم الرفع",
"notUploaded": "لم يتم الرفع",
"draft": "مسودة"
"draft": "مسودة",
"valid": "صالح"
},
"policies": {
"policies": "سياسات",
Expand Down Expand Up @@ -408,7 +409,7 @@
"devicesCountTxt": "مرتبطة بجهاز SBI هذا",
"addDevices": "إضافة أجهزة",
"viewDevices": "عرض الأجهزة",
"version": "الإصدار",
"sbiVersion": "إصدار SBI",
"searchVersion": "البحث عن إصدار SBI",
"linkedDevices": "الأجهزة المرتبطة",
"status":"حالة",
Expand All @@ -423,7 +424,10 @@
"deactivate": "إلغاء تنشيط SBI",
"submittedOn": "تم إرساله",
"errorInSbiList": "أثناء جلب قوائم SBI، واجهنا خطأً.",
"guidence": "ملاحظة: 1. لا يمكن للمستخدم إضافة أجهزة إلا بعد موافقة مسؤول الشريك على SBI. 2. لا يمكن للمستخدم إضافة أجهزة بعد انتهاء صلاحية SBI"
"guidence": "ملاحظة: 1. لا يمكن للمستخدم إضافة أجهزة إلا بعد موافقة مسؤول الشريك على SBI. 2. لا يمكن للمستخدم إضافة أجهزة بعد انتهاء صلاحية SBI",
"sbiExpiryStatus": "حالة انتهاء صلاحية SBI",
"selectSbiExpiryStatus": "حدد حالة انتهاء صلاحية SBI",
"listOfSbis": "قائمة SBI"
},
"devicesList": {
"addDevices": "إضافة أجهزة",
Expand Down
10 changes: 7 additions & 3 deletions pmp-reactjs-ui/public/i18n/eng.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@
"expired": "Expired",
"uploaded": "Uploaded",
"notUploaded": "Not Uploaded",
"draft": "Draft"
"draft": "Draft",
"valid": "Valid"
},
"policies": {
"policies": "Policies",
Expand Down Expand Up @@ -403,7 +404,7 @@
"pendingForApprovalContx": "pending for approval under this SBI",
"addDevices": "Add Devices",
"viewDevices": "View Devices",
"version": "Version",
"sbiVersion": "SBI Version",
"searchVersion": "Search SBI Version",
"linkedDevices": "Linked Devices",
"status": "Status",
Expand All @@ -418,7 +419,10 @@
"deactivate": "Deactivate SBI",
"submittedOn": "Submitted On",
"errorInSbiList": "While fetching SBI Lists, we have encountered with an error.",
"guidence": "Note: 1. User can add devices only after the SBI is approved by Partner Admin. 2. User cannot add devices anymore after the SBI is expired"
"guidence": "Note: 1. User can add devices only after the SBI is approved by Partner Admin. 2. User cannot add devices anymore after the SBI is expired",
"sbiExpiryStatus": "SBI Expiry Status",
"selectSbiExpiryStatus": "Select SBI Expiry Status",
"listOfSbis": "List of SBIs"
},
"devicesList": {
"addDevices": "Add Devices",
Expand Down
10 changes: 7 additions & 3 deletions pmp-reactjs-ui/public/i18n/fra.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@
"expired": "Expiré",
"uploaded": "Téléchargé",
"notUploaded": "Non téléchargé",
"draft": "Brouillon"
"draft": "Brouillon",
"valid": "Valide"
},
"policies": {
"policies": "Stratégies",
Expand Down Expand Up @@ -408,7 +409,7 @@
"devicesCountTxt": "sont associés à ce SBI",
"addDevices": "Ajouter des périphériques",
"viewDevices": "Afficher les périphériques",
"version": "Version",
"sbiVersion": "Version SBI",
"searchVersion": "Rechercher la version SBI",
"linkedDevices": "Appareils liés",
"status":"Statut",
Expand All @@ -423,7 +424,10 @@
"deactivate": "Désactiver SBI",
"submittedOn": "Soumis le",
"errorInSbiList": "Lors de la récupération des listes SBI, nous avons rencontré une erreur.",
"guidence": "Remarque : 1. L'utilisateur ne peut ajouter des appareils qu'une fois le SBI approuvé par l'administrateur partenaire. 2. L'utilisateur ne peut plus ajouter d'appareils une fois le SBI expiré"
"guidence": "Remarque : 1. L'utilisateur ne peut ajouter des appareils qu'une fois le SBI approuvé par l'administrateur partenaire. 2. L'utilisateur ne peut plus ajouter d'appareils une fois le SBI expiré",
"sbiExpiryStatus": "Statut d'expiration du SBI",
"selectSbiExpiryStatus": "Sélectionnez le statut d'expiration du SBI",
"listOfSbis": "Liste des SBI"
},
"devicesList": {
"addDevices": "Ajouter des périphériques",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function AdminSbiList() {
orgName: null,
sbiVersion: null,
status: null,
sbiExpiryStatus: null
});
const submenuRef = useRef([]);

Expand All @@ -60,9 +61,10 @@ function AdminSbiList() {
const tableHeaders = [
{ id: "partnerId", headerNameKey: 'sbiList.partnerId' },
{ id: "orgName", headerNameKey: 'sbiList.orgName' },
{ id: "sbiVersion", headerNameKey: "sbiList.version" },
{ id: "sbiVersion", headerNameKey: "sbiList.sbiVersion" },
{ id: "sbiCreatedDateTime", headerNameKey: "sbiList.sbiCreatedDate" },
{ id: "sbiExpiryDateTime", headerNameKey: "sbiList.sbiExpiryDate" },
{ id: "sbiExpiryStatus", headerNameKey: "sbiList.sbiExpiryStatus" },
{ id: "createdDateTime", headerNameKey: "sbiList.createdDate" },
{ id: "status", headerNameKey: "sbiList.status" },
{ id: "countOfAssociatedDevices", headerNameKey: "sbiList.linkedDevices" },
Expand All @@ -85,6 +87,7 @@ function AdminSbiList() {
if (filterAttributes.orgName) queryParams.append('orgName', filterAttributes.orgName);
if (filterAttributes.sbiVersion) queryParams.append('sbiVersion', filterAttributes.sbiVersion);
if (filterAttributes.status) queryParams.append('status', filterAttributes.status);
if (filterAttributes.sbiExpiryStatus) queryParams.append('sbiExpiryStatus', filterAttributes.sbiExpiryStatus);

const url = `${getPartnerManagerUrl('/securebiometricinterface/search/v2', process.env.NODE_ENV)}?${queryParams.toString()}`;
try {
Expand Down Expand Up @@ -198,7 +201,7 @@ function AdminSbiList() {
)}
<div className="flex-col mt-7">
<div className="flex justify-between mb-5 max-470:flex-col">
<Title title='deviceProviderServices.sbiDeviceDetails' backLink='/partnermanagement' ></Title>
<Title title='sbiList.listOfSbis' backLink='/partnermanagement' ></Title>
</div>
<DeviceProviderServicesTab
activeSbi={true}
Expand All @@ -213,7 +216,7 @@ function AdminSbiList() {
) : (
<div className={`bg-[#FCFCFC] w-full mt-1 rounded-t-xl shadow-lg pt-3 ${!tableDataLoaded && "py-6"}`}>
<FilterButtons
listTitle='sbiList.listOfSbi'
listTitle='sbiList.listOfSbis'
dataListLength={totalRecords}
filter={expandFilter}
onResetFilter={onResetFilter}
Expand All @@ -237,7 +240,7 @@ function AdminSbiList() {
<th key={index} className="py-4 text-sm font-semibold text-[#6F6E6E] w-[15%]">
<div className={`mx-2 flex gap-x-0 items-center ${isLoginLanguageRTL ? "text-right" : "text-left"}`}>
{t(header.headerNameKey)}
{(header.id !== "action") && (header.id !== "countOfAssociatedDevices") && (
{(header.id !== "action") && (
<SortingIcon
headerId={header.id}
sortDescOrder={sortDescOrder}
Expand All @@ -263,14 +266,15 @@ function AdminSbiList() {
<td onClick={() => sbi.status !== 'deactivated' && viewSbiDetails(sbi)} className="px-2">{sbi.sbiVersion}</td>
<td onClick={() => sbi.status !== 'deactivated' && viewSbiDetails(sbi)} className="px-2">{formatDate(sbi.sbiCreatedDateTime, "date", false)}</td>
<td onClick={() => sbi.status !== 'deactivated' && viewSbiDetails(sbi)} className="px-2">{formatDate(sbi.sbiExpiryDateTime, "date", false)}</td>
<td onClick={() => sbi.status !== 'deactivated' && viewSbiDetails(sbi)} className={`px-2 ${(sbi.status !== 'deactivated' && sbi.sbiExpiryStatus === 'expired') && 'text-crimson-red'}`}>{getStatusCode(sbi.sbiExpiryStatus, t)}</td>
<td onClick={() => sbi.status !== 'deactivated' && viewSbiDetails(sbi)} className="px-2">{formatDate(sbi.createdDateTime, "date", true)}</td>
<td onClick={() => sbi.status !== 'deactivated' && viewSbiDetails(sbi)}>
<div className={`${bgOfStatus(sbi.status)} flex min-w-fit w-14 justify-center py-1.5 px-2 mx-2 my-3 text-xs font-semibold rounded-md`}>
{getStatusCode(sbi.status, t)}
</div>
</td>
<td className={`px-2 text-center`}>
<div className="flex items-center justify-center">
<div className={`flex items-center justify-center ${sbi.countOfAssociatedDevices > 0 ? 'cursor-pointer' : 'cursor-default'}`}>
<img src={sbi.status === 'deactivated' ? deactiveLinkedDevices : activeLinkedDevices} alt=''></img>
<p className={`${sbi.status === 'deactivated' ? 'text-[#969696]' : 'text-tory-blue'} px-2`}>{sbi.countOfAssociatedDevices}</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,29 @@ function AdminSbiListFilter( {onApplyFilter} ) {
const { t } = useTranslation();
const isLoginLanguageRTL = isLangRTL(getUserProfile().langCode);
const [status, setStatus] = useState([]);
const [sbiExpiryStatus, setSbiExpiryStatus] = useState([]);
const [statusDropdownData, setStatusDropdownData] = useState([
{ status: 'approved' },
{ status: 'rejected'},
{ status: 'pending_approval'},
{ status: 'deactivated'}
{ status: 'approved' },
{ status: 'rejected'},
{ status: 'pending_approval'},
{ status: 'deactivated'}
]);
const [sbiExpiryStatusDropdownData, setSbiExpiryStatusDropdownData] = useState([
{ sbiExpiryStatus: 'expired' },
{ sbiExpiryStatus: 'valid'}
]);
const [filters, setFilters] = useState({
partnerId: "",
orgName: "",
sbiVersion: "",
status: "",
sbiExpiryStatus: "",
});

useEffect(() => {
const fetchData = async () => {
setStatus(
createDropdownData("status", "", true, statusDropdownData, t, t("partnerList.selectStatus"))
);
setStatus(createDropdownData("status", "", true, statusDropdownData, t, t("partnerList.selectStatus")));
setSbiExpiryStatus(createDropdownData("sbiExpiryStatus", "", true, sbiExpiryStatusDropdownData, t, t("sbiList.selectSbiExpiryStatus")));
};
fetchData();
}, [t]);
Expand Down Expand Up @@ -73,11 +78,21 @@ function AdminSbiListFilter( {onApplyFilter} ) {
<TextInputComponent
fieldName="sbiVersion"
onTextChange={onFilterChangeEvent}
fieldNameKey="sbiList.version"
fieldNameKey="sbiList.sbiVersion"
placeHolderKey="sbiList.searchVersion"
styleSet={styleSet}
id="sbi_version_filter"
/>
<DropdownComponent
fieldName="sbiExpiryStatus"
dropdownDataList={sbiExpiryStatus}
onDropDownChangeEvent={onFilterChangeEvent}
fieldNameKey="sbiList.sbiExpiryStatus"
placeHolderKey="sbiList.selectSbiExpiryStatus"
styleSet={styles}
isPlaceHolderPresent={true}
id="sbi_expiry_status_filter"
/>
<DropdownComponent
fieldName="status"
dropdownDataList={status}
Expand Down
4 changes: 3 additions & 1 deletion pmp-reactjs-ui/src/utils/AppUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ export const getStatusCode = (status, t) => {
return t('statusCodes.notUploaded');
} else if (status === "draft") {
return t('statusCodes.draft');
} else if (status === "valid") {
return t('statusCodes.valid');
} else if (status === "-") {
return "-"
}
Expand Down Expand Up @@ -321,7 +323,7 @@ export const createDropdownData = (fieldName, fieldDesc, isBlankEntryRequired, d
fieldCode: getPartnerTypeDescription(item[fieldName], t),
fieldValue: item[fieldName]
});
} else if (fieldName === "status" || fieldName === "certificateExpiryStatus" || fieldName === "certificateUploadStatus") {
} else if (fieldName === "status" || fieldName === "certificateExpiryStatus" || fieldName === "certificateUploadStatus" || fieldName === "sbiExpiryStatus") {
dataArr.push({
fieldCode: getStatusCode(item[fieldName], t),
fieldValue: item[fieldName]
Expand Down

0 comments on commit 60614d1

Please sign in to comment.