- saving progress;
This commit is contained in:
2
.env
2
.env
@@ -1,6 +1,6 @@
|
||||
REACT_APP_TAB_TITLE=Gepafin
|
||||
REACT_APP_API_EXECUTION_ADDRESS=https://api-dev-gepafin.memento.credit/v1
|
||||
REACT_APP_API_ADDRESS=https://api-dev-gepafin.memento.credit
|
||||
REACT_APP_LOGO_FILENAME=sviluppumbria-logo.png
|
||||
REACT_APP_LOGO_FILENAME=gepafin-logo.png
|
||||
REACT_APP_FAVICON_FILENAME=gepafin-favicon.ico
|
||||
REACT_APP_HUB_ID=p4lk3bcx1RStqTaIVVbXs
|
||||
@@ -11,6 +11,11 @@
|
||||
padding: 5px 0;
|
||||
width: 100%;
|
||||
|
||||
&.row {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
label {
|
||||
font-size: 14px;
|
||||
font-style: normal;
|
||||
|
||||
@@ -225,6 +225,31 @@
|
||||
gap: 0.5em;
|
||||
}
|
||||
|
||||
.appPageSection__message {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 7px;
|
||||
background: rgba(255, 242, 226, 0.7);
|
||||
border-style: solid;
|
||||
border-width: 0 0 0 6px;
|
||||
padding: 1.25rem 1.75rem;
|
||||
border-radius: 6px;
|
||||
|
||||
&.warning {
|
||||
color: var(--message-warning-color);
|
||||
border-color: var(--message-warning-color);
|
||||
}
|
||||
|
||||
&.info {
|
||||
color: var(--message-info-color);
|
||||
border-color: var(--message-info-color);
|
||||
}
|
||||
|
||||
.summary {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
@container section_with_border (max-width: 600px) {
|
||||
.appPageSection__withBorder {
|
||||
.row {
|
||||
|
||||
@@ -12,8 +12,14 @@ body {
|
||||
margin: 0;
|
||||
font-family: "Montserrat", sans-serif;
|
||||
|
||||
p, span:not(.p-button-label, .p-button-icon, .p-badge, .p-message-detail, .p-highlight, .p-inline-message-text, .p-tag, .p-tag-icon),
|
||||
input, label:not(.p-error), textarea, a, li, h1, h2, h3, h4, h5, h6, div:not(.p-inline-message, .p-toast-detail), th, td {
|
||||
/*p, span:not(.p-button-label, .p-button-icon, .p-badge, .p-message-detail, .p-message-summary, .p-highlight, .p-inline-message-text, .p-tag, .p-tag-icon),
|
||||
input:not(.p-checkbox-input),
|
||||
label:not(.p-error), textarea, a, li, h1, h2, h3, h4, h5, h6, div:not(.p-inline-message, .p-toast-detail, .p-checkbox-box), th, td,
|
||||
:not(svg, path, .p-button, .p-button > span, .statsBigBadges__gridItem > span, number-flow, .p-paginator-page, .p-badge) {
|
||||
color: var(--global-textColor);
|
||||
}*/
|
||||
|
||||
h2, h3, p, label, .appPageSection__hr {
|
||||
color: var(--global-textColor);
|
||||
}
|
||||
}
|
||||
@@ -87,6 +93,12 @@ img {
|
||||
color: white;
|
||||
}
|
||||
|
||||
svg {
|
||||
path {
|
||||
fill: white;
|
||||
}
|
||||
}
|
||||
|
||||
span {
|
||||
color: var(--menuitem-active-color);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
--table-border-color: #B7B7B7B2;
|
||||
--message-error-background: #ffdbdb;
|
||||
--message-error-color: #C2504D;
|
||||
--message-warning-color: #cc8925;
|
||||
--message-info-background: rgba(183, 183, 183, 0.7);
|
||||
--message-info-color: #3B82F6;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useParams } from 'react-router-dom';
|
||||
import { head, is, pluck, isEmpty, pathOr } from 'ramda';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { TZDate } from '@date-fns/tz';
|
||||
import "quill/dist/quill.core.css";
|
||||
import 'quill/dist/quill.core.css';
|
||||
|
||||
// store
|
||||
import { storeSet, storeGet, useStore } from '../../store';
|
||||
@@ -447,11 +447,10 @@ const BandoApplication = () => {
|
||||
|
||||
const handleSetSignedDocumentFromFileupload = (fieldName, stateFieldData) => {
|
||||
setSignedPdfFile(stateFieldData);
|
||||
setApplicationStatus('READY');
|
||||
|
||||
/*if (!isEmpty(stateFieldData)) {
|
||||
setVisibleConfirmation(true);
|
||||
}*/
|
||||
if (!isEmpty(stateFieldData)) {
|
||||
setApplicationStatus('READY');
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
@@ -459,7 +458,7 @@ const BandoApplication = () => {
|
||||
setVisibleConfirmation(true);
|
||||
}
|
||||
|
||||
if (['AWAIT', 'READY', 'SUBMIT'].includes(applicationStatus)) {
|
||||
if (['AWAITING', 'READY', 'SUBMIT'].includes(applicationStatus)) {
|
||||
const applId = getApplicationId();
|
||||
|
||||
if (applId) {
|
||||
@@ -528,7 +527,7 @@ const BandoApplication = () => {
|
||||
</div> : null}
|
||||
|
||||
{'DRAFT' === applicationStatus
|
||||
/*|| 'AWAIT' === applicationStatus*/
|
||||
/*|| 'AWAITING' === applicationStatus*/
|
||||
? formData.map(o => {
|
||||
const label = head(o.settings.filter(o => o.name === 'label'));
|
||||
const text = head(o.settings.filter(o => o.name === 'text'));
|
||||
@@ -565,9 +564,11 @@ const BandoApplication = () => {
|
||||
//console.log('validations', validations, o.name)
|
||||
|
||||
return ['paragraph'].includes(o.name) && text
|
||||
? <div className="appForm__content ql-editor" key={o.id}>
|
||||
? <div>
|
||||
<div className="ql-editor" key={o.id}>
|
||||
{renderHtmlContent(text.value)}
|
||||
</div>
|
||||
</div>
|
||||
: <FormField
|
||||
key={o.id}
|
||||
type={o.name}
|
||||
@@ -591,7 +592,7 @@ const BandoApplication = () => {
|
||||
})
|
||||
: null}
|
||||
|
||||
{['AWAIT', 'READY', 'SUBMIT', 'EVALUATION'].includes(applicationStatus)
|
||||
{['AWAITING', 'READY', 'SUBMIT', 'EVALUATION'].includes(applicationStatus)
|
||||
? <div className="appPageSection">
|
||||
<div className="appForm__field">
|
||||
<label>
|
||||
@@ -618,9 +619,9 @@ const BandoApplication = () => {
|
||||
<FileuploadApplicationSignedPdf
|
||||
setDataFn={handleSetSignedDocumentFromFileupload}
|
||||
fieldName="signedPdfFile"
|
||||
disabled={'AWAIT' !== applicationStatus}
|
||||
disabled={!isEmpty(signedPdfFile) || 'AWAITING' !== applicationStatus}
|
||||
defaultValue={is(Array, signedPdfFile) ? signedPdfFile : []}
|
||||
accept={['.p7m,application/pkcs7-mime,application/x-pkcs7-mime,.zip']}
|
||||
accept={['.p7m,application/pkcs7-mime,application/x-pkcs7-mime']}
|
||||
chooseLabel={__('Aggiungi documento', 'gepafin')}
|
||||
multiple={false}
|
||||
doctype="document"
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useNavigate, useParams } from 'react-router-dom';
|
||||
import { klona } from 'klona';
|
||||
import { head, isNil } from 'ramda';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import "quill/dist/quill.core.css";
|
||||
import 'quill/dist/quill.core.css';
|
||||
|
||||
// store
|
||||
import { storeSet, useStore } from '../../store';
|
||||
@@ -155,9 +155,11 @@ const BandoFormsPreview = () => {
|
||||
}, {});
|
||||
|
||||
return ['paragraph'].includes(o.name) && text
|
||||
? <div className="appForm__content ql-editor" key={o.id}>
|
||||
? <div>
|
||||
<div className="ql-editor" key={o.id}>
|
||||
{renderHtmlContent(text.value)}
|
||||
</div>
|
||||
</div>
|
||||
: <FormField
|
||||
key={o.id}
|
||||
type={o.name}
|
||||
|
||||
@@ -40,6 +40,10 @@ const DomandaEditPreInstructor = () => {
|
||||
navigate('/domande');
|
||||
}
|
||||
|
||||
const doNewSoccorso = () => {
|
||||
navigate(`/domande/${id}/aggiungi-soccorso/${data.id}`);
|
||||
}
|
||||
|
||||
const getCallback = (data) => {
|
||||
if (data.status === 'SUCCESS') {
|
||||
setData(getFormattedData(data.data));
|
||||
@@ -144,7 +148,7 @@ const DomandaEditPreInstructor = () => {
|
||||
const entityId = !isNaN(parsed) ? parsed : 0;
|
||||
|
||||
ApplicationEvaluationService.getEvaluationByApplId(getCallback, errGetCallback, [
|
||||
['assignedApplicationId', entityId]
|
||||
['applicationId', entityId]
|
||||
]);
|
||||
}, [id]);
|
||||
|
||||
@@ -348,6 +352,7 @@ const DomandaEditPreInstructor = () => {
|
||||
<div className="appPageSection__actions">
|
||||
<Button
|
||||
type="button"
|
||||
onClick={doNewSoccorso}
|
||||
outlined
|
||||
label={<>
|
||||
{__('Richiedi Soccorso Istruttorio', 'gepafin')}
|
||||
|
||||
304
src/pages/SoccorsoAddPreInstructor/index.js
Normal file
304
src/pages/SoccorsoAddPreInstructor/index.js
Normal file
@@ -0,0 +1,304 @@
|
||||
import React, { useState, useEffect, useRef } from 'react';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { useNavigate, useParams } from 'react-router-dom';
|
||||
import { is, isEmpty } from 'ramda';
|
||||
import { wrap } from 'object-path-immutable';
|
||||
|
||||
// store
|
||||
import { storeSet, useStore } from '../../store';
|
||||
|
||||
// api
|
||||
import ApplicationEvaluationService from '../../service/application-evaluation-service';
|
||||
import AmendmentsService from '../../service/amendments-service';
|
||||
|
||||
// tools
|
||||
import set404FromErrorResponse from '../../helpers/set404FromErrorResponse';
|
||||
import getBandoLabel from '../../helpers/getBandoLabel';
|
||||
import getDateFromISOstring from '../../helpers/getDateFromISOstring';
|
||||
|
||||
// components
|
||||
import { Skeleton } from 'primereact/skeleton';
|
||||
import { Button } from 'primereact/button';
|
||||
import { Checkbox } from 'primereact/checkbox';
|
||||
import { Editor } from 'primereact/editor';
|
||||
import { InputNumber } from 'primereact/inputnumber';
|
||||
import BlockingOverlay from '../../components/BlockingOverlay';
|
||||
import { Toast } from 'primereact/toast';
|
||||
import HelpIcon from '../../icons/HelpIcon';
|
||||
import { InputSwitch } from 'primereact/inputswitch';
|
||||
|
||||
const SoccorsoEditPreInstructor = () => {
|
||||
const isAsyncRequest = useStore().main.isAsyncRequest();
|
||||
const { id, evaluationId } = useParams();
|
||||
const navigate = useNavigate();
|
||||
const [data, setData] = useState({});
|
||||
const [formData, setFormData] = useState({});
|
||||
const toast = useRef(null);
|
||||
|
||||
const goToEvaluationPage = () => {
|
||||
navigate(`/domande/${id}`);
|
||||
}
|
||||
|
||||
const getCallback = (data) => {
|
||||
if (data.status === 'SUCCESS') {
|
||||
console.log(data.data)
|
||||
setData(data.data);
|
||||
setFormData(getFormattedFormData(data.data));
|
||||
}
|
||||
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 getFormattedFormData = (data) => {
|
||||
let newData = {};
|
||||
newData.formFields = data.formFields;
|
||||
newData.responseDays = 10;
|
||||
newData.note = '';
|
||||
newData.sendNotification = true;
|
||||
newData.sendEmail = true;
|
||||
return 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 updateEvaluationValue = (value, path, maxValue) => {
|
||||
let finalValue = value;
|
||||
|
||||
if (maxValue) {
|
||||
finalValue = value > maxValue ? maxValue : value;
|
||||
}
|
||||
|
||||
const newData = wrap(formData).set(path.split('.'), finalValue).value();
|
||||
|
||||
setFormData(newData);
|
||||
}
|
||||
|
||||
const doCreate = () => {
|
||||
storeSet.main.setAsyncRequest();
|
||||
|
||||
AmendmentsService.createSoccorso(formData, createCallback, errCreateCallback, [
|
||||
['applicationEvaluationId', evaluationId]
|
||||
]);
|
||||
}
|
||||
|
||||
const createCallback = (data) => {
|
||||
if (data.status === 'SUCCESS') {
|
||||
if (toast.current) {
|
||||
toast.current.show({
|
||||
severity: 'success',
|
||||
summary: '',
|
||||
detail: data.message
|
||||
});
|
||||
}
|
||||
setTimeout(() => {
|
||||
navigate(`/domande/${id}/soccorso/${data.data.id}`);
|
||||
}, 1000)
|
||||
}
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
}
|
||||
|
||||
const errCreateCallback = (data) => {
|
||||
if (toast.current && data.message) {
|
||||
toast.current.show({
|
||||
severity: 'error',
|
||||
summary: '',
|
||||
detail: data.message
|
||||
});
|
||||
}
|
||||
set404FromErrorResponse(data);
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
const parsed = parseInt(evaluationId)
|
||||
const entityId = !isNaN(parsed) ? parsed : 0;
|
||||
|
||||
storeSet.main.setAsyncRequest();
|
||||
AmendmentsService.getSoccorsoByApplId(entityId, getCallback, errGetCallback);
|
||||
}, [evaluationId]);
|
||||
|
||||
return (
|
||||
<div className="appPage">
|
||||
<div className="appPage__pageHeader">
|
||||
<h1>{__('Richiesta Integrazione Documentale', 'gepafin')}</h1>
|
||||
</div>
|
||||
|
||||
<div className="appPage__spacer"></div>
|
||||
<Toast ref={toast}/>
|
||||
<BlockingOverlay shouldDisplay={isAsyncRequest}/>
|
||||
|
||||
<div className="appPageSection__row">
|
||||
<Button
|
||||
type="button"
|
||||
outlined
|
||||
onClick={goToEvaluationPage}
|
||||
label={__('Indietro', 'gepafin')}
|
||||
icon="pi pi-arrow-left" iconPos="left"/>
|
||||
</div>
|
||||
|
||||
<div className="appPage__spacer"></div>
|
||||
|
||||
{!isAsyncRequest && !isEmpty(data)
|
||||
? <div className="appPage__content">
|
||||
<div className="appPageSection__withBorder column">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<div className="appPageSection">
|
||||
<div className="appPageSection columns">
|
||||
<div>
|
||||
<h3>{__('Note', 'gepafin')}</h3>
|
||||
<div>
|
||||
<Editor
|
||||
value={formData.note}
|
||||
placeholder={__('Digita qui il messagio', 'gepafin')}
|
||||
headerTemplate={header}
|
||||
onTextChange={(e) => updateEvaluationValue(
|
||||
e.htmlValue,
|
||||
'note'
|
||||
)}
|
||||
style={{ height: 80 * 3, width: '100%' }}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<h3>{__('Tempo per la Risposta (giorni)', 'gepafin')}</h3>
|
||||
<div>
|
||||
<InputNumber
|
||||
keyfilter="int"
|
||||
value={formData.responseDays}
|
||||
showButtons
|
||||
onChange={(e) => updateEvaluationValue(
|
||||
e.value,
|
||||
'responseDays',
|
||||
9999
|
||||
)}/>
|
||||
</div>
|
||||
|
||||
<h3>{__('Notifica', 'gepafin')}</h3>
|
||||
<div className="appPageSection__withBorder grey">
|
||||
<div className="appForm__field row">
|
||||
<InputSwitch
|
||||
inputId="notify_email"
|
||||
checked={formData.sendEmail}
|
||||
onChange={(e) => updateEvaluationValue(
|
||||
e.value,
|
||||
'sendEmail'
|
||||
)}/>
|
||||
<label htmlFor="notify_email">{__('Notifiche Email', 'gepafin')}</label>
|
||||
</div>
|
||||
<div className="appForm__field row">
|
||||
<InputSwitch
|
||||
inputId="notify_push"
|
||||
checked={formData.sendNotification}
|
||||
onChange={(e) => updateEvaluationValue(
|
||||
e.value,
|
||||
'sendNotification'
|
||||
)}/>
|
||||
<label htmlFor="notify_push">{__('Notifiche Push', 'gepafin')}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{formData.formFields
|
||||
? <div>
|
||||
<h3>{__('Documenti da Integrare', 'gepafin')}</h3>
|
||||
<div className="appPageSection__withBorder grey">
|
||||
<div className="appPageSection__checklist">
|
||||
{formData.formFields.map((o, i) => <div key={o.fieldId}>
|
||||
<Checkbox
|
||||
inputId={`checklist_${o.fieldId}`}
|
||||
onChange={(e) => updateEvaluationValue(
|
||||
e.checked,
|
||||
`formFields.${i}.selected`
|
||||
)}
|
||||
checked={o.selected}></Checkbox>
|
||||
<label htmlFor={`checklist_${o.fieldId}`}>{o.label}</label>
|
||||
</div>)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
: null}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="appPageSection__message warning">
|
||||
<i className="pi pi-exclamation-triangle"></i>
|
||||
<span className="summary">{__('Attenzione', 'gepafin')}</span>
|
||||
<span>{__("L'invio della richiesta di integrazione sospenderà il termine di valutazione della domanda.", 'gepafin')}</span>
|
||||
</div>
|
||||
|
||||
<div className="appPageSection__hr">
|
||||
<span>{__('Azioni rapide', 'gepafin')}</span>
|
||||
</div>
|
||||
|
||||
<div className="appPageSection">
|
||||
<div className="appPageSection__actions">
|
||||
<Button
|
||||
type="button"
|
||||
outlined
|
||||
label={__('Anulla', 'gepafin')}
|
||||
icon="pi pi-times" iconPos="right"/>
|
||||
<Button
|
||||
type="button"
|
||||
onClick={doCreate}
|
||||
label={__('Invia richiesta', 'gepafin')}
|
||||
icon="pi pi-check" iconPos="right"/>
|
||||
</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>
|
||||
</>}
|
||||
</div>
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
export default SoccorsoEditPreInstructor;
|
||||
@@ -26,10 +26,12 @@ import { InputNumber } from 'primereact/inputnumber';
|
||||
import BlockingOverlay from '../../components/BlockingOverlay';
|
||||
import { Toast } from 'primereact/toast';
|
||||
import HelpIcon from '../../icons/HelpIcon';
|
||||
import AmendmentsService from '../../service/amendments-service';
|
||||
import renderHtmlContent from '../../helpers/renderHtmlContent';
|
||||
|
||||
const SoccorsoEditPreInstructor = () => {
|
||||
const isAsyncRequest = useStore().main.isAsyncRequest();
|
||||
const { id, soccorsoId } = useParams();
|
||||
const { id, amendmendId } = useParams();
|
||||
const navigate = useNavigate();
|
||||
const [data, setData] = useState({});
|
||||
const toast = useRef(null);
|
||||
@@ -58,8 +60,8 @@ const SoccorsoEditPreInstructor = () => {
|
||||
}
|
||||
|
||||
const getFormattedData = (data) => {
|
||||
data.submissionDate = is(String, data.submissionDate) ? new Date(data.submissionDate) : (data.submissionDate ? data.submissionDate : '');
|
||||
data.evaluationDate = is(String, data.evaluationDate) ? new Date(data.evaluationDate) : (data.evaluationDate ? data.evaluationDate : '');
|
||||
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;
|
||||
};
|
||||
|
||||
@@ -130,15 +132,11 @@ const SoccorsoEditPreInstructor = () => {
|
||||
}*/
|
||||
|
||||
useEffect(() => {
|
||||
const parsed = parseInt(id)
|
||||
const assignedCallId = !isNaN(parsed) ? parsed : 0;
|
||||
const parsedSoccorsoId = parseInt(soccorsoId)
|
||||
const parsedSoccorsoId = parseInt(amendmendId)
|
||||
const soccorsoEntityId = !isNaN(parsedSoccorsoId) ? parsedSoccorsoId : 0;
|
||||
|
||||
ApplicationEvaluationService.getEvaluationByApplId(getCallback, errGetCallback, [
|
||||
['assignedApplicationId', assignedCallId]
|
||||
]);
|
||||
}, [id, soccorsoId]);
|
||||
AmendmentsService.getSoccorsoById(getCallback, errGetCallback, [['id', soccorsoEntityId]]);
|
||||
}, [amendmendId]);
|
||||
|
||||
return (
|
||||
<div className="appPage">
|
||||
@@ -174,15 +172,15 @@ const SoccorsoEditPreInstructor = () => {
|
||||
</p>
|
||||
<p className="appPageSection__pMeta">
|
||||
<span>{__('Beneficiario', 'gepafin')}</span>
|
||||
<span>{data.beneficiary}</span>
|
||||
<span>{data.beneficiaryName}</span>
|
||||
</p>
|
||||
<p className="appPageSection__pMeta">
|
||||
<span>{__('Data ricezione', 'gepafin')}</span>
|
||||
<span>{getDateFromISOstring(data.submissionDate)}</span>
|
||||
<span>{__('Inizio', 'gepafin')}</span>
|
||||
<span>{getDateFromISOstring(data.startDate)}</span>
|
||||
</p>
|
||||
<p className="appPageSection__pMeta">
|
||||
<span>{__('Scadenza Valutazione', 'gepafin')}</span>
|
||||
<span>{getDateFromISOstring(data.callEndDate)}</span>
|
||||
<span>{__('Scadenza', 'gepafin')}</span>
|
||||
<span>{getDateFromISOstring(data.expirationDate)}</span>
|
||||
</p>
|
||||
<p className="appPageSection__pMeta">
|
||||
<span>{__('Stato', 'gepafin')}</span>
|
||||
@@ -191,145 +189,49 @@ const SoccorsoEditPreInstructor = () => {
|
||||
</div>
|
||||
|
||||
<div className="appPageSection">
|
||||
<h2>{__('Punteggi di valutazione', 'gepafin')}</h2>
|
||||
{data.criteria
|
||||
? <table className="myTable">
|
||||
<thead className="myThead">
|
||||
<tr>
|
||||
<th>{__('Parametro', 'gepafin')}</th>
|
||||
<th style={{ width: 200 }}>{__('Punteggio', 'gepafin')}</th>
|
||||
<th style={{ width: 220 }}>{__('Stato', 'gepafin')}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody className="myTbody">
|
||||
{data.criteria.map((o, i) => <tr key={o.id}>
|
||||
<td>{o.label}</td>
|
||||
<td>
|
||||
<div className="p-inputgroup">
|
||||
<InputNumber
|
||||
placeholder={__('Punteggio', 'gepafin')}
|
||||
keyfilter="int"
|
||||
value={o.score}
|
||||
max={o.maxScore}
|
||||
onChange={(e) => updateEvaluationValue(
|
||||
e.value,
|
||||
`criteria.${i}.score`,
|
||||
o.maxScore
|
||||
)}/>
|
||||
<span className="p-inputgroup-addon">
|
||||
/ {o.maxScore}
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div className="appPageSection__iconActions">
|
||||
{!isEmpty(o.criteriaMappedFields)
|
||||
? <Button icon="pi pi-eye" rounded outlined severity="info"
|
||||
aria-label={__('Mostra', 'gepafin')}/> : null}
|
||||
<Button icon="pi pi-thumbs-up" rounded outlined
|
||||
severity={!isNil(o.valid) && o.valid ? 'success' : 'secondary'}
|
||||
onClick={() => updateEvaluationValue(
|
||||
true,
|
||||
`criteria.${i}.valid`
|
||||
)}
|
||||
aria-label={__('Su', 'gepafin')}/>
|
||||
<Button icon="pi pi-thumbs-down" rounded outlined
|
||||
severity={!isNil(o.valid) && !o.valid ? 'danger' : 'secondary'}
|
||||
onClick={() => updateEvaluationValue(
|
||||
false,
|
||||
`criteria.${i}.valid`
|
||||
)}
|
||||
aria-label={__('Giu', 'gepafin')}/>
|
||||
</div>
|
||||
</td>
|
||||
</tr>)}
|
||||
<tr>
|
||||
<td>{__('Punteggio:', 'gepafin')}</td>
|
||||
<td>{sum(data.criteria.map(o => o.score))}</td>
|
||||
<td>
|
||||
{isAdmissible
|
||||
? <Tag icon="pi pi-check" severity="success"
|
||||
value={__('Ammissibile')}></Tag> : null}
|
||||
{!isAdmissible
|
||||
? <Tag icon="pi pi-times" severity="warning"
|
||||
value={__('Inammissibile')}></Tag> : null}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot className="myTfoot">
|
||||
<tr>
|
||||
<td colSpan="3">{sprintf(__('Punteggio minimo per l\'ammissione: %d'), data.minScore)}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table> : null}
|
||||
</div>
|
||||
|
||||
<div className="appPageSection">
|
||||
<h2>{__('Checklist Valutazione', 'gepafin')}</h2>
|
||||
<h2>{__('Dettagli Richiesta', 'gepafin')}</h2>
|
||||
<div className="appPageSection columns">
|
||||
<div>
|
||||
<h3>{__('Lista', 'gepafin')}</h3>
|
||||
<div className="appPageSection__withBorder grey">
|
||||
<div className="appPageSection__checklist">
|
||||
{data.checklist.map((o, i) => <div key={o.id}>
|
||||
<Checkbox
|
||||
inputId={`checklist_${o.id}`}
|
||||
onChange={(e) => updateEvaluationValue(
|
||||
e.checked,
|
||||
`checklist.${i}.valid`
|
||||
)}
|
||||
checked={o.valid}></Checkbox>
|
||||
<label htmlFor={`checklist_${o.id}`}>{o.label}</label>
|
||||
</div>)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3>{__('Note', 'gepafin')}</h3>
|
||||
<div>
|
||||
<Editor
|
||||
value={data.note}
|
||||
placeholder={__('Digita qui il messagio', 'gepafin')}
|
||||
headerTemplate={header}
|
||||
onTextChange={(e) => updateEvaluationValue(
|
||||
e.htmlValue,
|
||||
'note'
|
||||
)}
|
||||
style={{ height: 80 * 3, width: '100%' }}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h3>{__('Documenti allegati', 'gepafin')}</h3>
|
||||
<h3>{__('Documenti Richiesti', 'gepafin')}</h3>
|
||||
<ol className="appPageSection__list">
|
||||
{data.files.map((o, i) => <li key={o.id}>
|
||||
{data.formFields.map((o, i) => <li key={o.fieldId}>
|
||||
<span>{o.label}</span>
|
||||
<div className="appPageSection__iconActions">
|
||||
{o.fileDetail.length === 1
|
||||
? <Button icon="pi pi-eye" rounded
|
||||
onClick={() => window.open(o.fileDetail[0].filePath, '_blank').focus()}
|
||||
outlined severity="info"
|
||||
aria-label={__('Mostra', 'gepafin')}/> : null}
|
||||
<Button icon="pi pi-thumbs-up" rounded outlined
|
||||
severity={!isNil(o.valid) && o.valid ? 'success' : 'secondary'}
|
||||
onClick={() => updateEvaluationValue(
|
||||
true,
|
||||
`files.${i}.valid`
|
||||
)}
|
||||
aria-label={__('Su', 'gepafin')}/>
|
||||
<Button icon="pi pi-thumbs-down" rounded outlined
|
||||
severity={!isNil(o.valid) && !o.valid ? 'danger' : 'secondary'}
|
||||
onClick={() => updateEvaluationValue(
|
||||
false,
|
||||
`files.${i}.valid`
|
||||
)}
|
||||
aria-label={__('Giu', 'gepafin')}/>
|
||||
</div>
|
||||
</li>)}
|
||||
</ol>
|
||||
</div>
|
||||
<div>
|
||||
<h3>{__('Note e spiegazioni', 'gepafin')}</h3>
|
||||
<div className="ql-editor">
|
||||
{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">
|
||||
{data.criteria
|
||||
? data.criteria.map((o, i) => <tr key={o.id}>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>) : null}
|
||||
<tr>
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div className="appPage__spacer"></div>
|
||||
|
||||
<div className="appPageSection__hr">
|
||||
@@ -341,27 +243,18 @@ const SoccorsoEditPreInstructor = () => {
|
||||
<Button
|
||||
type="button"
|
||||
outlined
|
||||
label={<>
|
||||
{__('Richiedi Soccorso Istruttorio', 'gepafin')}
|
||||
<i style={{ marginLeft: 7 }}>
|
||||
<HelpIcon/>
|
||||
</i>
|
||||
</>}
|
||||
label={__('Invia Sollecito', 'gepafin')}
|
||||
icon="pi pi-send"
|
||||
/>
|
||||
<Button
|
||||
type="button"
|
||||
onClick={doSaveDraft}
|
||||
outlined
|
||||
label={__('Salva Bozza Valutazione', 'gepafin')}
|
||||
icon="pi pi-save" iconPos="right"/>
|
||||
label={__('Estendi Scadenza', 'gepafin')}
|
||||
icon="pi pi-stopwatch"
|
||||
/>
|
||||
<Button
|
||||
type="button"
|
||||
disabled={!isAdmissible}
|
||||
label={__('Approva Domanda', 'gepafin')}
|
||||
icon="pi pi-check" iconPos="right"/>
|
||||
<Button
|
||||
type="button"
|
||||
label={__('Respingi Domanda', 'gepafin')}
|
||||
label={__('Chiudi Soccorso Istruttorio', 'gepafin')}
|
||||
icon="pi pi-times" iconPos="right"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -32,6 +32,7 @@ import DomandePreInstructor from './pages/DomandePreInstructor';
|
||||
import DomandaEditPreInstructor from './pages/DomandaEditPreInstructor';
|
||||
import SoccorsoIstruttorioPreInstructor from './pages/SoccorsoIstruttorioPreInstructor';
|
||||
import SoccorsoEditPreInstructor from './pages/SoccorsoEditPreInstructor';
|
||||
import SoccorsoAddPreInstructor from './pages/SoccorsoAddPreInstructor';
|
||||
|
||||
const routes = ({ role, chosenCompanyId }) => {
|
||||
|
||||
@@ -93,7 +94,12 @@ const routes = ({ role, chosenCompanyId }) => {
|
||||
{'ROLE_BENEFICIARY' === role ? <PageNotFound/> : null}
|
||||
{'ROLE_PRE_INSTRUCTOR' === role ? <DomandaEditPreInstructor/> : null}
|
||||
</DefaultLayout>}/>
|
||||
<Route path="/domande/:id/soccorso/new" element={<DefaultLayout>
|
||||
<Route path="/domande/:id/aggiungi-soccorso/:evaluationId" element={<DefaultLayout>
|
||||
{'ROLE_SUPER_ADMIN' === role ? <PageNotFound/> : null}
|
||||
{'ROLE_BENEFICIARY' === role ? <PageNotFound/> : null}
|
||||
{'ROLE_PRE_INSTRUCTOR' === role ? <SoccorsoAddPreInstructor/> : null}
|
||||
</DefaultLayout>}/>
|
||||
<Route path="/domande/:id/soccorso/:amendmendId" element={<DefaultLayout>
|
||||
{'ROLE_SUPER_ADMIN' === role ? <PageNotFound/> : null}
|
||||
{'ROLE_BENEFICIARY' === role ? <PageNotFound/> : null}
|
||||
{'ROLE_PRE_INSTRUCTOR' === role ? <SoccorsoEditPreInstructor/> : null}
|
||||
@@ -103,11 +109,6 @@ const routes = ({ role, chosenCompanyId }) => {
|
||||
{'ROLE_BENEFICIARY' === role ? <PageNotFound/> : null}
|
||||
{'ROLE_PRE_INSTRUCTOR' === role ? <SoccorsoIstruttorioPreInstructor/> : null}
|
||||
</DefaultLayout>}/>
|
||||
<Route path="/soccorso-istruttorio/:soccorsoId" element={<DefaultLayout>
|
||||
{'ROLE_SUPER_ADMIN' === role ? <PageNotFound/> : null}
|
||||
{'ROLE_BENEFICIARY' === role ? <PageNotFound/> : null}
|
||||
{'ROLE_PRE_INSTRUCTOR' === role ? <SoccorsoEditPreInstructor/> : null}
|
||||
</DefaultLayout>}/>
|
||||
<Route path="/imieibandi" element={<DefaultLayout>
|
||||
{'ROLE_SUPER_ADMIN' === role ? <PageNotFound/> : null}
|
||||
{'ROLE_BENEFICIARY' === role ? <Applications/> : null}
|
||||
|
||||
@@ -2,13 +2,17 @@ import { NetworkService } from './network-service';
|
||||
|
||||
const API_BASE_URL = process.env.REACT_APP_API_EXECUTION_ADDRESS;
|
||||
|
||||
export default class ApplicationEvaluationService {
|
||||
export default class AmendmentsService {
|
||||
|
||||
static getEvaluationByApplId = (callback, errCallback, queryParams) => {
|
||||
NetworkService.get(`${API_BASE_URL}/applicationEvaluation/application`, callback, errCallback, queryParams);
|
||||
static getSoccorsoByApplId = (id, callback, errCallback, queryParams) => {
|
||||
NetworkService.get(`${API_BASE_URL}/amendments/applicationEvaluation/${id}`, callback, errCallback, queryParams);
|
||||
};
|
||||
|
||||
static updateEvaluation = (id, body, callback, errCallback, queryParams) => {
|
||||
NetworkService.put(`${API_BASE_URL}/applicationEvaluation/${id}`, body, callback, errCallback, queryParams);
|
||||
static getSoccorsoById = (callback, errCallback, queryParams) => {
|
||||
NetworkService.get(`${API_BASE_URL}/amendments`, callback, errCallback, queryParams);
|
||||
};
|
||||
|
||||
static createSoccorso = (body, callback, errCallback, queryParams) => {
|
||||
NetworkService.post(`${API_BASE_URL}/amendments`, body, callback, errCallback, queryParams);
|
||||
};
|
||||
}
|
||||
|
||||
10
src/service/communication-service.js
Normal file
10
src/service/communication-service.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import { NetworkService } from './network-service';
|
||||
|
||||
const API_BASE_URL = process.env.REACT_APP_API_EXECUTION_ADDRESS;
|
||||
|
||||
export default class CommunicationService {
|
||||
|
||||
static getCommsByAmendmentId = (id, callback, errCallback, queryParams) => {
|
||||
NetworkService.get(`${API_BASE_URL}/amendments/applicationEvaluation/${id}`, callback, errCallback, queryParams);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user