- saving progress;
This commit is contained in:
@@ -1,52 +1,66 @@
|
||||
import React from 'react';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { intersection } from 'ramda';
|
||||
|
||||
// store
|
||||
import { useStore } from '../../../../store';
|
||||
|
||||
// components
|
||||
import { NavLink } from 'react-router-dom';
|
||||
|
||||
const AppSidebar = () => {
|
||||
const permissions = useStore().main.getPermissions();
|
||||
|
||||
const items = [
|
||||
{
|
||||
label: __('Riepilogo', 'gepafin'),
|
||||
icon: 'pi pi-objects-column',
|
||||
href: '/',
|
||||
id: 1
|
||||
id: 1,
|
||||
enable: true
|
||||
},
|
||||
{
|
||||
label: __('Gestione Bandi', 'gepafin'),
|
||||
icon: 'pi pi-file',
|
||||
href: '/bandi',
|
||||
id: 2
|
||||
id: 2,
|
||||
enable: intersection(permissions, ['VIEW_CALLS', 'MANAGE_TENDERS']).length
|
||||
},
|
||||
{
|
||||
label: __('Gestione Utenti', 'gepafin'),
|
||||
icon: 'pi pi-users',
|
||||
href: '/utenti',
|
||||
id: 3
|
||||
//href: '/utenti',
|
||||
id: 3,
|
||||
enable: intersection(permissions, ['VIEW_USERS', 'MANAGE_USERS']).length
|
||||
},
|
||||
{
|
||||
label: __('Configurazione', 'gepafin'),
|
||||
icon: 'pi pi-cog',
|
||||
href: '/configurazione',
|
||||
id: 4
|
||||
//href: '/configurazione',
|
||||
id: 4,
|
||||
enable: false
|
||||
},
|
||||
{
|
||||
label: __('Report e Analisi', 'gepafin'),
|
||||
icon: 'pi pi-chart-bar',
|
||||
href: '/stats',
|
||||
id: 5
|
||||
//href: '/stats',
|
||||
id: 5,
|
||||
enable: false
|
||||
},
|
||||
{
|
||||
label: __('Log di Sistema', 'gepafin'),
|
||||
icon: 'pi pi-receipt',
|
||||
clickFn: () => {},
|
||||
id: 6
|
||||
id: 6,
|
||||
enable: false
|
||||
}
|
||||
]
|
||||
|
||||
return <aside>
|
||||
<ul>
|
||||
{items.map(o => <li key={o.id}>
|
||||
{items
|
||||
.filter(o => o.enable)
|
||||
.map(o => <li key={o.id}>
|
||||
{o.href
|
||||
? <NavLink to={o.href}>
|
||||
<i className={o.icon}></i>
|
||||
|
||||
Reference in New Issue
Block a user