- saving progress;
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 24px;
|
gap: 24px;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
.appForm__field {
|
.appForm__field {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@@ -22,6 +22,10 @@ body {
|
|||||||
h2, h3, p, label, .appPageSection__hr {
|
h2, h3, p, label, .appPageSection__hr {
|
||||||
color: var(--global-textColor);
|
color: var(--global-textColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#root, .wrapper {
|
#root, .wrapper {
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ const getBandoLabel = (status) => {
|
|||||||
case 'READY':
|
case 'READY':
|
||||||
return __('Pronto', 'gepafin');
|
return __('Pronto', 'gepafin');
|
||||||
|
|
||||||
|
case 'SOCCORSO':
|
||||||
|
return __('Soccorso', 'gepafin');
|
||||||
|
|
||||||
case 'DRAFT':
|
case 'DRAFT':
|
||||||
return __('Bozza', 'gepafin');
|
return __('Bozza', 'gepafin');
|
||||||
|
|
||||||
@@ -38,6 +41,9 @@ const getBandoLabel = (status) => {
|
|||||||
case 'EXPIRED':
|
case 'EXPIRED':
|
||||||
return __('Scaduto', 'gepafin');
|
return __('Scaduto', 'gepafin');
|
||||||
|
|
||||||
|
case 'CLOSE':
|
||||||
|
return __('Chiuso', 'gepafin');
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ const getBandoSeverity = (status) => {
|
|||||||
case 'READY':
|
case 'READY':
|
||||||
return 'info';
|
return 'info';
|
||||||
|
|
||||||
|
case 'SOCCORSO':
|
||||||
|
return 'warning';
|
||||||
|
|
||||||
case 'DRAFT':
|
case 'DRAFT':
|
||||||
return 'warning';
|
return 'warning';
|
||||||
|
|
||||||
@@ -36,6 +39,9 @@ const getBandoSeverity = (status) => {
|
|||||||
case 'EXPIRED':
|
case 'EXPIRED':
|
||||||
return 'closed';
|
return 'closed';
|
||||||
|
|
||||||
|
case 'CLOSE':
|
||||||
|
return 'closed';
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 'info';
|
return 'info';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -406,8 +406,7 @@ const BandoViewBeneficiario = () => {
|
|||||||
: null}
|
: null}
|
||||||
|
|
||||||
<div className="appPageSection">
|
<div className="appPageSection">
|
||||||
{/*<h2>{__('Download Documenti', 'gepafin')}</h2>*/}
|
<h2>{__('Download Documenti', 'gepafin')}</h2>
|
||||||
<h2>{__('Partecipa', 'gepafin')}</h2>
|
|
||||||
<div className="appPageSection__actions">
|
<div className="appPageSection__actions">
|
||||||
{/* <Button
|
{/* <Button
|
||||||
type="button"
|
type="button"
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="appPageSection__hr">
|
<div className="appPageSection__hr">
|
||||||
<span>{__('Azioni rapide', 'gepafin')}</span>
|
<span>{__('Azioni', 'gepafin')}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="appPageSection">
|
<div className="appPageSection">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useState, useEffect, useRef } 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 { is, isEmpty, isNil } from 'ramda';
|
import { head, is, isEmpty, isNil, pathOr } from 'ramda';
|
||||||
import { wrap } from 'object-path-immutable';
|
import { wrap } from 'object-path-immutable';
|
||||||
|
|
||||||
// store
|
// store
|
||||||
@@ -26,6 +26,13 @@ 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 uniqid from '../../helpers/uniqid';
|
||||||
|
import { Editor } from 'primereact/editor';
|
||||||
|
import { TZDate } from '@date-fns/tz';
|
||||||
|
import { InputNumber } from 'primereact/inputnumber';
|
||||||
|
|
||||||
const SoccorsoEditPreInstructor = () => {
|
const SoccorsoEditPreInstructor = () => {
|
||||||
const isAsyncRequest = useStore().main.isAsyncRequest();
|
const isAsyncRequest = useStore().main.isAsyncRequest();
|
||||||
@@ -36,10 +43,28 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
const [isVisibleNewCommDialog, setIsVisibleNewCommDialog] = useState(false);
|
const [isVisibleNewCommDialog, setIsVisibleNewCommDialog] = useState(false);
|
||||||
const [newCommData, setNewCommData] = useState({});
|
const [newCommData, setNewCommData] = useState({});
|
||||||
const [isLoadingCommunication, setIsLoadingCommunication] = useState(false);
|
const [isLoadingCommunication, setIsLoadingCommunication] = useState(false);
|
||||||
|
const [isVisibleExtendTimeDialog, setIsVisibleExtendTimeDialog] = useState(false);
|
||||||
|
const [extendedTime, setExtendedTime] = useState(3);
|
||||||
|
const [isLoadingExtendingTime, setIsLoadingExtendingTime] = useState(false);
|
||||||
const toast = useRef(null);
|
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 goToEvaluationPage = () => {
|
const goToEvaluationPage = () => {
|
||||||
//navigate('/domande');
|
navigate(`/domande/${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const getCallback = (data) => {
|
const getCallback = (data) => {
|
||||||
@@ -64,7 +89,7 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
|
|
||||||
const getCommsCallback = (data) => {
|
const getCommsCallback = (data) => {
|
||||||
if (data.status === 'SUCCESS') {
|
if (data.status === 'SUCCESS') {
|
||||||
setComms(data.data.commentsList);
|
setComms(data.data.commentsList.map(o => getFormattedCommsData(o)));
|
||||||
}
|
}
|
||||||
storeSet.main.unsetAsyncRequest();
|
storeSet.main.unsetAsyncRequest();
|
||||||
}
|
}
|
||||||
@@ -87,31 +112,19 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|
||||||
const renderHeader = () => {
|
const getFormattedCommsData = (data) => {
|
||||||
return (
|
data.id = isNil(data.id) ? uniqid('id') : data.id;
|
||||||
<span className="ql-formats">
|
data.commentedDate = is(String, data.commentedDate) ? new Date(data.commentedDate) : (data.commentedDate ? data.commentedDate : '');
|
||||||
<button className="ql-bold" aria-label="Bold"></button>
|
data.createdDate = is(String, data.createdDate) ? new Date(data.createdDate) : (data.createdDate ? data.createdDate : '');
|
||||||
<button className="ql-italic" aria-label="Italic"></button>
|
data.updatedDate = is(String, data.updatedDate) ? new Date(data.updatedDate) : (data.updatedDate ? data.updatedDate : '');
|
||||||
<button className="ql-underline" aria-label="Underline"></button>
|
return data;
|
||||||
<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 headerNewComDialog = () => {
|
||||||
|
|
||||||
const headerEditDialog = () => {
|
|
||||||
return <span>{__('Aggiungi comunicazione', 'gepafin')}</span>
|
return <span>{__('Aggiungi comunicazione', 'gepafin')}</span>
|
||||||
}
|
}
|
||||||
|
|
||||||
const hideEditDialog = () => {
|
const hideNewComDialog = () => {
|
||||||
setIsVisibleNewCommDialog(false);
|
setIsVisibleNewCommDialog(false);
|
||||||
setNewCommData({
|
setNewCommData({
|
||||||
title: '',
|
title: '',
|
||||||
@@ -119,9 +132,9 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const footerEditDialog = () => {
|
const footerNewComDialog = () => {
|
||||||
return <div>
|
return <div>
|
||||||
<Button type="button" label={__('Anulla', 'gepafin')} onClick={hideEditDialog} outlined/>
|
<Button type="button" label={__('Anulla', 'gepafin')} onClick={hideNewComDialog} outlined/>
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
disabled={isLoadingCommunication || isEmpty(newCommData.title) || isEmpty(newCommData.comment)}
|
disabled={isLoadingCommunication || isEmpty(newCommData.title) || isEmpty(newCommData.comment)}
|
||||||
@@ -142,11 +155,34 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
setNewCommData(newData);
|
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 = () => {
|
const createCommunication = () => {
|
||||||
setIsLoadingCommunication(true);
|
setIsLoadingCommunication(true);
|
||||||
CommunicationService.createCommunication(newCommData, createCommunicationCallback, errCreateCommunicationCallback, [
|
CommunicationService.createCommunication(amendmentId, newCommData, createCommunicationCallback, errCreateCommunicationCallback);
|
||||||
['amendmentId', amendmentId]
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const createCommunicationCallback = (data) => {
|
const createCommunicationCallback = (data) => {
|
||||||
@@ -158,7 +194,8 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
detail: data.message
|
detail: data.message
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
console.log(data.data)
|
setComms([...comms, getFormattedCommsData(data.data)])
|
||||||
|
setIsVisibleNewCommDialog(false);
|
||||||
}
|
}
|
||||||
setIsLoadingCommunication(false);
|
setIsLoadingCommunication(false);
|
||||||
}
|
}
|
||||||
@@ -175,6 +212,150 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
setIsLoadingCommunication(false);
|
setIsLoadingCommunication(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const onSubmit = () => {
|
||||||
|
};
|
||||||
|
|
||||||
|
const doUpdateAmendment = () => {
|
||||||
|
trigger();
|
||||||
|
let formValues = klona(getValues());
|
||||||
|
const newFormValues = Object.keys(formValues)
|
||||||
|
.reduce((acc, cur) => {
|
||||||
|
let fieldVal = formValues[cur];
|
||||||
|
|
||||||
|
fieldVal = isEmpty(fieldVal) ? null : fieldVal;
|
||||||
|
fieldVal = is(Array, fieldVal) ? fieldVal.map(o => o.id).join(',') : null;
|
||||||
|
|
||||||
|
acc.push({
|
||||||
|
'fieldId': cur,
|
||||||
|
'fieldValue': fieldVal
|
||||||
|
});
|
||||||
|
return acc;
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const submitData = {
|
||||||
|
updatedFormFields: newFormValues,
|
||||||
|
//note: data.internalNote
|
||||||
|
}
|
||||||
|
|
||||||
|
storeSet.main.setAsyncRequest();
|
||||||
|
AmendmentsService.updateSoccorso(amendmentId, submitData, updateAmendmentCallback, errUpdateAmendmentCallback);
|
||||||
|
}
|
||||||
|
|
||||||
|
const updateAmendmentCallback = (data) => {
|
||||||
|
if (data.status === 'SUCCESS') {
|
||||||
|
if (toast.current) {
|
||||||
|
toast.current.show({
|
||||||
|
severity: 'success',
|
||||||
|
summary: '',
|
||||||
|
detail: data.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
storeSet.main.unsetAsyncRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
const errUpdateAmendmentCallback = (data) => {
|
||||||
|
if (toast.current && data.message) {
|
||||||
|
toast.current.show({
|
||||||
|
severity: 'error',
|
||||||
|
summary: '',
|
||||||
|
detail: data.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
set404FromErrorResponse(data);
|
||||||
|
storeSet.main.unsetAsyncRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
const doCloseAmendment = () => {
|
||||||
|
const submitData = {
|
||||||
|
internalNote: data.internalNote
|
||||||
|
}
|
||||||
|
storeSet.main.setAsyncRequest();
|
||||||
|
AmendmentsService.closeSoccorso(amendmentId, submitData, closeAmendmentCallback, errCloseAmendmentCallback);
|
||||||
|
}
|
||||||
|
|
||||||
|
const closeAmendmentCallback = (data) => {
|
||||||
|
if (data.status === 'SUCCESS') {
|
||||||
|
if (toast.current) {
|
||||||
|
toast.current.show({
|
||||||
|
severity: 'success',
|
||||||
|
summary: '',
|
||||||
|
detail: data.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (data.data.status) {
|
||||||
|
updateNewAmendmentData(data.data.status, 'status')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
storeSet.main.unsetAsyncRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
const errCloseAmendmentCallback = (data) => {
|
||||||
|
if (toast.current && data.message) {
|
||||||
|
toast.current.show({
|
||||||
|
severity: 'error',
|
||||||
|
summary: '',
|
||||||
|
detail: data.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
set404FromErrorResponse(data);
|
||||||
|
storeSet.main.unsetAsyncRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
const headerExtendRespDialog = () => {
|
||||||
|
return <span>{__('Estendi scadenza', 'gepafin')}</span>
|
||||||
|
}
|
||||||
|
|
||||||
|
const hideExtendRespDialog = () => {
|
||||||
|
setIsVisibleExtendTimeDialog(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
const footerExtendRespDialog = () => {
|
||||||
|
return <div>
|
||||||
|
<Button type="button" label={__('Anulla', 'gepafin')} onClick={hideExtendRespDialog} outlined/>
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
disabled={isLoadingExtendingTime || isEmpty(extendedTime)}
|
||||||
|
label={__('Invia', 'gepafin')} onClick={doExtendTimeResponse}/>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
const openExtendResponseTimeDialog = () => {
|
||||||
|
setIsVisibleExtendTimeDialog(true);
|
||||||
|
setExtendedTime(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
const doExtendTimeResponse = () => {
|
||||||
|
setIsLoadingExtendingTime(true);
|
||||||
|
AmendmentsService.extendSoccorso(amendmentId, extendedTime, extendCallback, errExtendCallback);
|
||||||
|
}
|
||||||
|
|
||||||
|
const extendCallback = (data) => {
|
||||||
|
if (data.status === 'SUCCESS') {
|
||||||
|
if (toast.current) {
|
||||||
|
toast.current.show({
|
||||||
|
severity: 'success',
|
||||||
|
summary: '',
|
||||||
|
detail: data.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
setIsVisibleExtendTimeDialog(false);
|
||||||
|
}
|
||||||
|
setIsLoadingExtendingTime(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
const errExtendCallback = (data) => {
|
||||||
|
if (toast.current && data.message) {
|
||||||
|
toast.current.show({
|
||||||
|
severity: 'error',
|
||||||
|
summary: '',
|
||||||
|
detail: data.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
set404FromErrorResponse(data);
|
||||||
|
setIsLoadingExtendingTime(false);
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const parsedSoccorsoId = parseInt(amendmentId);
|
const parsedSoccorsoId = parseInt(amendmentId);
|
||||||
const soccorsoEntityId = !isNaN(parsedSoccorsoId) ? parsedSoccorsoId : 0;
|
const soccorsoEntityId = !isNaN(parsedSoccorsoId) ? parsedSoccorsoId : 0;
|
||||||
@@ -228,7 +409,7 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
</p>
|
</p>
|
||||||
<p className="appPageSection__pMeta">
|
<p className="appPageSection__pMeta">
|
||||||
<span>{__('Stato', 'gepafin')}</span>
|
<span>{__('Stato', 'gepafin')}</span>
|
||||||
<span>{getBandoLabel(data.applicationStatus)}</span>
|
<span>{getBandoLabel(data.status)}</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -245,7 +426,8 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<h3>{__('Note e spiegazioni', 'gepafin')}</h3>
|
<h3>{__('Note e spiegazioni', 'gepafin')}</h3>
|
||||||
<div className="ql-editor">
|
<div className="appPageSection__withBorder grey ql-editor"
|
||||||
|
style={{ minHeight: '200px' }}>
|
||||||
{renderHtmlContent(data.note)}
|
{renderHtmlContent(data.note)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -265,13 +447,18 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
<tbody className="myTbody">
|
<tbody className="myTbody">
|
||||||
{!isNil(comms) && !isEmpty(comms)
|
{!isNil(comms) && !isEmpty(comms)
|
||||||
? comms.map((o, i) => <tr key={o.id}>
|
? comms.map((o, i) => <tr key={o.id}>
|
||||||
<td></td>
|
<td valign="top">
|
||||||
<td></td>
|
{getDateFromISOstring(o.commentedDate)}
|
||||||
</tr>) : null}
|
</td>
|
||||||
<tr>
|
<td>
|
||||||
|
<h3>{o.title}</h3>
|
||||||
|
<p>{o.comment}</p>
|
||||||
|
</td>
|
||||||
|
</tr>)
|
||||||
|
: <tr>
|
||||||
<td>-</td>
|
<td>-</td>
|
||||||
<td>-</td>
|
<td>-</td>
|
||||||
</tr>
|
</tr>}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
@@ -283,33 +470,98 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
icon="pi pi-plus" iconPos="right"/>
|
icon="pi pi-plus" iconPos="right"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className="appPageSection">
|
||||||
|
<h2>{__('Documenti Ricevuti', 'gepafin')}</h2>
|
||||||
|
|
||||||
|
<form className="appForm" onSubmit={handleSubmit(onSubmit)}>
|
||||||
|
{data.formFields.map((o, i) => {
|
||||||
|
const test = {
|
||||||
|
'updatedFormFields': [
|
||||||
|
{
|
||||||
|
'fieldId': 'a5867bdceb',
|
||||||
|
'fieldValue': '136'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'fieldId': 'ab0f00219b',
|
||||||
|
'fieldValue': null
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
const thisField = head(test.updatedFormFields.filter(j => j.fieldId === o.fieldId));
|
||||||
|
const value = pathOr({}, ['fieldValue'], thisField);
|
||||||
|
console.log('value', value, o.fieldId);
|
||||||
|
return <FormField
|
||||||
|
key={o.fieldId}
|
||||||
|
type="fileupload"
|
||||||
|
setDataFn={setValue}
|
||||||
|
fieldName={o.fieldId}
|
||||||
|
label={o.label}
|
||||||
|
control={control}
|
||||||
|
errors={errors}
|
||||||
|
defaultValue={[]}
|
||||||
|
accept={[]}
|
||||||
|
doctype="document"
|
||||||
|
register={register}
|
||||||
|
sourceId={data.applicationId}
|
||||||
|
source="application"
|
||||||
|
multiple={true}
|
||||||
|
/>
|
||||||
|
})}
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
style={{ marginTop: 30 }}
|
||||||
|
type="button"
|
||||||
|
onClick={doUpdateAmendment}
|
||||||
|
label={__('Aggiorna', 'gepafin')}/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="appPage__spacer"></div>
|
<div className="appPage__spacer"></div>
|
||||||
|
|
||||||
<div className="appPageSection__hr">
|
<div className="appPageSection__hr">
|
||||||
<span>{__('Azioni rapide', 'gepafin')}</span>
|
<span>{__('Azioni', 'gepafin')}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="appPageSection">
|
<div className="appPageSection">
|
||||||
<div className="appPageSection__actions">
|
<div className="appPageSection__actions">
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
|
disabled={true}
|
||||||
outlined
|
outlined
|
||||||
label={__('Invia Sollecito', 'gepafin')}
|
label={__('Invia Sollecito', 'gepafin')}
|
||||||
icon="pi pi-send"
|
icon="pi pi-send"
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
|
onClick={openExtendResponseTimeDialog}
|
||||||
outlined
|
outlined
|
||||||
label={__('Estendi Scadenza', 'gepafin')}
|
label={__('Estendi Scadenza', 'gepafin')}
|
||||||
icon="pi pi-stopwatch"
|
icon="pi pi-stopwatch"
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
|
onClick={doCloseAmendment}
|
||||||
label={__('Chiudi Soccorso Istruttorio', 'gepafin')}
|
label={__('Chiudi Soccorso Istruttorio', 'gepafin')}
|
||||||
icon="pi pi-times" iconPos="right"/>
|
icon="pi pi-times" iconPos="right"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className="appForm__field" style={{ marginTop: '-40px' }}>
|
||||||
|
<label>{__('Note Interne', 'gepafin')}</label>
|
||||||
|
<div>
|
||||||
|
<Editor
|
||||||
|
value={data.internalNote}
|
||||||
|
placeholder={__('Digita qui il messagio', 'gepafin')}
|
||||||
|
headerTemplate={header}
|
||||||
|
onTextChange={(e) => updateNewAmendmentData(
|
||||||
|
e.htmlValue,
|
||||||
|
'internalNote'
|
||||||
|
)}
|
||||||
|
style={{ height: 80 * 3, width: '100%' }}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
: <>
|
: <>
|
||||||
<Skeleton width="20%" height="1rem" className="mb-2"></Skeleton>
|
<Skeleton width="20%" height="1rem" className="mb-2"></Skeleton>
|
||||||
@@ -325,10 +577,10 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
<Dialog
|
<Dialog
|
||||||
visible={isVisibleNewCommDialog}
|
visible={isVisibleNewCommDialog}
|
||||||
modal
|
modal
|
||||||
header={headerEditDialog}
|
header={headerNewComDialog}
|
||||||
footer={footerEditDialog}
|
footer={footerNewComDialog}
|
||||||
style={{ maxWidth: '600px', width: '100%' }}
|
style={{ maxWidth: '600px', width: '100%' }}
|
||||||
onHide={hideEditDialog}>
|
onHide={hideNewComDialog}>
|
||||||
<div className="appForm__field">
|
<div className="appForm__field">
|
||||||
<label
|
<label
|
||||||
className={classNames({ 'p-error': isEmpty(newCommData.title) })}>
|
className={classNames({ 'p-error': isEmpty(newCommData.title) })}>
|
||||||
@@ -342,11 +594,33 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
className={classNames({ 'p-error': isEmpty(newCommData.comment) })}>
|
className={classNames({ 'p-error': isEmpty(newCommData.comment) })}>
|
||||||
{__('Contenuto', 'gepafin')}*
|
{__('Contenuto', 'gepafin')}*
|
||||||
</label>
|
</label>
|
||||||
<InputTextarea value={newCommData.comment}
|
<InputTextarea
|
||||||
|
value={newCommData.comment}
|
||||||
|
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')}/>
|
||||||
</div>
|
</div>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
||||||
|
<Dialog
|
||||||
|
visible={isVisibleExtendTimeDialog}
|
||||||
|
modal
|
||||||
|
header={headerExtendRespDialog}
|
||||||
|
footer={footerExtendRespDialog}
|
||||||
|
style={{ maxWidth: '600px', width: '100%' }}
|
||||||
|
onHide={hideExtendRespDialog}>
|
||||||
|
<div className="appForm__field">
|
||||||
|
<label
|
||||||
|
className={classNames({ 'p-error': isEmpty(extendedTime) })}>
|
||||||
|
{__('Giorni', 'gepafin')}*
|
||||||
|
</label>
|
||||||
|
<InputNumber
|
||||||
|
keyfilter="int"
|
||||||
|
value={extendedTime}
|
||||||
|
showButtons
|
||||||
|
onChange={(e) => setExtendedTime(e.value)}/>
|
||||||
|
</div>
|
||||||
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -15,4 +15,20 @@ export default class AmendmentsService {
|
|||||||
static createSoccorso = (body, callback, errCallback, queryParams) => {
|
static createSoccorso = (body, callback, errCallback, queryParams) => {
|
||||||
NetworkService.post(`${API_BASE_URL}/amendments`, body, callback, errCallback, queryParams);
|
NetworkService.post(`${API_BASE_URL}/amendments`, body, callback, errCallback, queryParams);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static updateSoccorso = (id, body, callback, errCallback, queryParams) => {
|
||||||
|
NetworkService.put(`${API_BASE_URL}/amendments/${id}`, body, callback, errCallback, queryParams);
|
||||||
|
};
|
||||||
|
|
||||||
|
static extendSoccorso = (id, days, callback, errCallback, queryParams) => {
|
||||||
|
NetworkService.put(`${API_BASE_URL}/amendments/${id}/extendExpiration`, {}, callback, errCallback, [
|
||||||
|
['extendedDays', days]
|
||||||
|
]);
|
||||||
|
};
|
||||||
|
|
||||||
|
static closeSoccorso = (id, body, callback, errCallback, queryParams) => {
|
||||||
|
NetworkService.put(`${API_BASE_URL}/amendments`, body, callback, errCallback, [
|
||||||
|
['id', id]
|
||||||
|
]);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export default class CommunicationService {
|
|||||||
NetworkService.get(`${API_BASE_URL}/communication/${id}`, callback, errCallback, queryParams);
|
NetworkService.get(`${API_BASE_URL}/communication/${id}`, callback, errCallback, queryParams);
|
||||||
};
|
};
|
||||||
|
|
||||||
static createCommunication = (body, callback, errCallback, queryParams) => {
|
static createCommunication = (id, body, callback, errCallback, queryParams) => {
|
||||||
NetworkService.post(`${API_BASE_URL}/communication`, body, callback, errCallback, queryParams);
|
NetworkService.post(`${API_BASE_URL}/communication/${id}`, body, callback, errCallback, queryParams);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user