{__('Vuoto', 'gepafin')}
@@ -256,17 +330,24 @@ const NotificationsSidebar = () => {
closeFn={closeChosenMsg}
markReadFn={makeNotificationRead}/>
: (notificationsRead.length > 0
- ?
- {notificationsRead.map(o => )}
-
- :
-
-
- {__('Vuoto', 'gepafin')}
-
)}
+ ? <>
+
+ {notificationsRead.map(o => )}
+
+
+ >
+ :
+
+
+ {__('Vuoto', 'gepafin')}
+
)}
diff --git a/src/components/PaginatorBasic/index.js b/src/components/PaginatorBasic/index.js
new file mode 100644
index 0000000..9c0c833
--- /dev/null
+++ b/src/components/PaginatorBasic/index.js
@@ -0,0 +1,59 @@
+import React from 'react';
+import { __ } from '@wordpress/i18n';
+
+const PaginatorBasic = ({
+ currentPage = 0,
+ totalPages = 0,
+ clickFn = () => {
+ }
+ }) => {
+ const handleClick = (num) => {
+ const newNum = num < 0
+ ? 0
+ : num > totalPages ? totalPages : num;
+ clickFn(newNum);
+ }
+ const prevDisabled = currentPage <= 1;
+ const nextDisabled = currentPage >= totalPages
+
+ return (
+ totalPages !== 0
+ ?
+
+
+ ({currentPage} {__('di', 'gepafin')} {totalPages})
+
+
+
: null
+ )
+}
+
+export default PaginatorBasic;
\ No newline at end of file
diff --git a/src/layouts/DefaultLayout/components/AppSidebar/index.js b/src/layouts/DefaultLayout/components/AppSidebar/index.js
index 5c81b8f..30bc83e 100644
--- a/src/layouts/DefaultLayout/components/AppSidebar/index.js
+++ b/src/layouts/DefaultLayout/components/AppSidebar/index.js
@@ -45,77 +45,77 @@ const AppSidebar = () => {
label: __('Bandi osservati', 'gepafin'),
icon: 'pi pi-star',
href: '/bandi-osservati',
- id: 13,
+ id: 5,
enable: intersection(permissions, ['VIEW_CALLS']).length
},
{
label: __('Gestione domande', 'gepafin'),
icon: 'pi pi-file',
href: '/domande',
- id: 5,
+ id: 6,
enable: intersection(permissions, ['VIEW_USERS', 'MANAGE_USERS']).length
},
{
label: __('Domande da valutare', 'gepafin'),
icon: 'pi pi-calendar-clock',
href: '/domande',
- id: 6,
+ id: 7,
enable: intersection(permissions, ['EVALUATE_APPLICATIONS']).length
},
{
label: __('Archivio domande', 'gepafin'),
icon: 'pi pi-briefcase',
href: '/domande',
- id: 7,
+ id: 8,
enable: intersection(permissions, ['APPLY_CALLS']).length
},
{
label: __('Archivio domande', 'gepafin'),
icon: 'pi pi-briefcase',
href: '/domande-archivio',
- id: 5,
+ id: 9,
enable: intersection(permissions, ['VIEW_USERS', 'MANAGE_USERS']).length
},
{
label: __('Archivio domande', 'gepafin'),
icon: 'pi pi-briefcase',
href: '/domande-archivio',
- id: 6,
+ id: 10,
enable: intersection(permissions, ['EVALUATE_APPLICATIONS']).length
},
{
label: __('Soccorso istruttorio', 'gepafin'),
icon:
,
href: '/soccorso-istruttorio',
- id: 8,
+ id: 11,
enable: intersection(permissions, ['EVALUATE_APPLICATIONS']).length
},
{
label: __('Gestione utenti', 'gepafin'),
icon: 'pi pi-users',
href: '/utenti',
- id: 9,
+ id: 12,
enable: intersection(permissions, ['VIEW_USERS', 'MANAGE_USERS']).length
},
{
label: __('Configurazione', 'gepafin'),
icon: 'pi pi-cog',
//href: '/configurazione',
- id: 10,
+ id: 13,
enable: false
},
{
label: __('Report e Analisi', 'gepafin'),
icon: 'pi pi-chart-bar',
//href: '/stats',
- id: 11,
+ id: 14,
enable: false
},
{
label: __('Log di Sistema', 'gepafin'),
icon: 'pi pi-receipt',
clickFn: () => {},
- id: 12,
+ id: 15,
enable: false
}
]
diff --git a/src/pages/Bandi/components/AllBandiTable/index.js b/src/pages/Bandi/components/AllBandiTable/index.js
index 9bbc70f..14e457b 100644
--- a/src/pages/Bandi/components/AllBandiTable/index.js
+++ b/src/pages/Bandi/components/AllBandiTable/index.js
@@ -121,7 +121,7 @@ const AllBandiTable = () => {
return(
-
{
{
{
return (
-
{
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(
-
{
return(
-
{
return (
-
{
return (
-
{
return(
-
{
return (
-
{
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 (
-
{
return (
-
{
return(
-
{
return (
- {
+ NetworkService.post(`${API_BASE_URL}/call/pagination`, body, callback, errCallback, queryParams);
+ };
+
static getBando = (id, callback, errCallback, queryParams) => {
NetworkService.get(`${API_BASE_URL}/call/${id}`, callback, errCallback, queryParams);
};
diff --git a/src/service/notification-service.js b/src/service/notification-service.js
index c3457b2..25b77f6 100644
--- a/src/service/notification-service.js
+++ b/src/service/notification-service.js
@@ -8,6 +8,14 @@ export default class NotificationService {
NetworkService.get(`${API_BASE_URL}/notification/user/${id}`, callback, errCallback, queryParams);
};
+ static getNotificationsByCompanyId = (id, companyId, callback, errCallback, queryParams) => {
+ NetworkService.get(`${API_BASE_URL}/notification/user/${id}/company/${companyId}/notifications`, callback, errCallback, queryParams);
+ };
+
+ static getNotificationsPagination = (id, body, callback, errCallback, queryParams) => {
+ NetworkService.post(`${API_BASE_URL}/notification/user/${id}/pagination`, body, callback, errCallback, queryParams);
+ };
+
static notificationMakeRead = (id, callback, errCallback) => {
NetworkService.put(`${API_BASE_URL}/notification/${id}`, {}, callback, errCallback, [
['status', 'READ']