- fixed access for evaluation page;
- changed labels;
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
.appPageLogin__wrapper {
|
.appPageLogin__wrapper {
|
||||||
h1 {
|
h1 {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -89,6 +89,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.appPageSection {
|
.appPageSection {
|
||||||
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
@@ -99,7 +100,7 @@
|
|||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
/*> div {
|
/*> div {
|
||||||
max-width: 50%;
|
max-width: 50%;
|
||||||
}*/
|
}*/
|
||||||
@@ -130,7 +131,7 @@
|
|||||||
padding: 5px 0;
|
padding: 5px 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.col {
|
.col {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -188,7 +189,7 @@
|
|||||||
|
|
||||||
ul, ol {
|
ul, ol {
|
||||||
padding-left: 1rem;
|
padding-left: 1rem;
|
||||||
|
|
||||||
li {
|
li {
|
||||||
color: var(--global-textColor);
|
color: var(--global-textColor);
|
||||||
}
|
}
|
||||||
@@ -217,7 +218,7 @@
|
|||||||
|
|
||||||
.appPageSection__pMeta {
|
.appPageSection__pMeta {
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
||||||
|
|
||||||
span:nth-of-type(1) {
|
span:nth-of-type(1) {
|
||||||
max-width: 30%;
|
max-width: 30%;
|
||||||
}
|
}
|
||||||
@@ -263,7 +264,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 1.2rem;
|
gap: 1.2rem;
|
||||||
|
|
||||||
div {
|
div {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
@@ -294,11 +295,11 @@
|
|||||||
color: var(--message-info-color);
|
color: var(--message-info-color);
|
||||||
border-color: var(--message-info-color);
|
border-color: var(--message-info-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.summary {
|
.summary {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
@@ -401,7 +402,7 @@
|
|||||||
gap: 10px;
|
gap: 10px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
||||||
&.lessGap {
|
&.lessGap {
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
}
|
}
|
||||||
@@ -418,7 +419,7 @@
|
|||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
color: var(--global-textColor);
|
color: var(--global-textColor);
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: var(--message-info-color);
|
color: var(--message-info-color);
|
||||||
@@ -440,4 +441,4 @@
|
|||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
961
src/pages/DomandaEditInstructorManager/index.js
Normal file
961
src/pages/DomandaEditInstructorManager/index.js
Normal file
@@ -0,0 +1,961 @@
|
|||||||
|
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
||||||
|
import { __, sprintf } from '@wordpress/i18n';
|
||||||
|
import { useNavigate, useParams } from 'react-router-dom';
|
||||||
|
import { is, isEmpty, isNil, sum, pathOr, head } from 'ramda';
|
||||||
|
import { klona } from 'klona';
|
||||||
|
import { wrap } from 'object-path-immutable';
|
||||||
|
|
||||||
|
// store
|
||||||
|
import { storeGet, storeSet, useStore } from '../../store';
|
||||||
|
|
||||||
|
// api
|
||||||
|
import ApplicationEvaluationService from '../../service/application-evaluation-service';
|
||||||
|
import AmendmentsService from '../../service/amendments-service';
|
||||||
|
import AppointmentService from '../../service/appointment-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 { Tag } from 'primereact/tag';
|
||||||
|
import { Checkbox } from 'primereact/checkbox';
|
||||||
|
import { Editor } from 'primereact/editor';
|
||||||
|
import { InputNumber } from 'primereact/inputnumber';
|
||||||
|
import { Toast } from 'primereact/toast';
|
||||||
|
import { Dialog } from 'primereact/dialog';
|
||||||
|
import HelpIcon from '../../icons/HelpIcon';
|
||||||
|
import BlockingOverlay from '../../components/BlockingOverlay';
|
||||||
|
import { classNames } from 'primereact/utils';
|
||||||
|
import { InputTextarea } from 'primereact/inputtextarea';
|
||||||
|
import { InputText } from 'primereact/inputtext';
|
||||||
|
import DownloadApplicationArchive from '../DomandaEditPreInstructor/components/DownloadApplicationArchive';
|
||||||
|
import DownloadCompanyDelegation from '../DomandaEditPreInstructor/components/DownloadCompanyDelegation';
|
||||||
|
import DownloadSignedApplication from '../DomandaEditPreInstructor/components/DownloadSignedApplication';
|
||||||
|
import ListOfFiles from '../DomandaEditPreInstructor/components/ListOfFiles';
|
||||||
|
import RepeaterFields from '../DomandaEditPreInstructor/components/RepeaterFields';
|
||||||
|
|
||||||
|
const APP_EVALUATION_FLOW_ID = process.env.REACT_APP_EVALUATION_FLOW_ID;
|
||||||
|
|
||||||
|
const DomandaEditPreInstructor = () => {
|
||||||
|
const isAsyncRequest = useStore().main.isAsyncRequest();
|
||||||
|
const { id } = useParams();
|
||||||
|
const navigate = useNavigate();
|
||||||
|
const [data, setData] = useState({});
|
||||||
|
const [isVisibleCriterionData, setIsVisibleCriterionData] = useState(0);
|
||||||
|
const [criterionDataTitle, setCriterionDataTitle] = useState('');
|
||||||
|
const [criterionDataContent, setCriterionDataContent] = useState('');
|
||||||
|
const [isAdmissible, setIsAdmissible] = useState(false);
|
||||||
|
const [connectedSoccorsoId, setConnectedSoccorsoId] = useState(0);
|
||||||
|
const toast = useRef(null);
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
const [isVisibleCompleteDialog, setIsVisibleCompleteDialog] = useState(false);
|
||||||
|
const [operationType, setOperationType] = useState('');
|
||||||
|
const [motivation, setMotivation] = useState('');
|
||||||
|
const [isVisibleAppointmentDialog, setIsVisibleAppointmentDialog] = useState(false);
|
||||||
|
const [allFilesRated, setAllFilesRated] = useState(false);
|
||||||
|
const [atLeastOneChecked, setAtLeastOneChecked] = useState(false);
|
||||||
|
const [allChecksChecked, setAllChecksChecked] = useState(false);
|
||||||
|
const [appointmentData, setAppointmentData] = useState({
|
||||||
|
title: '',
|
||||||
|
text: '',
|
||||||
|
duration: 0,
|
||||||
|
amount: 0
|
||||||
|
});
|
||||||
|
|
||||||
|
const goToEvaluationsPage = () => {
|
||||||
|
navigate('/domande');
|
||||||
|
}
|
||||||
|
|
||||||
|
const updateFlagsForSoccorso = (data) => {
|
||||||
|
let nonRatedFilesLength = 0;
|
||||||
|
|
||||||
|
if (data.files) {
|
||||||
|
const nonRatedFiles = data.files
|
||||||
|
.map(el => el.valid)
|
||||||
|
.filter(v => isNil(v));
|
||||||
|
nonRatedFilesLength = nonRatedFiles.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.amendmentDetails) {
|
||||||
|
const nonRatedFiles = data.amendmentDetails
|
||||||
|
.map(el => el.valid)
|
||||||
|
.filter(v => isNil(v));
|
||||||
|
nonRatedFilesLength = nonRatedFiles.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
setAllFilesRated(nonRatedFilesLength === 0);
|
||||||
|
|
||||||
|
if (data.checklist) {
|
||||||
|
const checkedChecklistItems = data.checklist
|
||||||
|
.map(el => el.valid)
|
||||||
|
.filter(v => v);
|
||||||
|
setAtLeastOneChecked(checkedChecklistItems.length > 0);
|
||||||
|
setAllChecksChecked(checkedChecklistItems.length === data.checklist.length)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const doNewSoccorso = () => {
|
||||||
|
if (connectedSoccorsoId !== 0) {
|
||||||
|
navigate(`/domande/${id}/soccorso/${connectedSoccorsoId}`);
|
||||||
|
} else {
|
||||||
|
doSaveDraft(`/domande/${id}/aggiungi-soccorso/`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const getCallback = (data) => {
|
||||||
|
if (data.status === 'SUCCESS') {
|
||||||
|
setData(getFormattedData(data.data));
|
||||||
|
setMotivation(data.data.motivation);
|
||||||
|
updateFlagsForSoccorso(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 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 : '');
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
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 = null) => {
|
||||||
|
let finalValue = value;
|
||||||
|
|
||||||
|
if (maxValue || maxValue === 0) {
|
||||||
|
finalValue = value > maxValue ? maxValue : value;
|
||||||
|
}
|
||||||
|
|
||||||
|
const newData = wrap(data).set(path, finalValue).value();
|
||||||
|
setData(newData);
|
||||||
|
updateFlagsForSoccorso(newData);
|
||||||
|
}
|
||||||
|
|
||||||
|
const doSaveDraft = useCallback((doRedirect = '') => {
|
||||||
|
const formData = {
|
||||||
|
criteria: klona(data.criteria),
|
||||||
|
checklist: klona(data.checklist),
|
||||||
|
files: klona(data.files),
|
||||||
|
evaluationDocument: klona(data.evaluationDocument.map(o => ({
|
||||||
|
...o,
|
||||||
|
fileValue: o.fileValue[0] ? o.fileValue[0].id : ''
|
||||||
|
})
|
||||||
|
)),
|
||||||
|
amendmentDetails: klona(data.amendmentDetails),
|
||||||
|
note: data.note
|
||||||
|
}
|
||||||
|
|
||||||
|
ApplicationEvaluationService.updateEvaluation(
|
||||||
|
data.assignedApplicationId,
|
||||||
|
formData,
|
||||||
|
(data) => updateCallback(data, doRedirect),
|
||||||
|
errUpdateCallback
|
||||||
|
);
|
||||||
|
}, [data]);
|
||||||
|
|
||||||
|
const updateCallback = (data, doRedirect = '') => {
|
||||||
|
if (data.status === 'SUCCESS') {
|
||||||
|
setData(getFormattedData(data.data));
|
||||||
|
if (toast.current) {
|
||||||
|
toast.current.show({
|
||||||
|
severity: 'success',
|
||||||
|
summary: '',
|
||||||
|
detail: data.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (!isEmpty(doRedirect)) {
|
||||||
|
navigate(doRedirect);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
storeSet.main.unsetAsyncRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
const errUpdateCallback = (data) => {
|
||||||
|
if (toast.current && data.message) {
|
||||||
|
toast.current.show({
|
||||||
|
severity: 'error',
|
||||||
|
summary: '',
|
||||||
|
detail: data.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
set404FromErrorResponse(data);
|
||||||
|
storeSet.main.unsetAsyncRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
const doApprove = () => {
|
||||||
|
const formData = {
|
||||||
|
applicationStatus: 'APPROVED',
|
||||||
|
criteria: klona(data.criteria),
|
||||||
|
checklist: klona(data.checklist),
|
||||||
|
files: klona(data.files),
|
||||||
|
note: data.note,
|
||||||
|
motivation
|
||||||
|
}
|
||||||
|
|
||||||
|
setIsVisibleCompleteDialog(false);
|
||||||
|
ApplicationEvaluationService.updateEvaluation(data.assignedApplicationId, formData, updateStatusCallback, errUpdateStatusCallback);
|
||||||
|
}
|
||||||
|
|
||||||
|
const doReject = () => {
|
||||||
|
const formData = {
|
||||||
|
applicationStatus: 'REJECTED',
|
||||||
|
criteria: klona(data.criteria),
|
||||||
|
checklist: klona(data.checklist),
|
||||||
|
files: klona(data.files),
|
||||||
|
note: data.note,
|
||||||
|
motivation
|
||||||
|
}
|
||||||
|
|
||||||
|
setIsVisibleCompleteDialog(false);
|
||||||
|
ApplicationEvaluationService.updateEvaluation(data.assignedApplicationId, formData, updateStatusCallback, errUpdateStatusCallback);
|
||||||
|
}
|
||||||
|
|
||||||
|
const updateStatusCallback = (data) => {
|
||||||
|
if (data.status === 'SUCCESS') {
|
||||||
|
setData(getFormattedData(data.data));
|
||||||
|
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));
|
||||||
|
setCriterionDataTitle(criterion.label);
|
||||||
|
const content = <div className="criterionRelatedData">
|
||||||
|
<h3>{__('I campi correlati')}</h3>
|
||||||
|
{criterion.criteriaMappedFields ? criterion.criteriaMappedFields.map(o => criteriaDataItem(o)) : null}
|
||||||
|
</div>;
|
||||||
|
setCriterionDataContent(content);
|
||||||
|
setIsVisibleCriterionData(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
const criteriaDataItem = (item) => {
|
||||||
|
let content = '';
|
||||||
|
|
||||||
|
switch (item.fieldName) {
|
||||||
|
case 'fileupload' :
|
||||||
|
content = <ul>
|
||||||
|
{item.fieldValue
|
||||||
|
? item.fieldValue.map(o => <li key={o.id}>
|
||||||
|
{o.filePath ? <a href={o.filePath}>{o.name}</a> : null}
|
||||||
|
</li>)
|
||||||
|
: null}
|
||||||
|
</ul>;
|
||||||
|
break;
|
||||||
|
case 'table' :
|
||||||
|
const th = Object.keys(item.fieldValue[0]);
|
||||||
|
content = <table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
{th.map(v => <th key={v}>{v}</th>)}
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{item.fieldValue
|
||||||
|
? item.fieldValue.map((o, i) => <tr key={i}>
|
||||||
|
{Object.values(o).map(v => <td key={v}>{v}</td>)}
|
||||||
|
</tr>)
|
||||||
|
: null}
|
||||||
|
</tbody>
|
||||||
|
</table>;
|
||||||
|
break;
|
||||||
|
default :
|
||||||
|
content = item.fieldValue;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return <div key={item.id} className="criterionRelatedData__item">
|
||||||
|
<strong>{item.fieldLabel}</strong>
|
||||||
|
{content}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
const hideCriterionData = () => {
|
||||||
|
setIsVisibleCriterionData(0);
|
||||||
|
setCriterionDataTitle('');
|
||||||
|
setCriterionDataContent('');
|
||||||
|
}
|
||||||
|
|
||||||
|
const getAmendmentsCallback = (data) => {
|
||||||
|
if (data.status === 'SUCCESS') {
|
||||||
|
if (data.data.length) {
|
||||||
|
setConnectedSoccorsoId(data.data[0].id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const errGetAmendmentsCallback = () => {
|
||||||
|
if (toast.current && data.message) {
|
||||||
|
toast.current.show({
|
||||||
|
severity: 'error',
|
||||||
|
summary: '',
|
||||||
|
detail: data.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
set404FromErrorResponse(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
const shouldDisableField = (fieldName) => {
|
||||||
|
return !['EVALUATION'].includes(data.applicationStatus)
|
||||||
|
|| (['ADMISSIBLE'].includes(data.applicationStatus) && fieldName !== 'criteria')
|
||||||
|
}
|
||||||
|
|
||||||
|
const headerCompleteDialog = () => {
|
||||||
|
return 'approve' === operationType
|
||||||
|
? <span>{__('Confermare l\'approvazione', 'gepafin')}</span>
|
||||||
|
: <span>{__('Confermare il rifiuto', 'gepafin')}</span>;
|
||||||
|
}
|
||||||
|
|
||||||
|
const hideCompleteDialog = () => {
|
||||||
|
setIsVisibleCompleteDialog(false);
|
||||||
|
setOperationType('');
|
||||||
|
setMotivation('');
|
||||||
|
}
|
||||||
|
|
||||||
|
const footerCompleteDialog = () => {
|
||||||
|
return <div>
|
||||||
|
<Button type="button" label={__('Anulla', 'gepafin')} onClick={hideCompleteDialog} outlined/>
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
disabled={loading}
|
||||||
|
label={__('Invia', 'gepafin')} onClick={'approve' === operationType ? doApprove : doReject}/>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
const initiateApproving = () => {
|
||||||
|
setOperationType('approve');
|
||||||
|
setIsVisibleCompleteDialog(true);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const initiateRejecting = () => {
|
||||||
|
setOperationType('reject');
|
||||||
|
setIsVisibleCompleteDialog(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
const doCheckNDG = () => {
|
||||||
|
storeSet.main.setAsyncRequest();
|
||||||
|
doSaveDraft();
|
||||||
|
setTimeout(() => {
|
||||||
|
AppointmentService.getNdg(id, getNdgCallback, errGetNdgCallback);
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
const getNdgCallback = (data) => {
|
||||||
|
if (data.status === 'SUCCESS') {
|
||||||
|
if (toast.current && data.message) {
|
||||||
|
toast.current.show({
|
||||||
|
severity: 'success',
|
||||||
|
summary: '',
|
||||||
|
detail: data.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
storeSet.main.unsetAsyncRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
const errGetNdgCallback = (data) => {
|
||||||
|
if (toast.current && data.message) {
|
||||||
|
toast.current.show({
|
||||||
|
severity: data.status === 'SUCCESS' ? 'info' : 'error',
|
||||||
|
summary: '',
|
||||||
|
detail: data.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
set404FromErrorResponse(data);
|
||||||
|
storeSet.main.unsetAsyncRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
const doCreateAppointment = () => {
|
||||||
|
setAppointmentData({
|
||||||
|
title: '',
|
||||||
|
text: '',
|
||||||
|
duration: 0,
|
||||||
|
amount: 0
|
||||||
|
});
|
||||||
|
setIsVisibleAppointmentDialog(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
const setValue = (name, value) => {
|
||||||
|
const newData = wrap(appointmentData).set(name, value).value();
|
||||||
|
setAppointmentData(newData);
|
||||||
|
}
|
||||||
|
|
||||||
|
const headerAppointmentDialog = () => {
|
||||||
|
return <span>{__('Crea appuntamento', 'gepafin')}</span>;
|
||||||
|
}
|
||||||
|
|
||||||
|
const hideAppointmentDialog = () => {
|
||||||
|
setIsVisibleAppointmentDialog(false);
|
||||||
|
setAppointmentData({});
|
||||||
|
}
|
||||||
|
|
||||||
|
const footerAppointmentDialog = () => {
|
||||||
|
return <div>
|
||||||
|
<Button type="button" label={__('Anulla', 'gepafin')} onClick={hideAppointmentDialog} outlined/>
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
disabled={loading}
|
||||||
|
label={__('Invia', 'gepafin')} onClick={doCreateAppointmentRequest}/>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
const doCreateAppointmentRequest = () => {
|
||||||
|
if (
|
||||||
|
!isEmpty(appointmentData.title) && !isEmpty(appointmentData.text) && !isEmpty(appointmentData.amount)
|
||||||
|
&& !isEmpty(appointmentData.duration) && appointmentData.duration !== 0 && appointmentData.amount !== 0
|
||||||
|
) {
|
||||||
|
storeSet.main.setAsyncRequest();
|
||||||
|
const submitData = {
|
||||||
|
'importoBreveTermine': appointmentData.amount,
|
||||||
|
'durataMesiFinanziamento': appointmentData.duration,
|
||||||
|
'nota': {
|
||||||
|
'titolo': appointmentData.title,
|
||||||
|
'testo': appointmentData.text
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
AppointmentService.createAppointment(id, submitData, getAppointemntCallback, errGetAppointemntCallback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const getAppointemntCallback = (data) => {
|
||||||
|
if (data.status === 'SUCCESS') {
|
||||||
|
if (toast.current && data.message) {
|
||||||
|
toast.current.show({
|
||||||
|
severity: 'success',
|
||||||
|
summary: '',
|
||||||
|
detail: data.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setIsVisibleAppointmentDialog(false);
|
||||||
|
storeSet.main.unsetAsyncRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
const errGetAppointemntCallback = (data) => {
|
||||||
|
if (toast.current && data.message) {
|
||||||
|
toast.current.show({
|
||||||
|
severity: data.status === 'SUCCESS' ? 'info' : 'error',
|
||||||
|
summary: '',
|
||||||
|
detail: data.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
setIsVisibleAppointmentDialog(false);
|
||||||
|
set404FromErrorResponse(data);
|
||||||
|
storeSet.main.unsetAsyncRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
const doMakeAdmisible = () => {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
const evaluationShouldBeBlocked = (data = {}) => {
|
||||||
|
const userData = storeGet.main.userData()
|
||||||
|
return isAsyncRequest || userData.id !== data.assignedUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const maxScore = pathOr(0, ['minScore'], data);
|
||||||
|
const criteria = pathOr([], ['criteria'], data);
|
||||||
|
const scoreSum = sum(criteria.map(o => o.score));
|
||||||
|
|
||||||
|
setIsAdmissible(scoreSum !== 0 && scoreSum >= maxScore);
|
||||||
|
}, [data]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const parsed = parseInt(id)
|
||||||
|
const entityId = !isNaN(parsed) ? parsed : 0;
|
||||||
|
|
||||||
|
storeSet.main.setAsyncRequest();
|
||||||
|
ApplicationEvaluationService.getEvaluationByApplId(getCallback, errGetCallback, [
|
||||||
|
['applicationId', entityId]
|
||||||
|
]);
|
||||||
|
AmendmentsService.getSoccorsoByApplId(entityId, getAmendmentsCallback, errGetAmendmentsCallback, [
|
||||||
|
['statuses', 'AWAITING']
|
||||||
|
]);
|
||||||
|
}, [id]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="appPage">
|
||||||
|
<div className="appPage__pageHeader">
|
||||||
|
<h1>{__('Valuta domanda', 'gepafin')}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appPage__spacer"></div>
|
||||||
|
<Toast ref={toast}/>
|
||||||
|
|
||||||
|
<div className="appPageSection__row">
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
outlined
|
||||||
|
onClick={goToEvaluationsPage}
|
||||||
|
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 columns">
|
||||||
|
<p className="appPageSection__pMeta">
|
||||||
|
<span>{__('ID domanda', 'gepafin')}</span>
|
||||||
|
<span>{data.applicationId}</span>
|
||||||
|
</p>
|
||||||
|
<p className="appPageSection__pMeta">
|
||||||
|
<span>{__('Protocollo', 'gepafin')}</span>
|
||||||
|
<span>{data.protocolNumber}</span>
|
||||||
|
</p>
|
||||||
|
<p className="appPageSection__pMeta">
|
||||||
|
<span>{__('NDG', 'gepafin')}</span>
|
||||||
|
<span>{data.ndg}</span>
|
||||||
|
</p>
|
||||||
|
<p className="appPageSection__pMeta">
|
||||||
|
<span>{__('Appuntamento', 'gepafin')}</span>
|
||||||
|
<span>{data.appointmentId}</span>
|
||||||
|
</p>
|
||||||
|
<p className="appPageSection__pMeta">
|
||||||
|
<span>{__('Bando', 'gepafin')}</span>
|
||||||
|
<span>{data.callName}</span>
|
||||||
|
</p>
|
||||||
|
<p className="appPageSection__pMeta">
|
||||||
|
<span>{__('Referente Aziendale', 'gepafin')}</span>
|
||||||
|
<span>{data.beneficiary}</span>
|
||||||
|
</p>
|
||||||
|
<p className="appPageSection__pMeta">
|
||||||
|
<span>{__('Azienda Beneficiaria', 'gepafin')}</span>
|
||||||
|
<span>{data.companyName}</span>
|
||||||
|
</p>
|
||||||
|
<p className="appPageSection__pMeta">
|
||||||
|
<span>{__('Data ricezione', 'gepafin')}</span>
|
||||||
|
<span>{getDateFromISOstring(data.submissionDate)}</span>
|
||||||
|
</p>
|
||||||
|
<p className="appPageSection__pMeta">
|
||||||
|
<span>{__('Data assegnazione', 'gepafin')}</span>
|
||||||
|
<span>{getDateFromISOstring(data.assignedAt)}</span>
|
||||||
|
</p>
|
||||||
|
<p className="appPageSection__pMeta">
|
||||||
|
<span>{__('Scadenza Valutazione', 'gepafin')}</span>
|
||||||
|
<span>{getDateFromISOstring(data.evaluationEndDate)}</span>
|
||||||
|
</p>
|
||||||
|
<p className="appPageSection__pMeta">
|
||||||
|
<span>{__('Stato', 'gepafin')}</span>
|
||||||
|
<span>{getBandoLabel(data.applicationStatus)}</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appPageSection">
|
||||||
|
<h2>{__('Scarica documenti della domanda', 'gepafin')}</h2>
|
||||||
|
<div className="appPageSection__row autoFlow">
|
||||||
|
<DownloadApplicationArchive applicationId={id}/>
|
||||||
|
<DownloadSignedApplication applicationId={id}/>
|
||||||
|
<DownloadCompanyDelegation applicationId={id}/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appPageSection">
|
||||||
|
<h2>{__('Documenti aggiuntivi', 'gepafin')}</h2>
|
||||||
|
<RepeaterFields
|
||||||
|
defaultValue={data.evaluationDocument ?? []}
|
||||||
|
updateFn={(data) => updateEvaluationValue(
|
||||||
|
data,
|
||||||
|
['evaluationDocument']
|
||||||
|
)}
|
||||||
|
shouldDisable={['APPROVED', 'REJECTED'].includes(data.applicationStatus) || evaluationShouldBeBlocked(data)}
|
||||||
|
sourceId={data.assignedApplicationId}
|
||||||
|
sourceName="evaluation"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appPageSection">
|
||||||
|
<h2>{__('Checklist Valutazione', 'gepafin')}</h2>
|
||||||
|
<div className="appPageSection columns">
|
||||||
|
<div>
|
||||||
|
<h3>{__('Lista', 'gepafin')}</h3>
|
||||||
|
<div className="appPageSection__withBorder grey" style={{ marginBottom: '20px' }}>
|
||||||
|
<div className="appPageSection__checklist">
|
||||||
|
{data.checklist.map((o, i) => <div key={o.id}>
|
||||||
|
<Checkbox
|
||||||
|
disabled={shouldDisableField('checklist') || evaluationShouldBeBlocked(data)}
|
||||||
|
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}
|
||||||
|
readOnly={shouldDisableField('note') || evaluationShouldBeBlocked(data)}
|
||||||
|
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>
|
||||||
|
<ListOfFiles
|
||||||
|
files={data.files}
|
||||||
|
updateFn={updateEvaluationValue}
|
||||||
|
shouldDisableFieldFn={(name) => shouldDisableField(name) || evaluationShouldBeBlocked(data)}
|
||||||
|
name="files"
|
||||||
|
ndg={data.ndg}
|
||||||
|
applicationId={id}/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{!isEmpty(data.amendmentDetails)
|
||||||
|
? <div className="appPageSection">
|
||||||
|
<h2>{__('Documenti di soccorso', 'gepafin')}</h2>
|
||||||
|
<ListOfFiles
|
||||||
|
files={data.amendmentDetails}
|
||||||
|
updateFn={updateEvaluationValue}
|
||||||
|
shouldDisableFieldFn={(name) => shouldDisableField(name) || evaluationShouldBeBlocked(data)}
|
||||||
|
name="amendmentDetails"
|
||||||
|
ndg={data.ndg}
|
||||||
|
applicationId={id}/>
|
||||||
|
</div> : null}
|
||||||
|
|
||||||
|
<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
|
||||||
|
disabled={shouldDisableField('criteria') || evaluationShouldBeBlocked(data)}
|
||||||
|
placeholder={__('Punteggio', 'gepafin')}
|
||||||
|
keyfilter="int"
|
||||||
|
value={o.score}
|
||||||
|
max={o.maxScore}
|
||||||
|
onChange={(e) => updateEvaluationValue(
|
||||||
|
e.value,
|
||||||
|
['criteria', i, 'score'],
|
||||||
|
o.criteria
|
||||||
|
)}/>
|
||||||
|
<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"
|
||||||
|
onClick={() => displayCriterionData(o.id)}
|
||||||
|
aria-label={__('Mostra', 'gepafin')}/> : null}
|
||||||
|
<Button icon="pi pi-thumbs-up" rounded outlined
|
||||||
|
disabled={shouldDisableField('criteria') || evaluationShouldBeBlocked(data)}
|
||||||
|
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
|
||||||
|
disabled={shouldDisableField('criteria') || evaluationShouldBeBlocked(data)}
|
||||||
|
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="appPage__spacer"></div>
|
||||||
|
|
||||||
|
<div className="appPageSection__hr">
|
||||||
|
<span>{__('Azioni rapide', 'gepafin')}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appPageSection">
|
||||||
|
<div className="appPageSection__actions">
|
||||||
|
{['EVALUATION', 'SOCCORSO', 'CLOSE'].includes(data.applicationStatus)
|
||||||
|
? <Button
|
||||||
|
type="button"
|
||||||
|
disabled={!data.id || data.status === 'CLOSE' || (data.applicationStatus === 'EVALUATION'
|
||||||
|
&& (!allFilesRated || !atLeastOneChecked)) || evaluationShouldBeBlocked(data)}
|
||||||
|
onClick={doNewSoccorso}
|
||||||
|
outlined
|
||||||
|
label={<>
|
||||||
|
{data.applicationStatus === 'EVALUATION'
|
||||||
|
? __('Richiedi Soccorso Istruttorio', 'gepafin')
|
||||||
|
: __('Apri Soccorso Istruttorio', 'gepafin')}
|
||||||
|
<i style={{ marginLeft: 7 }}>
|
||||||
|
<HelpIcon/>
|
||||||
|
</i>
|
||||||
|
</>}
|
||||||
|
/> : null}
|
||||||
|
{data.id
|
||||||
|
? <Button
|
||||||
|
type="button"
|
||||||
|
disabled={data.status === 'CLOSE' || evaluationShouldBeBlocked(data)}
|
||||||
|
onClick={() => doSaveDraft()}
|
||||||
|
outlined
|
||||||
|
label={__('Salva bozza valutazione', 'gepafin')}
|
||||||
|
icon="pi pi-save" iconPos="right"/>
|
||||||
|
: <Button
|
||||||
|
type="button"
|
||||||
|
onClick={() => doSaveDraft()}
|
||||||
|
label={__('Crea valutazione', 'gepafin')}
|
||||||
|
icon="pi pi-save" iconPos="right"/>}
|
||||||
|
{/*{APP_EVALUATION_FLOW_ID === '1' && ['EVALUATION'].includes(data.applicationStatus)
|
||||||
|
? <Button
|
||||||
|
type="button"
|
||||||
|
disabled={!data.id || !allFilesRated || !allChecksChecked || evaluationShouldBeBlocked(data)}
|
||||||
|
onClick={doCheckNDG}
|
||||||
|
label={__('Controlla NDG', 'gepafin')}
|
||||||
|
/> : null}*/}
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
disabled={true}
|
||||||
|
onClick={() => {}}
|
||||||
|
label={__('Controlla NDG', 'gepafin')}
|
||||||
|
/>
|
||||||
|
{/*{APP_EVALUATION_FLOW_ID === '1' && ['NDG'].includes(data.applicationStatus) && data.ndg
|
||||||
|
? <Button
|
||||||
|
type="button"
|
||||||
|
disabled={!data.id || evaluationShouldBeBlocked(data)}
|
||||||
|
onClick={doCreateAppointment}
|
||||||
|
label={__('Crea l\'appuntamento', 'gepafin')}
|
||||||
|
/> : null}*/}
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
disabled={true}
|
||||||
|
onClick={() => {}}
|
||||||
|
label={__('Crea l\'appuntamento', 'gepafin')}
|
||||||
|
/>
|
||||||
|
{/*{APP_EVALUATION_FLOW_ID === '1' && ['APPOINTMENT'].includes(data.applicationStatus)
|
||||||
|
? <Button
|
||||||
|
type="button"
|
||||||
|
disabled={!data.id || evaluationShouldBeBlocked(data)}
|
||||||
|
onClick={doMakeAdmisible}
|
||||||
|
label={__('Ammissibile', 'gepafin')}
|
||||||
|
/> : null}*/}
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
disabled={true}
|
||||||
|
onClick={() => {}}
|
||||||
|
label={__('Ammissibile', 'gepafin')}
|
||||||
|
/>
|
||||||
|
{data.id
|
||||||
|
? <Button
|
||||||
|
type="button"
|
||||||
|
disabled={!isAdmissible || ['APPROVED'].includes(data.applicationStatus) || evaluationShouldBeBlocked(data)}
|
||||||
|
/*disabled={!isAdmissible
|
||||||
|
|| (APP_EVALUATION_FLOW_ID === '1' && !['ADMISSIBLE', 'APPOINTMENT'].includes(data.applicationStatus))}*/
|
||||||
|
onClick={initiateApproving}
|
||||||
|
label={__('Approva Domanda', 'gepafin')}
|
||||||
|
icon="pi pi-check" iconPos="right"/> : null}
|
||||||
|
{/*{data.id
|
||||||
|
? <Button
|
||||||
|
type="button"
|
||||||
|
disabled={APP_EVALUATION_FLOW_ID === '1' && !['ADMISSIBLE', 'APPOINTMENT'].includes(data.applicationStatus)}
|
||||||
|
onClick={initiateRejecting}
|
||||||
|
label={__('Respingi Domanda', 'gepafin')}
|
||||||
|
icon="pi pi-times" iconPos="right"/> : null}*/}
|
||||||
|
{data.id
|
||||||
|
? <Button
|
||||||
|
type="button"
|
||||||
|
disabled={APP_EVALUATION_FLOW_ID === '1'
|
||||||
|
&& !['EVALUATION', 'ADMISSIBLE', 'APPOINTMENT'].includes(data.applicationStatus)
|
||||||
|
|| evaluationShouldBeBlocked(data)}
|
||||||
|
onClick={initiateRejecting}
|
||||||
|
label={__('Respingi Domanda', 'gepafin')}
|
||||||
|
icon="pi pi-times" iconPos="right"/> : null}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Dialog
|
||||||
|
header={criterionDataTitle}
|
||||||
|
visible={isVisibleCriterionData !== 0}
|
||||||
|
style={{ width: '50vw' }}
|
||||||
|
onHide={hideCriterionData}>
|
||||||
|
{criterionDataContent}
|
||||||
|
</Dialog>
|
||||||
|
|
||||||
|
<Dialog
|
||||||
|
visible={isVisibleCompleteDialog}
|
||||||
|
modal
|
||||||
|
header={headerCompleteDialog}
|
||||||
|
footer={footerCompleteDialog}
|
||||||
|
style={{ maxWidth: '600px', width: '100%' }}
|
||||||
|
onHide={hideCompleteDialog}>
|
||||||
|
<div className="appForm__field">
|
||||||
|
<label>{__('Motivazione', 'gepafin')}</label>
|
||||||
|
<Editor
|
||||||
|
value={motivation}
|
||||||
|
readOnly={loading}
|
||||||
|
placeholder={__('Digita qui il messagio', 'gepafin')}
|
||||||
|
headerTemplate={header}
|
||||||
|
onTextChange={(e) => setMotivation(e.htmlValue)}
|
||||||
|
style={{ height: 80 * 3, width: '100%' }}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</Dialog>
|
||||||
|
|
||||||
|
<Dialog
|
||||||
|
visible={isVisibleAppointmentDialog}
|
||||||
|
modal
|
||||||
|
header={headerAppointmentDialog}
|
||||||
|
footer={footerAppointmentDialog}
|
||||||
|
style={{ maxWidth: '600px', width: '100%' }}
|
||||||
|
onHide={hideAppointmentDialog}>
|
||||||
|
<div className="appForm__field">
|
||||||
|
<label
|
||||||
|
className={classNames({ 'p-error': isEmpty(appointmentData.amount) || appointmentData.amount === 0 })}>
|
||||||
|
{__('Importo', 'gepafin')}
|
||||||
|
</label>
|
||||||
|
<InputNumber
|
||||||
|
value={appointmentData.amount}
|
||||||
|
keyfilter="int"
|
||||||
|
invalid={isEmpty(appointmentData.amount) || appointmentData.amount === 0}
|
||||||
|
onChange={(e) => setValue('amount', e.value)}/>
|
||||||
|
</div>
|
||||||
|
<div className="appForm__field">
|
||||||
|
<label
|
||||||
|
className={classNames({ 'p-error': isEmpty(appointmentData.duration) || appointmentData.duration === 0 })}>
|
||||||
|
{__('Durata', 'gepafin')}
|
||||||
|
</label>
|
||||||
|
<InputNumber
|
||||||
|
value={appointmentData.duration}
|
||||||
|
keyfilter="int"
|
||||||
|
invalid={isEmpty(appointmentData.duration) || appointmentData.duration === 0}
|
||||||
|
onChange={(e) => setValue('duration', e.value)}/>
|
||||||
|
</div>
|
||||||
|
<div className="appForm__field">
|
||||||
|
<label className={classNames({ 'p-error': isEmpty(appointmentData.title) })}>
|
||||||
|
{__('Titolo', 'gepafin')}
|
||||||
|
</label>
|
||||||
|
<InputText
|
||||||
|
value={appointmentData.title}
|
||||||
|
invalid={isEmpty(appointmentData.title)}
|
||||||
|
onChange={(e) => setValue('title', e.target.value)}/>
|
||||||
|
</div>
|
||||||
|
<div className="appForm__field">
|
||||||
|
<label className={classNames({ 'p-error': isEmpty(appointmentData.text) })}>
|
||||||
|
{__('Messaggio', 'gepafin')}
|
||||||
|
</label>
|
||||||
|
<InputTextarea
|
||||||
|
value={appointmentData.text}
|
||||||
|
invalid={isEmpty(appointmentData.text)}
|
||||||
|
onChange={(e) => setValue('text', e.target.value)}
|
||||||
|
rows={3}
|
||||||
|
cols={30}/>
|
||||||
|
</div>
|
||||||
|
</Dialog>
|
||||||
|
|
||||||
|
</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 DomandaEditPreInstructor;
|
||||||
@@ -568,11 +568,11 @@ const DomandaEditPreInstructor = () => {
|
|||||||
<span>{data.callName}</span>
|
<span>{data.callName}</span>
|
||||||
</p>
|
</p>
|
||||||
<p className="appPageSection__pMeta">
|
<p className="appPageSection__pMeta">
|
||||||
<span>{__('Beneficiario', 'gepafin')}</span>
|
<span>{__('Referente Aziendale', 'gepafin')}</span>
|
||||||
<span>{data.beneficiary}</span>
|
<span>{data.beneficiary}</span>
|
||||||
</p>
|
</p>
|
||||||
<p className="appPageSection__pMeta">
|
<p className="appPageSection__pMeta">
|
||||||
<span>{__('Azienda', 'gepafin')}</span>
|
<span>{__('Azienda Beneficiaria', 'gepafin')}</span>
|
||||||
<span>{data.companyName}</span>
|
<span>{data.companyName}</span>
|
||||||
</p>
|
</p>
|
||||||
<p className="appPageSection__pMeta">
|
<p className="appPageSection__pMeta">
|
||||||
@@ -934,4 +934,4 @@ const DomandaEditPreInstructor = () => {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default DomandaEditPreInstructor;
|
export default DomandaEditPreInstructor;
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ const AllDomandeTable = ({ openDialogFn, updaterString = '' }) => {
|
|||||||
? <Link to={'/domande'}>
|
? <Link to={'/domande'}>
|
||||||
<Button severity="info" label={__('Gestire', 'gepafin')} size="small"/>
|
<Button severity="info" label={__('Gestire', 'gepafin')} size="small"/>
|
||||||
</Link> : null}
|
</Link> : null}
|
||||||
<Link to={`/domande/${rowData.id}`}>
|
<Link to={`/domande/${rowData.id}/preview`}>
|
||||||
<Button severity="info" label={__('Anteprima', 'gepafin')} icon="pi pi-eye" size="small"
|
<Button severity="info" label={__('Anteprima', 'gepafin')} icon="pi pi-eye" size="small"
|
||||||
iconPos="right"/>
|
iconPos="right"/>
|
||||||
</Link>
|
</Link>
|
||||||
@@ -165,7 +165,7 @@ const AllDomandeTable = ({ openDialogFn, updaterString = '' }) => {
|
|||||||
filter sortable
|
filter sortable
|
||||||
filterPlaceholder={__('Cerca', 'gepafin')}
|
filterPlaceholder={__('Cerca', 'gepafin')}
|
||||||
style={{ minWidth: '10rem' }}/>
|
style={{ minWidth: '10rem' }}/>
|
||||||
<Column field="companyName" header={__('Azienda', 'gepafin')}
|
<Column field="companyName" header={__('Azienda Beneficiaria', 'gepafin')}
|
||||||
filter sortable
|
filter sortable
|
||||||
filterPlaceholder={__('Cerca il nome', 'gepafin')}
|
filterPlaceholder={__('Cerca il nome', 'gepafin')}
|
||||||
style={{ minWidth: '8rem' }}/>
|
style={{ minWidth: '8rem' }}/>
|
||||||
@@ -173,10 +173,10 @@ const AllDomandeTable = ({ openDialogFn, updaterString = '' }) => {
|
|||||||
filterField="submissionDate" dataType="date"
|
filterField="submissionDate" dataType="date"
|
||||||
style={{ minWidth: '8rem' }}
|
style={{ minWidth: '8rem' }}
|
||||||
body={dateAppliedBodyTemplate} filter filterElement={dateFilterTemplate}/>
|
body={dateAppliedBodyTemplate} filter filterElement={dateFilterTemplate}/>
|
||||||
{/*<Column header={__('Scadenza', 'gepafin')}
|
<Column field="assignedUserName" header={__('Assegnato', 'gepafin')}
|
||||||
filterField="callEndDate" dataType="date"
|
filter sortable
|
||||||
style={{ minWidth: '8rem' }}
|
filterPlaceholder={__('Cerca il nome', 'gepafin')}
|
||||||
body={dateEndBodyTemplate} filter filterElement={dateFilterTemplate}/>*/}
|
style={{ minWidth: '8rem' }}/>
|
||||||
<Column field="status" header={__('Stato', 'gepafin')}
|
<Column field="status" header={__('Stato', 'gepafin')}
|
||||||
style={{ minWidth: '8rem' }} body={statusBodyTemplate}
|
style={{ minWidth: '8rem' }} body={statusBodyTemplate}
|
||||||
filter
|
filter
|
||||||
@@ -188,4 +188,4 @@ const AllDomandeTable = ({ openDialogFn, updaterString = '' }) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default AllDomandeTable;
|
export default AllDomandeTable;
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ const BeneficiarioDomandeTable = () => {
|
|||||||
filter sortable
|
filter sortable
|
||||||
filterPlaceholder={__('Cerca il nome', 'gepafin')}
|
filterPlaceholder={__('Cerca il nome', 'gepafin')}
|
||||||
style={{ minWidth: '8rem' }}/>
|
style={{ minWidth: '8rem' }}/>
|
||||||
<Column field="companyName" header={__('Azienda', 'gepafin')}
|
<Column field="companyName" header={__('Azienda Beneficiaria', 'gepafin')}
|
||||||
filter sortable
|
filter sortable
|
||||||
filterPlaceholder={__('Cerca il nome', 'gepafin')}
|
filterPlaceholder={__('Cerca il nome', 'gepafin')}
|
||||||
style={{ minWidth: '8rem' }}/>
|
style={{ minWidth: '8rem' }}/>
|
||||||
@@ -184,4 +184,4 @@ const BeneficiarioDomandeTable = () => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default BeneficiarioDomandeTable;
|
export default BeneficiarioDomandeTable;
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ const SoccorsoAddPreInstructor = () => {
|
|||||||
<span>{data.callName}</span>
|
<span>{data.callName}</span>
|
||||||
</p>
|
</p>
|
||||||
<p className="appPageSection__pMeta">
|
<p className="appPageSection__pMeta">
|
||||||
<span>{__('Beneficiario', 'gepafin')}</span>
|
<span>{__('Referente Aziendale', 'gepafin')}</span>
|
||||||
<span>{data.beneficiaryName}</span>
|
<span>{data.beneficiaryName}</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -308,4 +308,4 @@ const SoccorsoAddPreInstructor = () => {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default SoccorsoAddPreInstructor;
|
export default SoccorsoAddPreInstructor;
|
||||||
|
|||||||
@@ -275,11 +275,11 @@ const SoccorsoEditBeneficiario = () => {
|
|||||||
<span>{data.callName}</span>
|
<span>{data.callName}</span>
|
||||||
</p>
|
</p>
|
||||||
<p className="appPageSection__pMeta">
|
<p className="appPageSection__pMeta">
|
||||||
<span>{__('Beneficiario', 'gepafin')}</span>
|
<span>{__('Referente Aziendale', 'gepafin')}</span>
|
||||||
<span>{data.beneficiaryName}</span>
|
<span>{data.beneficiaryName}</span>
|
||||||
</p>
|
</p>
|
||||||
<p className="appPageSection__pMeta">
|
<p className="appPageSection__pMeta">
|
||||||
<span>{__('Azienda', 'gepafin')}</span>
|
<span>{__('Azienda Beneficiaria', 'gepafin')}</span>
|
||||||
<span></span>
|
<span></span>
|
||||||
</p>
|
</p>
|
||||||
<p className="appPageSection__pMeta">
|
<p className="appPageSection__pMeta">
|
||||||
@@ -306,7 +306,7 @@ const SoccorsoEditBeneficiario = () => {
|
|||||||
<span>{dataAppl.callTitle}</span>
|
<span>{dataAppl.callTitle}</span>
|
||||||
</p>
|
</p>
|
||||||
<p className="appPageSection__pMeta">
|
<p className="appPageSection__pMeta">
|
||||||
<span>{__('Azienda', 'gepafin')}</span>
|
<span>{__('Azienda Beneficiaria', 'gepafin')}</span>
|
||||||
<span>{dataAppl.companyName}</span>
|
<span>{dataAppl.companyName}</span>
|
||||||
</p>
|
</p>
|
||||||
<p className="appPageSection__pMeta">
|
<p className="appPageSection__pMeta">
|
||||||
@@ -462,4 +462,4 @@ const SoccorsoEditBeneficiario = () => {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default SoccorsoEditBeneficiario;
|
export default SoccorsoEditBeneficiario;
|
||||||
|
|||||||
@@ -392,7 +392,7 @@ const SoccorsoEditPreInstructor = () => {
|
|||||||
<span>{data.callName}</span>
|
<span>{data.callName}</span>
|
||||||
</p>
|
</p>
|
||||||
<p className="appPageSection__pMeta">
|
<p className="appPageSection__pMeta">
|
||||||
<span>{__('Beneficiario', 'gepafin')}</span>
|
<span>{__('Referente Aziendale', 'gepafin')}</span>
|
||||||
<span>{data.beneficiaryName}</span>
|
<span>{data.beneficiaryName}</span>
|
||||||
</p>
|
</p>
|
||||||
<p className="appPageSection__pMeta">
|
<p className="appPageSection__pMeta">
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ const PreInstructorSoccorsiTable = ({ openDialogFn }) => {
|
|||||||
operator: FilterOperator.AND,
|
operator: FilterOperator.AND,
|
||||||
constraints: [{ value: null, matchMode: FilterMatchMode.STARTS_WITH }]
|
constraints: [{ value: null, matchMode: FilterMatchMode.STARTS_WITH }]
|
||||||
},
|
},
|
||||||
beneficiaryName: {
|
companyName: {
|
||||||
operator: FilterOperator.AND,
|
operator: FilterOperator.AND,
|
||||||
constraints: [{ value: null, matchMode: FilterMatchMode.STARTS_WITH }]
|
constraints: [{ value: null, matchMode: FilterMatchMode.STARTS_WITH }]
|
||||||
},
|
},
|
||||||
@@ -149,7 +149,7 @@ const PreInstructorSoccorsiTable = ({ openDialogFn }) => {
|
|||||||
<Column field="callName" header={__('Bando', 'gepafin')}
|
<Column field="callName" header={__('Bando', 'gepafin')}
|
||||||
filter filterPlaceholder={__('Cerca', 'gepafin')}
|
filter filterPlaceholder={__('Cerca', 'gepafin')}
|
||||||
style={{ minWidth: '8rem' }}/>
|
style={{ minWidth: '8rem' }}/>
|
||||||
<Column field="beneficiaryName" header={__('Beneficiario', 'gepafin')}
|
<Column field="companyName" header={__('Azienda Beneficiaria', 'gepafin')}
|
||||||
filter filterPlaceholder={__('Cerca', 'gepafin')}
|
filter filterPlaceholder={__('Cerca', 'gepafin')}
|
||||||
style={{ minWidth: '8rem' }}/>
|
style={{ minWidth: '8rem' }}/>
|
||||||
<Column header={__('Data Richiesta', 'gepafin')}
|
<Column header={__('Data Richiesta', 'gepafin')}
|
||||||
@@ -170,4 +170,4 @@ const PreInstructorSoccorsiTable = ({ openDialogFn }) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default PreInstructorSoccorsiTable;
|
export default PreInstructorSoccorsiTable;
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ import SoccorsoEditBeneficiario from './pages/SoccorsoEditBeneficiario';
|
|||||||
import BandoApplicationPreview from './pages/BandoApplicationPreview';
|
import BandoApplicationPreview from './pages/BandoApplicationPreview';
|
||||||
import BandiPreferredBeneficiario from './pages/BandiPreferredBeneficiario';
|
import BandiPreferredBeneficiario from './pages/BandiPreferredBeneficiario';
|
||||||
import DomandeInstructorManager from './pages/DomandeInstructorManager';
|
import DomandeInstructorManager from './pages/DomandeInstructorManager';
|
||||||
|
import DomandaEditInstructorManager from './pages/DomandaEditInstructorManager';
|
||||||
|
|
||||||
const routes = ({ role, chosenCompanyId }) => {
|
const routes = ({ role, chosenCompanyId }) => {
|
||||||
|
|
||||||
@@ -114,6 +115,12 @@ const routes = ({ role, chosenCompanyId }) => {
|
|||||||
{'ROLE_SUPER_ADMIN' === role ? <BandoApplicationPreview/> : null}
|
{'ROLE_SUPER_ADMIN' === role ? <BandoApplicationPreview/> : null}
|
||||||
{'ROLE_BENEFICIARY' === role ? <SoccorsoEditBeneficiario/> : null}
|
{'ROLE_BENEFICIARY' === role ? <SoccorsoEditBeneficiario/> : null}
|
||||||
{'ROLE_PRE_INSTRUCTOR' === role ? <DomandaEditPreInstructor/> : null}
|
{'ROLE_PRE_INSTRUCTOR' === role ? <DomandaEditPreInstructor/> : null}
|
||||||
|
{'ROLE_INSTRUCTOR_MANAGER' === role ? <DomandaEditInstructorManager/> : null}
|
||||||
|
</DefaultLayout>}/>
|
||||||
|
<Route path="/domande/:id/preview" element={<DefaultLayout>
|
||||||
|
{'ROLE_SUPER_ADMIN' === role ? <BandoApplicationPreview/> : null}
|
||||||
|
{'ROLE_BENEFICIARY' === role ? <PageNotFound/> : null}
|
||||||
|
{'ROLE_PRE_INSTRUCTOR' === role ? <BandoApplicationPreview/> : null}
|
||||||
{'ROLE_INSTRUCTOR_MANAGER' === role ? <BandoApplicationPreview/> : null}
|
{'ROLE_INSTRUCTOR_MANAGER' === role ? <BandoApplicationPreview/> : null}
|
||||||
</DefaultLayout>}/>
|
</DefaultLayout>}/>
|
||||||
<Route path="/domande/:id/aggiungi-soccorso" element={<DefaultLayout>
|
<Route path="/domande/:id/aggiungi-soccorso" element={<DefaultLayout>
|
||||||
|
|||||||
Reference in New Issue
Block a user