Merge branch 'develop' into feature/130-table-async
This commit is contained in:
@@ -159,6 +159,11 @@
|
|||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.danger {
|
||||||
|
border-color: var(--message-error-color);
|
||||||
|
background-color: #ffd0d0;
|
||||||
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
color: var(--global-textColor);
|
color: var(--global-textColor);
|
||||||
font-size: 21px;
|
font-size: 21px;
|
||||||
@@ -168,6 +173,12 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.danger {
|
||||||
|
p, span {
|
||||||
|
color: var(--message-error-color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.row {
|
.row {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const NumericFormulaCell = ({ getValue, row: { index }, column: { id }, table })
|
|||||||
return (
|
return (
|
||||||
<InputNumber
|
<InputNumber
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
value={initialValue ?? 0}
|
value={initialValue}
|
||||||
onValueChange={(e) => onChange(e.value)}
|
onValueChange={(e) => onChange(e.value)}
|
||||||
onFocus={onFocus}
|
onFocus={onFocus}
|
||||||
minFractionDigits={0}
|
minFractionDigits={0}
|
||||||
|
|||||||
@@ -120,12 +120,14 @@ const Table = ({
|
|||||||
? <span className="appForm__field--required">*</span> : null}
|
? <span className="appForm__field--required">*</span> : null}
|
||||||
</label>
|
</label>
|
||||||
{tableValue
|
{tableValue
|
||||||
? <RenderTable
|
? <div style={{ width: '100%', overflow: 'auto' }}>
|
||||||
|
<RenderTable
|
||||||
columnsCfg={columns}
|
columnsCfg={columns}
|
||||||
tableValue={tableValue}
|
tableValue={tableValue}
|
||||||
lastRowCfg={lastRow}
|
lastRowCfg={lastRow}
|
||||||
setTableValueFn={updateValue}
|
setTableValueFn={updateValue}
|
||||||
disabled={disabled}/> : null}
|
disabled={disabled}/>
|
||||||
|
</div> : null}
|
||||||
</>)
|
</>)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const NumericFormulaCell = ({ getValue, row: { index }, column: { id }, table })
|
|||||||
return (
|
return (
|
||||||
<InputNumber
|
<InputNumber
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
value={initialValue ?? 0}
|
value={initialValue}
|
||||||
onValueChange={(e) => onChange(e.value)}
|
onValueChange={(e) => onChange(e.value)}
|
||||||
onFocus={onFocus}
|
onFocus={onFocus}
|
||||||
minFractionDigits={0}
|
minFractionDigits={0}
|
||||||
|
|||||||
@@ -170,12 +170,15 @@ const Table = ({
|
|||||||
? <span className="appForm__field--required">*</span> : null}
|
? <span className="appForm__field--required">*</span> : null}
|
||||||
</label>
|
</label>
|
||||||
{rows
|
{rows
|
||||||
? <RenderTable
|
? <div style={{ width: '100%', overflow: 'auto' }}>
|
||||||
|
<RenderTable
|
||||||
columnsCfg={columns}
|
columnsCfg={columns}
|
||||||
rowsData={rows}
|
rowsData={rows}
|
||||||
lastRowCfg={lastRow}
|
lastRowCfg={lastRow}
|
||||||
setRowsFn={updateRows}
|
setRowsFn={updateRows}
|
||||||
disabled={disabled}/> : null}
|
disabled={disabled}/>
|
||||||
|
</div>
|
||||||
|
: null}
|
||||||
{!isEmpty(columns) && !shouldDisableNewRows
|
{!isEmpty(columns) && !shouldDisableNewRows
|
||||||
? <div className="addNewTableRow p-button p-component" onClick={addNewRow}>
|
? <div className="addNewTableRow p-button p-component" onClick={addNewRow}>
|
||||||
{__('Aggiungi una riga', 'gepafin')}
|
{__('Aggiungi una riga', 'gepafin')}
|
||||||
|
|||||||
@@ -88,35 +88,24 @@ const NotificationsSidebar = () => {
|
|||||||
const bodyParams = getPaginationQuery(status, currentPage);
|
const bodyParams = getPaginationQuery(status, currentPage);
|
||||||
|
|
||||||
if (currentSubscription) {
|
if (currentSubscription) {
|
||||||
//console.log('UNsubscribed')
|
|
||||||
currentSubscription.unsubscribe();
|
currentSubscription.unsubscribe();
|
||||||
setCurrentSubscription(null);
|
setCurrentSubscription(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (userData.id && chosenCompanyId !== 0 && role === 'ROLE_BENEFICIARY') {
|
if (userData.id && chosenCompanyId !== 0 && role === 'ROLE_BENEFICIARY') {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
NotificationService.getNotificationsByCompanyId(
|
NotificationService.getNotificationsByCompanyIdPagination(
|
||||||
userData.id,
|
userData.id,
|
||||||
chosenCompanyId,
|
chosenCompanyId,
|
||||||
status === 'UNREAD' ? getNotifications : getNotificationsRead,
|
bodyParams,
|
||||||
errGetNotifications,
|
status === 'UNREAD' ? getNotificationsPagi : getNotificationsReadPagi,
|
||||||
[
|
errGetNotifications
|
||||||
['status', status]
|
|
||||||
]
|
|
||||||
);
|
);
|
||||||
if (isConnected && socket.current) {
|
if (isConnected && socket.current) {
|
||||||
subscribeTo(`/topic/notifications_user_${userData.id}_company_${chosenCompanyId}`)
|
subscribeTo(`/topic/notifications_user_${userData.id}_company_${chosenCompanyId}`)
|
||||||
}
|
}
|
||||||
} else if (userData.id && role !== 'ROLE_BENEFICIARY') {
|
} else if (userData.id && role !== 'ROLE_BENEFICIARY') {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
/*NotificationService.getNotifications(
|
|
||||||
userData.id,
|
|
||||||
status === 'UNREAD' ? getNotifications : getNotificationsRead,
|
|
||||||
errGetNotifications,
|
|
||||||
[
|
|
||||||
['status', status]
|
|
||||||
]
|
|
||||||
);*/
|
|
||||||
NotificationService.getNotificationsPagination(
|
NotificationService.getNotificationsPagination(
|
||||||
userData.id,
|
userData.id,
|
||||||
bodyParams,
|
bodyParams,
|
||||||
@@ -157,24 +146,6 @@ const NotificationsSidebar = () => {
|
|||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
const getNotifications = (resp) => {
|
|
||||||
if (resp.status === 'SUCCESS') {
|
|
||||||
setNotifications(resp.data);
|
|
||||||
setTotalRecordsNum(resp.data.length);
|
|
||||||
}
|
|
||||||
set404FromErrorResponse(resp);
|
|
||||||
setLoading(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
const getNotificationsRead = (resp) => {
|
|
||||||
if (resp.status === 'SUCCESS') {
|
|
||||||
setNotificationsRead(resp.data);
|
|
||||||
setTotalRecordsNum(resp.data.length);
|
|
||||||
}
|
|
||||||
set404FromErrorResponse(resp);
|
|
||||||
setLoading(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
const errGetNotifications = (resp) => {
|
const errGetNotifications = (resp) => {
|
||||||
set404FromErrorResponse(resp);
|
set404FromErrorResponse(resp);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
@@ -257,7 +228,9 @@ const NotificationsSidebar = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (userData && userData.id) {
|
||||||
fetchMessages();
|
fetchMessages();
|
||||||
|
}
|
||||||
}, [chosenCompanyId, userData.id, isConnected]);
|
}, [chosenCompanyId, userData.id, isConnected]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
9
src/helpers/getTimeFromISOstring.js
Normal file
9
src/helpers/getTimeFromISOstring.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
const getTimeFromISOstring = (
|
||||||
|
value,
|
||||||
|
options = {
|
||||||
|
hour: 'numeric', minute: 'numeric'
|
||||||
|
}) => {
|
||||||
|
return value ? Intl.DateTimeFormat('it-IT', options).format(new Date(value)) : value;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default getTimeFromISOstring;
|
||||||
@@ -64,6 +64,7 @@ const BandoApplication = () => {
|
|||||||
const [signedPdfFile, setSignedPdfFile] = useState([]);
|
const [signedPdfFile, setSignedPdfFile] = useState([]);
|
||||||
const [isRequestForApplData, setIsRequestForApplData] = useState(false);
|
const [isRequestForApplData, setIsRequestForApplData] = useState(false);
|
||||||
const isAsyncRequest = useStore().main.isAsyncRequest();
|
const isAsyncRequest = useStore().main.isAsyncRequest();
|
||||||
|
const previousStatus = useRef('');
|
||||||
const toast = useRef(null);
|
const toast = useRef(null);
|
||||||
const formMsgs = useRef(null);
|
const formMsgs = useRef(null);
|
||||||
const {
|
const {
|
||||||
@@ -578,6 +579,13 @@ const BandoApplication = () => {
|
|||||||
}, [formValues]);
|
}, [formValues]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (previousStatus.current === applicationStatus || (previousStatus.current !== applicationStatus && isEmpty(previousStatus.current))) {
|
||||||
|
previousStatus.current = applicationStatus;
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
previousStatus.current = applicationStatus;
|
||||||
|
}
|
||||||
|
|
||||||
if ('DRAFT' === applicationStatus && !isRequestForApplData) {
|
if ('DRAFT' === applicationStatus && !isRequestForApplData) {
|
||||||
const applId = getApplicationId();
|
const applId = getApplicationId();
|
||||||
|
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ const DraftApplicationsTable = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const actionsBodyTemplate = (rowData) => {
|
const actionsBodyTemplate = (rowData) => {
|
||||||
return <Link to={`/domande/${rowData.id}`}>
|
return <Link to={`/domande/${rowData.id}/preview`}>
|
||||||
<Button severity="info" label={__('Anteprima', 'gepafin')} icon="pi pi-eye" size="small"
|
<Button severity="info" label={__('Anteprima', 'gepafin')} icon="pi pi-eye" size="small"
|
||||||
iconPos="right"/>
|
iconPos="right"/>
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ import { Calendar } from 'primereact/calendar';
|
|||||||
import ProperBandoLabel from '../../../../components/ProperBandoLabel';
|
import ProperBandoLabel from '../../../../components/ProperBandoLabel';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import translationStrings from '../../../../translationStringsForComponents';
|
import translationStrings from '../../../../translationStringsForComponents';
|
||||||
|
import getTimeParsedFromString from '../../../../helpers/getTimeParsedFromString';
|
||||||
|
import getTimeFromISOstring from '../../../../helpers/getTimeFromISOstring';
|
||||||
|
|
||||||
|
|
||||||
const LatestBandiTable = () => {
|
const LatestBandiTable = () => {
|
||||||
@@ -107,11 +109,13 @@ const LatestBandiTable = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const dateStartBodyTemplate = (rowData) => {
|
const dateStartBodyTemplate = (rowData) => {
|
||||||
return formatDate(rowData.start_date);
|
const startTimeObj = getTimeParsedFromString(rowData.startTime);
|
||||||
|
return formatDate(rowData.start_date) + ' ' + getTimeFromISOstring(startTimeObj);
|
||||||
};
|
};
|
||||||
|
|
||||||
const dateEndBodyTemplate = (rowData) => {
|
const dateEndBodyTemplate = (rowData) => {
|
||||||
return formatDate(rowData.end_date);
|
const endTimeObg = getTimeParsedFromString(rowData.endTime);
|
||||||
|
return formatDate(rowData.end_date) + ' ' + getTimeFromISOstring(endTimeObg);
|
||||||
};
|
};
|
||||||
|
|
||||||
const dateFilterTemplate = (options) => {
|
const dateFilterTemplate = (options) => {
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ const Dashboard = () => {
|
|||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const [mainStats, setMainStats] = useState({});
|
const [mainStats, setMainStats] = useState({});
|
||||||
const [chartStats, setChartStats] = useState({});
|
const [chartStats, setChartStats] = useState({});
|
||||||
|
const [pecUsage, setPecUsage] = useState(0);
|
||||||
|
|
||||||
const onGoToCreateNewBando = () => {
|
const onGoToCreateNewBando = () => {
|
||||||
navigate('/bandi/new');
|
navigate('/bandi/new');
|
||||||
@@ -45,6 +46,7 @@ const Dashboard = () => {
|
|||||||
if (data.status === 'SUCCESS') {
|
if (data.status === 'SUCCESS') {
|
||||||
setMainStats(data.data.widget1);
|
setMainStats(data.data.widget1);
|
||||||
setChartStats(data.data.widgetBars);
|
setChartStats(data.data.widgetBars);
|
||||||
|
setPecUsage(data.data.pecUsage/data.data.pecLimit * 100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,6 +65,19 @@ const Dashboard = () => {
|
|||||||
|
|
||||||
<div className="appPage__spacer"></div>
|
<div className="appPage__spacer"></div>
|
||||||
|
|
||||||
|
<div className={`appPageSection__withBorder${pecUsage > 91 ? ' danger' : ''}`}>
|
||||||
|
<p className="appPageSection__pMeta">
|
||||||
|
<span>{__('PEC inbox quota', 'gepafin')}</span>
|
||||||
|
<span>{<NumberFlow
|
||||||
|
value={pecUsage}
|
||||||
|
format={{ notation: 'compact' }}
|
||||||
|
suffix={'%'}
|
||||||
|
locales="it-IT"/>}</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appPage__spacer"></div>
|
||||||
|
|
||||||
<div className="appPageSection statsBigBadges">
|
<div className="appPageSection statsBigBadges">
|
||||||
<h2>{__('Panoramica di Sistema', 'gepafin')}</h2>
|
<h2>{__('Panoramica di Sistema', 'gepafin')}</h2>
|
||||||
<div className="statsBigBadges__grid">
|
<div className="statsBigBadges__grid">
|
||||||
|
|||||||
@@ -0,0 +1,132 @@
|
|||||||
|
import React, { useState, useEffect} from 'react';
|
||||||
|
import { __ } from '@wordpress/i18n';
|
||||||
|
import { uniq } from 'ramda';
|
||||||
|
|
||||||
|
// api
|
||||||
|
import BandoService from '../../../../service/bando-service';
|
||||||
|
|
||||||
|
// tools
|
||||||
|
import getTimeParsedFromString from '../../../../helpers/getTimeParsedFromString';
|
||||||
|
import getTimeFromISOstring from '../../../../helpers/getTimeFromISOstring';
|
||||||
|
|
||||||
|
// components
|
||||||
|
import { FilterMatchMode, FilterOperator } from 'primereact/api';
|
||||||
|
import { DataTable } from 'primereact/datatable';
|
||||||
|
import { Column } from 'primereact/column';
|
||||||
|
import { Button } from 'primereact/button';
|
||||||
|
import { Calendar } from 'primereact/calendar';
|
||||||
|
import ProperBandoLabel from '../../../../components/ProperBandoLabel';
|
||||||
|
import translationStrings from '../../../../translationStringsForComponents';
|
||||||
|
|
||||||
|
|
||||||
|
const LatestBandiTable = () => {
|
||||||
|
const [items, setItems] = useState(null);
|
||||||
|
const [filters, setFilters] = useState(null);
|
||||||
|
const [localAsyncRequest, setLocalAsyncRequest] = useState(false);
|
||||||
|
const [, setStatuses] = useState([]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setLocalAsyncRequest(true);
|
||||||
|
BandoService.getBandi(getCallback, errGetCallbacks);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const getCallback = (data) => {
|
||||||
|
if (data.status === 'SUCCESS') {
|
||||||
|
const newItems = data.data.filter(o => o.status === 'PUBLISH');
|
||||||
|
setItems(getFormattedBandiData(newItems));
|
||||||
|
setStatuses(uniq(data.data.map(o => o.status)));
|
||||||
|
initFilters();
|
||||||
|
}
|
||||||
|
setLocalAsyncRequest(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
const errGetCallbacks = (data) => {
|
||||||
|
setLocalAsyncRequest(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
const getFormattedBandiData = (data) => {
|
||||||
|
return [...(data || [])].map((d) => {
|
||||||
|
d.start_date = new Date(d.dates[0]);
|
||||||
|
d.end_date = new Date(d.dates[1]);
|
||||||
|
|
||||||
|
return d;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const formatDate = (value) => {
|
||||||
|
return value.toLocaleDateString('it-IT', {
|
||||||
|
day: '2-digit',
|
||||||
|
month: '2-digit',
|
||||||
|
year: 'numeric'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const clearFilter = () => {
|
||||||
|
initFilters();
|
||||||
|
};
|
||||||
|
|
||||||
|
const initFilters = () => {
|
||||||
|
setFilters({
|
||||||
|
global: { value: null, matchMode: FilterMatchMode.CONTAINS },
|
||||||
|
name: { operator: FilterOperator.AND, constraints: [{ value: null, matchMode: FilterMatchMode.STARTS_WITH }] },
|
||||||
|
start_date: { operator: FilterOperator.AND, constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }] },
|
||||||
|
end_date: { operator: FilterOperator.AND, constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }] },
|
||||||
|
status: { operator: FilterOperator.OR, constraints: [{ value: null, matchMode: FilterMatchMode.EQUALS }] }
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const renderHeader = () => {
|
||||||
|
return (
|
||||||
|
<div className="appTableHeader">
|
||||||
|
<Button type="button" icon="pi pi-filter-slash" label={__('Pulisci', 'gepafin')} outlined onClick={clearFilter} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const dateStartBodyTemplate = (rowData) => {
|
||||||
|
const startTimeObj = getTimeParsedFromString(rowData.startTime);
|
||||||
|
return formatDate(rowData.start_date) + ' ' + getTimeFromISOstring(startTimeObj);
|
||||||
|
};
|
||||||
|
|
||||||
|
const dateEndBodyTemplate = (rowData) => {
|
||||||
|
const endTimeObg = getTimeParsedFromString(rowData.endTime);
|
||||||
|
return formatDate(rowData.end_date) + ' ' + getTimeFromISOstring(endTimeObg);
|
||||||
|
};
|
||||||
|
|
||||||
|
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 header = renderHeader();
|
||||||
|
|
||||||
|
return(
|
||||||
|
<div className="appPageSection__table">
|
||||||
|
<DataTable value={items}
|
||||||
|
paginator showGridlines
|
||||||
|
rows={5} loading={localAsyncRequest} dataKey="id"
|
||||||
|
filters={filters} stripedRows removableSort
|
||||||
|
header={header}
|
||||||
|
emptyMessage={translationStrings.emptyMessage}
|
||||||
|
onFilter={(e) => setFilters(e.filters)}>
|
||||||
|
<Column field="name" header={__('Nome Bando', 'gepafin')}
|
||||||
|
filter sortable
|
||||||
|
filterPlaceholder={__('Cerca il nome', 'gepafin')}
|
||||||
|
style={{ minWidth: '8rem' }}/>
|
||||||
|
<Column header={__('Data Pubblicazione', 'gepafin')} filterField="start_date" dataType="date"
|
||||||
|
style={{ minWidth: '8rem' }}
|
||||||
|
body={dateStartBodyTemplate} filter filterElement={dateFilterTemplate}/>
|
||||||
|
<Column header={__('Data Scadenza', 'gepafin')} filterField="end_date" dataType="date"
|
||||||
|
style={{ minWidth: '8rem' }}
|
||||||
|
body={dateEndBodyTemplate} filter filterElement={dateFilterTemplate}/>
|
||||||
|
<Column field="status" header={__('Stato', 'gepafin')}
|
||||||
|
style={{ minWidth: '7rem' }} body={statusBodyTemplate} />
|
||||||
|
</DataTable>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default LatestBandiTable;
|
||||||
@@ -9,30 +9,37 @@ import DashboardService from '../../service/dashboard-service';
|
|||||||
|
|
||||||
// components
|
// components
|
||||||
import { Button } from 'primereact/button';
|
import { Button } from 'primereact/button';
|
||||||
import PreInstructorDomandeTable from '../DashboardPreInstructor/components/PreInstructorDomandeTable';
|
import LatestBandiTableInstructorManager from './components/LatestBandiTableInstructorManager';
|
||||||
|
import AllDomandeTable from '../Domande/components/AllDomandeTable';
|
||||||
|
import DraftApplicationsTable from '../Dashboard/components/DraftApplicationsTable';
|
||||||
|
import ChartDomandePerBando from '../../components/ChartDomandePerBando';
|
||||||
|
import ChartStatoDomande from '../../components/ChartStatoDomande';
|
||||||
|
|
||||||
const DashboardInstructorManager = () => {
|
const DashboardInstructorManager = () => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const [mainStats, setMainStats] = useState({});
|
const [mainStats, setMainStats] = useState({});
|
||||||
|
const [chartStats, setChartStats] = useState({});
|
||||||
|
|
||||||
const goToAllEvaluations = () => {
|
const goToAllEvaluations = () => {
|
||||||
navigate('/domande');
|
navigate('/domande');
|
||||||
}
|
}
|
||||||
|
|
||||||
const getStats = (data) => {
|
|
||||||
if (data.status === 'SUCCESS') {
|
|
||||||
setMainStats(data.data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const errGetStats = () => {}
|
|
||||||
|
|
||||||
const getStatValue = (key, fallback = '') => {
|
const getStatValue = (key, fallback = '') => {
|
||||||
return pathOr(fallback, [key], mainStats);
|
return pathOr(fallback, [key], mainStats);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getStats = (data) => {
|
||||||
|
if (data.status === 'SUCCESS') {
|
||||||
|
setMainStats(data.data.widget1);
|
||||||
|
setChartStats(data.data.widgetBars);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const errGetStats = () => {
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
DashboardService.getEvaluationsStats(getStats, errGetStats);
|
DashboardService.getAdminStats(getStats, errGetStats);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return(
|
return(
|
||||||
@@ -44,63 +51,102 @@ const DashboardInstructorManager = () => {
|
|||||||
<div className="appPage__spacer"></div>
|
<div className="appPage__spacer"></div>
|
||||||
|
|
||||||
<div className="appPageSection statsBigBadges">
|
<div className="appPageSection statsBigBadges">
|
||||||
<h2>{__('Riepilogo', 'gepafin')}</h2>
|
<h2>{__('Panoramica di Sistema', 'gepafin')}</h2>
|
||||||
<div className="statsBigBadges__grid applStats">
|
<div className="statsBigBadges__grid">
|
||||||
<div className="statsBigBadges__gridItem">
|
<div className="statsBigBadges__gridItem">
|
||||||
<span>{__('Totale domande', 'gepafin')}</span>
|
<span>{__('Bandi attivi', 'gepafin')}</span>
|
||||||
<span><NumberFlow
|
<span><NumberFlow
|
||||||
value={getStatValue('numberOfAssignedApplication', 0)}
|
value={getStatValue('numberOfActiveCalls', 0)}
|
||||||
format={{ notation: 'compact' }}
|
format={{ notation: 'compact' }}
|
||||||
locales="it-IT"/></span>
|
locales="it-IT"/></span>
|
||||||
</div>
|
</div>
|
||||||
<div className="statsBigBadges__gridItem">
|
<div className="statsBigBadges__gridItem">
|
||||||
<span>{__('In soccorso', 'gepafin')}</span>
|
<span>{__('Utenti registrati', 'gepafin')}</span>
|
||||||
<span><NumberFlow
|
<span><NumberFlow
|
||||||
value={getStatValue('numberOfApplicationInAmendmentState', 0)}
|
value={getStatValue('numberOfResgisteredUsers', 0)}
|
||||||
format={{ notation: 'compact' }}
|
format={{ notation: 'compact' }}
|
||||||
locales="it-IT"/></span>
|
locales="it-IT"/></span>
|
||||||
</div>
|
</div>
|
||||||
<div className="statsBigBadges__gridItem">
|
<div className="statsBigBadges__gridItem">
|
||||||
<span>{__('In valutazione', 'gepafin')}</span>
|
<span>{__('Domande in pre-istruttoria', 'gepafin')}</span>
|
||||||
<span><NumberFlow
|
<span><NumberFlow
|
||||||
value={getStatValue('numberOfApplicationInOpenState', 0)}
|
value={getStatValue('numberOfSubmittedApplications', 0)}
|
||||||
format={{ notation: 'compact' }}
|
format={{ notation: 'compact' }}
|
||||||
locales="it-IT"/></span>
|
locales="it-IT"/></span>
|
||||||
</div>
|
</div>
|
||||||
<div className="statsBigBadges__gridItem">
|
<div className="statsBigBadges__gridItem">
|
||||||
<span>{__('Completate', 'gepafin')}</span>
|
<span>{__('Domande in bozza', 'gepafin')}</span>
|
||||||
<span><NumberFlow
|
<span><NumberFlow
|
||||||
value={getStatValue('numberOfApplicationInCloseState', 0)}
|
value={getStatValue('numberOfDraftApplications', 0)}
|
||||||
format={{ notation: 'compact' }}
|
format={{ notation: 'compact' }}
|
||||||
locales="it-IT"/></span>
|
locales="it-IT"/></span>
|
||||||
</div>
|
</div>
|
||||||
<div className="statsBigBadges__gridItem">
|
<div className="statsBigBadges__gridItem">
|
||||||
<span>{__('Tempo medio di valutazione', 'gepafin')}</span>
|
<span>{__('Aziende', 'gepafin')}</span>
|
||||||
<span><NumberFlow
|
<span><NumberFlow
|
||||||
value={getStatValue('averageEvaluationDays', 0)}
|
value={getStatValue('numberOfCompany', 0)}
|
||||||
format={{ notation: 'compact' }}
|
format={{ notation: 'compact' }}
|
||||||
suffix={` ${__('giorni', 'gepafin')}`}
|
|
||||||
locales="it-IT"/></span>
|
locales="it-IT"/></span>
|
||||||
</div>
|
</div>
|
||||||
<div className="statsBigBadges__gridItem">
|
<div className="statsBigBadges__gridItem">
|
||||||
<span>{__('Domande in scadenza (48h)', 'gepafin')}</span>
|
<span>{__('Totale finanziamenti attivi', 'gepafin')}</span>
|
||||||
<span><NumberFlow
|
<span><NumberFlow
|
||||||
value={getStatValue('numberOfApplicationExpiringIn48Hours', 0)}
|
value={getStatValue('totalActiveFinancing', 0)}
|
||||||
format={{ notation: 'compact' }}
|
format={{
|
||||||
locales="en-US"/></span>
|
notation: 'compact',
|
||||||
|
compactDisplay: 'short',
|
||||||
|
roundingMode: 'trunc',
|
||||||
|
style: 'currency',
|
||||||
|
currency: 'EUR',
|
||||||
|
currencyDisplay: 'symbol'
|
||||||
|
}}
|
||||||
|
locales="it-IT"/></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="appPage__spacer"></div>
|
<div className="appPage__spacer"></div>
|
||||||
|
|
||||||
<div className="appPageSection">
|
{/*<div className="appPageSection">
|
||||||
<h2>{__('Panoramica delle domande da valutare', 'gepafin')}</h2>
|
<h2>{__('Panoramica delle domande da valutare', 'gepafin')}</h2>
|
||||||
<PreInstructorDomandeTable statuses={['OPEN', 'SOCCORSO']} userId={0}/>
|
<PreInstructorDomandeTable statuses={['OPEN', 'SOCCORSO']} userId={0}/>
|
||||||
|
</div>*/}
|
||||||
|
<div className="appPageSection">
|
||||||
|
<h2>{__('Ultimi bandi pubblicati', 'gepafin')}</h2>
|
||||||
|
<LatestBandiTableInstructorManager/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="appPage__spacer"></div>
|
<div className="appPage__spacer"></div>
|
||||||
|
|
||||||
|
<div className="appPageSection">
|
||||||
|
<h2>{__('Ultime domande pubblicate', 'gepafin')}</h2>
|
||||||
|
<AllDomandeTable/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appPage__spacer"></div>
|
||||||
|
|
||||||
|
<div className="appPageSection">
|
||||||
|
<h2>{__('Domande in bozza', 'gepafin')}</h2>
|
||||||
|
<DraftApplicationsTable/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appPage__spacer"></div>
|
||||||
|
|
||||||
|
{chartStats.applicationPerCall
|
||||||
|
? <div className="appPageSection">
|
||||||
|
<h2>{__('Statistiche di sistema', 'gepafin')}</h2>
|
||||||
|
<div className="appPageSection columns">
|
||||||
|
<ChartDomandePerBando
|
||||||
|
title={__('Domande per bando', 'gepafin')}
|
||||||
|
data={chartStats.applicationPerCall}/>
|
||||||
|
<ChartStatoDomande
|
||||||
|
title={__('Stato domande', 'gepafin')}
|
||||||
|
data={chartStats.applicationPerStatus}/>
|
||||||
|
</div>
|
||||||
|
</div> : null}
|
||||||
|
|
||||||
|
<div className="appPage__spacer"></div>
|
||||||
|
|
||||||
<div className="appPageSection__hr">
|
<div className="appPageSection__hr">
|
||||||
<span>{__('Azioni rapide', 'gepafin')}</span>
|
<span>{__('Azioni rapide', 'gepafin')}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,12 +4,8 @@ const API_BASE_URL = process.env.REACT_APP_API_EXECUTION_ADDRESS;
|
|||||||
|
|
||||||
export default class NotificationService {
|
export default class NotificationService {
|
||||||
|
|
||||||
/*static getNotifications = (id, callback, errCallback, queryParams) => {
|
static getNotificationsByCompanyIdPagination = (id, companyId, body, callback, errCallback, queryParams) => {
|
||||||
NetworkService.get(`${API_BASE_URL}/notification/user/${id}`, callback, errCallback, queryParams);
|
NetworkService.post(`${API_BASE_URL}/notification/user/${id}/company/${companyId}/pagination`, body, 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) => {
|
static getNotificationsPagination = (id, body, callback, errCallback, queryParams) => {
|
||||||
@@ -22,9 +18,9 @@ export default class NotificationService {
|
|||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
|
|
||||||
static notificationMakeUnread = (id, callback, errCallback) => {
|
/*static notificationMakeUnread = (id, callback, errCallback) => {
|
||||||
NetworkService.put(`${API_BASE_URL}/notification/${id}`, {}, callback, errCallback, [
|
NetworkService.put(`${API_BASE_URL}/notification/${id}`, {}, callback, errCallback, [
|
||||||
['status', 'UNREAD']
|
['status', 'UNREAD']
|
||||||
]);
|
]);
|
||||||
};
|
};*/
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user