- added instructor dashboard page;
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
"@babel/preset-react": "7.24.7",
|
"@babel/preset-react": "7.24.7",
|
||||||
"@date-fns/tz": "1.1.2",
|
"@date-fns/tz": "1.1.2",
|
||||||
"@emotion/styled": "11.13.0",
|
"@emotion/styled": "11.13.0",
|
||||||
|
"@number-flow/react": "^0.2.0",
|
||||||
"@tanstack/react-table": "^8.20.5",
|
"@tanstack/react-table": "^8.20.5",
|
||||||
"@wordpress/i18n": "5.8.0",
|
"@wordpress/i18n": "5.8.0",
|
||||||
"@wordpress/react-i18n": "4.8.0",
|
"@wordpress/react-i18n": "4.8.0",
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ const TopBarProfileMenu = ({ menuLeftRef }) => {
|
|||||||
command: () => {
|
command: () => {
|
||||||
navigate('/profilo-aziendale')
|
navigate('/profilo-aziendale')
|
||||||
},
|
},
|
||||||
enable: !intersection(permissions, ['MANAGE_TENDERS']).length && companies.length > 0
|
enable: intersection(permissions, ['APPLY_CALLS']).length && companies.length > 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: __('Seleziona azienda', 'gepafin'),
|
label: __('Seleziona azienda', 'gepafin'),
|
||||||
@@ -67,7 +67,7 @@ const TopBarProfileMenu = ({ menuLeftRef }) => {
|
|||||||
command: () => {
|
command: () => {
|
||||||
navigate('/agguingi-azienda')
|
navigate('/agguingi-azienda')
|
||||||
},
|
},
|
||||||
enable: !intersection(permissions, ['MANAGE_TENDERS']).length
|
enable: intersection(permissions, ['APPLY_CALLS']).length
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
separator: true,
|
separator: true,
|
||||||
|
|||||||
@@ -14,6 +14,9 @@ const getBandoLabel = (status) => {
|
|||||||
case 'DRAFT':
|
case 'DRAFT':
|
||||||
return __('Bozza', 'gepafin');
|
return __('Bozza', 'gepafin');
|
||||||
|
|
||||||
|
case 'AWAITING':
|
||||||
|
return __('In attesa', 'gepafin');
|
||||||
|
|
||||||
case 'EXPIRED':
|
case 'EXPIRED':
|
||||||
return __('Scaduto', 'gepafin');
|
return __('Scaduto', 'gepafin');
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,9 @@ const getBandoSeverity = (status) => {
|
|||||||
case 'DRAFT':
|
case 'DRAFT':
|
||||||
return 'warning';
|
return 'warning';
|
||||||
|
|
||||||
|
case 'AWAITING':
|
||||||
|
return 'warning';
|
||||||
|
|
||||||
case 'EXPIRED':
|
case 'EXPIRED':
|
||||||
return 'closed';
|
return 'closed';
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,13 @@ const AppSidebar = () => {
|
|||||||
id: 4,
|
id: 4,
|
||||||
enable: intersection(permissions, ['VIEW_CALLS']).length
|
enable: intersection(permissions, ['VIEW_CALLS']).length
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: __('Domande da valutare', 'gepafin'),
|
||||||
|
icon: 'pi pi-calendar-clock',
|
||||||
|
href: '/valutazioni',
|
||||||
|
id: 4,
|
||||||
|
enable: intersection(permissions, ['EVALUATE_APPLICATIONS']).length
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: __('Gestione Utenti', 'gepafin'),
|
label: __('Gestione Utenti', 'gepafin'),
|
||||||
icon: 'pi pi-users',
|
icon: 'pi pi-users',
|
||||||
|
|||||||
@@ -31,12 +31,12 @@ import { Link } from 'react-router-dom';
|
|||||||
const AllBandiTable = () => {
|
const AllBandiTable = () => {
|
||||||
const [items, setItems] = useState(null);
|
const [items, setItems] = useState(null);
|
||||||
const [filters, setFilters] = useState(null);
|
const [filters, setFilters] = useState(null);
|
||||||
const [loading, setLoading] = useState(false);
|
const [localAsyncRequest, setLocalAsyncRequest] = useState(false);
|
||||||
const [globalFilterValue, setGlobalFilterValue] = useState('');
|
const [globalFilterValue, setGlobalFilterValue] = useState('');
|
||||||
const [statuses, setStatuses] = useState([]);
|
const [statuses, setStatuses] = useState([]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
storeSet.main.setAsyncRequest();
|
setLocalAsyncRequest(true);
|
||||||
BandoService.getBandi(getCallback, errGetCallbacks);
|
BandoService.getBandi(getCallback, errGetCallbacks);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@@ -46,12 +46,11 @@ const AllBandiTable = () => {
|
|||||||
setStatuses(uniq(data.data.map(o => o.status)))
|
setStatuses(uniq(data.data.map(o => o.status)))
|
||||||
initFilters();
|
initFilters();
|
||||||
}
|
}
|
||||||
storeSet.main.unsetAsyncRequest();
|
setLocalAsyncRequest(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
const errGetCallbacks = (data) => {
|
const errGetCallbacks = (data) => {
|
||||||
console.log('errGetCallbacks', data)
|
setLocalAsyncRequest(false);
|
||||||
storeSet.main.unsetAsyncRequest();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const getFormattedBandiData = (data) => {
|
const getFormattedBandiData = (data) => {
|
||||||
@@ -136,7 +135,7 @@ const AllBandiTable = () => {
|
|||||||
|
|
||||||
return(
|
return(
|
||||||
<div className="appPageSection__table">
|
<div className="appPageSection__table">
|
||||||
<DataTable value={items} paginator showGridlines rows={10} loading={loading} dataKey="id"
|
<DataTable value={items} paginator showGridlines rows={10} loading={localAsyncRequest} dataKey="id"
|
||||||
filters={filters}
|
filters={filters}
|
||||||
globalFilterFields={['name', 'status']}
|
globalFilterFields={['name', 'status']}
|
||||||
header={header}
|
header={header}
|
||||||
|
|||||||
@@ -31,44 +31,12 @@ import { Link } from 'react-router-dom';
|
|||||||
const LatestBandiTable = () => {
|
const LatestBandiTable = () => {
|
||||||
const [items, setItems] = useState(null);
|
const [items, setItems] = useState(null);
|
||||||
const [filters, setFilters] = useState(null);
|
const [filters, setFilters] = useState(null);
|
||||||
const [loading, setLoading] = useState(false);
|
const [localAsyncRequest, setLocalAsyncRequest] = useState(false);
|
||||||
const [globalFilterValue, setGlobalFilterValue] = useState('');
|
const [globalFilterValue, setGlobalFilterValue] = useState('');
|
||||||
const [statuses, setStatuses] = useState([]);
|
const [statuses, setStatuses] = useState([]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// TODO
|
setLocalAsyncRequest(true);
|
||||||
/*const items = [
|
|
||||||
{
|
|
||||||
name: 'Bando Innovazione 2024',
|
|
||||||
start_date: '2024-08-08T00:00:00+00:00',
|
|
||||||
end_date: '2024-08-30T00:00:00+00:00',
|
|
||||||
submissions: 24,
|
|
||||||
status: 'PUBLISH',
|
|
||||||
id: 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Bando Sostenibilità 2024',
|
|
||||||
start_date: '2024-07-28T00:00:00+00:00',
|
|
||||||
end_date: '2024-08-15T00:00:00+00:00',
|
|
||||||
submissions: 35,
|
|
||||||
status: 'PUBLISH',
|
|
||||||
id: 9
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Bando A',
|
|
||||||
start_date: '2024-06-28T00:00:00+00:00',
|
|
||||||
end_date: '2024-06-15T00:00:00+00:00',
|
|
||||||
submissions: 2,
|
|
||||||
status: 'EXPIRED',
|
|
||||||
id: 2
|
|
||||||
}
|
|
||||||
]
|
|
||||||
setItems(getFormattedBandiData(items));
|
|
||||||
setStatuses(uniq(items.map(o => o.status)))
|
|
||||||
setLoading(false);
|
|
||||||
initFilters();*/
|
|
||||||
|
|
||||||
storeSet.main.setAsyncRequest();
|
|
||||||
BandoService.getBandi(getCallback, errGetCallbacks);
|
BandoService.getBandi(getCallback, errGetCallbacks);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@@ -79,12 +47,11 @@ const LatestBandiTable = () => {
|
|||||||
setStatuses(uniq(data.data.map(o => o.status)))
|
setStatuses(uniq(data.data.map(o => o.status)))
|
||||||
initFilters();
|
initFilters();
|
||||||
}
|
}
|
||||||
storeSet.main.unsetAsyncRequest();
|
setLocalAsyncRequest(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
const errGetCallbacks = (data) => {
|
const errGetCallbacks = (data) => {
|
||||||
console.log('errGetCallbacks', data)
|
setLocalAsyncRequest(false);
|
||||||
storeSet.main.unsetAsyncRequest();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const getFormattedBandiData = (data) => {
|
const getFormattedBandiData = (data) => {
|
||||||
@@ -179,13 +146,13 @@ const LatestBandiTable = () => {
|
|||||||
|
|
||||||
return(
|
return(
|
||||||
<div className="appPageSection__table">
|
<div className="appPageSection__table">
|
||||||
<DataTable value={items} paginator showGridlines rows={10} loading={loading} dataKey="id"
|
<DataTable value={items} paginator showGridlines rows={10} loading={localAsyncRequest} dataKey="id"
|
||||||
filters={filters}
|
filters={filters}
|
||||||
globalFilterFields={['name', 'status']}
|
globalFilterFields={['name', 'status']}
|
||||||
header={header}
|
header={header}
|
||||||
emptyMessage={__('Nessun dato disponibile', 'gepafin')}
|
emptyMessage={__('Nessun dato disponibile', 'gepafin')}
|
||||||
onFilter={(e) => setFilters(e.filters)}>
|
onFilter={(e) => setFilters(e.filters)}>
|
||||||
<Column field="name" header={__('Nome Bando', 'gepafin')} filter filterPlaceholder="Search by name"
|
<Column field="name" header={__('Nome Bando', 'gepafin')} filter filterPlaceholder={__('Cerca il nome', 'gepafin')}
|
||||||
style={{ minWidth: '12rem' }}/>
|
style={{ minWidth: '12rem' }}/>
|
||||||
<Column header={__('Data Pubblicazione', 'gepafin')} filterField="start_date" dataType="date"
|
<Column header={__('Data Pubblicazione', 'gepafin')} filterField="start_date" dataType="date"
|
||||||
style={{ minWidth: '10rem' }}
|
style={{ minWidth: '10rem' }}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react';
|
|||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { pathOr } from 'ramda';
|
import { pathOr } from 'ramda';
|
||||||
|
import NumberFlow from '@number-flow/react';
|
||||||
|
|
||||||
// store
|
// store
|
||||||
//import { storeSet } from '../../store';
|
//import { storeSet } from '../../store';
|
||||||
@@ -13,6 +14,7 @@ import DashboardService from '../../service/dashboard-service';
|
|||||||
import LatestBandiTable from './components/LatestBandiTable';
|
import LatestBandiTable from './components/LatestBandiTable';
|
||||||
//import LatestUsersActivityTable from './components/LatestUsersActivityTable';
|
//import LatestUsersActivityTable from './components/LatestUsersActivityTable';
|
||||||
import { Button } from 'primereact/button';
|
import { Button } from 'primereact/button';
|
||||||
|
import MyEvaluationsTable from '../DashboardInstructor/components/MyEvaluationsTable';
|
||||||
|
|
||||||
const Dashboard = () => {
|
const Dashboard = () => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@@ -67,27 +69,52 @@ const Dashboard = () => {
|
|||||||
<div className="statsBigBadges__grid">
|
<div className="statsBigBadges__grid">
|
||||||
<div className="statsBigBadges__gridItem">
|
<div className="statsBigBadges__gridItem">
|
||||||
<span>{__('Bandi attivi', 'gepafin')}</span>
|
<span>{__('Bandi attivi', 'gepafin')}</span>
|
||||||
<span>{getStatValue('numberOfActiveCalls', 0)}</span>
|
<span><NumberFlow
|
||||||
|
value={getStatValue('numberOfActiveCalls', 0)}
|
||||||
|
format={{ notation: 'compact' }}
|
||||||
|
locales="it-IT" /></span>
|
||||||
</div>
|
</div>
|
||||||
<div className="statsBigBadges__gridItem">
|
<div className="statsBigBadges__gridItem">
|
||||||
<span>{__('Utenti registrati', 'gepafin')}</span>
|
<span>{__('Utenti registrati', 'gepafin')}</span>
|
||||||
<span>{getStatValue('numberOfResgisteredUsers', 0)}</span>
|
<span><NumberFlow
|
||||||
|
value={getStatValue('numberOfResgisteredUsers', 0)}
|
||||||
|
format={{ notation: 'compact' }}
|
||||||
|
locales="it-IT" /></span>
|
||||||
</div>
|
</div>
|
||||||
<div className="statsBigBadges__gridItem">
|
<div className="statsBigBadges__gridItem">
|
||||||
<span>{__('Domande in pre-istruttoria', 'gepafin')}</span>
|
<span>{__('Domande in pre-istruttoria', 'gepafin')}</span>
|
||||||
<span>{getStatValue('numberOfSubmittedApplications', 0)}</span>
|
<span><NumberFlow
|
||||||
|
value={getStatValue('numberOfSubmittedApplications', 0)}
|
||||||
|
format={{ notation: 'compact' }}
|
||||||
|
locales="it-IT" /></span>
|
||||||
</div>
|
</div>
|
||||||
<div className="statsBigBadges__gridItem">
|
<div className="statsBigBadges__gridItem">
|
||||||
<span>{__('Domande in bozza', 'gepafin')}</span>
|
<span>{__('Domande in bozza', 'gepafin')}</span>
|
||||||
<span>{getStatValue('numberOfDraftApplications', 0)}</span>
|
<span><NumberFlow
|
||||||
|
value={getStatValue('numberOfDraftApplications', 0)}
|
||||||
|
format={{ notation: 'compact' }}
|
||||||
|
locales="it-IT" /></span>
|
||||||
</div>
|
</div>
|
||||||
<div className="statsBigBadges__gridItem">
|
<div className="statsBigBadges__gridItem">
|
||||||
<span>{__('Aziende', 'gepafin')}</span>
|
<span>{__('Aziende', 'gepafin')}</span>
|
||||||
<span>{getStatValue('numberOfCompany', 0)}</span>
|
<span><NumberFlow
|
||||||
|
value={getStatValue('numberOfCompany', 0)}
|
||||||
|
format={{ notation: 'compact' }}
|
||||||
|
locales="it-IT" /></span>
|
||||||
</div>
|
</div>
|
||||||
<div className="statsBigBadges__gridItem">
|
<div className="statsBigBadges__gridItem">
|
||||||
<span>{__('Totale finanziamenti attivi', 'gepafin')}</span>
|
<span>{__('Totale finanziamenti attivi', 'gepafin')}</span>
|
||||||
<span>€{formatToMillions(getStatValue('totalActiveFinancing', 0))}</span>
|
<span><NumberFlow
|
||||||
|
value={getStatValue('totalActiveFinancing', 0)}
|
||||||
|
format={{
|
||||||
|
notation: 'compact',
|
||||||
|
compactDisplay: 'short',
|
||||||
|
roundingMode: 'trunc',
|
||||||
|
style: 'currency',
|
||||||
|
currency: 'EUR',
|
||||||
|
currencyDisplay: 'symbol'
|
||||||
|
}}
|
||||||
|
locales="en-US" /></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -95,10 +122,17 @@ const Dashboard = () => {
|
|||||||
<div className="appPage__spacer"></div>
|
<div className="appPage__spacer"></div>
|
||||||
|
|
||||||
<div className="appPageSection">
|
<div className="appPageSection">
|
||||||
<h2>{__('Ultimi Bandi Pubblicati', 'gepafin')}</h2>
|
<h2>{__('Ultimi bandi pubblicati', 'gepafin')}</h2>
|
||||||
<LatestBandiTable/>
|
<LatestBandiTable/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className="appPage__spacer"></div>
|
||||||
|
|
||||||
|
<div className="appPageSection">
|
||||||
|
<h2>{__('Ultime domande pubblicate', 'gepafin')}</h2>
|
||||||
|
<MyEvaluationsTable/>
|
||||||
|
</div>
|
||||||
|
|
||||||
{/*<div className="appPage__spacer"></div>
|
{/*<div className="appPage__spacer"></div>
|
||||||
|
|
||||||
<div className="appPageSection">
|
<div className="appPageSection">
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React, { useState, useEffect} from 'react';
|
import React, { useState, useEffect} from 'react';
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
import { uniq } from 'ramda';
|
import { uniq } from 'ramda';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
// tools
|
// tools
|
||||||
import getBandoLabel from '../../../../helpers/getBandoLabel';
|
import getBandoLabel from '../../../../helpers/getBandoLabel';
|
||||||
@@ -25,7 +26,6 @@ import { Button } from 'primereact/button';
|
|||||||
import { Calendar } from 'primereact/calendar';
|
import { Calendar } from 'primereact/calendar';
|
||||||
import { Tag } from 'primereact/tag';
|
import { Tag } from 'primereact/tag';
|
||||||
import ProperBandoLabel from '../../../../components/ProperBandoLabel';
|
import ProperBandoLabel from '../../../../components/ProperBandoLabel';
|
||||||
import { Link } from 'react-router-dom';
|
|
||||||
|
|
||||||
|
|
||||||
const LatestBandiTable = () => {
|
const LatestBandiTable = () => {
|
||||||
@@ -43,7 +43,7 @@ const LatestBandiTable = () => {
|
|||||||
const getCallback = (data) => {
|
const getCallback = (data) => {
|
||||||
if (data.status === 'SUCCESS') {
|
if (data.status === 'SUCCESS') {
|
||||||
const newItems = data.data.filter(o => o.status === 'PUBLISH');
|
const newItems = data.data.filter(o => o.status === 'PUBLISH');
|
||||||
setItems(getFormattedBandiData(newItems));
|
setItems(getFormattedData(newItems));
|
||||||
setStatuses(uniq(data.data.map(o => o.status)))
|
setStatuses(uniq(data.data.map(o => o.status)))
|
||||||
initFilters();
|
initFilters();
|
||||||
}
|
}
|
||||||
@@ -55,7 +55,7 @@ const LatestBandiTable = () => {
|
|||||||
storeSet.main.unsetAsyncRequest();
|
storeSet.main.unsetAsyncRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
const getFormattedBandiData = (data) => {
|
const getFormattedData = (data) => {
|
||||||
return [...(data || [])].map((d) => {
|
return [...(data || [])].map((d) => {
|
||||||
d.start_date = new Date(d.dates[0]);
|
d.start_date = new Date(d.dates[0]);
|
||||||
d.end_date = new Date(d.dates[1]);
|
d.end_date = new Date(d.dates[1]);
|
||||||
@@ -121,18 +121,10 @@ const LatestBandiTable = () => {
|
|||||||
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)} dateFormat="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999" />;
|
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)} dateFormat="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999" />;
|
||||||
};
|
};
|
||||||
|
|
||||||
const balanceFilterTemplate = (options) => {
|
|
||||||
return <InputNumber value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)} />;
|
|
||||||
};
|
|
||||||
|
|
||||||
const statusBodyTemplate = (rowData) => {
|
const statusBodyTemplate = (rowData) => {
|
||||||
return <ProperBandoLabel status={rowData.status}/>;
|
return <ProperBandoLabel status={rowData.status}/>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const statusFilterTemplate = (options) => {
|
|
||||||
return <Dropdown value={options.value} options={statuses} onChange={(e) => options.filterCallback(e.value, options.index)} itemTemplate={statusItemTemplate} placeholder="Select One" className="p-column-filter" showClear />;
|
|
||||||
};
|
|
||||||
|
|
||||||
const statusItemTemplate = (option) => {
|
const statusItemTemplate = (option) => {
|
||||||
return <Tag value={getBandoLabel(option)} severity={getBandoSeverity(option)} />;
|
return <Tag value={getBandoLabel(option)} severity={getBandoSeverity(option)} />;
|
||||||
};
|
};
|
||||||
@@ -153,7 +145,7 @@ const LatestBandiTable = () => {
|
|||||||
header={header}
|
header={header}
|
||||||
emptyMessage={__('Nessun dato disponibile', 'gepafin')}
|
emptyMessage={__('Nessun dato disponibile', 'gepafin')}
|
||||||
onFilter={(e) => setFilters(e.filters)}>
|
onFilter={(e) => setFilters(e.filters)}>
|
||||||
<Column field="name" header={__('Nome Bando', 'gepafin')} filter filterPlaceholder="Search by name"
|
<Column field="name" header={__('Nome Bando', 'gepafin')} filter filterPlaceholder={__('Cerca il nome', 'gepafin')}
|
||||||
style={{ minWidth: '12rem' }}/>
|
style={{ minWidth: '12rem' }}/>
|
||||||
<Column header={__('Data Pubblicazione', 'gepafin')} filterField="start_date" dataType="date"
|
<Column header={__('Data Pubblicazione', 'gepafin')} filterField="start_date" dataType="date"
|
||||||
style={{ minWidth: '10rem' }}
|
style={{ minWidth: '10rem' }}
|
||||||
|
|||||||
@@ -26,14 +26,14 @@ import set404FromErrorResponse from '../../../../helpers/set404FromErrorResponse
|
|||||||
|
|
||||||
|
|
||||||
const MyLatestSubmissionsTable = () => {
|
const MyLatestSubmissionsTable = () => {
|
||||||
const isAsyncRequest = useStore().main.isAsyncRequest();
|
const [localAsyncRequest, setLocalAsyncRequest] = useState(false);
|
||||||
const [items, setItems] = useState(null);
|
const [items, setItems] = useState(null);
|
||||||
const [filters, setFilters] = useState(null);
|
const [filters, setFilters] = useState(null);
|
||||||
const [globalFilterValue, setGlobalFilterValue] = useState('');
|
const [globalFilterValue, setGlobalFilterValue] = useState('');
|
||||||
const [statuses, setStatuses] = useState([]);
|
const [statuses, setStatuses] = useState([]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
storeSet.main.setAsyncRequest();
|
setLocalAsyncRequest(true);
|
||||||
ApplicationService.getApplications(getApplCallback, errGetApplCallback)
|
ApplicationService.getApplications(getApplCallback, errGetApplCallback)
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@@ -45,12 +45,11 @@ const MyLatestSubmissionsTable = () => {
|
|||||||
initFilters();
|
initFilters();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
storeSet.main.unsetAsyncRequest();
|
setLocalAsyncRequest(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
const errGetApplCallback = (data) => {
|
const errGetApplCallback = (data) => {
|
||||||
set404FromErrorResponse(data);
|
setLocalAsyncRequest(false);
|
||||||
storeSet.main.unsetAsyncRequest();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const getFormattedBandiData = (data) => {
|
const getFormattedBandiData = (data) => {
|
||||||
@@ -164,13 +163,13 @@ const MyLatestSubmissionsTable = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="appPageSection__table">
|
<div className="appPageSection__table">
|
||||||
<DataTable value={items} paginator showGridlines rows={10} loading={isAsyncRequest} dataKey="id"
|
<DataTable value={items} paginator showGridlines rows={10} loading={localAsyncRequest} dataKey="id"
|
||||||
filters={filters}
|
filters={filters}
|
||||||
globalFilterFields={['name', 'status']}
|
globalFilterFields={['name', 'status']}
|
||||||
header={header}
|
header={header}
|
||||||
emptyMessage={__('Nessun dato disponibile', 'gepafin')}
|
emptyMessage={__('Nessun dato disponibile', 'gepafin')}
|
||||||
onFilter={(e) => setFilters(e.filters)}>
|
onFilter={(e) => setFilters(e.filters)}>
|
||||||
<Column field="callTitle" header={__('Bando', 'gepafin')} filter filterPlaceholder="Search by name"
|
<Column field="callTitle" header={__('Bando', 'gepafin')} filter filterPlaceholder={__('Cerca il nome', 'gepafin')}
|
||||||
style={{ minWidth: '12rem' }}/>
|
style={{ minWidth: '12rem' }}/>
|
||||||
<Column header={__('Scadenza', 'gepafin')} filterField="callEndDate" dataType="date"
|
<Column header={__('Scadenza', 'gepafin')} filterField="callEndDate" dataType="date"
|
||||||
style={{ minWidth: '10rem' }}
|
style={{ minWidth: '10rem' }}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react';
|
|||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { head, pathOr } from 'ramda';
|
import { head, pathOr } from 'ramda';
|
||||||
|
import NumberFlow from '@number-flow/react';
|
||||||
|
|
||||||
// store
|
// store
|
||||||
import { useStore } from '../../store';
|
import { useStore } from '../../store';
|
||||||
@@ -57,15 +58,24 @@ const DashboardBeneficiario = () => {
|
|||||||
<div className="statsBigBadges__grid">
|
<div className="statsBigBadges__grid">
|
||||||
<div className="statsBigBadges__gridItem">
|
<div className="statsBigBadges__gridItem">
|
||||||
<span>{__('Domande attive', 'gepafin')}</span>
|
<span>{__('Domande attive', 'gepafin')}</span>
|
||||||
<span>{getStatValue('numberOfApplications', 0)}</span>
|
<span><NumberFlow
|
||||||
|
value={getStatValue('numberOfApplications', 0)}
|
||||||
|
format={{ notation: 'compact' }}
|
||||||
|
locales="it-IT" /></span>
|
||||||
</div>
|
</div>
|
||||||
<div className="statsBigBadges__gridItem">
|
<div className="statsBigBadges__gridItem">
|
||||||
<span>{__('Bandi osservati', 'gepafin')}</span>
|
<span>{__('Bandi osservati', 'gepafin')}</span>
|
||||||
<span>{getStatValue('numberOfCalls', 0)}</span>
|
<span><NumberFlow
|
||||||
|
value={getStatValue('numberOfCalls', 0)}
|
||||||
|
format={{ notation: 'compact' }}
|
||||||
|
locales="it-IT" /></span>
|
||||||
</div>
|
</div>
|
||||||
<div className="statsBigBadges__gridItem">
|
<div className="statsBigBadges__gridItem">
|
||||||
<span>{__('Documenti da integrare', 'gepafin')}</span>
|
<span>{__('Documenti da integrare', 'gepafin')}</span>
|
||||||
<span>{getStatValue('numberOfIntegratedDocuments', 0)}</span>
|
<span><NumberFlow
|
||||||
|
value={getStatValue('numberOfIntegratedDocuments', 0)}
|
||||||
|
format={{ notation: 'compact' }}
|
||||||
|
locales="it-IT" /></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,189 @@
|
|||||||
|
import React, { useState, useEffect } from 'react';
|
||||||
|
import { __ } from '@wordpress/i18n';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
|
// store
|
||||||
|
import { useStore } from '../../../../store';
|
||||||
|
|
||||||
|
// tools
|
||||||
|
//import set404FromErrorResponse from '../../../../helpers/set404FromErrorResponse';
|
||||||
|
import ProperBandoLabel from '../../../../components/ProperBandoLabel';
|
||||||
|
|
||||||
|
// api
|
||||||
|
//import ApplicationService from '../../../../service/application-service';
|
||||||
|
|
||||||
|
// components
|
||||||
|
import { FilterMatchMode, FilterOperator } from 'primereact/api';
|
||||||
|
import { DataTable } from 'primereact/datatable';
|
||||||
|
import { Column } from 'primereact/column';
|
||||||
|
import { InputText } from 'primereact/inputtext';
|
||||||
|
import { IconField } from 'primereact/iconfield';
|
||||||
|
import { InputIcon } from 'primereact/inputicon';
|
||||||
|
import { Button } from 'primereact/button';
|
||||||
|
import { Calendar } from 'primereact/calendar';
|
||||||
|
|
||||||
|
|
||||||
|
const MyEvaluationsTable = () => {
|
||||||
|
const isAsyncRequest = useStore().main.isAsyncRequest();
|
||||||
|
const [items, setItems] = useState(null);
|
||||||
|
const [filters, setFilters] = useState(null);
|
||||||
|
const [globalFilterValue, setGlobalFilterValue] = useState('');
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const demoItems = [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
callTitle: 'Bando 1',
|
||||||
|
appliedDate: '2024-10-01',
|
||||||
|
callEndDate: '2025-11-25',
|
||||||
|
status: 'AWAITING'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
callTitle: 'Bando 2',
|
||||||
|
appliedDate: '2024-08-11',
|
||||||
|
callEndDate: '2027-09-23',
|
||||||
|
status: 'AWAITING'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
setItems(getFormattedData(demoItems));
|
||||||
|
/*storeSet.main.setAsyncRequest();
|
||||||
|
ApplicationService.getApplications(getApplCallback, errGetApplCallback)*/
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
/*const getApplCallback = (data) => {
|
||||||
|
if (data.status === 'SUCCESS') {
|
||||||
|
if (data.data.length) {
|
||||||
|
setItems(getFormattedBandiData(data.data));
|
||||||
|
setStatuses(uniq(items.map(o => o.status)))
|
||||||
|
initFilters();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
storeSet.main.unsetAsyncRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
const errGetApplCallback = (data) => {
|
||||||
|
set404FromErrorResponse(data);
|
||||||
|
storeSet.main.unsetAsyncRequest();
|
||||||
|
}*/
|
||||||
|
|
||||||
|
const getFormattedData = (data) => {
|
||||||
|
return [...(data || [])].map((d) => {
|
||||||
|
d.appliedDate = new Date(d.appliedDate);
|
||||||
|
d.callEndDate = new Date(d.callEndDate);
|
||||||
|
|
||||||
|
return d;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const formatDate = (value) => {
|
||||||
|
return value.toLocaleDateString('it-IT', {
|
||||||
|
day: '2-digit',
|
||||||
|
month: '2-digit',
|
||||||
|
year: 'numeric'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const clearFilter = () => {
|
||||||
|
initFilters();
|
||||||
|
};
|
||||||
|
|
||||||
|
const onGlobalFilterChange = (e) => {
|
||||||
|
const value = e.target.value;
|
||||||
|
let _filters = { ...filters };
|
||||||
|
|
||||||
|
_filters['global'].value = value;
|
||||||
|
|
||||||
|
setFilters(_filters);
|
||||||
|
setGlobalFilterValue(value);
|
||||||
|
};
|
||||||
|
|
||||||
|
const initFilters = () => {
|
||||||
|
setFilters({
|
||||||
|
global: { value: null, matchMode: FilterMatchMode.CONTAINS },
|
||||||
|
callTitle: {
|
||||||
|
operator: FilterOperator.AND,
|
||||||
|
constraints: [{ value: null, matchMode: FilterMatchMode.STARTS_WITH }]
|
||||||
|
},
|
||||||
|
appliedDate: {
|
||||||
|
operator: FilterOperator.AND,
|
||||||
|
constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }]
|
||||||
|
},
|
||||||
|
callEndDate: {
|
||||||
|
operator: FilterOperator.AND,
|
||||||
|
constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
setGlobalFilterValue('');
|
||||||
|
};
|
||||||
|
|
||||||
|
const renderHeader = () => {
|
||||||
|
return (
|
||||||
|
<div className="appTableHeader">
|
||||||
|
<Button type="button" icon="pi pi-filter-slash" label={__('Pulisci', 'gepafin')} outlined
|
||||||
|
onClick={clearFilter}/>
|
||||||
|
<IconField iconPosition="left">
|
||||||
|
<InputIcon className="pi pi-search"/>
|
||||||
|
<InputText value={globalFilterValue} onChange={onGlobalFilterChange}
|
||||||
|
placeholder={__('Cerca', 'gepafin')}/>
|
||||||
|
</IconField>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const dateAppliedBodyTemplate = (rowData) => {
|
||||||
|
return formatDate(rowData.appliedDate);
|
||||||
|
};
|
||||||
|
|
||||||
|
const dateEndBodyTemplate = (rowData) => {
|
||||||
|
return formatDate(rowData.callEndDate);
|
||||||
|
};
|
||||||
|
|
||||||
|
const dateFilterTemplate = (options) => {
|
||||||
|
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
||||||
|
dateFormat="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999"/>;
|
||||||
|
};
|
||||||
|
|
||||||
|
const statusBodyTemplate = (rowData) => {
|
||||||
|
return <ProperBandoLabel status={rowData.status}/>;
|
||||||
|
};
|
||||||
|
|
||||||
|
const actionsBodyTemplate = (rowData) => {
|
||||||
|
return <Link to={`/valutazioni/${rowData.id}`}>
|
||||||
|
<Button type="button"
|
||||||
|
severity="info"
|
||||||
|
label={__('Valuta', 'gepafin')}
|
||||||
|
size="small"/>
|
||||||
|
</Link>
|
||||||
|
}
|
||||||
|
|
||||||
|
const header = renderHeader();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="appPageSection__table">
|
||||||
|
<DataTable value={items} paginator showGridlines rows={10} loading={isAsyncRequest} dataKey="id"
|
||||||
|
filters={filters}
|
||||||
|
globalFilterFields={['name', 'status']}
|
||||||
|
header={header}
|
||||||
|
emptyMessage={__('Nessun dato disponibile', 'gepafin')}
|
||||||
|
onFilter={(e) => setFilters(e.filters)}>
|
||||||
|
<Column field="id" header={__('ID domanda', 'gepafin')}
|
||||||
|
style={{ minWidth: '2rem' }}/>
|
||||||
|
<Column field="callTitle" header={__('Bando', 'gepafin')} filter filterPlaceholder={__('Cerca il nome', 'gepafin')}
|
||||||
|
style={{ minWidth: '12rem' }}/>
|
||||||
|
<Column header={__('Data Ricezione', 'gepafin')} filterField="modifiedDate" dataType="date"
|
||||||
|
style={{ minWidth: '10rem' }}
|
||||||
|
body={dateAppliedBodyTemplate} filter filterElement={dateFilterTemplate}/>
|
||||||
|
<Column header={__('Scadenza', 'gepafin')} filterField="callEndDate" dataType="date"
|
||||||
|
style={{ minWidth: '10rem' }}
|
||||||
|
body={dateEndBodyTemplate} filter filterElement={dateFilterTemplate}/>
|
||||||
|
<Column field="status" header={__('Stato', 'gepafin')}
|
||||||
|
style={{ width: '120px' }} body={statusBodyTemplate} />
|
||||||
|
<Column header={__('Azioni', 'gepafin')}
|
||||||
|
body={actionsBodyTemplate}/>
|
||||||
|
</DataTable>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default MyEvaluationsTable;
|
||||||
76
src/pages/DashboardInstructor/index.js
Normal file
76
src/pages/DashboardInstructor/index.js
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
import React, { useEffect, useState } from 'react';
|
||||||
|
import { __ } from '@wordpress/i18n';
|
||||||
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
import { head, pathOr } from 'ramda';
|
||||||
|
|
||||||
|
// store
|
||||||
|
import { useStore } from '../../store';
|
||||||
|
|
||||||
|
// api
|
||||||
|
//import DashboardService from '../../service/dashboard-service';
|
||||||
|
|
||||||
|
// components
|
||||||
|
//import LatestBandiTable from './components/LatestBandiTable';
|
||||||
|
//import MyLatestSubmissionsTable from './components/MyLatestSubmissionsTable';
|
||||||
|
import { Button } from 'primereact/button';
|
||||||
|
import MyEvaluationsTable from './components/MyEvaluationsTable';
|
||||||
|
|
||||||
|
const DashboardInstructor = () => {
|
||||||
|
const navigate = useNavigate();
|
||||||
|
//const [mainStats, setMainStats] = useState({});
|
||||||
|
|
||||||
|
const goToAllEvaluations = () => {
|
||||||
|
navigate('/valutazioni');
|
||||||
|
}
|
||||||
|
|
||||||
|
return(
|
||||||
|
<div className="appPage">
|
||||||
|
<div className="appPage__pageHeader">
|
||||||
|
<h1>{__('Dashboard', 'gepafin')}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/*<div className="appPage__spacer"></div>
|
||||||
|
|
||||||
|
<div className="appPageSection statsBigBadges">
|
||||||
|
<h2>{__('Panoramica di Sistema', 'gepafin')}</h2>
|
||||||
|
<div className="statsBigBadges__grid">
|
||||||
|
<div className="statsBigBadges__gridItem">
|
||||||
|
<span>{__('Domande attive', 'gepafin')}</span>
|
||||||
|
<span>{getStatValue('numberOfApplications', 0)}</span>
|
||||||
|
</div>
|
||||||
|
<div className="statsBigBadges__gridItem">
|
||||||
|
<span>{__('Bandi osservati', 'gepafin')}</span>
|
||||||
|
<span>{getStatValue('numberOfCalls', 0)}</span>
|
||||||
|
</div>
|
||||||
|
<div className="statsBigBadges__gridItem">
|
||||||
|
<span>{__('Documenti da integrare', 'gepafin')}</span>
|
||||||
|
<span>{getStatValue('numberOfIntegratedDocuments', 0)}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>*/}
|
||||||
|
|
||||||
|
<div className="appPage__spacer"></div>
|
||||||
|
|
||||||
|
<div className="appPageSection">
|
||||||
|
<h2>{__('Coda di lavoro', 'gepafin')}</h2>
|
||||||
|
<MyEvaluationsTable/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appPage__spacer"></div>
|
||||||
|
|
||||||
|
<div className="appPageSection__hr">
|
||||||
|
<span>{__('Azioni rapide', 'gepafin')}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appPageSection">
|
||||||
|
<div className="appPageSection__actions">
|
||||||
|
<Button
|
||||||
|
onClick={goToAllEvaluations}
|
||||||
|
label={__('Tutti valutazioni', 'gepafin')} icon="pi pi-arrow-right" iconPos="right"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default DashboardInstructor;
|
||||||
23
src/pages/Evaluations/index.js
Normal file
23
src/pages/Evaluations/index.js
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { __ } from '@wordpress/i18n';
|
||||||
|
|
||||||
|
// components
|
||||||
|
import MyEvaluationsTable from '../DashboardInstructor/components/MyEvaluationsTable';
|
||||||
|
|
||||||
|
const Bandi = () => {
|
||||||
|
return(
|
||||||
|
<div className="appPage">
|
||||||
|
<div className="appPage__pageHeader">
|
||||||
|
<h1>{__('Domande da valutare', 'gepafin')}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appPage__spacer"></div>
|
||||||
|
|
||||||
|
<div className="appPageSection">
|
||||||
|
<MyEvaluationsTable/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Bandi;
|
||||||
@@ -129,88 +129,7 @@ const Profile = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="appPageSection">
|
<div className="appPageSection">
|
||||||
<h2>{__('Consensi', 'gepafin')}</h2>
|
<h2>{__('Impostazioni', 'gepafin')}</h2>
|
||||||
|
|
||||||
<div className="appForm__switchFieldWrapper">
|
|
||||||
<FormField
|
|
||||||
type="switch"
|
|
||||||
disabled={true}
|
|
||||||
fieldName="privacy"
|
|
||||||
label={''}
|
|
||||||
control={control}
|
|
||||||
errors={errors}
|
|
||||||
onLabel={''}
|
|
||||||
offLabel={''}
|
|
||||||
/>
|
|
||||||
<div>
|
|
||||||
{__('Dichiaro di aver preso visione, prima dell\'accesso al portale https://bandi.gepafin.it, dell\' "Informativa Privacy" all\'interno dell\'Appendice 10 dell\'Avviso secondo il Regolamento UE 2016/679 relativo alla protezione delle persone fisiche con riguardo al trattamento dei dati personale, nonché alla libera circolazione di tali dati e che abroga la Direttiva 95/46 CE.', 'gepafin')}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="appForm__switchFieldWrapper">
|
|
||||||
<FormField
|
|
||||||
type="switch"
|
|
||||||
disabled={true}
|
|
||||||
fieldName="terms"
|
|
||||||
label={''}
|
|
||||||
control={control}
|
|
||||||
errors={errors}
|
|
||||||
onLabel={''}
|
|
||||||
offLabel={''}
|
|
||||||
/>
|
|
||||||
<div>
|
|
||||||
{__('Termini e condizioni', 'gepafin')}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="appForm__switchFieldWrapper">
|
|
||||||
<FormField
|
|
||||||
type="switch"
|
|
||||||
fieldName="marketing"
|
|
||||||
label={''}
|
|
||||||
control={control}
|
|
||||||
errors={errors}
|
|
||||||
onLabel={''}
|
|
||||||
offLabel={''}
|
|
||||||
/>
|
|
||||||
<div>
|
|
||||||
{__('Invio di materiale pubblicitario, vendita diretta, compimento di ricerche di mercato o comunicazione commerciale riguardanti promozione e vendita di prodotti e servizi della Gepafin, mediante modalità di contatto automatizzate (posta elettronica, PEC, messaggi tramite canali informatici, network ed applicazioni web) e tradizionali (come posta cartacea e chiamate telefoniche con operatore)', 'gepafin')}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="appForm__switchFieldWrapper">
|
|
||||||
<FormField
|
|
||||||
type="switch"
|
|
||||||
fieldName="offers"
|
|
||||||
label={''}
|
|
||||||
control={control}
|
|
||||||
errors={errors}
|
|
||||||
onLabel={''}
|
|
||||||
offLabel={''}
|
|
||||||
/>
|
|
||||||
<div>
|
|
||||||
{__('Elaborazione, in forma elettronica, dei dati relativi ai rapporti e servizi forniti, per l’analisi di comportamenti e preferenze della clientela, da utilizzare a scopo commerciale, per la individuazione ed offerta di prodotti e servizi di suo interesse', 'gepafin')}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="appForm__switchFieldWrapper">
|
|
||||||
<FormField
|
|
||||||
type="switch"
|
|
||||||
fieldName="thirdParty"
|
|
||||||
label={''}
|
|
||||||
control={control}
|
|
||||||
errors={errors}
|
|
||||||
onLabel={''}
|
|
||||||
offLabel={''}
|
|
||||||
/>
|
|
||||||
<div>
|
|
||||||
{__('Comunicazione dei miei dati ad altre società in ambito bancario, finanziario od assicurativo e enti pubblici che li tratteranno per invio di materiale pubblicitario, vendita diretta, compimento di ricerche di mercato o comunicazione commerciale riguardanti loro prodotti o servizi, mediante le modalità automatizzate e tradizionali di comunicazione sopra indicate', 'gepafin')}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="appPageSection">
|
|
||||||
<h2>{__('Utenti Associati', 'gepafin')}</h2>
|
|
||||||
<div className="appForm__cols">
|
<div className="appForm__cols">
|
||||||
<FormField
|
<FormField
|
||||||
type="select"
|
type="select"
|
||||||
|
|||||||
288
src/pages/ProfileBeneficiario/index.js
Normal file
288
src/pages/ProfileBeneficiario/index.js
Normal file
@@ -0,0 +1,288 @@
|
|||||||
|
import React, { useMemo, useRef } from 'react';
|
||||||
|
import { __ } from '@wordpress/i18n';
|
||||||
|
import { useForm } from 'react-hook-form';
|
||||||
|
|
||||||
|
// store
|
||||||
|
import { storeSet, useStore } from '../../store';
|
||||||
|
|
||||||
|
// components
|
||||||
|
import set404FromErrorResponse from '../../helpers/set404FromErrorResponse';
|
||||||
|
import FormField from '../../components/FormField';
|
||||||
|
import { Button } from 'primereact/button';
|
||||||
|
import { Toast } from 'primereact/toast';
|
||||||
|
|
||||||
|
// api
|
||||||
|
import UserService from '../../service/user-service';
|
||||||
|
|
||||||
|
// tools
|
||||||
|
import getDateFromISOstring from '../../helpers/getDateFromISOstring';
|
||||||
|
|
||||||
|
const ProfileBeneficiario = () => {
|
||||||
|
const isAsyncRequest = useStore().main.isAsyncRequest();
|
||||||
|
const userData = useStore().main.userData();
|
||||||
|
const toast = useRef(null);
|
||||||
|
|
||||||
|
const {
|
||||||
|
control,
|
||||||
|
handleSubmit,
|
||||||
|
formState: { errors }
|
||||||
|
} = useForm({
|
||||||
|
defaultValues: useMemo(() => {
|
||||||
|
return userData;
|
||||||
|
}, [userData]),
|
||||||
|
mode: 'onChange'
|
||||||
|
});
|
||||||
|
|
||||||
|
const onSubmit = (formData) => {
|
||||||
|
storeSet.main.setAsyncRequest();
|
||||||
|
|
||||||
|
UserService.updateUser(userData.id, formData, updateCallback, updateError);
|
||||||
|
};
|
||||||
|
|
||||||
|
const updateCallback = (data) => {
|
||||||
|
if (data.status === 'SUCCESS') {
|
||||||
|
storeSet.main.userData(data.data);
|
||||||
|
if (toast.current) {
|
||||||
|
toast.current.show({
|
||||||
|
severity: 'success',
|
||||||
|
summary: '',
|
||||||
|
detail: __('L\'utente è stato aggiornato!', 'gepafin')
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
storeSet.main.unsetAsyncRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
const updateError = (data) => {
|
||||||
|
set404FromErrorResponse(data);
|
||||||
|
storeSet.main.unsetAsyncRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="appPage">
|
||||||
|
<div className="appPage__pageHeader">
|
||||||
|
<h1>{__('Profilo utente', 'gepafin')}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appPage__spacer"></div>
|
||||||
|
<Toast ref={toast}/>
|
||||||
|
|
||||||
|
<form className="appForm" onSubmit={handleSubmit(onSubmit)}>
|
||||||
|
|
||||||
|
<div className="appPageSection">
|
||||||
|
<h2>{__('Informazioni personali', 'gepafin')}</h2>
|
||||||
|
<div className="appForm__cols">
|
||||||
|
<FormField
|
||||||
|
type="textinput"
|
||||||
|
disabled={true}
|
||||||
|
fieldName="firstName"
|
||||||
|
label={__('Nome', 'gepafin')}
|
||||||
|
control={control}
|
||||||
|
errors={errors}
|
||||||
|
config={{ required: __('È obbligatorio', 'gepafin') }}
|
||||||
|
placeholder="Francesco"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
type="textinput"
|
||||||
|
disabled={true}
|
||||||
|
fieldName="lastName"
|
||||||
|
label={__('Cognome', 'gepafin')}
|
||||||
|
control={control}
|
||||||
|
errors={errors}
|
||||||
|
config={{ required: __('È obbligatorio', 'gepafin') }}
|
||||||
|
placeholder="Moli"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
type="textinput"
|
||||||
|
disabled={true}
|
||||||
|
fieldName="codiceFiscale"
|
||||||
|
label={__('Codice fiscale', 'gepafin')}
|
||||||
|
control={control}
|
||||||
|
errors={errors}
|
||||||
|
config={{ required: __('È obbligatorio', 'gepafin') }}
|
||||||
|
placeholder="XXXXXXXX"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="appForm__cols">
|
||||||
|
<FormField
|
||||||
|
type="textinput"
|
||||||
|
fieldName="email"
|
||||||
|
label={__('Email', 'gepafin')}
|
||||||
|
control={control}
|
||||||
|
errors={errors}
|
||||||
|
config={{ required: __('È obbligatorio', 'gepafin') }}
|
||||||
|
placeholder="user@example.com"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
type="textinput"
|
||||||
|
fieldName="phoneNumber"
|
||||||
|
label={__('Telefono', 'gepafin')}
|
||||||
|
control={control}
|
||||||
|
errors={errors}
|
||||||
|
config={{ required: __('È obbligatorio', 'gepafin') }}
|
||||||
|
placeholder="1234567"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appPageSection">
|
||||||
|
<h2>{__('Consensi', 'gepafin')}</h2>
|
||||||
|
|
||||||
|
<div className="appForm__switchFieldWrapper">
|
||||||
|
<FormField
|
||||||
|
type="switch"
|
||||||
|
disabled={true}
|
||||||
|
fieldName="privacy"
|
||||||
|
label={''}
|
||||||
|
control={control}
|
||||||
|
errors={errors}
|
||||||
|
onLabel={''}
|
||||||
|
offLabel={''}
|
||||||
|
/>
|
||||||
|
<div>
|
||||||
|
{__('Dichiaro di aver preso visione, prima dell\'accesso al portale https://bandi.gepafin.it, dell\' "Informativa Privacy" all\'interno dell\'Appendice 10 dell\'Avviso secondo il Regolamento UE 2016/679 relativo alla protezione delle persone fisiche con riguardo al trattamento dei dati personale, nonché alla libera circolazione di tali dati e che abroga la Direttiva 95/46 CE.', 'gepafin')}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appForm__switchFieldWrapper">
|
||||||
|
<FormField
|
||||||
|
type="switch"
|
||||||
|
disabled={true}
|
||||||
|
fieldName="terms"
|
||||||
|
label={''}
|
||||||
|
control={control}
|
||||||
|
errors={errors}
|
||||||
|
onLabel={''}
|
||||||
|
offLabel={''}
|
||||||
|
/>
|
||||||
|
<div>
|
||||||
|
{__('Termini e condizioni', 'gepafin')}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appForm__switchFieldWrapper">
|
||||||
|
<FormField
|
||||||
|
type="switch"
|
||||||
|
fieldName="marketing"
|
||||||
|
label={''}
|
||||||
|
control={control}
|
||||||
|
errors={errors}
|
||||||
|
onLabel={''}
|
||||||
|
offLabel={''}
|
||||||
|
/>
|
||||||
|
<div>
|
||||||
|
{__('Invio di materiale pubblicitario, vendita diretta, compimento di ricerche di mercato o comunicazione commerciale riguardanti promozione e vendita di prodotti e servizi della Gepafin, mediante modalità di contatto automatizzate (posta elettronica, PEC, messaggi tramite canali informatici, network ed applicazioni web) e tradizionali (come posta cartacea e chiamate telefoniche con operatore)', 'gepafin')}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appForm__switchFieldWrapper">
|
||||||
|
<FormField
|
||||||
|
type="switch"
|
||||||
|
fieldName="offers"
|
||||||
|
label={''}
|
||||||
|
control={control}
|
||||||
|
errors={errors}
|
||||||
|
onLabel={''}
|
||||||
|
offLabel={''}
|
||||||
|
/>
|
||||||
|
<div>
|
||||||
|
{__('Elaborazione, in forma elettronica, dei dati relativi ai rapporti e servizi forniti, per l’analisi di comportamenti e preferenze della clientela, da utilizzare a scopo commerciale, per la individuazione ed offerta di prodotti e servizi di suo interesse', 'gepafin')}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appForm__switchFieldWrapper">
|
||||||
|
<FormField
|
||||||
|
type="switch"
|
||||||
|
fieldName="thirdParty"
|
||||||
|
label={''}
|
||||||
|
control={control}
|
||||||
|
errors={errors}
|
||||||
|
onLabel={''}
|
||||||
|
offLabel={''}
|
||||||
|
/>
|
||||||
|
<div>
|
||||||
|
{__('Comunicazione dei miei dati ad altre società in ambito bancario, finanziario od assicurativo e enti pubblici che li tratteranno per invio di materiale pubblicitario, vendita diretta, compimento di ricerche di mercato o comunicazione commerciale riguardanti loro prodotti o servizi, mediante le modalità automatizzate e tradizionali di comunicazione sopra indicate', 'gepafin')}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appPageSection">
|
||||||
|
<h2>{__('Impostazioni', 'gepafin')}</h2>
|
||||||
|
<div className="appForm__cols">
|
||||||
|
<FormField
|
||||||
|
type="select"
|
||||||
|
disabled={true}
|
||||||
|
fieldName="language"
|
||||||
|
defaultValue={'it'}
|
||||||
|
label={__('Lingua predefinita', 'gepafin')}
|
||||||
|
control={control}
|
||||||
|
errors={errors}
|
||||||
|
config={{ required: __('È obbligatorio', 'gepafin') }}
|
||||||
|
options={[
|
||||||
|
{ label: __('Italiano', 'gepafin'), name: 'it' }
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
type="select"
|
||||||
|
disabled={true}
|
||||||
|
fieldName="timezone"
|
||||||
|
defaultValue={'Europe/Rome'}
|
||||||
|
label={__('Fuso Orario', 'gepafin')}
|
||||||
|
control={control}
|
||||||
|
errors={errors}
|
||||||
|
config={{ required: __('È obbligatorio', 'gepafin') }}
|
||||||
|
options={[
|
||||||
|
{ label: __('Europe/Rome', 'gepafin'), name: 'Europe/Rome' }
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
type="select"
|
||||||
|
disabled={true}
|
||||||
|
fieldName="dateformat"
|
||||||
|
defaultValue={'DD/MM/YY'}
|
||||||
|
label={__('Formato Data', 'gepafin')}
|
||||||
|
control={control}
|
||||||
|
errors={errors}
|
||||||
|
config={{ required: __('È obbligatorio', 'gepafin') }}
|
||||||
|
options={[
|
||||||
|
{ label: __('DD/MM/YY', 'gepafin'), name: 'DD/MM/YY' }
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appPageSection">
|
||||||
|
<h2>{__('Sicurezza', 'gepafin')}</h2>
|
||||||
|
<div className="appForm__row">
|
||||||
|
<label>{__('Ultimo accesso', 'gepafin')}</label>
|
||||||
|
<span>{getDateFromISOstring(userData.lastLogin)}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appPage__spacer"></div>
|
||||||
|
|
||||||
|
<div className="appPageSection__hr">
|
||||||
|
<span>{__('Azioni rapide', 'gepafin')}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appPageSection">
|
||||||
|
<div className="appPageSection__actions">
|
||||||
|
<Button
|
||||||
|
disabled={isAsyncRequest}
|
||||||
|
label={__('Salva modifiche', 'gepafin')}
|
||||||
|
icon="pi pi-check" iconPos="right"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ProfileBeneficiario;
|
||||||
@@ -152,7 +152,7 @@ const AllUsersTable = () => {
|
|||||||
header={header}
|
header={header}
|
||||||
emptyMessage={__('Nessun dato disponibile', 'gepafin')}
|
emptyMessage={__('Nessun dato disponibile', 'gepafin')}
|
||||||
onFilter={(e) => setFilters(e.filters)}>
|
onFilter={(e) => setFilters(e.filters)}>
|
||||||
<Column field="name" header={__('Nome utente', 'gepafin')} filter filterPlaceholder="Search by name"
|
<Column field="name" header={__('Nome utente', 'gepafin')} filter filterPlaceholder={__('Cerca il nome', 'gepafin')}
|
||||||
style={{ minWidth: '12rem' }}/>
|
style={{ minWidth: '12rem' }}/>
|
||||||
<Column field="email" header={__('Email', 'gepafin')} filter filterPlaceholder="Search by email"
|
<Column field="email" header={__('Email', 'gepafin')} filter filterPlaceholder="Search by email"
|
||||||
style={{ minWidth: '12rem' }}/>
|
style={{ minWidth: '12rem' }}/>
|
||||||
|
|||||||
@@ -25,6 +25,9 @@ import ProfileCompany from './pages/ProfileCompany';
|
|||||||
import Users from './pages/Users';
|
import Users from './pages/Users';
|
||||||
import AddCompany from './pages/AddCompany';
|
import AddCompany from './pages/AddCompany';
|
||||||
import ResetPassword from './pages/ResetPassword';
|
import ResetPassword from './pages/ResetPassword';
|
||||||
|
import DashboardInstructor from './pages/DashboardInstructor';
|
||||||
|
import ProfileBeneficiario from './pages/ProfileBeneficiario';
|
||||||
|
import Evaluations from './pages/Evaluations';
|
||||||
|
|
||||||
const routes = ({ role, chosenCompanyId }) => {
|
const routes = ({ role, chosenCompanyId }) => {
|
||||||
|
|
||||||
@@ -34,62 +37,82 @@ const routes = ({ role, chosenCompanyId }) => {
|
|||||||
<Route path="/" element={<DefaultLayout>
|
<Route path="/" element={<DefaultLayout>
|
||||||
{'ROLE_SUPER_ADMIN' === role ? <Dashboard/> : null}
|
{'ROLE_SUPER_ADMIN' === role ? <Dashboard/> : null}
|
||||||
{'ROLE_BENEFICIARY' === role ? <DashboardBeneficiario/> : null}
|
{'ROLE_BENEFICIARY' === role ? <DashboardBeneficiario/> : null}
|
||||||
|
{'ROLE_PRE_INSTRUCTOR' === role ? <DashboardInstructor/> : null}
|
||||||
</DefaultLayout>}/>
|
</DefaultLayout>}/>
|
||||||
<Route path="/bandi" element={<DefaultLayout>
|
<Route path="/bandi" element={<DefaultLayout>
|
||||||
{'ROLE_SUPER_ADMIN' === role ? <Bandi/> : null}
|
{'ROLE_SUPER_ADMIN' === role ? <Bandi/> : null}
|
||||||
{'ROLE_BENEFICIARY' === role ? <BandiBeneficiario/> : null}
|
{'ROLE_BENEFICIARY' === role ? <BandiBeneficiario/> : null}
|
||||||
|
{'ROLE_PRE_INSTRUCTOR' === role ? <PageNotFound/> : null}
|
||||||
</DefaultLayout>}/>
|
</DefaultLayout>}/>
|
||||||
<Route path="/bandi/:id" element={<DefaultLayout>
|
<Route path="/bandi/:id" element={<DefaultLayout>
|
||||||
{'ROLE_SUPER_ADMIN' === role ? <BandoEdit/> : null}
|
{'ROLE_SUPER_ADMIN' === role ? <BandoEdit/> : null}
|
||||||
{'ROLE_BENEFICIARY' === role ? <BandoViewBeneficiario/> : null}
|
{'ROLE_BENEFICIARY' === role ? <BandoViewBeneficiario/> : null}
|
||||||
|
{'ROLE_PRE_INSTRUCTOR' === role ? <PageNotFound/> : null}
|
||||||
</DefaultLayout>}/>
|
</DefaultLayout>}/>
|
||||||
<Route path="/bandi/:id/preview" element={<DefaultLayout>
|
<Route path="/bandi/:id/preview" element={<DefaultLayout>
|
||||||
{'ROLE_SUPER_ADMIN' === role ? <BandoView/> : null}
|
{'ROLE_SUPER_ADMIN' === role ? <BandoView/> : null}
|
||||||
{'ROLE_BENEFICIARY' === role ? <PageNotFound/> : null}
|
{'ROLE_BENEFICIARY' === role ? <PageNotFound/> : null}
|
||||||
|
{'ROLE_PRE_INSTRUCTOR' === role ? <PageNotFound/> : null}
|
||||||
</DefaultLayout>}/>
|
</DefaultLayout>}/>
|
||||||
<Route path="/bandi/:id/preview-evaluation" element={<DefaultLayout>
|
<Route path="/bandi/:id/preview-evaluation" element={<DefaultLayout>
|
||||||
{'ROLE_SUPER_ADMIN' === role ? <BandoView/> : null}
|
{'ROLE_SUPER_ADMIN' === role ? <BandoView/> : null}
|
||||||
{'ROLE_BENEFICIARY' === role ? <PageNotFound/> : null}
|
{'ROLE_BENEFICIARY' === role ? <PageNotFound/> : null}
|
||||||
|
{'ROLE_PRE_INSTRUCTOR' === role ? <PageNotFound/> : null}
|
||||||
</DefaultLayout>}/>
|
</DefaultLayout>}/>
|
||||||
<Route path="/bandi/:id/forms" element={<DefaultLayout>
|
<Route path="/bandi/:id/forms" element={<DefaultLayout>
|
||||||
{'ROLE_SUPER_ADMIN' === role ? <BandoForms/> : null}
|
{'ROLE_SUPER_ADMIN' === role ? <BandoForms/> : null}
|
||||||
{'ROLE_BENEFICIARY' === role ? <PageNotFound/> : null}
|
{'ROLE_BENEFICIARY' === role ? <PageNotFound/> : null}
|
||||||
|
{'ROLE_PRE_INSTRUCTOR' === role ? <PageNotFound/> : null}
|
||||||
</DefaultLayout>}/>
|
</DefaultLayout>}/>
|
||||||
<Route path="/bandi/:id/forms/:formId" element={<DefaultLayout>
|
<Route path="/bandi/:id/forms/:formId" element={<DefaultLayout>
|
||||||
{'ROLE_SUPER_ADMIN' === role ? <BandoFormsEdit/> : null}
|
{'ROLE_SUPER_ADMIN' === role ? <BandoFormsEdit/> : null}
|
||||||
{'ROLE_BENEFICIARY' === role ? <PageNotFound/> : null}
|
{'ROLE_BENEFICIARY' === role ? <PageNotFound/> : null}
|
||||||
|
{'ROLE_PRE_INSTRUCTOR' === role ? <PageNotFound/> : null}
|
||||||
</DefaultLayout>}/>
|
</DefaultLayout>}/>
|
||||||
<Route path="/bandi/:id/forms/:formId/preview" element={<DefaultLayout>
|
<Route path="/bandi/:id/forms/:formId/preview" element={<DefaultLayout>
|
||||||
{'ROLE_SUPER_ADMIN' === role ? <BandoFormsPreview/> : null}
|
{'ROLE_SUPER_ADMIN' === role ? <BandoFormsPreview/> : null}
|
||||||
{'ROLE_BENEFICIARY' === role ? <PageNotFound/> : null}
|
{'ROLE_BENEFICIARY' === role ? <PageNotFound/> : null}
|
||||||
|
{'ROLE_PRE_INSTRUCTOR' === role ? <PageNotFound/> : null}
|
||||||
</DefaultLayout>}/>
|
</DefaultLayout>}/>
|
||||||
<Route path="/bandi/:id/flow" element={<DefaultLayout>
|
<Route path="/bandi/:id/flow" element={<DefaultLayout>
|
||||||
{'ROLE_SUPER_ADMIN' === role ? <BandoFlowEdit/> : null}
|
{'ROLE_SUPER_ADMIN' === role ? <BandoFlowEdit/> : null}
|
||||||
{'ROLE_BENEFICIARY' === role ? <PageNotFound/> : null}
|
{'ROLE_BENEFICIARY' === role ? <PageNotFound/> : null}
|
||||||
|
{'ROLE_PRE_INSTRUCTOR' === role ? <PageNotFound/> : null}
|
||||||
</DefaultLayout>}/>
|
</DefaultLayout>}/>
|
||||||
<Route path="/imieibandi" element={<DefaultLayout>
|
<Route path="/imieibandi" element={<DefaultLayout>
|
||||||
{'ROLE_SUPER_ADMIN' === role ? <PageNotFound/> : null}
|
{'ROLE_SUPER_ADMIN' === role ? <PageNotFound/> : null}
|
||||||
{'ROLE_BENEFICIARY' === role ? <Applications/> : null}
|
{'ROLE_BENEFICIARY' === role ? <Applications/> : null}
|
||||||
|
{'ROLE_PRE_INSTRUCTOR' === role ? <PageNotFound/> : null}
|
||||||
</DefaultLayout>}/>
|
</DefaultLayout>}/>
|
||||||
<Route path="/imieibandi/:id/" element={<DefaultLayout>
|
<Route path="/imieibandi/:id/" element={<DefaultLayout>
|
||||||
{'ROLE_SUPER_ADMIN' === role ? <PageNotFound/> : null}
|
{'ROLE_SUPER_ADMIN' === role ? <PageNotFound/> : null}
|
||||||
{'ROLE_BENEFICIARY' === role ? <BandoApplication/> : null}
|
{'ROLE_BENEFICIARY' === role ? <BandoApplication/> : null}
|
||||||
|
{'ROLE_PRE_INSTRUCTOR' === role ? <PageNotFound/> : null}
|
||||||
|
</DefaultLayout>}/>
|
||||||
|
<Route path="/valutazioni" element={<DefaultLayout>
|
||||||
|
{'ROLE_SUPER_ADMIN' === role ? <PageNotFound/> : null}
|
||||||
|
{'ROLE_BENEFICIARY' === role ? <PageNotFound/> : null}
|
||||||
|
{'ROLE_PRE_INSTRUCTOR' === role ? <Evaluations/> : null}
|
||||||
</DefaultLayout>}/>
|
</DefaultLayout>}/>
|
||||||
<Route path="/profilo" element={<DefaultLayout>
|
<Route path="/profilo" element={<DefaultLayout>
|
||||||
{'ROLE_SUPER_ADMIN' === role ? <Profile/> : null}
|
{'ROLE_SUPER_ADMIN' === role ? <Profile/> : null}
|
||||||
{'ROLE_BENEFICIARY' === role ? <Profile/> : null}
|
{'ROLE_BENEFICIARY' === role ? <ProfileBeneficiario/> : null}
|
||||||
|
{'ROLE_PRE_INSTRUCTOR' === role ? <Profile/> : null}
|
||||||
</DefaultLayout>}/>
|
</DefaultLayout>}/>
|
||||||
<Route path="/profilo-aziendale" element={<DefaultLayout>
|
<Route path="/profilo-aziendale" element={<DefaultLayout>
|
||||||
{'ROLE_SUPER_ADMIN' === role ? <PageNotFound/> : null}
|
{'ROLE_SUPER_ADMIN' === role ? <PageNotFound/> : null}
|
||||||
{'ROLE_BENEFICIARY' === role && chosenCompanyId > 0 ? <ProfileCompany/> : <PageNotFound/>}
|
{'ROLE_BENEFICIARY' === role && chosenCompanyId > 0 ? <ProfileCompany/> : <PageNotFound/>}
|
||||||
|
{'ROLE_PRE_INSTRUCTOR' === role ? <PageNotFound/> : null}
|
||||||
</DefaultLayout>}/>
|
</DefaultLayout>}/>
|
||||||
<Route path="/agguingi-azienda" element={<DefaultLayout>
|
<Route path="/agguingi-azienda" element={<DefaultLayout>
|
||||||
{'ROLE_SUPER_ADMIN' === role ? <PageNotFound/> : null}
|
{'ROLE_SUPER_ADMIN' === role ? <PageNotFound/> : null}
|
||||||
{'ROLE_BENEFICIARY' === role ? <AddCompany/> : null}
|
{'ROLE_BENEFICIARY' === role ? <AddCompany/> : null}
|
||||||
|
{'ROLE_PRE_INSTRUCTOR' === role ? <PageNotFound/> : null}
|
||||||
</DefaultLayout>}/>
|
</DefaultLayout>}/>
|
||||||
<Route path="/utenti" element={<DefaultLayout>
|
<Route path="/utenti" element={<DefaultLayout>
|
||||||
{'ROLE_SUPER_ADMIN' === role ? <Users/> : null}
|
{'ROLE_SUPER_ADMIN' === role ? <Users/> : null}
|
||||||
{'ROLE_BENEFICIARY' === role ? <PageNotFound/> : null}
|
{'ROLE_BENEFICIARY' === role ? <PageNotFound/> : null}
|
||||||
|
{'ROLE_PRE_INSTRUCTOR' === role ? <PageNotFound/> : null}
|
||||||
</DefaultLayout>}/>
|
</DefaultLayout>}/>
|
||||||
</Route>
|
</Route>
|
||||||
<Route exact path="/reset-password" element={<ResetPassword/>}/>
|
<Route exact path="/reset-password" element={<ResetPassword/>}/>
|
||||||
|
|||||||
Reference in New Issue
Block a user