- added pagination for notifications (non beneficiary);
This commit is contained in:
@@ -121,7 +121,7 @@ const AllBandiTable = () => {
|
||||
|
||||
return(
|
||||
<div className="appPageSection__table">
|
||||
<DataTable value={items} paginator showGridlines rows={10} loading={localAsyncRequest} dataKey="id"
|
||||
<DataTable value={items} paginator showGridlines rows={5} loading={localAsyncRequest} dataKey="id"
|
||||
filters={filters} stripedRows removableSort
|
||||
header={header}
|
||||
emptyMessage={translationStrings.emptyMessage}
|
||||
|
||||
@@ -206,7 +206,7 @@ const AllBandiAccordion = ({ showOnlyPreferred = false }) => {
|
||||
<div className="appPageSection__table">
|
||||
<DataTable value={items}
|
||||
paginator
|
||||
rows={10}
|
||||
rows={5}
|
||||
loading={isAsyncRequest}
|
||||
dataKey="id"
|
||||
filters={filters}
|
||||
|
||||
@@ -186,7 +186,7 @@ const AllBandiPreferredAccordion = () => {
|
||||
<div className="appPageSection__table">
|
||||
<DataTable value={items}
|
||||
paginator
|
||||
rows={10}
|
||||
rows={5}
|
||||
loading={isAsyncRequest}
|
||||
dataKey="id"
|
||||
filters={filters}
|
||||
|
||||
@@ -136,7 +136,7 @@ const DraftApplicationsTable = () => {
|
||||
|
||||
return (
|
||||
<div className="appPageSection__table">
|
||||
<DataTable value={items} paginator showGridlines rows={10} loading={localAsyncRequest} dataKey="id"
|
||||
<DataTable value={items} paginator showGridlines rows={5} loading={localAsyncRequest} dataKey="id"
|
||||
filters={filters} stripedRows removableSort
|
||||
header={header}
|
||||
emptyMessage={translationStrings.emptyMessage}
|
||||
|
||||
@@ -21,17 +21,43 @@ const LatestBandiTable = () => {
|
||||
const [filters, setFilters] = useState(null);
|
||||
const [localAsyncRequest, setLocalAsyncRequest] = useState(false);
|
||||
const [, setStatuses] = useState([]);
|
||||
/*const [totalRecordsNum, setTotalRecordsNum] = useState(0);
|
||||
const [perPageNum, setPerPageNum] = useState(0);
|
||||
const getPaginationQuery = () => {
|
||||
return {
|
||||
"globalFilters": {
|
||||
"page": 1,
|
||||
"limit": 5,
|
||||
"sortBy": {
|
||||
"columnName": "ID",
|
||||
"sortDesc": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const onPageChange = (e) => {
|
||||
console.log('onPageChange', e)
|
||||
}*/
|
||||
|
||||
useEffect(() => {
|
||||
setLocalAsyncRequest(true);
|
||||
BandoService.getBandi(getCallback, errGetCallbacks);
|
||||
//const paginationQuery = getPaginationQuery();
|
||||
//BandoService.getBandiPaginated(paginationQuery, getCallback, errGetCallbacks);
|
||||
}, []);
|
||||
|
||||
const getCallback = (data) => {
|
||||
if (data.status === 'SUCCESS') {
|
||||
/*const { body, totalRecords, currentPage, totalPages, pageSize } = data.data;
|
||||
setTotalRecordsNum(totalRecords);
|
||||
setPerPageNum(pageSize);
|
||||
const newItems = body.filter(o => o.status === 'PUBLISH');
|
||||
setItems(getFormattedBandiData(newItems));
|
||||
setStatuses(uniq(body.map(o => o.status)));*/
|
||||
const newItems = data.data.filter(o => o.status === 'PUBLISH');
|
||||
setItems(getFormattedBandiData(newItems));
|
||||
setStatuses(uniq(data.data.map(o => o.status)))
|
||||
setStatuses(uniq(data.data.map(o => o.status)));
|
||||
initFilters();
|
||||
}
|
||||
setLocalAsyncRequest(false);
|
||||
@@ -106,7 +132,10 @@ const LatestBandiTable = () => {
|
||||
|
||||
return(
|
||||
<div className="appPageSection__table">
|
||||
<DataTable value={items} paginator showGridlines rows={10} loading={localAsyncRequest} dataKey="id"
|
||||
<DataTable value={items}
|
||||
paginator showGridlines
|
||||
/*lazy totalRecords={totalRecordsNum} onPage={onPageChange}*/
|
||||
rows={5} loading={localAsyncRequest} dataKey="id"
|
||||
filters={filters} stripedRows removableSort
|
||||
header={header}
|
||||
emptyMessage={translationStrings.emptyMessage}
|
||||
|
||||
@@ -103,7 +103,7 @@ const LatestUsersActivityTable = () => {
|
||||
|
||||
return(
|
||||
<div className="appPageSection__table">
|
||||
<DataTable value={items} paginator showGridlines rows={10} loading={loading} dataKey="id"
|
||||
<DataTable value={items} paginator showGridlines rows={5} loading={loading} dataKey="id"
|
||||
filters={filters}
|
||||
globalFilterFields={['name', 'status']}
|
||||
header={header}
|
||||
|
||||
@@ -189,7 +189,7 @@ const LatestBandiTable = () => {
|
||||
|
||||
return (
|
||||
<div className="appPageSection__table">
|
||||
<DataTable value={items} paginator showGridlines rows={10} loading={loading} dataKey="id"
|
||||
<DataTable value={items} paginator showGridlines rows={5} loading={loading} dataKey="id"
|
||||
filters={filters} stripedRows removableSort
|
||||
header={header}
|
||||
emptyMessage={translationStrings.emptyMessage}
|
||||
|
||||
@@ -204,7 +204,7 @@ const MyLatestSubmissionsTable = () => {
|
||||
|
||||
return (
|
||||
<div className="appPageSection__table">
|
||||
<DataTable value={items} paginator showGridlines rows={10} loading={localAsyncRequest} dataKey="id"
|
||||
<DataTable value={items} paginator showGridlines rows={5} loading={localAsyncRequest} dataKey="id"
|
||||
filters={filters} stripedRows removableSort
|
||||
header={header}
|
||||
emptyMessage={translationStrings.emptyMessage}
|
||||
|
||||
@@ -136,7 +136,7 @@ const PreInstructorDomandeTable = () => {
|
||||
|
||||
return(
|
||||
<div className="appPageSection__table">
|
||||
<DataTable value={items} paginator showGridlines rows={10} loading={localAsyncRequest} dataKey="id"
|
||||
<DataTable value={items} paginator showGridlines rows={5} loading={localAsyncRequest} dataKey="id"
|
||||
filters={filters} stripedRows removableSort
|
||||
header={header}
|
||||
emptyMessage={translationStrings.emptyMessage}
|
||||
|
||||
@@ -150,7 +150,7 @@ const AllDomandeTable = ({ openDialogFn, updaterString = '' }) => {
|
||||
|
||||
return (
|
||||
<div className="appPageSection__table">
|
||||
<DataTable value={items} paginator showGridlines rows={10} loading={localAsyncRequest} dataKey="id"
|
||||
<DataTable value={items} paginator showGridlines rows={5} loading={localAsyncRequest} dataKey="id"
|
||||
filters={filters} stripedRows removableSort
|
||||
header={header}
|
||||
emptyMessage={translationStrings.emptyMessage}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { is, uniq } from 'ramda';
|
||||
import { Link, useLocation } from 'react-router-dom';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
// api
|
||||
import ApplicationService from '../../../../service/application-service';
|
||||
@@ -29,7 +29,6 @@ const AllDomandeArchiveTable = ({ updaterString = '' }) => {
|
||||
const [filters, setFilters] = useState(null);
|
||||
const [localAsyncRequest, setLocalAsyncRequest] = useState(false);
|
||||
const [statuses, setStatuses] = useState([]);
|
||||
const location = useLocation();
|
||||
|
||||
useEffect(() => {
|
||||
setLocalAsyncRequest(true);
|
||||
@@ -141,7 +140,7 @@ const AllDomandeArchiveTable = ({ updaterString = '' }) => {
|
||||
|
||||
return (
|
||||
<div className="appPageSection__table">
|
||||
<DataTable value={items} paginator showGridlines rows={10} loading={localAsyncRequest} dataKey="id"
|
||||
<DataTable value={items} paginator showGridlines rows={5} loading={localAsyncRequest} dataKey="id"
|
||||
filters={filters} stripedRows removableSort
|
||||
header={header}
|
||||
emptyMessage={translationStrings.emptyMessage}
|
||||
|
||||
@@ -157,7 +157,7 @@ const BeneficiarioDomandeTable = () => {
|
||||
|
||||
return (
|
||||
<div className="appPageSection__table">
|
||||
<DataTable value={items} paginator showGridlines rows={10} loading={localAsyncRequest} dataKey="id"
|
||||
<DataTable value={items} paginator showGridlines rows={5} loading={localAsyncRequest} dataKey="id"
|
||||
filters={filters} stripedRows removableSort
|
||||
header={header}
|
||||
emptyMessage={translationStrings.emptyMessage}
|
||||
|
||||
@@ -135,7 +135,7 @@ const PreInstructorSoccorsiTable = ({ openDialogFn }) => {
|
||||
|
||||
return(
|
||||
<div className="appPageSection__table">
|
||||
<DataTable value={items} paginator showGridlines rows={10} loading={localAsyncRequest} dataKey="id"
|
||||
<DataTable value={items} paginator showGridlines rows={5} loading={localAsyncRequest} dataKey="id"
|
||||
filters={filters} stripedRows removableSort
|
||||
header={header}
|
||||
emptyMessage={translationStrings.emptyMessage}
|
||||
|
||||
@@ -141,7 +141,7 @@ const AllUsersTable = () => {
|
||||
|
||||
return (
|
||||
<div className="appPageSection__table">
|
||||
<DataTable value={users} paginator showGridlines rows={10} loading={loading} dataKey="id"
|
||||
<DataTable value={users} paginator showGridlines rows={5} loading={loading} dataKey="id"
|
||||
filters={filters} stripedRows removableSort
|
||||
header={header}
|
||||
emptyMessage={translationStrings.emptyMessage}
|
||||
|
||||
Reference in New Issue
Block a user