Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOSIP-36952: Filter Service Integration in PolicyGroupList #884

Merged
merged 2 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pmp-reactjs-ui/public/i18n/ara.json
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@
},
"policyGroupList": {
"policies": "السياسات",
"policyGroup":"مجموعة السياسات",
"policyGroup":"مجموعات السياسات",
"authPolicy": "سياسة المصادقة",
"dataSharePolicy": "سياسة مشاركة البيانات",
"createPolicyGroup": "إنشاء مجموعة سياسات",
Expand All @@ -622,7 +622,10 @@
"status":"حالة",
"action":"فعل",
"listOfPolicyGroups": "قائمة مجموعات السياسات",
"errorInPolicyGroupList": "أثناء جلب قائمة مجموعات السياسات، واجهنا خطأً."
"errorInPolicyGroupList": "أثناء جلب قائمة مجموعات السياسات، واجهنا خطأً.",
"searchPolicyGroupId": "معرف مجموعة سياسة البحث",
"searchPolicyGroupName": "البحث عن اسم مجموعة السياسات",
"searchPolicyGroupDescription": "وصف مجموعة سياسة البحث"
},
"authPoliciesList": {
"createAuthPolicy": "إنشاء سياسة المصادقة",
Expand Down
7 changes: 5 additions & 2 deletions pmp-reactjs-ui/public/i18n/eng.json
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@
},
"policyGroupList": {
"policies": "Policies",
"policyGroup":"Policy Group",
"policyGroup":"Policy Groups",
"authPolicy": "Auth Policy",
"dataSharePolicy": "Data Share Policy",
"createPolicyGroup": "Create Policy Group",
Expand All @@ -618,7 +618,10 @@
"status":"Status",
"action":"Action",
"listOfPolicyGroups": "List of Policy Groups",
"errorInPolicyGroupList": "While fetching policy groups list, we have encountered with an error."
"errorInPolicyGroupList": "While fetching policy groups list, we have encountered with an error.",
"searchPolicyGroupId": "Search Policy Group ID",
"searchPolicyGroupName": "Search Policy Group Name",
"searchPolicyGroupDescription": "Search Policy Group Description"
},
"authPoliciesList": {
"createAuthPolicy": "Create Auth Policy",
Expand Down
7 changes: 5 additions & 2 deletions pmp-reactjs-ui/public/i18n/fra.json
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@
},
"policyGroupList": {
"policies": "Politiques",
"policyGroup":"Groupe de politiques",
"policyGroup":"Groupes de politiques",
"authPolicy": "Politique d'authentification",
"dataSharePolicy": "Politique de partage des données",
"createPolicyGroup": "Créer un groupe de politiques",
Expand All @@ -621,7 +621,10 @@
"status":"Statut",
"action":"Action",
"listOfPolicyGroups": "Liste des groupes de politiques",
"errorInPolicyGroupList": "Lors de la récupération de la liste des groupes de stratégies, nous avons rencontré une erreur."
"errorInPolicyGroupList": "Lors de la récupération de la liste des groupes de stratégies, nous avons rencontré une erreur.",
"searchPolicyGroupId": "ID de groupe de politiques de recherche",
"searchPolicyGroupName": "Rechercher le nom du groupe de politiques",
"searchPolicyGroupDescription": "Description du groupe de politiques de recherche"
},
"authPoliciesList": {
"createAuthPolicy": "Créer une politique d'authentification",
Expand Down
21 changes: 4 additions & 17 deletions pmp-reactjs-ui/src/pages/admin/partners/PartnersList.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
getStatusCode,
handleMouseClickForDropdown,
getPartnerTypeDescription,
resetPageNumber, applyFilter, setPageNumberAndPageSize, onResetFilter
} from "../../../utils/AppUtils";
import LoadingIcon from "../../common/LoadingIcon";
import ErrorMessage from "../../common/ErrorMessage";
Expand Down Expand Up @@ -83,8 +84,7 @@ function PartnersList() {
queryParams.append('pageSize', pageSize);

//reset page number to 0 if filter applied or page number is out of bounds
const totalNumberOfPages = Math.ceil(totalRecords / pageSize);
const effectivePageNo = pageNo > totalNumberOfPages || resetPageNo ? 0 : pageNo;
const effectivePageNo = resetPageNumber(totalRecords, pageNo, pageSize, resetPageNo);
queryParams.append('pageNo', effectivePageNo);
setResetPageNo(false);

Expand Down Expand Up @@ -129,20 +129,11 @@ function PartnersList() {
}, [sortFieldName, sortType, pageNo, pageSize, filters]);

const onApplyFilter = (filters) => {
console.log(filters)
setIsFilterApplied(true);
setResetPageNo(true);
setTriggerServerMethod(true);
setFilters(filters);
applyFilter(filters, setIsFilterApplied, setResetPageNo, setTriggerServerMethod, setFilters);
};

const getPaginationValues = (recordsPerPage, pageIndex) => {
// console.log(recordsPerPage, pageIndex);
if (pageNo !== pageIndex || pageSize !== recordsPerPage) {
setPageNo(pageIndex);
setPageSize(recordsPerPage);
setTriggerServerMethod(true);
}
setPageNumberAndPageSize(recordsPerPage, pageIndex, pageNo, setPageNo, pageSize, setPageSize, setTriggerServerMethod);
}

const viewPartnerDetails = (selectedPartnerData) => {
Expand Down Expand Up @@ -181,10 +172,6 @@ function PartnersList() {
backArrowIcon: "!mt-[9%]",
};

const onResetFilter = () => {
window.location.reload();
};

const showDeactivatePartner = (selectedPartnerdata) => {
if (selectedPartnerdata.isActive === true) {
const request = createRequest({
Expand Down
Loading
Loading