- page benficiary domanda/soccorso;
- fixed fetching data in overview tables for beneficiary/pre instructor; - fixed styles;
This commit is contained in:
@@ -208,13 +208,18 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
||||||
li {
|
> li {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
border-bottom: 1px solid var(--button-secondary-borderColor);
|
border-bottom: 1px solid var(--button-secondary-borderColor);
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
|
|
||||||
|
&.row {
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -237,7 +242,7 @@
|
|||||||
.appPageSection__message {
|
.appPageSection__message {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 7px;
|
gap: 20px;
|
||||||
background: rgba(255, 242, 226, 0.7);
|
background: rgba(255, 242, 226, 0.7);
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
border-width: 0 0 0 6px;
|
border-width: 0 0 0 6px;
|
||||||
|
|||||||
18
src/assets/scss/components/evaluation.scss
Normal file
18
src/assets/scss/components/evaluation.scss
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
.criterionRelatedData {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 15px;
|
||||||
|
max-height: 400px;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding: 0 0 10px 0;
|
||||||
|
|
||||||
|
> h3 {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.criterionRelatedData__item {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 7px;
|
||||||
|
}
|
||||||
@@ -43,3 +43,4 @@
|
|||||||
@import "./components/flowBuilder.scss";
|
@import "./components/flowBuilder.scss";
|
||||||
@import "./components/error404.scss";
|
@import "./components/error404.scss";
|
||||||
@import "./components/myTable.scss";
|
@import "./components/myTable.scss";
|
||||||
|
@import "./components/evaluation.scss";
|
||||||
@@ -34,20 +34,20 @@ const AppSidebar = () => {
|
|||||||
id: 3,
|
id: 3,
|
||||||
enable: intersection(permissions, ['APPLY_CALLS']).length
|
enable: intersection(permissions, ['APPLY_CALLS']).length
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: __('Gestione Domande', 'gepafin'),
|
|
||||||
icon: 'pi pi-file',
|
|
||||||
href: '/domande',
|
|
||||||
id: 4,
|
|
||||||
enable: intersection(permissions, ['VIEW_USERS', 'MANAGE_USERS']).length
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: __('Bandi disponibili', 'gepafin'),
|
label: __('Bandi disponibili', 'gepafin'),
|
||||||
icon: 'pi pi-bookmark',
|
icon: 'pi pi-bookmark',
|
||||||
href: '/bandi',
|
href: '/bandi',
|
||||||
id: 5,
|
id: 4,
|
||||||
enable: intersection(permissions, ['VIEW_CALLS']).length
|
enable: intersection(permissions, ['VIEW_CALLS']).length
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: __('Gestione domande', 'gepafin'),
|
||||||
|
icon: 'pi pi-file',
|
||||||
|
href: '/domande',
|
||||||
|
id: 5,
|
||||||
|
enable: intersection(permissions, ['VIEW_USERS', 'MANAGE_USERS']).length
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: __('Domande da valutare', 'gepafin'),
|
label: __('Domande da valutare', 'gepafin'),
|
||||||
icon: 'pi pi-calendar-clock',
|
icon: 'pi pi-calendar-clock',
|
||||||
@@ -56,38 +56,45 @@ const AppSidebar = () => {
|
|||||||
enable: intersection(permissions, ['EVALUATE_APPLICATIONS']).length
|
enable: intersection(permissions, ['EVALUATE_APPLICATIONS']).length
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: __('Soccorso Istruttorio', 'gepafin'),
|
label: __('Archivio domande', 'gepafin'),
|
||||||
|
icon: 'pi pi-file',
|
||||||
|
href: '/domande',
|
||||||
|
id: 7,
|
||||||
|
enable: intersection(permissions, ['APPLY_CALLS']).length
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: __('Soccorso istruttorio', 'gepafin'),
|
||||||
icon: <HelpIcon/>,
|
icon: <HelpIcon/>,
|
||||||
href: '/soccorso-istruttorio',
|
href: '/soccorso-istruttorio',
|
||||||
id: 7,
|
id: 8,
|
||||||
enable: intersection(permissions, ['EVALUATE_APPLICATIONS']).length
|
enable: intersection(permissions, ['EVALUATE_APPLICATIONS']).length
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: __('Gestione Utenti', 'gepafin'),
|
label: __('Gestione utenti', 'gepafin'),
|
||||||
icon: 'pi pi-users',
|
icon: 'pi pi-users',
|
||||||
href: '/utenti',
|
href: '/utenti',
|
||||||
id: 8,
|
id: 9,
|
||||||
enable: intersection(permissions, ['VIEW_USERS', 'MANAGE_USERS']).length
|
enable: intersection(permissions, ['VIEW_USERS', 'MANAGE_USERS']).length
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: __('Configurazione', 'gepafin'),
|
label: __('Configurazione', 'gepafin'),
|
||||||
icon: 'pi pi-cog',
|
icon: 'pi pi-cog',
|
||||||
//href: '/configurazione',
|
//href: '/configurazione',
|
||||||
id: 9,
|
id: 10,
|
||||||
enable: false
|
enable: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: __('Report e Analisi', 'gepafin'),
|
label: __('Report e Analisi', 'gepafin'),
|
||||||
icon: 'pi pi-chart-bar',
|
icon: 'pi pi-chart-bar',
|
||||||
//href: '/stats',
|
//href: '/stats',
|
||||||
id: 10,
|
id: 11,
|
||||||
enable: false
|
enable: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: __('Log di Sistema', 'gepafin'),
|
label: __('Log di Sistema', 'gepafin'),
|
||||||
icon: 'pi pi-receipt',
|
icon: 'pi pi-receipt',
|
||||||
clickFn: () => {},
|
clickFn: () => {},
|
||||||
id: 11,
|
id: 12,
|
||||||
enable: false
|
enable: false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -36,7 +36,8 @@ const MyLatestSubmissionsTable = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setLocalAsyncRequest(true);
|
setLocalAsyncRequest(true);
|
||||||
ApplicationService.getApplications(getApplCallback, errGetApplCallback, [
|
ApplicationService.getApplications(getApplCallback, errGetApplCallback, [
|
||||||
['companyId', chosenCompanyId]
|
['companyId', chosenCompanyId],
|
||||||
|
['statuses', ['DRAFT', 'SUBMIT', 'AWAITING', 'READY', 'DISCARD']]
|
||||||
])
|
])
|
||||||
}, [chosenCompanyId]);
|
}, [chosenCompanyId]);
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,9 @@ const PreInstructorDomandeTable = () => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setLocalAsyncRequest(true);
|
setLocalAsyncRequest(true);
|
||||||
AssignedApplicationService.getAssignedApplications(getCallback, errGetCallbacks, [['userId', userData.id]]);
|
AssignedApplicationService.getAssignedApplications(getCallback, errGetCallbacks, [
|
||||||
|
['userId', userData.id]
|
||||||
|
]);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const getCallback = (data) => {
|
const getCallback = (data) => {
|
||||||
@@ -132,10 +134,6 @@ const PreInstructorDomandeTable = () => {
|
|||||||
|
|
||||||
const header = renderHeader();
|
const header = renderHeader();
|
||||||
|
|
||||||
const createEvaluation = (id) => {
|
|
||||||
console.log('createEvaluation:', id)
|
|
||||||
}
|
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<div className="appPageSection__table">
|
<div className="appPageSection__table">
|
||||||
<DataTable value={items} paginator showGridlines rows={10} loading={localAsyncRequest} dataKey="id"
|
<DataTable value={items} paginator showGridlines rows={10} loading={localAsyncRequest} dataKey="id"
|
||||||
@@ -144,7 +142,7 @@ const PreInstructorDomandeTable = () => {
|
|||||||
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="id" header={__('ID domanda', 'gepafin')}
|
<Column field="applicationId" header={__('ID domanda', 'gepafin')}
|
||||||
filter filterPlaceholder={__('Cerca', 'gepafin')}
|
filter filterPlaceholder={__('Cerca', 'gepafin')}
|
||||||
style={{ minWidth: '12rem' }}/>
|
style={{ minWidth: '12rem' }}/>
|
||||||
<Column field="callName" header={__('Bando', 'gepafin')}
|
<Column field="callName" header={__('Bando', 'gepafin')}
|
||||||
|
|||||||
391
src/pages/DomandaBeneficiario/index.js
Normal file
391
src/pages/DomandaBeneficiario/index.js
Normal file
@@ -0,0 +1,391 @@
|
|||||||
|
import React, { useState, useEffect, useRef, useMemo } from 'react';
|
||||||
|
import { __, sprintf } from '@wordpress/i18n';
|
||||||
|
import { useNavigate, useParams } from 'react-router-dom';
|
||||||
|
import { is, isEmpty, isNil } from 'ramda';
|
||||||
|
import { wrap } from 'object-path-immutable';
|
||||||
|
import { klona } from 'klona';
|
||||||
|
import { useForm } from 'react-hook-form';
|
||||||
|
|
||||||
|
// store
|
||||||
|
import { storeSet, useStore } from '../../store';
|
||||||
|
|
||||||
|
// api
|
||||||
|
import AmendmentsService from '../../service/amendments-service';
|
||||||
|
import CommunicationService from '../../service/communication-service';
|
||||||
|
|
||||||
|
// tools
|
||||||
|
import set404FromErrorResponse from '../../helpers/set404FromErrorResponse';
|
||||||
|
import getBandoLabel from '../../helpers/getBandoLabel';
|
||||||
|
import getDateFromISOstring from '../../helpers/getDateFromISOstring';
|
||||||
|
import renderHtmlContent from '../../helpers/renderHtmlContent';
|
||||||
|
import uniqid from '../../helpers/uniqid';
|
||||||
|
|
||||||
|
// components
|
||||||
|
import { Button } from 'primereact/button';
|
||||||
|
import BlockingOverlay from '../../components/BlockingOverlay';
|
||||||
|
import { Toast } from 'primereact/toast';
|
||||||
|
import { classNames } from 'primereact/utils';
|
||||||
|
import { Dialog } from 'primereact/dialog';
|
||||||
|
import { InputText } from 'primereact/inputtext';
|
||||||
|
import { InputTextarea } from 'primereact/inputtextarea';
|
||||||
|
import FormField from '../../components/FormField';
|
||||||
|
import { Editor } from 'primereact/editor';
|
||||||
|
import { InputNumber } from 'primereact/inputnumber';
|
||||||
|
|
||||||
|
const DomandaBeneficiario = () => {
|
||||||
|
const isAsyncRequest = useStore().main.isAsyncRequest();
|
||||||
|
const { id } = useParams();
|
||||||
|
const navigate = useNavigate();
|
||||||
|
const [data, setData] = useState({});
|
||||||
|
const [comms, setComms] = useState([]);
|
||||||
|
const [isVisibleNewCommDialog, setIsVisibleNewCommDialog] = useState(false);
|
||||||
|
const [newCommData, setNewCommData] = useState({});
|
||||||
|
const [isLoadingCommunication, setIsLoadingCommunication] = useState(false);
|
||||||
|
const [isVisibleExtendTimeDialog, setIsVisibleExtendTimeDialog] = useState(false);
|
||||||
|
const [extendedTime, setExtendedTime] = useState(3);
|
||||||
|
const [isLoadingExtendingTime, setIsLoadingExtendingTime] = useState(false);
|
||||||
|
const [isLoadingReminding, setIsLoadingReminding] = useState(false);
|
||||||
|
const toast = useRef(null);
|
||||||
|
const [formInitialData, setFormInitialData] = useState({});
|
||||||
|
const {
|
||||||
|
control,
|
||||||
|
handleSubmit,
|
||||||
|
formState: { errors, isValid },
|
||||||
|
setValue,
|
||||||
|
register,
|
||||||
|
trigger,
|
||||||
|
getValues,
|
||||||
|
clearErrors
|
||||||
|
} = useForm({
|
||||||
|
defaultValues: useMemo(() => {
|
||||||
|
return formInitialData;
|
||||||
|
}, [formInitialData]), mode: 'onChange'
|
||||||
|
});
|
||||||
|
|
||||||
|
const goToArchivePage = () => {
|
||||||
|
navigate(`/domande`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const getCallback = (data) => {
|
||||||
|
if (data.status === 'SUCCESS') {
|
||||||
|
setData(getFormattedData(data.data));
|
||||||
|
//CommunicationService.getCommsByAmendmentId(data.data.id, getCommsCallback, errGetCommsCallback);
|
||||||
|
}
|
||||||
|
//storeSet.main.unsetAsyncRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
const errGetCallback = (data) => {
|
||||||
|
if (toast.current && data.message) {
|
||||||
|
toast.current.show({
|
||||||
|
severity: 'error',
|
||||||
|
summary: '',
|
||||||
|
detail: data.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
set404FromErrorResponse(data);
|
||||||
|
storeSet.main.unsetAsyncRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
const getCommsCallback = (data) => {
|
||||||
|
if (data.status === 'SUCCESS') {
|
||||||
|
setComms(data.data.commentsList.map(o => getFormattedCommsData(o)));
|
||||||
|
}
|
||||||
|
storeSet.main.unsetAsyncRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
const errGetCommsCallback = (data) => {
|
||||||
|
if (toast.current && data.message) {
|
||||||
|
toast.current.show({
|
||||||
|
severity: 'error',
|
||||||
|
summary: '',
|
||||||
|
detail: data.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
set404FromErrorResponse(data);
|
||||||
|
storeSet.main.unsetAsyncRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
const getFormattedData = (data) => {
|
||||||
|
data.startDate = is(String, data.startDate) ? new Date(data.startDate) : (data.startDate ? data.startDate : '');
|
||||||
|
data.expirationDate = is(String, data.expirationDate) ? new Date(data.expirationDate) : (data.expirationDate ? data.expirationDate : '');
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
const getFormattedCommsData = (data) => {
|
||||||
|
data.id = isNil(data.id) ? uniqid('id') : data.id;
|
||||||
|
data.commentedDate = is(String, data.commentedDate) ? new Date(data.commentedDate) : (data.commentedDate ? data.commentedDate : '');
|
||||||
|
data.createdDate = is(String, data.createdDate) ? new Date(data.createdDate) : (data.createdDate ? data.createdDate : '');
|
||||||
|
data.updatedDate = is(String, data.updatedDate) ? new Date(data.updatedDate) : (data.updatedDate ? data.updatedDate : '');
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
const headerNewComDialog = () => {
|
||||||
|
return <span>{__('Aggiungi comunicazione', 'gepafin')}</span>
|
||||||
|
}
|
||||||
|
|
||||||
|
const hideNewComDialog = () => {
|
||||||
|
setIsVisibleNewCommDialog(false);
|
||||||
|
setNewCommData({
|
||||||
|
title: '',
|
||||||
|
comment: ''
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const footerNewComDialog = () => {
|
||||||
|
return <div>
|
||||||
|
<Button type="button" label={__('Anulla', 'gepafin')} onClick={hideNewComDialog} outlined/>
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
disabled={isLoadingCommunication || isEmpty(newCommData.title) || isEmpty(newCommData.comment)}
|
||||||
|
label={__('Invia', 'gepafin')} onClick={createCommunication}/>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
const openNewCommDialog = () => {
|
||||||
|
setIsVisibleNewCommDialog(true);
|
||||||
|
setNewCommData({
|
||||||
|
title: '',
|
||||||
|
comment: ''
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const updateNewCommData = (value, path) => {
|
||||||
|
const newData = wrap(newCommData).set(path.split('.'), value).value();
|
||||||
|
setNewCommData(newData);
|
||||||
|
}
|
||||||
|
|
||||||
|
const renderHeader = () => {
|
||||||
|
return (
|
||||||
|
<span className="ql-formats">
|
||||||
|
<button className="ql-bold" aria-label="Bold"></button>
|
||||||
|
<button className="ql-italic" aria-label="Italic"></button>
|
||||||
|
<button className="ql-underline" aria-label="Underline"></button>
|
||||||
|
<button className="ql-link" aria-label="Link"></button>
|
||||||
|
<button className="ql-list" value="ordered"></button>
|
||||||
|
<button className="ql-header" value="2"></button>
|
||||||
|
<button className="ql-header" value="3"></button>
|
||||||
|
<button className="ql-blockquote"></button>
|
||||||
|
<button className="ql-list" value="bullet"></button>
|
||||||
|
<button className="ql-indent" value="-1"></button>
|
||||||
|
<button className="ql-indent" value="+1"></button>
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const header = renderHeader();
|
||||||
|
|
||||||
|
const updateNewAmendmentData = (value, path) => {
|
||||||
|
const newData = wrap(data).set(path.split('.'), value).value();
|
||||||
|
setData(newData);
|
||||||
|
}
|
||||||
|
|
||||||
|
const createCommunication = () => {
|
||||||
|
setIsLoadingCommunication(true);
|
||||||
|
const amendmentId = 0
|
||||||
|
CommunicationService.createCommunication(amendmentId, newCommData, createCommunicationCallback, errCreateCommunicationCallback);
|
||||||
|
}
|
||||||
|
|
||||||
|
const createCommunicationCallback = (data) => {
|
||||||
|
if (data.status === 'SUCCESS') {
|
||||||
|
if (toast.current) {
|
||||||
|
toast.current.show({
|
||||||
|
severity: 'success',
|
||||||
|
summary: '',
|
||||||
|
detail: data.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
setComms([...comms, getFormattedCommsData(data.data)])
|
||||||
|
setIsVisibleNewCommDialog(false);
|
||||||
|
}
|
||||||
|
setIsLoadingCommunication(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
const errCreateCommunicationCallback = (data) => {
|
||||||
|
if (toast.current && data.message) {
|
||||||
|
toast.current.show({
|
||||||
|
severity: 'error',
|
||||||
|
summary: '',
|
||||||
|
detail: data.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
set404FromErrorResponse(data);
|
||||||
|
setIsLoadingCommunication(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const parsedId = parseInt(id);
|
||||||
|
const entityId = !isNaN(parsedId) ? parsedId : 0;
|
||||||
|
|
||||||
|
AmendmentsService.getSoccorsoByApplId(entityId, getCallback, errGetCallback, [
|
||||||
|
['statuses', 'AWAITING']
|
||||||
|
]);
|
||||||
|
}, [id]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="appPage">
|
||||||
|
<div className="appPage__pageHeader">
|
||||||
|
<h1>{sprintf(__('Soccorso Istruttorio: richiesta integrazione documenti per domanda #%s', 'gepafin'), id)}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appPage__spacer"></div>
|
||||||
|
<Toast ref={toast}/>
|
||||||
|
<BlockingOverlay shouldDisplay={isAsyncRequest}/>
|
||||||
|
|
||||||
|
<div className="appPageSection__row">
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
outlined
|
||||||
|
onClick={goToArchivePage}
|
||||||
|
label={__('Indietro', 'gepafin')}
|
||||||
|
icon="pi pi-arrow-left" iconPos="left"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appPage__spacer"></div>
|
||||||
|
|
||||||
|
<div className="appPage__content">
|
||||||
|
<div className="appPageSection__withBorder columns">
|
||||||
|
<p className="appPageSection__pMeta">
|
||||||
|
<span>{__('ID domanda', 'gepafin')}</span>
|
||||||
|
<span>{data.applicationId}</span>
|
||||||
|
</p>
|
||||||
|
<p className="appPageSection__pMeta">
|
||||||
|
<span>{__('Bando', 'gepafin')}</span>
|
||||||
|
<span>{data.callName}</span>
|
||||||
|
</p>
|
||||||
|
<p className="appPageSection__pMeta">
|
||||||
|
<span>{__('Beneficiario', 'gepafin')}</span>
|
||||||
|
<span>{data.beneficiaryName}</span>
|
||||||
|
</p>
|
||||||
|
<p className="appPageSection__pMeta">
|
||||||
|
<span>{__('Inizio', 'gepafin')}</span>
|
||||||
|
<span>{getDateFromISOstring(data.startDate)}</span>
|
||||||
|
</p>
|
||||||
|
<p className="appPageSection__pMeta">
|
||||||
|
<span>{__('Scadenza', 'gepafin')}</span>
|
||||||
|
<span>{getDateFromISOstring(data.expirationDate)}</span>
|
||||||
|
</p>
|
||||||
|
<p className="appPageSection__pMeta">
|
||||||
|
<span>{__('Stato', 'gepafin')}</span>
|
||||||
|
<span>{getBandoLabel(data.status)}</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appPageSection">
|
||||||
|
<h2>{__('Dettagli Richiesta', 'gepafin')}</h2>
|
||||||
|
<div className="appPageSection columns">
|
||||||
|
<div>
|
||||||
|
<h3>{__('Documenti Richiesti', 'gepafin')}</h3>
|
||||||
|
<ol className="appPageSection__list">
|
||||||
|
{data.formFields
|
||||||
|
? data.formFields.map((o, i) => <li key={o.fieldId} style={{ flexDirection: 'row' }}>
|
||||||
|
<span>{o.label}</span>
|
||||||
|
</li>) : null}
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h3>{__('Note e spiegazioni', 'gepafin')}</h3>
|
||||||
|
<div className="appPageSection__withBorder grey ql-editor"
|
||||||
|
style={{ minHeight: '200px' }}>
|
||||||
|
{renderHtmlContent(data.note)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appPageSection">
|
||||||
|
<h2>{__('Comunicazioni', 'gepafin')}</h2>
|
||||||
|
<table className="myTable">
|
||||||
|
<thead className="myThead">
|
||||||
|
<tr>
|
||||||
|
<th style={{ width: 250 }}>{__('Data', 'gepafin')}</th>
|
||||||
|
<th>{__('Comunicazione', 'gepafin')}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody className="myTbody">
|
||||||
|
{!isNil(comms) && !isEmpty(comms)
|
||||||
|
? comms.map((o, i) => <tr key={o.id}>
|
||||||
|
<td valign="top">
|
||||||
|
{getDateFromISOstring(o.commentedDate)}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<h3>{o.title}</h3>
|
||||||
|
<p>{o.comment}</p>
|
||||||
|
</td>
|
||||||
|
</tr>)
|
||||||
|
: <tr>
|
||||||
|
<td>-</td>
|
||||||
|
<td>-</td>
|
||||||
|
</tr>}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
style={{ marginTop: 30 }}
|
||||||
|
onClick={openNewCommDialog}
|
||||||
|
disabled={data.status === 'CLOSE'}
|
||||||
|
type="button"
|
||||||
|
label={__('Aggiungi Comunicazione', 'gepafin')}
|
||||||
|
icon="pi pi-plus" iconPos="right"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appPageSection__message warning">
|
||||||
|
<i className="pi pi-exclamation-triangle"></i>
|
||||||
|
<span className="summary">{__('Attenzione', 'gepafin')}</span>
|
||||||
|
<span>{__('Inviare la documentazione richiesta completa delle integrazioni esclusivamente via PEC. In caso contarrio l’integrazione non può essere ritenuta valida.', 'gepafin')}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appPageSection">
|
||||||
|
<div className="appPageSection__actions">
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
disabled={isAsyncRequest}
|
||||||
|
label={__('Invia documenti via PEC', 'gepafin')}
|
||||||
|
icon="pi pi-envelope" iconPos="right"/>
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
outlined
|
||||||
|
disabled={isAsyncRequest}
|
||||||
|
label={__('Chiudi', 'gepafin')}
|
||||||
|
icon="pi pi-times" iconPos="right"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Dialog
|
||||||
|
visible={isVisibleNewCommDialog}
|
||||||
|
modal
|
||||||
|
header={headerNewComDialog}
|
||||||
|
footer={footerNewComDialog}
|
||||||
|
style={{ maxWidth: '600px', width: '100%' }}
|
||||||
|
onHide={hideNewComDialog}>
|
||||||
|
<div className="appForm__field">
|
||||||
|
<label
|
||||||
|
className={classNames({ 'p-error': isEmpty(newCommData.title) })}>
|
||||||
|
{__('Titolo', 'gepafin')}*
|
||||||
|
</label>
|
||||||
|
<InputText value={newCommData.title}
|
||||||
|
disabled={data.status === 'CLOSE'}
|
||||||
|
invalid={isEmpty(newCommData.title)}
|
||||||
|
onChange={(e) => updateNewCommData(e.target.value, 'title')}/>
|
||||||
|
|
||||||
|
<label
|
||||||
|
className={classNames({ 'p-error': isEmpty(newCommData.comment) })}>
|
||||||
|
{__('Contenuto', 'gepafin')}*
|
||||||
|
</label>
|
||||||
|
<InputTextarea
|
||||||
|
value={newCommData.comment}
|
||||||
|
disabled={data.status === 'CLOSE'}
|
||||||
|
rows={5} cols={30}
|
||||||
|
invalid={isEmpty(newCommData.comment)}
|
||||||
|
onChange={(e) => updateNewCommData(e.target.value, 'comment')}/>
|
||||||
|
</div>
|
||||||
|
</Dialog>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export default DomandaBeneficiario;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useState, useEffect, useRef } from 'react';
|
import React, { useState, useEffect, useRef } from 'react';
|
||||||
import { __, sprintf } from '@wordpress/i18n';
|
import { __, sprintf } from '@wordpress/i18n';
|
||||||
import { useNavigate, useParams } from 'react-router-dom';
|
import { useNavigate, useParams } from 'react-router-dom';
|
||||||
import { is, isEmpty, isNil, sum, pathOr } from 'ramda';
|
import { is, isEmpty, isNil, sum, pathOr, head } from 'ramda';
|
||||||
import { klona } from 'klona';
|
import { klona } from 'klona';
|
||||||
import { wrap } from 'object-path-immutable';
|
import { wrap } from 'object-path-immutable';
|
||||||
|
|
||||||
@@ -26,13 +26,16 @@ import { InputNumber } from 'primereact/inputnumber';
|
|||||||
import BlockingOverlay from '../../components/BlockingOverlay';
|
import BlockingOverlay from '../../components/BlockingOverlay';
|
||||||
import { Toast } from 'primereact/toast';
|
import { Toast } from 'primereact/toast';
|
||||||
import HelpIcon from '../../icons/HelpIcon';
|
import HelpIcon from '../../icons/HelpIcon';
|
||||||
|
import { Dialog } from 'primereact/dialog';
|
||||||
|
|
||||||
const DomandaEditPreInstructor = () => {
|
const DomandaEditPreInstructor = () => {
|
||||||
const isAsyncRequest = useStore().main.isAsyncRequest();
|
const isAsyncRequest = useStore().main.isAsyncRequest();
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const [data, setData] = useState({});
|
const [data, setData] = useState({});
|
||||||
const [message, setMessage] = useState('');
|
const [isVisibleCriterionData, setIsVisibleCriterionData] = useState(0);
|
||||||
|
const [criterionDataTitle, setCriterionDataTitle] = useState('');
|
||||||
|
const [criterionDataContent, setCriterionDataContent] = useState('');
|
||||||
const [isAdmissible, setIsAdmissible] = useState(false);
|
const [isAdmissible, setIsAdmissible] = useState(false);
|
||||||
const toast = useRef(null);
|
const toast = useRef(null);
|
||||||
|
|
||||||
@@ -107,7 +110,7 @@ const DomandaEditPreInstructor = () => {
|
|||||||
files: klona(data.files),
|
files: klona(data.files),
|
||||||
note: data.note
|
note: data.note
|
||||||
}
|
}
|
||||||
ApplicationEvaluationService.updateEvaluation(id, formData, updateCallback, errUpdateCallback);
|
ApplicationEvaluationService.updateEvaluation(data.assignedApplicationId, formData, updateCallback, errUpdateCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateCallback = (data) => {
|
const updateCallback = (data) => {
|
||||||
@@ -135,6 +138,66 @@ const DomandaEditPreInstructor = () => {
|
|||||||
storeSet.main.unsetAsyncRequest();
|
storeSet.main.unsetAsyncRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const doApprove = () => {
|
||||||
|
const formData = {
|
||||||
|
status: 'APPROVED'
|
||||||
|
}
|
||||||
|
ApplicationEvaluationService.updateEvaluation(data.assignedApplicationId, formData, updateStatusCallback, errUpdateStatusCallback);
|
||||||
|
}
|
||||||
|
|
||||||
|
const doReject = () => {
|
||||||
|
const formData = {
|
||||||
|
status: 'REJECTED'
|
||||||
|
}
|
||||||
|
ApplicationEvaluationService.updateEvaluation(data.assignedApplicationId, formData, updateStatusCallback, errUpdateStatusCallback);
|
||||||
|
}
|
||||||
|
|
||||||
|
const updateStatusCallback = (data) => {
|
||||||
|
if (data.status === 'SUCCESS') {
|
||||||
|
if (toast.current) {
|
||||||
|
toast.current.show({
|
||||||
|
severity: 'success',
|
||||||
|
summary: '',
|
||||||
|
detail: data.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
storeSet.main.unsetAsyncRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
const errUpdateStatusCallback = (data) => {
|
||||||
|
if (toast.current && data.message) {
|
||||||
|
toast.current.show({
|
||||||
|
severity: 'error',
|
||||||
|
summary: '',
|
||||||
|
detail: data.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
set404FromErrorResponse(data);
|
||||||
|
storeSet.main.unsetAsyncRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
const displayCriterionData = (id) => {
|
||||||
|
const criterion = head(data.criteria.filter(o => o.id === id));
|
||||||
|
console.log(id, criterion);
|
||||||
|
setCriterionDataTitle(criterion.label);
|
||||||
|
const content = <div className="criterionRelatedData">
|
||||||
|
<h3>{__('I campi correlati')}</h3>
|
||||||
|
{criterion.criteriaMappedFields.map(o => <div key={o.id} className="criterionRelatedData__item">
|
||||||
|
<strong>{o.fieldLabel}</strong>
|
||||||
|
{o.fieldValue}
|
||||||
|
</div>)}
|
||||||
|
</div>;
|
||||||
|
setCriterionDataContent(content);
|
||||||
|
setIsVisibleCriterionData(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
const hideCriterionData = () => {
|
||||||
|
setIsVisibleCriterionData(0);
|
||||||
|
setCriterionDataTitle('');
|
||||||
|
setCriterionDataContent('');
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const maxScore = pathOr(0, ['minScore'], data);
|
const maxScore = pathOr(0, ['minScore'], data);
|
||||||
const criteria = pathOr([], ['criteria'], data);
|
const criteria = pathOr([], ['criteria'], data);
|
||||||
@@ -236,7 +299,9 @@ const DomandaEditPreInstructor = () => {
|
|||||||
<td>
|
<td>
|
||||||
<div className="appPageSection__iconActions">
|
<div className="appPageSection__iconActions">
|
||||||
{!isEmpty(o.criteriaMappedFields)
|
{!isEmpty(o.criteriaMappedFields)
|
||||||
? <Button icon="pi pi-eye" rounded outlined severity="info"
|
? <Button icon="pi pi-eye"
|
||||||
|
rounded outlined severity="info"
|
||||||
|
onClick={() => displayCriterionData(o.id)}
|
||||||
aria-label={__('Mostra', 'gepafin')}/> : null}
|
aria-label={__('Mostra', 'gepafin')}/> : null}
|
||||||
<Button icon="pi pi-thumbs-up" rounded outlined
|
<Button icon="pi pi-thumbs-up" rounded outlined
|
||||||
severity={!isNil(o.valid) && o.valid ? 'success' : 'secondary'}
|
severity={!isNil(o.valid) && o.valid ? 'success' : 'secondary'}
|
||||||
@@ -280,8 +345,9 @@ const DomandaEditPreInstructor = () => {
|
|||||||
<h2>{__('Checklist Valutazione', 'gepafin')}</h2>
|
<h2>{__('Checklist Valutazione', 'gepafin')}</h2>
|
||||||
<div className="appPageSection columns">
|
<div className="appPageSection columns">
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
<h3>{__('Lista', 'gepafin')}</h3>
|
<h3>{__('Lista', 'gepafin')}</h3>
|
||||||
<div className="appPageSection__withBorder grey">
|
<div className="appPageSection__withBorder grey" style={{ marginBottom: '20px' }}>
|
||||||
<div className="appPageSection__checklist">
|
<div className="appPageSection__checklist">
|
||||||
{data.checklist.map((o, i) => <div key={o.id}>
|
{data.checklist.map((o, i) => <div key={o.id}>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
@@ -314,6 +380,11 @@ const DomandaEditPreInstructor = () => {
|
|||||||
<h3>{__('Documenti allegati', 'gepafin')}</h3>
|
<h3>{__('Documenti allegati', 'gepafin')}</h3>
|
||||||
<ol className="appPageSection__list">
|
<ol className="appPageSection__list">
|
||||||
{data.files.map((o, i) => <li key={o.id}>
|
{data.files.map((o, i) => <li key={o.id}>
|
||||||
|
<div className="appPageSection" style={{
|
||||||
|
flexDirection: 'row',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'space-between'
|
||||||
|
}}>
|
||||||
<span>{o.label}</span>
|
<span>{o.label}</span>
|
||||||
<div className="appPageSection__iconActions">
|
<div className="appPageSection__iconActions">
|
||||||
{o.fileDetail.length === 1
|
{o.fileDetail.length === 1
|
||||||
@@ -336,6 +407,31 @@ const DomandaEditPreInstructor = () => {
|
|||||||
)}
|
)}
|
||||||
aria-label={__('Giu', 'gepafin')}/>
|
aria-label={__('Giu', 'gepafin')}/>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
{o.fileDetail.length > 1
|
||||||
|
? <ul style={{
|
||||||
|
width: '100%',
|
||||||
|
paddingLeft: '15px',
|
||||||
|
display: 'flex',
|
||||||
|
flexDirection: 'column',
|
||||||
|
gap: '10px'
|
||||||
|
}}>
|
||||||
|
{o.fileDetail.map((k, i) => <li key={k.id} style={{
|
||||||
|
display: 'flex',
|
||||||
|
flexDirection: 'row',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'space-between'
|
||||||
|
}}>
|
||||||
|
<span>{k.name}</span>
|
||||||
|
<div className="appPageSection__iconActions">
|
||||||
|
<Button icon="pi pi-eye" rounded
|
||||||
|
onClick={() => window.open(k.filePath, '_blank').focus()}
|
||||||
|
outlined severity="info"
|
||||||
|
aria-label={__('Mostra', 'gepafin')}/>
|
||||||
|
</div>
|
||||||
|
</li>)}
|
||||||
|
</ul>
|
||||||
|
: null}
|
||||||
</li>)}
|
</li>)}
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
@@ -370,15 +466,25 @@ const DomandaEditPreInstructor = () => {
|
|||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
disabled={!isAdmissible}
|
disabled={!isAdmissible}
|
||||||
|
onClick={doApprove}
|
||||||
label={__('Approva Domanda', 'gepafin')}
|
label={__('Approva Domanda', 'gepafin')}
|
||||||
icon="pi pi-check" iconPos="right"/>
|
icon="pi pi-check" iconPos="right"/>
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
|
onClick={doReject}
|
||||||
label={__('Respingi Domanda', 'gepafin')}
|
label={__('Respingi Domanda', 'gepafin')}
|
||||||
icon="pi pi-times" iconPos="right"/>
|
icon="pi pi-times" iconPos="right"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<Dialog
|
||||||
|
header={criterionDataTitle}
|
||||||
|
visible={isVisibleCriterionData !== 0}
|
||||||
|
style={{ width: '50vw' }}
|
||||||
|
onHide={hideCriterionData}>
|
||||||
|
{criterionDataContent}
|
||||||
|
</Dialog>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
: <>
|
: <>
|
||||||
<Skeleton width="20%" height="1rem" className="mb-2"></Skeleton>
|
<Skeleton width="20%" height="1rem" className="mb-2"></Skeleton>
|
||||||
|
|||||||
@@ -30,7 +30,9 @@ const AllDomandeTable = ({ openDialogFn, updaterString = '' }) => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setLocalAsyncRequest(true);
|
setLocalAsyncRequest(true);
|
||||||
ApplicationService.getApplications(getCallback, errGetCallbacks, [['status', 'SUBMIT']]);
|
ApplicationService.getApplications(getCallback, errGetCallbacks, [
|
||||||
|
['statuses', 'SUBMIT']
|
||||||
|
]);
|
||||||
}, [updaterString]);
|
}, [updaterString]);
|
||||||
|
|
||||||
const getCallback = (data) => {
|
const getCallback = (data) => {
|
||||||
|
|||||||
@@ -0,0 +1,193 @@
|
|||||||
|
import React, { useState, useEffect } from 'react';
|
||||||
|
import { __ } from '@wordpress/i18n';
|
||||||
|
import { is, uniq } from 'ramda';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
|
// store
|
||||||
|
import { useStore } from '../../../../store';
|
||||||
|
|
||||||
|
// api
|
||||||
|
import ApplicationService from '../../../../service/application-service';
|
||||||
|
|
||||||
|
// tools
|
||||||
|
import getBandoLabel from '../../../../helpers/getBandoLabel';
|
||||||
|
import getBandoSeverity from '../../../../helpers/getBandoSeverity';
|
||||||
|
|
||||||
|
// 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';
|
||||||
|
import ProperBandoLabel from '../../../../components/ProperBandoLabel';
|
||||||
|
import { Dropdown } from 'primereact/dropdown';
|
||||||
|
import { Tag } from 'primereact/tag';
|
||||||
|
|
||||||
|
|
||||||
|
const BeneficiarioDomandeTable = () => {
|
||||||
|
const chosenCompanyId = useStore().main.chosenCompanyId();
|
||||||
|
const [items, setItems] = useState(null);
|
||||||
|
const [filters, setFilters] = useState(null);
|
||||||
|
const [localAsyncRequest, setLocalAsyncRequest] = useState(false);
|
||||||
|
const [globalFilterValue, setGlobalFilterValue] = useState('');
|
||||||
|
const [statuses, setStatuses] = useState([]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setLocalAsyncRequest(true);
|
||||||
|
ApplicationService.getApplications(getApplCallback, errGetApplCallback, [
|
||||||
|
['companyId', chosenCompanyId],
|
||||||
|
['statuses', ['SOCCORSO', 'APPROVED', 'REJECTED', 'EVALUATION']]
|
||||||
|
])
|
||||||
|
}, [chosenCompanyId]);
|
||||||
|
|
||||||
|
const getApplCallback = (data) => {
|
||||||
|
if (data.status === 'SUCCESS') {
|
||||||
|
if (is(Array, data.data)) {
|
||||||
|
setItems(getFormattedBandiData(data.data));
|
||||||
|
setStatuses(uniq(items.map(o => o.status)))
|
||||||
|
initFilters();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setLocalAsyncRequest(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
const errGetApplCallback = (data) => {
|
||||||
|
setLocalAsyncRequest(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
const getFormattedBandiData = (data) => {
|
||||||
|
return [...(data || [])].map((d) => {
|
||||||
|
d.callEndDate = new Date(d.callEndDate);
|
||||||
|
d.modifiedDate = new Date(d.modifiedDate);
|
||||||
|
d.submissionDate = new Date(d.submissionDate);
|
||||||
|
|
||||||
|
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 }]
|
||||||
|
},
|
||||||
|
modifiedDate: {
|
||||||
|
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 dateSubmissionBodyTemplate = (rowData) => {
|
||||||
|
return formatDate(rowData.submissionDate);
|
||||||
|
};
|
||||||
|
|
||||||
|
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 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 progressBodyTemplate = (options) => {
|
||||||
|
return '-';
|
||||||
|
};
|
||||||
|
|
||||||
|
const statusItemTemplate = (option) => {
|
||||||
|
return <Tag value={getBandoLabel(option)} severity={getBandoSeverity(option)}/>;
|
||||||
|
};
|
||||||
|
|
||||||
|
const actionsBodyTemplate = (rowData) => {
|
||||||
|
return rowData.status === 'SOCCORSO'
|
||||||
|
? <Link to={`/domande/${rowData.id}`}>
|
||||||
|
<Button severity="info" label={__('Dettagli', 'gepafin')} icon="pi pi-eye" size="small"
|
||||||
|
iconPos="right"/>
|
||||||
|
</Link> : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const header = renderHeader();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="appPageSection__table">
|
||||||
|
<DataTable value={items} paginator showGridlines rows={10} loading={localAsyncRequest} 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')} filter
|
||||||
|
filterPlaceholder={__('Cerca il nome', 'gepafin')}
|
||||||
|
style={{ minWidth: '12rem' }}/>
|
||||||
|
<Column field="callTitle" header={__('Titolo bando', 'gepafin')} filter
|
||||||
|
filterPlaceholder={__('Cerca il nome', 'gepafin')}
|
||||||
|
style={{ minWidth: '12rem' }}/>
|
||||||
|
<Column header={__('Data di invio', 'gepafin')} filterField="submissionDate" dataType="date"
|
||||||
|
style={{ minWidth: '10rem' }}
|
||||||
|
body={dateSubmissionBodyTemplate} filter filterElement={dateFilterTemplate}/>
|
||||||
|
<Column field="status" header={__('Stato', 'gepafin')} filterMenuStyle={{ width: '14rem' }}
|
||||||
|
style={{ width: '120px' }} body={statusBodyTemplate} filter
|
||||||
|
filterElement={statusFilterTemplate}/>
|
||||||
|
<Column header={__('Esito', 'gepafin')}
|
||||||
|
style={{ minWidth: '10rem' }} field="progress" body={progressBodyTemplate}/>
|
||||||
|
<Column header={__('Azioni', 'gepafin')}
|
||||||
|
body={actionsBodyTemplate}/>
|
||||||
|
</DataTable>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default BeneficiarioDomandeTable;
|
||||||
23
src/pages/DomandeBeneficiario/index.js
Normal file
23
src/pages/DomandeBeneficiario/index.js
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { __ } from '@wordpress/i18n';
|
||||||
|
|
||||||
|
// components
|
||||||
|
import BeneficiarioDomandeTable from './components/BeneficiarioDomandeTable';
|
||||||
|
|
||||||
|
const DomandePreInstructor = () => {
|
||||||
|
return(
|
||||||
|
<div className="appPage">
|
||||||
|
<div className="appPage__pageHeader">
|
||||||
|
<h1>{__('Archivio domande', 'gepafin')}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appPage__spacer"></div>
|
||||||
|
|
||||||
|
<div className="appPageSection">
|
||||||
|
<BeneficiarioDomandeTable/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default DomandePreInstructor;
|
||||||
@@ -8,7 +8,7 @@ const DomandePreInstructor = () => {
|
|||||||
return(
|
return(
|
||||||
<div className="appPage">
|
<div className="appPage">
|
||||||
<div className="appPage__pageHeader">
|
<div className="appPage__pageHeader">
|
||||||
<h1>{__('Domande da valutare', 'gepafin')}</h1>
|
<h1>{__('Archivio domande', 'gepafin')}</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="appPage__spacer"></div>
|
<div className="appPage__spacer"></div>
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
newData.formFields = data.formFields;
|
newData.formFields = data.formFields;
|
||||||
newData.responseDays = 10;
|
newData.responseDays = 10;
|
||||||
newData.note = '';
|
newData.note = '';
|
||||||
newData.sendNotification = true;
|
newData.isSendNotification = true;
|
||||||
newData.sendEmail = true;
|
newData.isSendEmail = true;
|
||||||
return newData;
|
return newData;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
const entityId = !isNaN(parsed) ? parsed : 0;
|
const entityId = !isNaN(parsed) ? parsed : 0;
|
||||||
|
|
||||||
storeSet.main.setAsyncRequest();
|
storeSet.main.setAsyncRequest();
|
||||||
AmendmentsService.getSoccorsoByApplId(entityId, getCallback, errGetCallback);
|
AmendmentsService.getSoccorsoByApplEvalId(entityId, getCallback, errGetCallback);
|
||||||
}, [evaluationId]);
|
}, [evaluationId]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -184,7 +184,7 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
<div className="appPageSection columns">
|
<div className="appPageSection columns">
|
||||||
<div>
|
<div>
|
||||||
<h3>{__('Note', 'gepafin')}</h3>
|
<h3>{__('Note', 'gepafin')}</h3>
|
||||||
<div>
|
<div style={{marginBottom: '30px'}}>
|
||||||
<Editor
|
<Editor
|
||||||
value={formData.note}
|
value={formData.note}
|
||||||
placeholder={__('Digita qui il messagio', 'gepafin')}
|
placeholder={__('Digita qui il messagio', 'gepafin')}
|
||||||
@@ -198,7 +198,7 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3>{__('Tempo per la Risposta (giorni)', 'gepafin')}</h3>
|
<h3>{__('Tempo per la Risposta (giorni)', 'gepafin')}</h3>
|
||||||
<div>
|
<div style={{marginBottom: '30px'}}>
|
||||||
<InputNumber
|
<InputNumber
|
||||||
keyfilter="int"
|
keyfilter="int"
|
||||||
value={formData.responseDays}
|
value={formData.responseDays}
|
||||||
@@ -215,20 +215,20 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
<div className="appForm__field row">
|
<div className="appForm__field row">
|
||||||
<InputSwitch
|
<InputSwitch
|
||||||
inputId="notify_email"
|
inputId="notify_email"
|
||||||
checked={formData.sendEmail}
|
checked={formData.isSendEmail}
|
||||||
onChange={(e) => updateEvaluationValue(
|
onChange={(e) => updateEvaluationValue(
|
||||||
e.value,
|
e.value,
|
||||||
'sendEmail'
|
'isSendEmail'
|
||||||
)}/>
|
)}/>
|
||||||
<label htmlFor="notify_email">{__('Notifiche Email', 'gepafin')}</label>
|
<label htmlFor="notify_email">{__('Notifiche Email', 'gepafin')}</label>
|
||||||
</div>
|
</div>
|
||||||
<div className="appForm__field row">
|
<div className="appForm__field row">
|
||||||
<InputSwitch
|
<InputSwitch
|
||||||
inputId="notify_push"
|
inputId="notify_push"
|
||||||
checked={formData.sendNotification}
|
checked={formData.isSendNotification}
|
||||||
onChange={(e) => updateEvaluationValue(
|
onChange={(e) => updateEvaluationValue(
|
||||||
e.value,
|
e.value,
|
||||||
'sendNotification'
|
'isSendNotification'
|
||||||
)}/>
|
)}/>
|
||||||
<label htmlFor="notify_push">{__('Notifiche Push', 'gepafin')}</label>
|
<label htmlFor="notify_push">{__('Notifiche Push', 'gepafin')}</label>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
import React, { useState, useEffect, useRef, useMemo } from 'react';
|
import React, { useState, useEffect, useRef, useMemo } from 'react';
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
import { useNavigate, useParams } from 'react-router-dom';
|
import { useNavigate, useParams } from 'react-router-dom';
|
||||||
import { head, is, isEmpty, isNil, pathOr } from 'ramda';
|
import { is, isEmpty, isNil } from 'ramda';
|
||||||
import { wrap } from 'object-path-immutable';
|
import { wrap } from 'object-path-immutable';
|
||||||
|
import { klona } from 'klona';
|
||||||
|
import { useForm } from 'react-hook-form';
|
||||||
|
|
||||||
// store
|
// store
|
||||||
import { storeSet, useStore } from '../../store';
|
import { storeSet, useStore } from '../../store';
|
||||||
@@ -16,9 +18,9 @@ import set404FromErrorResponse from '../../helpers/set404FromErrorResponse';
|
|||||||
import getBandoLabel from '../../helpers/getBandoLabel';
|
import getBandoLabel from '../../helpers/getBandoLabel';
|
||||||
import getDateFromISOstring from '../../helpers/getDateFromISOstring';
|
import getDateFromISOstring from '../../helpers/getDateFromISOstring';
|
||||||
import renderHtmlContent from '../../helpers/renderHtmlContent';
|
import renderHtmlContent from '../../helpers/renderHtmlContent';
|
||||||
|
import uniqid from '../../helpers/uniqid';
|
||||||
|
|
||||||
// components
|
// components
|
||||||
import { Skeleton } from 'primereact/skeleton';
|
|
||||||
import { Button } from 'primereact/button';
|
import { Button } from 'primereact/button';
|
||||||
import BlockingOverlay from '../../components/BlockingOverlay';
|
import BlockingOverlay from '../../components/BlockingOverlay';
|
||||||
import { Toast } from 'primereact/toast';
|
import { Toast } from 'primereact/toast';
|
||||||
@@ -26,12 +28,8 @@ import { classNames } from 'primereact/utils';
|
|||||||
import { Dialog } from 'primereact/dialog';
|
import { Dialog } from 'primereact/dialog';
|
||||||
import { InputText } from 'primereact/inputtext';
|
import { InputText } from 'primereact/inputtext';
|
||||||
import { InputTextarea } from 'primereact/inputtextarea';
|
import { InputTextarea } from 'primereact/inputtextarea';
|
||||||
import { klona } from 'klona';
|
|
||||||
import { useForm } from 'react-hook-form';
|
|
||||||
import FormField from '../../components/FormField';
|
import FormField from '../../components/FormField';
|
||||||
import uniqid from '../../helpers/uniqid';
|
|
||||||
import { Editor } from 'primereact/editor';
|
import { Editor } from 'primereact/editor';
|
||||||
import { TZDate } from '@date-fns/tz';
|
|
||||||
import { InputNumber } from 'primereact/inputnumber';
|
import { InputNumber } from 'primereact/inputnumber';
|
||||||
|
|
||||||
const SoccorsoEditPreInstructor = () => {
|
const SoccorsoEditPreInstructor = () => {
|
||||||
@@ -46,6 +44,7 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
const [isVisibleExtendTimeDialog, setIsVisibleExtendTimeDialog] = useState(false);
|
const [isVisibleExtendTimeDialog, setIsVisibleExtendTimeDialog] = useState(false);
|
||||||
const [extendedTime, setExtendedTime] = useState(3);
|
const [extendedTime, setExtendedTime] = useState(3);
|
||||||
const [isLoadingExtendingTime, setIsLoadingExtendingTime] = useState(false);
|
const [isLoadingExtendingTime, setIsLoadingExtendingTime] = useState(false);
|
||||||
|
const [isLoadingReminding, setIsLoadingReminding] = useState(false);
|
||||||
const toast = useRef(null);
|
const toast = useRef(null);
|
||||||
const [formInitialData, setFormInitialData] = useState({});
|
const [formInitialData, setFormInitialData] = useState({});
|
||||||
const {
|
const {
|
||||||
@@ -70,6 +69,13 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
const getCallback = (data) => {
|
const getCallback = (data) => {
|
||||||
if (data.status === 'SUCCESS') {
|
if (data.status === 'SUCCESS') {
|
||||||
setData(getFormattedData(data.data));
|
setData(getFormattedData(data.data));
|
||||||
|
const formDataInitial = data.data.applicationFormFields.reduce((acc, cur) => {
|
||||||
|
if (cur.fieldValue) {
|
||||||
|
acc[cur.fieldId] = cur.fieldValue;
|
||||||
|
}
|
||||||
|
return acc;
|
||||||
|
}, {});
|
||||||
|
setFormInitialData(formDataInitial);
|
||||||
CommunicationService.getCommsByAmendmentId(data.data.id, getCommsCallback, errGetCommsCallback);
|
CommunicationService.getCommsByAmendmentId(data.data.id, getCommsCallback, errGetCommsCallback);
|
||||||
}
|
}
|
||||||
//storeSet.main.unsetAsyncRequest();
|
//storeSet.main.unsetAsyncRequest();
|
||||||
@@ -234,7 +240,6 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
|
|
||||||
const submitData = {
|
const submitData = {
|
||||||
updatedFormFields: newFormValues,
|
updatedFormFields: newFormValues,
|
||||||
//note: data.internalNote
|
|
||||||
}
|
}
|
||||||
|
|
||||||
storeSet.main.setAsyncRequest();
|
storeSet.main.setAsyncRequest();
|
||||||
@@ -356,6 +361,36 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
setIsLoadingExtendingTime(false);
|
setIsLoadingExtendingTime(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const sendReminder = () => {
|
||||||
|
setIsLoadingReminding(true);
|
||||||
|
AmendmentsService.sendReminderForSoccorso(amendmentId, reminderCallback, errReminderCallback)
|
||||||
|
}
|
||||||
|
|
||||||
|
const reminderCallback = (data) => {
|
||||||
|
if (data.status === 'SUCCESS') {
|
||||||
|
if (toast.current) {
|
||||||
|
toast.current.show({
|
||||||
|
severity: 'success',
|
||||||
|
summary: '',
|
||||||
|
detail: data.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setIsLoadingReminding(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
const errReminderCallback = (data) => {
|
||||||
|
if (toast.current && data.message) {
|
||||||
|
toast.current.show({
|
||||||
|
severity: 'error',
|
||||||
|
summary: '',
|
||||||
|
detail: data.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
set404FromErrorResponse(data);
|
||||||
|
setIsLoadingReminding(false);
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const parsedSoccorsoId = parseInt(amendmentId);
|
const parsedSoccorsoId = parseInt(amendmentId);
|
||||||
const soccorsoEntityId = !isNaN(parsedSoccorsoId) ? parsedSoccorsoId : 0;
|
const soccorsoEntityId = !isNaN(parsedSoccorsoId) ? parsedSoccorsoId : 0;
|
||||||
@@ -384,8 +419,7 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
|
|
||||||
<div className="appPage__spacer"></div>
|
<div className="appPage__spacer"></div>
|
||||||
|
|
||||||
{!isAsyncRequest && !isEmpty(data)
|
<div className="appPage__content">
|
||||||
? <div className="appPage__content">
|
|
||||||
<div className="appPageSection__withBorder columns">
|
<div className="appPageSection__withBorder columns">
|
||||||
<p className="appPageSection__pMeta">
|
<p className="appPageSection__pMeta">
|
||||||
<span>{__('ID domanda', 'gepafin')}</span>
|
<span>{__('ID domanda', 'gepafin')}</span>
|
||||||
@@ -419,9 +453,10 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
<div>
|
<div>
|
||||||
<h3>{__('Documenti Richiesti', 'gepafin')}</h3>
|
<h3>{__('Documenti Richiesti', 'gepafin')}</h3>
|
||||||
<ol className="appPageSection__list">
|
<ol className="appPageSection__list">
|
||||||
{data.formFields.map((o, i) => <li key={o.fieldId}>
|
{data.formFields
|
||||||
|
? data.formFields.map((o, i) => <li key={o.fieldId} style={{ flexDirection: 'row' }}>
|
||||||
<span>{o.label}</span>
|
<span>{o.label}</span>
|
||||||
</li>)}
|
</li>) : null}
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@@ -465,6 +500,7 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
<Button
|
<Button
|
||||||
style={{ marginTop: 30 }}
|
style={{ marginTop: 30 }}
|
||||||
onClick={openNewCommDialog}
|
onClick={openNewCommDialog}
|
||||||
|
disabled={data.status === 'CLOSE'}
|
||||||
type="button"
|
type="button"
|
||||||
label={__('Aggiungi Comunicazione', 'gepafin')}
|
label={__('Aggiungi Comunicazione', 'gepafin')}
|
||||||
icon="pi pi-plus" iconPos="right"/>
|
icon="pi pi-plus" iconPos="right"/>
|
||||||
@@ -474,31 +510,21 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
<h2>{__('Documenti Ricevuti', 'gepafin')}</h2>
|
<h2>{__('Documenti Ricevuti', 'gepafin')}</h2>
|
||||||
|
|
||||||
<form className="appForm" onSubmit={handleSubmit(onSubmit)}>
|
<form className="appForm" onSubmit={handleSubmit(onSubmit)}>
|
||||||
{data.formFields.map((o, i) => {
|
{data.formFields
|
||||||
const test = {
|
? data.formFields.map((o, i) => {
|
||||||
'updatedFormFields': [
|
/*const thisField = head(test.updatedFormFields.filter(j => j.fieldId === o.fieldId));
|
||||||
{
|
|
||||||
'fieldId': 'a5867bdceb',
|
|
||||||
'fieldValue': '136'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'fieldId': 'ab0f00219b',
|
|
||||||
'fieldValue': null
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
const thisField = head(test.updatedFormFields.filter(j => j.fieldId === o.fieldId));
|
|
||||||
const value = pathOr({}, ['fieldValue'], thisField);
|
const value = pathOr({}, ['fieldValue'], thisField);
|
||||||
console.log('value', value, o.fieldId);
|
console.log('value', value, o.fieldId);*/
|
||||||
return <FormField
|
return <FormField
|
||||||
key={o.fieldId}
|
key={o.fieldId}
|
||||||
|
disabled={data.status === 'CLOSE'}
|
||||||
type="fileupload"
|
type="fileupload"
|
||||||
setDataFn={setValue}
|
setDataFn={setValue}
|
||||||
fieldName={o.fieldId}
|
fieldName={o.fieldId}
|
||||||
label={o.label}
|
label={o.label}
|
||||||
control={control}
|
control={control}
|
||||||
errors={errors}
|
errors={errors}
|
||||||
defaultValue={[]}
|
defaultValue={formInitialData[o.fieldId] ? formInitialData[o.fieldId] : []}
|
||||||
accept={[]}
|
accept={[]}
|
||||||
doctype="document"
|
doctype="document"
|
||||||
register={register}
|
register={register}
|
||||||
@@ -506,12 +532,13 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
source="application"
|
source="application"
|
||||||
multiple={true}
|
multiple={true}
|
||||||
/>
|
/>
|
||||||
})}
|
}) : null}
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
style={{ marginTop: 30 }}
|
style={{ marginTop: 30 }}
|
||||||
type="button"
|
type="button"
|
||||||
|
disabled={data.status === 'CLOSE'}
|
||||||
onClick={doUpdateAmendment}
|
onClick={doUpdateAmendment}
|
||||||
label={__('Aggiorna', 'gepafin')}/>
|
label={__('Aggiorna', 'gepafin')}/>
|
||||||
</div>
|
</div>
|
||||||
@@ -526,7 +553,8 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
<div className="appPageSection__actions">
|
<div className="appPageSection__actions">
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
disabled={true}
|
onClick={sendReminder}
|
||||||
|
disabled={isLoadingReminding || data.status === 'CLOSE'}
|
||||||
outlined
|
outlined
|
||||||
label={__('Invia Sollecito', 'gepafin')}
|
label={__('Invia Sollecito', 'gepafin')}
|
||||||
icon="pi pi-send"
|
icon="pi pi-send"
|
||||||
@@ -534,6 +562,7 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={openExtendResponseTimeDialog}
|
onClick={openExtendResponseTimeDialog}
|
||||||
|
disabled={isLoadingExtendingTime || data.status === 'CLOSE'}
|
||||||
outlined
|
outlined
|
||||||
label={__('Estendi Scadenza', 'gepafin')}
|
label={__('Estendi Scadenza', 'gepafin')}
|
||||||
icon="pi pi-stopwatch"
|
icon="pi pi-stopwatch"
|
||||||
@@ -541,6 +570,7 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={doCloseAmendment}
|
onClick={doCloseAmendment}
|
||||||
|
disabled={isAsyncRequest || data.status === 'CLOSE'}
|
||||||
label={__('Chiudi Soccorso Istruttorio', 'gepafin')}
|
label={__('Chiudi Soccorso Istruttorio', 'gepafin')}
|
||||||
icon="pi pi-times" iconPos="right"/>
|
icon="pi pi-times" iconPos="right"/>
|
||||||
</div>
|
</div>
|
||||||
@@ -548,9 +578,11 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
|
|
||||||
<div className="appForm__field" style={{ marginTop: '-40px' }}>
|
<div className="appForm__field" style={{ marginTop: '-40px' }}>
|
||||||
<label>{__('Note Interne', 'gepafin')}</label>
|
<label>{__('Note Interne', 'gepafin')}</label>
|
||||||
<div>
|
<div style={{position: 'relative'}}>
|
||||||
|
<BlockingOverlay shouldDisplay={data.status === 'CLOSE'}/>
|
||||||
<Editor
|
<Editor
|
||||||
value={data.internalNote}
|
value={data.internalNote}
|
||||||
|
readOnly={data.status === 'CLOSE'}
|
||||||
placeholder={__('Digita qui il messagio', 'gepafin')}
|
placeholder={__('Digita qui il messagio', 'gepafin')}
|
||||||
headerTemplate={header}
|
headerTemplate={header}
|
||||||
onTextChange={(e) => updateNewAmendmentData(
|
onTextChange={(e) => updateNewAmendmentData(
|
||||||
@@ -563,16 +595,6 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
: <>
|
|
||||||
<Skeleton width="20%" height="1rem" className="mb-2"></Skeleton>
|
|
||||||
<Skeleton width="100%" height="2rem" className="mb-8"></Skeleton>
|
|
||||||
<Skeleton width="20%" height="1rem" className="mb-2"></Skeleton>
|
|
||||||
<Skeleton width="100%" height="4rem" className="mb-8"></Skeleton>
|
|
||||||
<Skeleton width="20%" height="1rem" className="mb-2"></Skeleton>
|
|
||||||
<Skeleton width="100%" height="2rem" className="mb-8"></Skeleton>
|
|
||||||
<Skeleton width="20%" height="1rem" className="mb-2"></Skeleton>
|
|
||||||
<Skeleton width="100%" height="4rem"></Skeleton>
|
|
||||||
</>}
|
|
||||||
|
|
||||||
<Dialog
|
<Dialog
|
||||||
visible={isVisibleNewCommDialog}
|
visible={isVisibleNewCommDialog}
|
||||||
@@ -587,6 +609,7 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
{__('Titolo', 'gepafin')}*
|
{__('Titolo', 'gepafin')}*
|
||||||
</label>
|
</label>
|
||||||
<InputText value={newCommData.title}
|
<InputText value={newCommData.title}
|
||||||
|
disabled={data.status === 'CLOSE'}
|
||||||
invalid={isEmpty(newCommData.title)}
|
invalid={isEmpty(newCommData.title)}
|
||||||
onChange={(e) => updateNewCommData(e.target.value, 'title')}/>
|
onChange={(e) => updateNewCommData(e.target.value, 'title')}/>
|
||||||
|
|
||||||
@@ -596,6 +619,7 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
</label>
|
</label>
|
||||||
<InputTextarea
|
<InputTextarea
|
||||||
value={newCommData.comment}
|
value={newCommData.comment}
|
||||||
|
disabled={data.status === 'CLOSE'}
|
||||||
rows={5} cols={30}
|
rows={5} cols={30}
|
||||||
invalid={isEmpty(newCommData.comment)}
|
invalid={isEmpty(newCommData.comment)}
|
||||||
onChange={(e) => updateNewCommData(e.target.value, 'comment')}/>
|
onChange={(e) => updateNewCommData(e.target.value, 'comment')}/>
|
||||||
@@ -616,6 +640,7 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
</label>
|
</label>
|
||||||
<InputNumber
|
<InputNumber
|
||||||
keyfilter="int"
|
keyfilter="int"
|
||||||
|
disabled={data.status === 'CLOSE'}
|
||||||
value={extendedTime}
|
value={extendedTime}
|
||||||
showButtons
|
showButtons
|
||||||
onChange={(e) => setExtendedTime(e.value)}/>
|
onChange={(e) => setExtendedTime(e.value)}/>
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ import DomandaEditPreInstructor from './pages/DomandaEditPreInstructor';
|
|||||||
import SoccorsoIstruttorioPreInstructor from './pages/SoccorsoIstruttorioPreInstructor';
|
import SoccorsoIstruttorioPreInstructor from './pages/SoccorsoIstruttorioPreInstructor';
|
||||||
import SoccorsoEditPreInstructor from './pages/SoccorsoEditPreInstructor';
|
import SoccorsoEditPreInstructor from './pages/SoccorsoEditPreInstructor';
|
||||||
import SoccorsoAddPreInstructor from './pages/SoccorsoAddPreInstructor';
|
import SoccorsoAddPreInstructor from './pages/SoccorsoAddPreInstructor';
|
||||||
|
import DomandeBeneficiario from './pages/DomandeBeneficiario';
|
||||||
|
import DomandaBeneficiario from './pages/DomandaBeneficiario';
|
||||||
|
|
||||||
const routes = ({ role, chosenCompanyId }) => {
|
const routes = ({ role, chosenCompanyId }) => {
|
||||||
|
|
||||||
@@ -86,12 +88,12 @@ const routes = ({ role, chosenCompanyId }) => {
|
|||||||
</DefaultLayout>}/>
|
</DefaultLayout>}/>
|
||||||
<Route path="/domande" element={<DefaultLayout>
|
<Route path="/domande" element={<DefaultLayout>
|
||||||
{'ROLE_SUPER_ADMIN' === role ? <Domande/> : null}
|
{'ROLE_SUPER_ADMIN' === role ? <Domande/> : null}
|
||||||
{'ROLE_BENEFICIARY' === role ? <PageNotFound/> : null}
|
{'ROLE_BENEFICIARY' === role ? <DomandeBeneficiario/> : null}
|
||||||
{'ROLE_PRE_INSTRUCTOR' === role ? <DomandePreInstructor/> : null}
|
{'ROLE_PRE_INSTRUCTOR' === role ? <DomandePreInstructor/> : null}
|
||||||
</DefaultLayout>}/>
|
</DefaultLayout>}/>
|
||||||
<Route path="/domande/:id/" element={<DefaultLayout>
|
<Route path="/domande/:id/" element={<DefaultLayout>
|
||||||
{'ROLE_SUPER_ADMIN' === role ? <PageNotFound/> : null}
|
{'ROLE_SUPER_ADMIN' === role ? <PageNotFound/> : null}
|
||||||
{'ROLE_BENEFICIARY' === role ? <PageNotFound/> : null}
|
{'ROLE_BENEFICIARY' === role ? <DomandaBeneficiario/> : null}
|
||||||
{'ROLE_PRE_INSTRUCTOR' === role ? <DomandaEditPreInstructor/> : null}
|
{'ROLE_PRE_INSTRUCTOR' === role ? <DomandaEditPreInstructor/> : null}
|
||||||
</DefaultLayout>}/>
|
</DefaultLayout>}/>
|
||||||
<Route path="/domande/:id/aggiungi-soccorso/:evaluationId" element={<DefaultLayout>
|
<Route path="/domande/:id/aggiungi-soccorso/:evaluationId" element={<DefaultLayout>
|
||||||
|
|||||||
@@ -4,10 +4,14 @@ const API_BASE_URL = process.env.REACT_APP_API_EXECUTION_ADDRESS;
|
|||||||
|
|
||||||
export default class AmendmentsService {
|
export default class AmendmentsService {
|
||||||
|
|
||||||
static getSoccorsoByApplId = (id, callback, errCallback, queryParams) => {
|
static getSoccorsoByApplEvalId = (id, callback, errCallback, queryParams) => {
|
||||||
NetworkService.get(`${API_BASE_URL}/amendments/applicationEvaluation/${id}`, callback, errCallback, queryParams);
|
NetworkService.get(`${API_BASE_URL}/amendments/applicationEvaluation/${id}`, callback, errCallback, queryParams);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static getSoccorsoByApplId = (id, callback, errCallback, queryParams) => {
|
||||||
|
NetworkService.get(`${API_BASE_URL}/amendments/application/${id}`, callback, errCallback, queryParams);
|
||||||
|
};
|
||||||
|
|
||||||
static getSoccorsoById = (callback, errCallback, queryParams) => {
|
static getSoccorsoById = (callback, errCallback, queryParams) => {
|
||||||
NetworkService.get(`${API_BASE_URL}/amendments`, callback, errCallback, queryParams);
|
NetworkService.get(`${API_BASE_URL}/amendments`, callback, errCallback, queryParams);
|
||||||
};
|
};
|
||||||
@@ -30,6 +34,10 @@ export default class AmendmentsService {
|
|||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static sendReminderForSoccorso = (id, callback, errCallback, queryParams) => {
|
||||||
|
NetworkService.post(`${API_BASE_URL}/amendments/${id}/reminder`, {}, callback, errCallback, queryParams);
|
||||||
|
};
|
||||||
|
|
||||||
static closeSoccorso = (id, body, callback, errCallback, queryParams) => {
|
static closeSoccorso = (id, body, callback, errCallback, queryParams) => {
|
||||||
NetworkService.put(`${API_BASE_URL}/amendments`, body, callback, errCallback, [
|
NetworkService.put(`${API_BASE_URL}/amendments`, body, callback, errCallback, [
|
||||||
['id', id]
|
['id', id]
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export default class ApplicationEvaluationService {
|
|||||||
NetworkService.get(`${API_BASE_URL}/applicationEvaluation/application`, callback, errCallback, queryParams);
|
NetworkService.get(`${API_BASE_URL}/applicationEvaluation/application`, callback, errCallback, queryParams);
|
||||||
};
|
};
|
||||||
|
|
||||||
static updateEvaluation = (id, body, callback, errCallback, queryParams) => {
|
static updateEvaluation = (assignedApplicationId, body, callback, errCallback, queryParams) => {
|
||||||
NetworkService.put(`${API_BASE_URL}/applicationEvaluation/${id}`, body, callback, errCallback, queryParams);
|
NetworkService.put(`${API_BASE_URL}/applicationEvaluation/${assignedApplicationId}`, body, callback, errCallback, queryParams);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -371,7 +371,8 @@ export class NetworkService {
|
|||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Authorization': 'Bearer ' + storeGet.main.getToken(),
|
'Authorization': 'Bearer ' + storeGet.main.getToken(),
|
||||||
}
|
},
|
||||||
|
signal: AbortSignal.timeout(5000)
|
||||||
})
|
})
|
||||||
.then(async response => {
|
.then(async response => {
|
||||||
let status = response.status;
|
let status = response.status;
|
||||||
|
|||||||
Reference in New Issue
Block a user