- saving progress;
This commit is contained in:
@@ -174,13 +174,25 @@ const BandoApplication = () => {
|
|||||||
const validateApplicationCallback = (data) => {
|
const validateApplicationCallback = (data) => {
|
||||||
if (data.status === 'SUCCESS') {
|
if (data.status === 'SUCCESS') {
|
||||||
if (data.data.status) {
|
if (data.data.status) {
|
||||||
setApplicationStatus(data.data.status); // ask why not 'applicationStatus'?
|
setApplicationStatus(data.data.status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
storeSet.main.unsetAsyncRequest();
|
storeSet.main.unsetAsyncRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
const errValidateApplicationCallback = (data) => {
|
const errValidateApplicationCallback = (data) => {
|
||||||
|
if (data.status === 'VALIDATION_ERROR') {
|
||||||
|
if (formMsgs.current) {
|
||||||
|
formMsgs.current.show([
|
||||||
|
{
|
||||||
|
id: '99',
|
||||||
|
sticky: true, severity: 'error', summary: '',
|
||||||
|
detail: data.data.join(' '),
|
||||||
|
closable: true
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if (toast.current) {
|
if (toast.current) {
|
||||||
toast.current.show({
|
toast.current.show({
|
||||||
severity: 'error',
|
severity: 'error',
|
||||||
@@ -188,6 +200,7 @@ const BandoApplication = () => {
|
|||||||
detail: data.message
|
detail: data.message
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
storeSet.main.unsetAsyncRequest();
|
storeSet.main.unsetAsyncRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -269,7 +282,7 @@ const BandoApplication = () => {
|
|||||||
{
|
{
|
||||||
id: '99',
|
id: '99',
|
||||||
sticky: true, severity: 'error', summary: '',
|
sticky: true, severity: 'error', summary: '',
|
||||||
detail: data.data.join(', '),
|
detail: data.data.join(' '),
|
||||||
closable: true
|
closable: true
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
@@ -441,7 +454,9 @@ const BandoApplication = () => {
|
|||||||
icon="pi pi-arrow-right"
|
icon="pi pi-arrow-right"
|
||||||
iconPos="right"/> : null}
|
iconPos="right"/> : null}
|
||||||
<Button
|
<Button
|
||||||
|
type="button"
|
||||||
disabled={'SUBMIT' === applicationStatus || isExpired}
|
disabled={'SUBMIT' === applicationStatus || isExpired}
|
||||||
|
onClick={onValidate}
|
||||||
label={__('Convalidare', 'gepafin')}
|
label={__('Convalidare', 'gepafin')}
|
||||||
icon="pi pi-check"
|
icon="pi pi-check"
|
||||||
iconPos="right"/>
|
iconPos="right"/>
|
||||||
@@ -736,7 +751,7 @@ const BandoApplication = () => {
|
|||||||
iconPos="right"/>
|
iconPos="right"/>
|
||||||
</div> : null}
|
</div> : null}
|
||||||
|
|
||||||
{'DRAFT' !== applicationStatus
|
{'AWAITING' === applicationStatus
|
||||||
? <div className="appPageSection">
|
? <div className="appPageSection">
|
||||||
<div className="appForm__field">
|
<div className="appForm__field">
|
||||||
<label htmlFor="signedPdfFile">
|
<label htmlFor="signedPdfFile">
|
||||||
@@ -759,7 +774,7 @@ const BandoApplication = () => {
|
|||||||
</div>
|
</div>
|
||||||
: null}
|
: null}
|
||||||
|
|
||||||
{'DRAFT' !== applicationStatus
|
{['AWAITING', 'READY'].includes(applicationStatus)
|
||||||
? <div className="appPageSection">
|
? <div className="appPageSection">
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
|
|||||||
@@ -817,13 +817,12 @@ const DomandaEditPreInstructor = () => {
|
|||||||
onClick={doCreateAppointment}
|
onClick={doCreateAppointment}
|
||||||
label={__('Crea l\'appuntamento', 'gepafin')}
|
label={__('Crea l\'appuntamento', 'gepafin')}
|
||||||
/> : null}
|
/> : null}
|
||||||
{APP_EVALUATION_FLOW_ID === '1'
|
<Button
|
||||||
? <Button
|
|
||||||
type="button"
|
type="button"
|
||||||
disabled={!data.id || !['APPOINTMENT'].includes(data.applicationStatus) || evaluationShouldBeBlocked(data)}
|
disabled={!data.id || !['APPOINTMENT'].includes(data.applicationStatus) || evaluationShouldBeBlocked(data)}
|
||||||
onClick={doMakeAdmisible}
|
onClick={doMakeAdmisible}
|
||||||
label={__('Ammissibile formalmente', 'gepafin')}
|
label={__('Ammissibile formalmente', 'gepafin')}
|
||||||
/> : null}
|
/>
|
||||||
{data.id
|
{data.id
|
||||||
? <Button
|
? <Button
|
||||||
type="button"
|
type="button"
|
||||||
|
|||||||
@@ -819,13 +819,12 @@ const DomandaEditPreInstructor = () => {
|
|||||||
onClick={doCreateAppointment}
|
onClick={doCreateAppointment}
|
||||||
label={__('Crea l\'appuntamento', 'gepafin')}
|
label={__('Crea l\'appuntamento', 'gepafin')}
|
||||||
/> : null}
|
/> : null}
|
||||||
{APP_EVALUATION_FLOW_ID === '1'
|
<Button
|
||||||
? <Button
|
|
||||||
type="button"
|
type="button"
|
||||||
disabled={!data.id || !['APPOINTMENT'].includes(data.applicationStatus) || evaluationShouldBeBlocked(data)}
|
disabled={!data.id || !['APPOINTMENT'].includes(data.applicationStatus) || evaluationShouldBeBlocked(data)}
|
||||||
onClick={doMakeAdmisible}
|
onClick={doMakeAdmisible}
|
||||||
label={__('Ammissibile formalmente', 'gepafin')}
|
label={__('Ammissibile formalmente', 'gepafin')}
|
||||||
/> : null}
|
/>
|
||||||
{data.id
|
{data.id
|
||||||
? <Button
|
? <Button
|
||||||
type="button"
|
type="button"
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ const Domande = () => {
|
|||||||
<span><NumberFlow
|
<span><NumberFlow
|
||||||
value={getStatValue('evaluationAverageTime', 0)}
|
value={getStatValue('evaluationAverageTime', 0)}
|
||||||
format={{ notation: 'compact' }}
|
format={{ notation: 'compact' }}
|
||||||
suffix={` ${__('minuti', 'gepafin')}`}
|
suffix={` ${__('giorni', 'gepafin')}`}
|
||||||
locales="it-IT"/></span>
|
locales="it-IT"/></span>
|
||||||
</div>
|
</div>
|
||||||
<div className="statsBigBadges__gridItem">
|
<div className="statsBigBadges__gridItem">
|
||||||
|
|||||||
@@ -1,10 +1,31 @@
|
|||||||
import React from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
|
|
||||||
// components
|
// components
|
||||||
import PreInstructorSoccorsiTable from './components/PreInstructorSoccorsiTable';
|
import PreInstructorSoccorsiTable from './components/PreInstructorSoccorsiTable';
|
||||||
|
import DashboardService from '../../service/dashboard-service';
|
||||||
|
import { pathOr } from 'ramda';
|
||||||
|
import NumberFlow from '@number-flow/react';
|
||||||
|
|
||||||
const SoccorsoIstruttorioPreInstructor = () => {
|
const SoccorsoIstruttorioPreInstructor = () => {
|
||||||
|
const [mainStats, setMainStats] = useState({});
|
||||||
|
|
||||||
|
const getStats = (data) => {
|
||||||
|
if (data.status === 'SUCCESS') {
|
||||||
|
setMainStats(data.data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const errGetStats = () => {}
|
||||||
|
|
||||||
|
const getStatValue = (key, fallback = '') => {
|
||||||
|
return pathOr(fallback, [key], mainStats);
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
DashboardService.getAmendmentsStats(getStats, errGetStats);
|
||||||
|
}, []);
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<div className="appPage">
|
<div className="appPage">
|
||||||
<div className="appPage__pageHeader">
|
<div className="appPage__pageHeader">
|
||||||
@@ -16,6 +37,57 @@ const SoccorsoIstruttorioPreInstructor = () => {
|
|||||||
<div className="appPageSection">
|
<div className="appPageSection">
|
||||||
<PreInstructorSoccorsiTable/>
|
<PreInstructorSoccorsiTable/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className="appPage__spacer"></div>
|
||||||
|
|
||||||
|
<div className="appPageSection statsBigBadges">
|
||||||
|
<h2>{__('Riepilogo', 'gepafin')}</h2>
|
||||||
|
<div className="statsBigBadges__grid applStats">
|
||||||
|
<div className="statsBigBadges__gridItem">
|
||||||
|
<span>{__('Totale richieste', 'gepafin')}</span>
|
||||||
|
<span><NumberFlow
|
||||||
|
value={getStatValue('totalAmendments', 0)}
|
||||||
|
format={{ notation: 'compact' }}
|
||||||
|
locales="it-IT"/></span>
|
||||||
|
</div>
|
||||||
|
<div className="statsBigBadges__gridItem">
|
||||||
|
<span>{__('In attesa risposta', 'gepafin')}</span>
|
||||||
|
<span><NumberFlow
|
||||||
|
value={getStatValue('waitingForResponseAmendments', 0)}
|
||||||
|
format={{ notation: 'compact' }}
|
||||||
|
locales="it-IT"/></span>
|
||||||
|
</div>
|
||||||
|
<div className="statsBigBadges__gridItem">
|
||||||
|
<span>{__('Risposte ricevute', 'gepafin')}</span>
|
||||||
|
<span><NumberFlow
|
||||||
|
value={getStatValue('responseReceivedAmendments', 0)}
|
||||||
|
format={{ notation: 'compact' }}
|
||||||
|
locales="it-IT"/></span>
|
||||||
|
</div>
|
||||||
|
<div className="statsBigBadges__gridItem">
|
||||||
|
<span>{__('Tempo medio di risposta', 'gepafin')}</span>
|
||||||
|
<span><NumberFlow
|
||||||
|
value={getStatValue('averageResponseDays', 0)}
|
||||||
|
format={{ notation: 'compact' }}
|
||||||
|
suffix={` ${__('giorni', 'gepafin')}`}
|
||||||
|
locales="it-IT"/></span>
|
||||||
|
</div>
|
||||||
|
<div className="statsBigBadges__gridItem">
|
||||||
|
<span>{__('Scadute', 'gepafin')}</span>
|
||||||
|
<span><NumberFlow
|
||||||
|
value={getStatValue('expiredAmendments', 0)}
|
||||||
|
format={{ notation: 'compact' }}
|
||||||
|
locales="it-IT"/></span>
|
||||||
|
</div>
|
||||||
|
<div className="statsBigBadges__gridItem">
|
||||||
|
<span>{__('Richieste in scadenza (48h)', 'gepafin')}</span>
|
||||||
|
<span><NumberFlow
|
||||||
|
value={getStatValue('expiringRequestsIn48Hours', 0)}
|
||||||
|
format={{ notation: 'compact' }}
|
||||||
|
locales="en-US"/></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ export default class DashboardService {
|
|||||||
NetworkService.get(`${API_BASE_URL}/dashboard/application`, callback, errCallback);
|
NetworkService.get(`${API_BASE_URL}/dashboard/application`, callback, errCallback);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static getAmendmentsStats = (callback, errCallback) => {
|
||||||
|
NetworkService.get(`${API_BASE_URL}/dashboard/amendment`, callback, errCallback);
|
||||||
|
};
|
||||||
|
|
||||||
static getBeneficiaryStatsForCompany = (id, callback, errCallback) => {
|
static getBeneficiaryStatsForCompany = (id, callback, errCallback) => {
|
||||||
NetworkService.get(`${API_BASE_URL}/dashboard/beneficiary/company/${id}`, callback, errCallback);
|
NetworkService.get(`${API_BASE_URL}/dashboard/beneficiary/company/${id}`, callback, errCallback);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user