- merged develop;
This commit is contained in:
@@ -19,9 +19,11 @@ import BlockingOverlay from '../../components/BlockingOverlay';
|
||||
import CompanyService from '../../service/company-service';
|
||||
|
||||
// tools
|
||||
import { isPIVA, isEmail, isEmailPEC } from '../../helpers/validators';
|
||||
import { isPIVA, isEmail, isEmailPEC, isCodiceFiscale } from '../../helpers/validators';
|
||||
import set404FromErrorResponse from '../../helpers/set404FromErrorResponse';
|
||||
|
||||
//const APP_EVALUATION_FLOW_ID = process.env.REACT_APP_EVALUATION_FLOW_ID;
|
||||
|
||||
const AddCompany = () => {
|
||||
const navigate = useNavigate();
|
||||
const isAsyncRequest = useStore().main.isAsyncRequest();
|
||||
@@ -33,12 +35,14 @@ const AddCompany = () => {
|
||||
handleSubmit,
|
||||
formState: { errors },
|
||||
setValue,
|
||||
watch
|
||||
watch,
|
||||
trigger
|
||||
} = useForm({
|
||||
defaultValues: {},
|
||||
mode: 'onChange'
|
||||
});
|
||||
const isPiva = watch('vatNumber');
|
||||
//const isPiva = watch('vatNumber');
|
||||
|
||||
const setEmptyValues = () => {
|
||||
const formData = {
|
||||
@@ -116,7 +120,7 @@ const AddCompany = () => {
|
||||
pec,
|
||||
email: pec,
|
||||
city: comune,
|
||||
codiceFiscale: cf,
|
||||
codiceFiscale: cf ? cf : piva,
|
||||
address: indirizzo,
|
||||
vatNumber: piva,
|
||||
companyName: denominazione
|
||||
@@ -127,6 +131,7 @@ const AddCompany = () => {
|
||||
} else {
|
||||
setEmptyValues();
|
||||
}
|
||||
trigger();
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
}
|
||||
|
||||
@@ -136,6 +141,11 @@ const AddCompany = () => {
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
}
|
||||
|
||||
/*const shouldDisableFiscalCode = () => {
|
||||
const formData = getValues();
|
||||
return !formData.type || formData.type && formData.type === 'giuridica';
|
||||
}*/
|
||||
|
||||
useEffect(() => {
|
||||
setInputPiva(isPiva);
|
||||
}, [isPiva]);
|
||||
@@ -174,6 +184,23 @@ const AddCompany = () => {
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/*{APP_EVALUATION_FLOW_ID === '2'
|
||||
? <div className="appForm__cols">
|
||||
<FormField
|
||||
type="radio"
|
||||
fieldName="type"
|
||||
label={__('Type', 'gepafin')}
|
||||
control={control}
|
||||
errors={errors}
|
||||
config={{ required: __('È obbligatorio', 'gepafin') }}
|
||||
defaultValue="giuridica"
|
||||
options={[
|
||||
{ name: 'giuridica', label: 'Giuridica' },
|
||||
{ name: 'fisica', label: 'Fisica' },
|
||||
]}
|
||||
/>
|
||||
</div> : null}*/}
|
||||
|
||||
<div className="appForm__cols">
|
||||
<FormField
|
||||
type="textinput"
|
||||
@@ -181,18 +208,46 @@ const AddCompany = () => {
|
||||
label={__('P.IVA', 'gepafin')}
|
||||
control={control}
|
||||
errors={errors}
|
||||
config={{ required: __('È obbligatorio', 'gepafin') }}
|
||||
config={{
|
||||
required: __('È obbligatorio', 'gepafin'),
|
||||
validate: {
|
||||
isPIVA
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
type="textinput"
|
||||
disabled={true}
|
||||
fieldName="codiceFiscale"
|
||||
label={__('Codice fiscale', 'gepafin')}
|
||||
control={control}
|
||||
errors={errors}
|
||||
config={{ required: __('È obbligatorio', 'gepafin') }}
|
||||
config={{
|
||||
required: __('È obbligatorio', 'gepafin'),
|
||||
validate: {
|
||||
validCF: (value) => isCodiceFiscale(value) || isPIVA(value)
|
||||
}
|
||||
}}
|
||||
/>
|
||||
{/*{APP_EVALUATION_FLOW_ID === '1'
|
||||
? <FormField
|
||||
type="textinput"
|
||||
disabled
|
||||
fieldName="codiceFiscale"
|
||||
label={__('Codice fiscale', 'gepafin')}
|
||||
control={control}
|
||||
errors={errors}
|
||||
config={{ required: __('È obbligatorio', 'gepafin') }}
|
||||
/>
|
||||
: <FormField
|
||||
type="textinput"
|
||||
disabled={shouldDisableFiscalCode()}
|
||||
fieldName="codiceFiscale"
|
||||
label={__('Codice fiscale', 'gepafin')}
|
||||
control={control}
|
||||
errors={errors}
|
||||
config={{ required: __('È obbligatorio', 'gepafin') }}
|
||||
/>}*/}
|
||||
</div>
|
||||
|
||||
<div className="appForm__cols">
|
||||
|
||||
@@ -5,6 +5,7 @@ import { useNavigate } from 'react-router-dom';
|
||||
// components
|
||||
import MyLatestSubmissionsTable from '../DashboardBeneficiario/components/MyLatestSubmissionsTable';
|
||||
import { Button } from 'primereact/button';
|
||||
import ErrorBoundary from '../../components/ErrorBoundary';
|
||||
|
||||
const Applications = () => {
|
||||
const navigate = useNavigate();
|
||||
@@ -22,7 +23,7 @@ const Applications = () => {
|
||||
<div className="appPage__spacer"></div>
|
||||
|
||||
<div className="appPageSection">
|
||||
<MyLatestSubmissionsTable/>
|
||||
<ErrorBoundary><MyLatestSubmissionsTable/></ErrorBoundary>
|
||||
</div>
|
||||
|
||||
<div className="appPage__spacer"></div>
|
||||
|
||||
@@ -8,6 +8,7 @@ import { useStore } from '../../store';
|
||||
|
||||
// components
|
||||
import AllBandiAccordion from './components/AllBandiAccordion';
|
||||
import ErrorBoundary from '../../components/ErrorBoundary';
|
||||
|
||||
const BandiBeneficiario = () => {
|
||||
const chosenCompanyId = useStore().main.chosenCompanyId();
|
||||
@@ -34,7 +35,7 @@ const BandiBeneficiario = () => {
|
||||
</> : null}
|
||||
|
||||
<div className="appPageSection">
|
||||
<AllBandiAccordion/>
|
||||
<ErrorBoundary><AllBandiAccordion/></ErrorBoundary>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -14,6 +14,7 @@ import DashboardService from '../../service/dashboard-service';
|
||||
import LatestBandiTable from './components/LatestBandiTable';
|
||||
import MyLatestSubmissionsTable from './components/MyLatestSubmissionsTable';
|
||||
import { Button } from 'primereact/button';
|
||||
import ErrorBoundary from '../../components/ErrorBoundary';
|
||||
|
||||
const DashboardBeneficiario = () => {
|
||||
const navigate = useNavigate();
|
||||
@@ -85,7 +86,7 @@ const DashboardBeneficiario = () => {
|
||||
|
||||
<div className="appPageSection">
|
||||
<h2>{__('Domande in lavorazione', 'gepafin')}</h2>
|
||||
<MyLatestSubmissionsTable/>
|
||||
<ErrorBoundary><MyLatestSubmissionsTable/></ErrorBoundary>
|
||||
</div>
|
||||
|
||||
<div className="appPage__spacer"></div>
|
||||
@@ -105,7 +106,7 @@ const DashboardBeneficiario = () => {
|
||||
|
||||
<div className="appPageSection">
|
||||
<h2>{__('Bandi disponibili', 'gepafin')}</h2>
|
||||
<LatestBandiTable/>
|
||||
<ErrorBoundary><LatestBandiTable/></ErrorBoundary>
|
||||
</div>
|
||||
|
||||
<div className="appPage__spacer"></div>
|
||||
|
||||
@@ -54,7 +54,7 @@ const PreInstructorDomandeTable = () => {
|
||||
|
||||
const getFormattedData = (data) => {
|
||||
return data.map((d) => {
|
||||
d.callEndDate = is(String, d.callEndDate) ? new Date(d.callEndDate) : (d.callEndDate ? d.callEndDate : '');
|
||||
d.evaluationEndDate = is(String, d.evaluationEndDate) ? new Date(d.evaluationEndDate) : (d.evaluationEndDate ? d.evaluationEndDate : '');
|
||||
d.submissionDate = is(String, d.submissionDate) ? new Date(d.submissionDate) : (d.submissionDate ? d.submissionDate : '');
|
||||
return d;
|
||||
});
|
||||
@@ -87,7 +87,7 @@ const PreInstructorDomandeTable = () => {
|
||||
operator: FilterOperator.AND,
|
||||
constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }]
|
||||
},
|
||||
callEndDate : {
|
||||
evaluationEndDate: {
|
||||
operator: FilterOperator.AND,
|
||||
constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }]
|
||||
}
|
||||
@@ -107,7 +107,7 @@ const PreInstructorDomandeTable = () => {
|
||||
};
|
||||
|
||||
const dateEndBodyTemplate = (rowData) => {
|
||||
return formatDate(rowData.callEndDate);
|
||||
return formatDate(rowData.evaluationEndDate);
|
||||
};
|
||||
|
||||
const dateFilterTemplate = (options) => {
|
||||
@@ -144,6 +144,15 @@ const PreInstructorDomandeTable = () => {
|
||||
<Column field="applicationId" header={__('ID domanda', 'gepafin')}
|
||||
sortable filterPlaceholder={__('Cerca', 'gepafin')}
|
||||
style={{ minWidth: '6rem' }}/>
|
||||
<Column field="protocolNumber" header={__('Protocollo', 'gepafin')}
|
||||
sortable filterPlaceholder={__('Cerca', 'gepafin')}
|
||||
style={{ minWidth: '6rem' }}/>
|
||||
<Column field="ndg" header={__('NDG', 'gepafin')}
|
||||
sortable filterPlaceholder={__('Cerca', 'gepafin')}
|
||||
style={{ minWidth: '6rem' }}/>
|
||||
<Column field="appointmentId" header={__('ID appuntamento', 'gepafin')}
|
||||
sortable filterPlaceholder={__('Cerca', 'gepafin')}
|
||||
style={{ minWidth: '6rem' }}/>
|
||||
<Column field="callName" header={__('Bando', 'gepafin')}
|
||||
filter sortable
|
||||
filterPlaceholder={__('Cerca', 'gepafin')}
|
||||
@@ -155,7 +164,7 @@ const PreInstructorDomandeTable = () => {
|
||||
<Column header={__('Data ricezione', 'gepafin')} filterField="submissionDate" dataType="date"
|
||||
style={{ minWidth: '8rem' }}
|
||||
body={dateAppliedBodyTemplate} filter filterElement={dateFilterTemplate}/>
|
||||
<Column header={__('Scadenza', 'gepafin')} filterField="callEndDate" dataType="date"
|
||||
<Column header={__('Scadenza', 'gepafin')} filterField="evaluationEndDate" dataType="date"
|
||||
style={{ minWidth: '8rem' }}
|
||||
body={dateEndBodyTemplate} filter filterElement={dateFilterTemplate}/>
|
||||
<Column field="status" header={__('Stato', 'gepafin')}
|
||||
|
||||
@@ -207,35 +207,39 @@ const DomandaBeneficiario = () => {
|
||||
<div className="appPage__content">
|
||||
{data.id
|
||||
? <div className="appPageSection__withBorder columns">
|
||||
<p className="appPageSection__pMeta">
|
||||
<span>{__('ID domanda', 'gepafin')}</span>
|
||||
<span>{data.applicationId}</span>
|
||||
</p>
|
||||
<p className="appPageSection__pMeta">
|
||||
<span>{__('Bando', 'gepafin')}</span>
|
||||
<span>{data.callName}</span>
|
||||
</p>
|
||||
<p className="appPageSection__pMeta">
|
||||
<span>{__('Beneficiario', 'gepafin')}</span>
|
||||
<span>{data.beneficiaryName}</span>
|
||||
</p>
|
||||
<p className="appPageSection__pMeta">
|
||||
<span>{__('Inizio', 'gepafin')}</span>
|
||||
<span>{getDateFromISOstring(data.startDate)}</span>
|
||||
</p>
|
||||
<p className="appPageSection__pMeta">
|
||||
<span>{__('Scadenza', 'gepafin')}</span>
|
||||
<span>{getDateFromISOstring(data.expirationDate)}</span>
|
||||
</p>
|
||||
<p className="appPageSection__pMeta">
|
||||
<span>{__('Stato', 'gepafin')}</span>
|
||||
<span>{getBandoLabel(data.status)}</span>
|
||||
</p>
|
||||
</div> : null}
|
||||
<p className="appPageSection__pMeta">
|
||||
<span>{__('ID domanda', 'gepafin')}</span>
|
||||
<span>{data.applicationId}</span>
|
||||
</p>
|
||||
<p className="appPageSection__pMeta">
|
||||
<span>{__('Bando', 'gepafin')}</span>
|
||||
<span>{data.callName}</span>
|
||||
</p>
|
||||
<p className="appPageSection__pMeta">
|
||||
<span>{__('Beneficiario', 'gepafin')}</span>
|
||||
<span>{data.beneficiaryName}</span>
|
||||
</p>
|
||||
<p className="appPageSection__pMeta">
|
||||
<span>{__('Azienda', 'gepafin')}</span>
|
||||
<span></span>
|
||||
</p>
|
||||
<p className="appPageSection__pMeta">
|
||||
<span>{__('Inizio', 'gepafin')}</span>
|
||||
<span>{getDateFromISOstring(data.startDate)}</span>
|
||||
</p>
|
||||
<p className="appPageSection__pMeta">
|
||||
<span>{__('Scadenza', 'gepafin')}</span>
|
||||
<span>{getDateFromISOstring(data.expirationDate)}</span>
|
||||
</p>
|
||||
<p className="appPageSection__pMeta">
|
||||
<span>{__('Stato', 'gepafin')}</span>
|
||||
<span>{getBandoLabel(data.status)}</span>
|
||||
</p>
|
||||
</div> : null}
|
||||
{dataAppl.id
|
||||
? <div className="appPageSection__withBorder columns">
|
||||
<p className="appPageSection__pMeta">
|
||||
<span>{__('ID domanda', 'gepafin')}</span>
|
||||
<span>{__('ID domanda', 'gepafin')}</span>
|
||||
<span>{dataAppl.id}</span>
|
||||
</p>
|
||||
<p className="appPageSection__pMeta">
|
||||
@@ -289,6 +293,7 @@ const DomandaBeneficiario = () => {
|
||||
errors={errors}
|
||||
defaultValue={formInitialData[o.fieldId] ? formInitialData[o.fieldId] : []}
|
||||
accept={[]}
|
||||
source="AMENDMENT"
|
||||
sourceId={data.applicationId}
|
||||
multiple={true}
|
||||
/>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { isEmpty } from 'ramda';
|
||||
import { wrap } from 'object-path-immutable';
|
||||
@@ -9,24 +9,37 @@ import { Dialog } from 'primereact/dialog';
|
||||
import { InputTextarea } from 'primereact/inputtextarea';
|
||||
import { Dropdown } from 'primereact/dropdown';
|
||||
import { classNames } from 'primereact/utils';
|
||||
import { InputSwitch } from 'primereact/inputswitch';
|
||||
import { InputText } from 'primereact/inputtext';
|
||||
|
||||
const ArchiveDocument = ({ ndg = '', fileId = 0 }) => {
|
||||
import { classificationType, protocolType } from '../../../../configData';
|
||||
import AppointmentService from '../../../../service/appointment-service';
|
||||
import set404FromErrorResponse from '../../../../helpers/set404FromErrorResponse';
|
||||
import { storeSet } from '../../../../store';
|
||||
import { Toast } from 'primereact/toast';
|
||||
|
||||
const ArchiveDocument = ({ applicationId, ndg = '', fileId = 0 }) => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [isVisibleDialog, setIsVisibleDialog] = useState(false);
|
||||
const [modalData, setModalData] = useState({});
|
||||
const [types, setTypes] = useState([]);
|
||||
const [categories, setCategories] = useState([]);
|
||||
const toast = useRef(null);
|
||||
|
||||
const openArchivationModal = () => {
|
||||
setIsVisibleDialog(true);
|
||||
setModalData({
|
||||
description: '',
|
||||
categoryId: 0,
|
||||
descrizione: '',
|
||||
idTipoProtocollo: 0,
|
||||
idClassificazione: 0,
|
||||
flagDaFirmare: false,
|
||||
email: '',
|
||||
fileId
|
||||
});
|
||||
}
|
||||
|
||||
const headerDialog = () => {
|
||||
return <span>{__('Archive document', 'gepafin')}</span>;
|
||||
return <span>{__('Archiviazione del documento', 'gepafin')}</span>;
|
||||
}
|
||||
|
||||
const hideDialog = () => {
|
||||
@@ -50,57 +63,141 @@ const ArchiveDocument = ({ ndg = '', fileId = 0 }) => {
|
||||
}
|
||||
|
||||
const submitData = () => {
|
||||
console.log('submitData', modalData);
|
||||
//setLoading(true);
|
||||
if (
|
||||
modalData.idTipoProtocollo !== 0 && modalData.idClassificazione !== 0
|
||||
&& !isEmpty(modalData.descrizione) && !isEmpty(modalData.email)
|
||||
) {
|
||||
setLoading(true);
|
||||
const submitData = {
|
||||
'input': {
|
||||
'idTipoProtocollo': modalData.idTipoProtocollo,
|
||||
'idClassificazione': modalData.idClassificazione,
|
||||
'flagDaFirmare': modalData.flagDaFirmare,
|
||||
'descrizione': modalData.descrizione,
|
||||
'attributes': {
|
||||
'ndg': ndg,
|
||||
'email': modalData.email
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AppointmentService.archiveDocument(applicationId, fileId, submitData, submitCallback, errSubmitCallback)
|
||||
}
|
||||
}
|
||||
|
||||
const submitCallback = (data) => {
|
||||
if (data.status === 'SUCCESS') {
|
||||
console.log(data.data);
|
||||
}
|
||||
setLoading(false);
|
||||
}
|
||||
|
||||
const errSubmitCallback = (data) => {
|
||||
if (toast.current && data.message) {
|
||||
toast.current.show({
|
||||
severity: 'error',
|
||||
summary: '',
|
||||
detail: data.message
|
||||
});
|
||||
}
|
||||
set404FromErrorResponse(data);
|
||||
setLoading(false);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
setCategories([
|
||||
{value: 1, label: 'Type 1'},
|
||||
{value: 2, label: 'Type 2'},
|
||||
])
|
||||
const newModalData = {
|
||||
...modalData,
|
||||
idClassificazione: 0
|
||||
};
|
||||
setModalData(newModalData);
|
||||
setCategories(classificationType
|
||||
.filter(o => o.idTipoprotocollo === modalData.idTipoProtocollo)
|
||||
.map(o => ({ value: o.idClassificazione, label: o.name })));
|
||||
}, [modalData.idTipoProtocollo])
|
||||
|
||||
useEffect(() => {
|
||||
setTypes(protocolType.map(o => ({ value: o.id, label: o.name })));
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
{!isEmpty(ndg)
|
||||
? <Button icon="pi pi-file-export"
|
||||
rounded
|
||||
onClick={openArchivationModal}
|
||||
outlined
|
||||
severity="info"
|
||||
aria-label={__('Mostra', 'gepafin')}/>
|
||||
: null}
|
||||
<Dialog
|
||||
visible={isVisibleDialog}
|
||||
modal
|
||||
header={headerDialog}
|
||||
footer={footerDialog}
|
||||
style={{ maxWidth: '600px', width: '100%' }}
|
||||
onHide={hideDialog}>
|
||||
<div className="appForm__field">
|
||||
<label className={classNames({ 'p-error': !modalData.categoryId || modalData.categoryId === 0 })}>
|
||||
{__('Classificazione', 'gepafin')}*
|
||||
</label>
|
||||
<Dropdown
|
||||
value={modalData.categoryId}
|
||||
invalid={!modalData.categoryId || modalData.categoryId === 0}
|
||||
onChange={(e) => setValue('categoryId', e.value)}
|
||||
options={categories}/>
|
||||
</div>
|
||||
<div className="appForm__field">
|
||||
<label className={classNames({ 'p-error': isEmpty(modalData.description) })}>
|
||||
{__('Descrizione', 'gepafin')}
|
||||
</label>
|
||||
<InputTextarea
|
||||
value={modalData.description}
|
||||
invalid={isEmpty(modalData.description)}
|
||||
onChange={(e) => setValue('description', e.target.value)}
|
||||
rows={3}
|
||||
cols={30}/>
|
||||
</div>
|
||||
</Dialog>
|
||||
</>
|
||||
return (!isEmpty(ndg)
|
||||
? <>
|
||||
<Toast ref={toast}/>
|
||||
<Button icon="pi pi-file-export"
|
||||
rounded
|
||||
onClick={openArchivationModal}
|
||||
outlined
|
||||
severity="info"
|
||||
aria-label={__('Mostra', 'gepafin')}/>
|
||||
<Dialog
|
||||
visible={isVisibleDialog}
|
||||
modal
|
||||
header={headerDialog}
|
||||
footer={footerDialog}
|
||||
style={{ maxWidth: '600px', width: '100%' }}
|
||||
onHide={hideDialog}>
|
||||
<div className="appForm__field">
|
||||
<label
|
||||
className={classNames({ 'p-error': !modalData.idTipoProtocollo || modalData.idTipoProtocollo === 0 })}>
|
||||
{__('Tipo di protocollo', 'gepafin')}*
|
||||
</label>
|
||||
<Dropdown
|
||||
value={modalData.idTipoProtocollo}
|
||||
invalid={!modalData.idTipoProtocollo || modalData.idTipoProtocollo === 0}
|
||||
onChange={(e) => setValue('idTipoProtocollo', e.value)}
|
||||
options={types}/>
|
||||
</div>
|
||||
<div className="appForm__field">
|
||||
<label
|
||||
className={classNames({ 'p-error': !modalData.idClassificazione || modalData.idClassificazione === 0 })}>
|
||||
{__('Classificazione', 'gepafin')}*
|
||||
</label>
|
||||
<Dropdown
|
||||
value={modalData.idClassificazione}
|
||||
invalid={!modalData.idClassificazione || modalData.idClassificazione === 0}
|
||||
onChange={(e) => setValue('idClassificazione', e.value)}
|
||||
options={categories}/>
|
||||
</div>
|
||||
<div className="appForm__field">
|
||||
<label>
|
||||
{__('Da firmare?', 'gepafin')}
|
||||
</label>
|
||||
<InputSwitch
|
||||
checked={modalData.flagDaFirmare}
|
||||
onChange={(e) => setValue('flagDaFirmare', e.value)}/>
|
||||
</div>
|
||||
<div className="appForm__field">
|
||||
<label className={classNames({ 'p-error': isEmpty(modalData.descrizione) })}>
|
||||
{__('Descrizione', 'gepafin')}*
|
||||
</label>
|
||||
<InputTextarea
|
||||
value={modalData.descrizione}
|
||||
invalid={isEmpty(modalData.descrizione)}
|
||||
onChange={(e) => setValue('descrizione', e.target.value)}
|
||||
rows={3}
|
||||
cols={30}/>
|
||||
</div>
|
||||
<div className="appForm__field">
|
||||
<label>
|
||||
{__('NDG', 'gepafin')}*
|
||||
</label>
|
||||
<InputText
|
||||
value={ndg}
|
||||
disabled
|
||||
onChange={() => {
|
||||
}}/>
|
||||
</div>
|
||||
<div className="appForm__field">
|
||||
<label className={classNames({ 'p-error': isEmpty(modalData.email) })}>
|
||||
{__('Email', 'gepafin')}*
|
||||
</label>
|
||||
<InputText
|
||||
value={modalData.email}
|
||||
keyfilter="email"
|
||||
invalid={isEmpty(modalData.email)}
|
||||
onChange={(e) => setValue('email', e.target.value)}/>
|
||||
</div>
|
||||
</Dialog>
|
||||
</> : null
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
import React, { useState } from 'react';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
|
||||
// tools
|
||||
import set404FromErrorResponse from '../../../../helpers/set404FromErrorResponse';
|
||||
|
||||
// api
|
||||
import ApplicationService from '../../../../service/application-service';
|
||||
|
||||
// components
|
||||
import { Button } from 'primereact/button';
|
||||
|
||||
const DownloadApplicationArchive = ({ applicationId = 0 }) => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const onClickDownload = () => {
|
||||
setLoading(true);
|
||||
ApplicationService.downloadCompleteZip(applicationId, getCompleteZipCallback, errCompleteZipCallback);
|
||||
}
|
||||
|
||||
const getCompleteZipCallback = (data) => {
|
||||
const file = new Blob([data], { type: 'application/zip' });
|
||||
const url = window.URL.createObjectURL(file);
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.setAttribute('download', `application-${applicationId}.zip`);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
link.remove();
|
||||
setLoading(false);
|
||||
}
|
||||
|
||||
const errCompleteZipCallback = (data) => {
|
||||
set404FromErrorResponse(data);
|
||||
setLoading(false);
|
||||
}
|
||||
|
||||
return (applicationId && applicationId !== 0
|
||||
? <Button
|
||||
type="button"
|
||||
disabled={loading}
|
||||
onClick={onClickDownload}
|
||||
label={__('Scarica ZIP', 'gepafin')}
|
||||
icon="pi pi-download"
|
||||
iconPos="right"/> : null
|
||||
)
|
||||
}
|
||||
|
||||
export default DownloadApplicationArchive;
|
||||
@@ -0,0 +1,51 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { isEmpty } from 'ramda';
|
||||
|
||||
// api
|
||||
import CompanyService from '../../../../service/company-service';
|
||||
|
||||
// components
|
||||
import { Button } from 'primereact/button';
|
||||
|
||||
const DownloadCompanyDelegation = ({ applicationId = 0 }) => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [delega, setDelega] = useState({});
|
||||
|
||||
const onClickDownload = () => {
|
||||
if (delega.filePath) {
|
||||
window.open(encodeURI(delega.filePath), '_blank').focus()
|
||||
}
|
||||
}
|
||||
|
||||
const getDellegaCallback = (data) => {
|
||||
if (data.data) {
|
||||
setDelega(data.data);
|
||||
}
|
||||
setLoading(false);
|
||||
}
|
||||
|
||||
const errDellegaCallback = () => {
|
||||
setDelega([]);
|
||||
setLoading(false);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
setLoading(true);
|
||||
CompanyService.getCompanyDelega(getDellegaCallback, errDellegaCallback, [
|
||||
['applicationId', applicationId]
|
||||
]);
|
||||
}, [])
|
||||
|
||||
return (applicationId && applicationId !== 0
|
||||
? <Button
|
||||
type="button"
|
||||
disabled={loading || isEmpty(delega)}
|
||||
onClick={onClickDownload}
|
||||
label={__('Scarica la delega', 'gepafin')}
|
||||
icon="pi pi-download"
|
||||
iconPos="right"/> : null
|
||||
)
|
||||
}
|
||||
|
||||
export default DownloadCompanyDelegation;
|
||||
@@ -0,0 +1,45 @@
|
||||
import React, { useState } from 'react';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
|
||||
// api
|
||||
import ApplicationService from '../../../../service/application-service';
|
||||
|
||||
// components
|
||||
import { Button } from 'primereact/button';
|
||||
|
||||
const DownloadSignedApplication = ({ applicationId = 0 }) => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [, setDocument] = useState({});
|
||||
|
||||
const onClickDownload = () => {
|
||||
setLoading(true);
|
||||
ApplicationService.getApplicationSignedPdf(applicationId, getSignedPdfCallback, errSignedPdfCallbacks);
|
||||
}
|
||||
|
||||
const getSignedPdfCallback = (data) => {
|
||||
if (data.data) {
|
||||
setDocument([data.data]);
|
||||
if (data.data.filePath) {
|
||||
window.open(encodeURI(data.data.filePath), '_blank').focus()
|
||||
}
|
||||
}
|
||||
setLoading(false);
|
||||
}
|
||||
|
||||
const errSignedPdfCallbacks = () => {
|
||||
setDocument([]);
|
||||
setLoading(false);
|
||||
}
|
||||
|
||||
return (applicationId && applicationId !== 0
|
||||
? <Button
|
||||
type="button"
|
||||
disabled={loading}
|
||||
onClick={onClickDownload}
|
||||
label={__('Scarica PDF firmato', 'gepafin')}
|
||||
icon="pi pi-download"
|
||||
iconPos="right"/> : null
|
||||
)
|
||||
}
|
||||
|
||||
export default DownloadSignedApplication;
|
||||
@@ -0,0 +1,72 @@
|
||||
import React from 'react';
|
||||
import { Button } from 'primereact/button';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { isNil } from 'ramda';
|
||||
import ArchiveDocument from '../ArchiveDocument';
|
||||
|
||||
const ListOfFiles = ({ files, updateFn, shouldDisableFieldFn, name, ndg, applicationId }) => {
|
||||
|
||||
return (
|
||||
<ol className="appPageSection__list">
|
||||
{files.map((o, i) => <li key={o.id} className="appPageSection__listItem">
|
||||
<div className="appPageSection__listItemRow">
|
||||
<span>{o.label}</span>
|
||||
<div className="appPageSection__iconActions">
|
||||
{o.fileDetail && 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
|
||||
disabled={shouldDisableFieldFn(name)}
|
||||
severity={!isNil(o.valid) && o.valid ? 'success' : 'secondary'}
|
||||
onClick={() => updateFn(
|
||||
true,
|
||||
[name, i, 'valid']
|
||||
)}
|
||||
aria-label={__('Su', 'gepafin')}/>
|
||||
<Button icon="pi pi-thumbs-down" rounded outlined
|
||||
disabled={shouldDisableFieldFn(name)}
|
||||
severity={!isNil(o.valid) && !o.valid ? 'danger' : 'secondary'}
|
||||
onClick={() => updateFn(
|
||||
false,
|
||||
[name, i, 'valid']
|
||||
)}
|
||||
aria-label={__('Giu', 'gepafin')}/>
|
||||
</div>
|
||||
</div>
|
||||
{o.fileDetail && o.fileDetail.length > 1
|
||||
? <ul style={{
|
||||
width: '100%',
|
||||
paddingLeft: '15px',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
gap: '10px'
|
||||
}}>
|
||||
{o.fileDetail.map((k) => <li key={k.id} style={{
|
||||
display: 'flex',
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'space-between'
|
||||
}}>
|
||||
<span>{k.name}</span>
|
||||
<div className="appPageSection__iconActions">
|
||||
<ArchiveDocument ndg={ndg} applicationId={applicationId} fileId={k.id}/>
|
||||
<Button icon="pi pi-eye" rounded
|
||||
onClick={() => {
|
||||
window.open(k.filePath, '_blank').focus()
|
||||
}}
|
||||
outlined severity="info"
|
||||
aria-label={__('Mostra', 'gepafin')}/>
|
||||
</div>
|
||||
</li>)}
|
||||
</ul>
|
||||
: null}
|
||||
</li>)}
|
||||
</ol>
|
||||
)
|
||||
}
|
||||
|
||||
export default ListOfFiles;
|
||||
@@ -32,6 +32,11 @@ import ArchiveDocument from './components/ArchiveDocument';
|
||||
import { classNames } from 'primereact/utils';
|
||||
import { InputTextarea } from 'primereact/inputtextarea';
|
||||
import { InputText } from 'primereact/inputtext';
|
||||
import DownloadApplicationArchive from './components/DownloadApplicationArchive';
|
||||
import DownloadCompanyDelegation from './components/DownloadCompanyDelegation';
|
||||
import DownloadSignedApplication from './components/DownloadSignedApplication';
|
||||
import AppointmentService from '../../service/appointment-service';
|
||||
import ListOfFiles from './components/ListOfFiles';
|
||||
|
||||
const APP_EVALUATION_FLOW_ID = process.env.REACT_APP_EVALUATION_FLOW_ID;
|
||||
|
||||
@@ -51,6 +56,9 @@ const DomandaEditPreInstructor = () => {
|
||||
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: '',
|
||||
@@ -62,6 +70,22 @@ const DomandaEditPreInstructor = () => {
|
||||
navigate('/domande');
|
||||
}
|
||||
|
||||
const updateFlagsForSoccorso = (data) => {
|
||||
if (data.files) {
|
||||
const nonRatedFiles = data.files
|
||||
.map(el => el.valid)
|
||||
.filter(v => isNil(v));
|
||||
setAllFilesRated(nonRatedFiles.length === 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) {
|
||||
doSaveDraft(`/domande/${id}/soccorso/${connectedSoccorsoId}`)
|
||||
@@ -74,6 +98,7 @@ const DomandaEditPreInstructor = () => {
|
||||
if (data.status === 'SUCCESS') {
|
||||
setData(getFormattedData(data.data));
|
||||
setMotivation(data.data.motivation);
|
||||
updateFlagsForSoccorso(data.data);
|
||||
}
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
}
|
||||
@@ -116,15 +141,16 @@ const DomandaEditPreInstructor = () => {
|
||||
|
||||
const header = renderHeader();
|
||||
|
||||
const updateEvaluationValue = (value, path, maxValue) => {
|
||||
const updateEvaluationValue = (value, path, maxValue = null) => {
|
||||
let finalValue = value;
|
||||
|
||||
if (maxValue || maxValue === 0) {
|
||||
finalValue = value > maxValue ? maxValue : value;
|
||||
}
|
||||
|
||||
const newData = wrap(data).set(path.split('.'), finalValue).value();
|
||||
const newData = wrap(data).set(path, finalValue).value();
|
||||
setData(newData);
|
||||
updateFlagsForSoccorso(newData);
|
||||
}
|
||||
|
||||
const doSaveDraft = (doRedirect = '') => {
|
||||
@@ -134,6 +160,7 @@ const DomandaEditPreInstructor = () => {
|
||||
files: klona(data.files),
|
||||
note: data.note
|
||||
}
|
||||
|
||||
ApplicationEvaluationService.updateEvaluation(
|
||||
data.assignedApplicationId,
|
||||
formData,
|
||||
@@ -241,9 +268,11 @@ const DomandaEditPreInstructor = () => {
|
||||
switch (item.fieldName) {
|
||||
case 'fileupload' :
|
||||
content = <ul>
|
||||
{item.fieldValue.map(o => <li key={o.id}>
|
||||
{o.filePath ? <a href={o.filePath}>{o.name}</a> : null}
|
||||
</li>)}
|
||||
{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' :
|
||||
@@ -255,9 +284,11 @@ const DomandaEditPreInstructor = () => {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{item.fieldValue.map((o, i) => <tr key={i}>
|
||||
{Object.values(o).map(v => <td key={v}>{v}</td>)}
|
||||
</tr>)}
|
||||
{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;
|
||||
@@ -336,7 +367,30 @@ const DomandaEditPreInstructor = () => {
|
||||
}
|
||||
|
||||
const doCheckNDG = () => {
|
||||
// TODO
|
||||
storeSet.main.setAsyncRequest();
|
||||
doSaveDraft();
|
||||
setTimeout(() => {
|
||||
AppointmentService.getNdg(id, getNdgCallback, errGetNdgCallback);
|
||||
}, 100);
|
||||
}
|
||||
|
||||
const getNdgCallback = (data) => {
|
||||
if (data.status === 'SUCCESS') {
|
||||
console.log('data', data.data);
|
||||
}
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
}
|
||||
|
||||
const errGetNdgCallback = (data) => {
|
||||
if (toast.current && data.message) {
|
||||
toast.current.show({
|
||||
severity: 'error',
|
||||
summary: '',
|
||||
detail: data.message
|
||||
});
|
||||
}
|
||||
set404FromErrorResponse(data);
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
}
|
||||
|
||||
const doCreateAppointment = () => {
|
||||
@@ -376,7 +430,7 @@ const DomandaEditPreInstructor = () => {
|
||||
const doCreateAppointmentRequest = () => {
|
||||
if (
|
||||
!isEmpty(appointmentData.title) && !isEmpty(appointmentData.text) && !isEmpty(appointmentData.amount)
|
||||
&& !isEmpty(appointmentData.duration) && appointmentData.duration !== 0 && appointmentData.amount !== 0
|
||||
&& !isEmpty(appointmentData.duration) && appointmentData.duration !== 0 && appointmentData.amount !== 0
|
||||
) {
|
||||
console.log(appointmentData);
|
||||
//setLoading(true);
|
||||
@@ -436,6 +490,18 @@ const DomandaEditPreInstructor = () => {
|
||||
<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>
|
||||
@@ -444,13 +510,21 @@ const DomandaEditPreInstructor = () => {
|
||||
<span>{__('Beneficiario', 'gepafin')}</span>
|
||||
<span>{data.beneficiary}</span>
|
||||
</p>
|
||||
<p className="appPageSection__pMeta">
|
||||
<span>{__('Azienda', '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.callEndDate)}</span>
|
||||
<span>{getDateFromISOstring(data.evaluationEndDate)}</span>
|
||||
</p>
|
||||
<p className="appPageSection__pMeta">
|
||||
<span>{__('Stato', 'gepafin')}</span>
|
||||
@@ -458,7 +532,64 @@ const DomandaEditPreInstructor = () => {
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="appPageSection"></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>{__('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')}
|
||||
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')}
|
||||
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={shouldDisableField}
|
||||
name="files"
|
||||
ndg={data.ndg}
|
||||
applicationId={id}/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="appPageSection">
|
||||
<h2>{__('Punteggi di valutazione', 'gepafin')}</h2>
|
||||
@@ -484,8 +615,8 @@ const DomandaEditPreInstructor = () => {
|
||||
max={o.maxScore}
|
||||
onChange={(e) => updateEvaluationValue(
|
||||
e.value,
|
||||
`criteria.${i}.score`,
|
||||
o.maxScore
|
||||
['criteria', i, 'score'],
|
||||
o.criteria
|
||||
)}/>
|
||||
<span className="p-inputgroup-addon">
|
||||
/ {o.maxScore}
|
||||
@@ -504,7 +635,7 @@ const DomandaEditPreInstructor = () => {
|
||||
severity={!isNil(o.valid) && o.valid ? 'success' : 'secondary'}
|
||||
onClick={() => updateEvaluationValue(
|
||||
true,
|
||||
`criteria.${i}.valid`
|
||||
['criteria', i, 'valid']
|
||||
)}
|
||||
aria-label={__('Su', 'gepafin')}/>
|
||||
<Button icon="pi pi-thumbs-down" rounded outlined
|
||||
@@ -512,7 +643,7 @@ const DomandaEditPreInstructor = () => {
|
||||
severity={!isNil(o.valid) && !o.valid ? 'danger' : 'secondary'}
|
||||
onClick={() => updateEvaluationValue(
|
||||
false,
|
||||
`criteria.${i}.valid`
|
||||
['criteria', i, 'valid']
|
||||
)}
|
||||
aria-label={__('Giu', 'gepafin')}/>
|
||||
</div>
|
||||
@@ -539,104 +670,6 @@ const DomandaEditPreInstructor = () => {
|
||||
</table> : null}
|
||||
</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')}
|
||||
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')}
|
||||
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>
|
||||
<ol className="appPageSection__list">
|
||||
{data.files.map((o, i) => <li key={o.id} className="appPageSection__listItem">
|
||||
<div className="appPageSection__listItemRow">
|
||||
<span>{o.label}</span>
|
||||
<div className="appPageSection__iconActions">
|
||||
{o.fileDetail && 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
|
||||
disabled={shouldDisableField('files')}
|
||||
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
|
||||
disabled={shouldDisableField('files')}
|
||||
severity={!isNil(o.valid) && !o.valid ? 'danger' : 'secondary'}
|
||||
onClick={() => updateEvaluationValue(
|
||||
false,
|
||||
`files.${i}.valid`
|
||||
)}
|
||||
aria-label={__('Giu', 'gepafin')}/>
|
||||
</div>
|
||||
</div>
|
||||
{o.fileDetail && o.fileDetail.length > 1
|
||||
? <ul style={{
|
||||
width: '100%',
|
||||
paddingLeft: '15px',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
gap: '10px'
|
||||
}}>
|
||||
{o.fileDetail.map((k, i) => <li key={k.id} style={{
|
||||
display: 'flex',
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'space-between'
|
||||
}}>
|
||||
<span>{k.name}</span>
|
||||
<div className="appPageSection__iconActions">
|
||||
<ArchiveDocument ndg={data.ndg} fileId={k.id}/>
|
||||
<Button icon="pi pi-eye" rounded
|
||||
onClick={() => window.open(k.filePath, '_blank').focus()}
|
||||
outlined severity="info"
|
||||
aria-label={__('Mostra', 'gepafin')}/>
|
||||
</div>
|
||||
</li>)}
|
||||
</ul>
|
||||
: null}
|
||||
</li>)}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="appPage__spacer"></div>
|
||||
|
||||
<div className="appPageSection__hr">
|
||||
@@ -647,36 +680,36 @@ const DomandaEditPreInstructor = () => {
|
||||
<div className="appPageSection__actions">
|
||||
{['EVALUATION', 'SOCCORSO', 'CLOSE'].includes(data.applicationStatus)
|
||||
? <Button
|
||||
type="button"
|
||||
disabled={!data.id || data.status === 'CLOSE'}
|
||||
onClick={doNewSoccorso}
|
||||
outlined
|
||||
label={<>
|
||||
{data.applicationStatus === 'EVALUATION'
|
||||
? __('Richiedi Soccorso Istruttorio', 'gepafin')
|
||||
: __('Apri Soccorso Istruttorio', 'gepafin')}
|
||||
<i style={{ marginLeft: 7 }}>
|
||||
<HelpIcon/>
|
||||
</i>
|
||||
</>}
|
||||
/> : null}
|
||||
type="button"
|
||||
disabled={!data.id || data.status === 'CLOSE' || !allFilesRated || !atLeastOneChecked}
|
||||
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'}
|
||||
onClick={doSaveDraft}
|
||||
onClick={() => doSaveDraft()}
|
||||
outlined
|
||||
label={__('Salva bozza valutazione', 'gepafin')}
|
||||
icon="pi pi-save" iconPos="right"/>
|
||||
: <Button
|
||||
type="button"
|
||||
onClick={doSaveDraft}
|
||||
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}
|
||||
disabled={!data.id || !allFilesRated || !allChecksChecked}
|
||||
onClick={doCheckNDG}
|
||||
label={__('Controlla NDG', 'gepafin')}
|
||||
/> : null}
|
||||
@@ -748,7 +781,8 @@ const DomandaEditPreInstructor = () => {
|
||||
style={{ maxWidth: '600px', width: '100%' }}
|
||||
onHide={hideAppointmentDialog}>
|
||||
<div className="appForm__field">
|
||||
<label className={classNames({ 'p-error': isEmpty(appointmentData.amount) || appointmentData.amount === 0})}>
|
||||
<label
|
||||
className={classNames({ 'p-error': isEmpty(appointmentData.amount) || appointmentData.amount === 0 })}>
|
||||
{__('Importo', 'gepafin')}
|
||||
</label>
|
||||
<InputNumber
|
||||
@@ -758,13 +792,14 @@ const DomandaEditPreInstructor = () => {
|
||||
onChange={(e) => setValue('amount', e.value)}/>
|
||||
</div>
|
||||
<div className="appForm__field">
|
||||
<label className={classNames({ 'p-error': isEmpty(appointmentData.duration) || appointmentData.duration === 0 })}>
|
||||
<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}
|
||||
invalid={isEmpty(appointmentData.duration) || appointmentData.duration === 0}
|
||||
onChange={(e) => setValue('duration', e.value)}/>
|
||||
</div>
|
||||
<div className="appForm__field">
|
||||
|
||||
@@ -98,9 +98,9 @@ const AllDomandeTable = ({ openDialogFn, updaterString = '' }) => {
|
||||
return formatDate(rowData.submissionDate);
|
||||
};
|
||||
|
||||
const dateEndBodyTemplate = (rowData) => {
|
||||
/*const dateEndBodyTemplate = (rowData) => {
|
||||
return formatDate(rowData.callEndDate);
|
||||
};
|
||||
};*/
|
||||
|
||||
const dateFilterTemplate = (options) => {
|
||||
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
||||
@@ -138,9 +138,11 @@ const AllDomandeTable = ({ openDialogFn, updaterString = '' }) => {
|
||||
emptyMessage={translationStrings.emptyMessage}
|
||||
onFilter={(e) => setFilters(e.filters)}>
|
||||
<Column field="id" header={__('ID domanda', 'gepafin')}
|
||||
sortable
|
||||
filterPlaceholder={__('Cerca', 'gepafin')}
|
||||
style={{ minWidth: '8rem' }}/>
|
||||
sortable filterPlaceholder={__('Cerca', 'gepafin')}
|
||||
style={{ minWidth: '6rem' }}/>
|
||||
<Column field="protocolNumber" header={__('Protocollo', 'gepafin')}
|
||||
sortable filterPlaceholder={__('Cerca', 'gepafin')}
|
||||
style={{ minWidth: '6rem' }}/>
|
||||
<Column field="callTitle" header={__('Bando', 'gepafin')}
|
||||
filter sortable
|
||||
filterPlaceholder={__('Cerca', 'gepafin')}
|
||||
@@ -153,10 +155,10 @@ const AllDomandeTable = ({ openDialogFn, updaterString = '' }) => {
|
||||
filterField="submissionDate" dataType="date"
|
||||
style={{ minWidth: '8rem' }}
|
||||
body={dateAppliedBodyTemplate} filter filterElement={dateFilterTemplate}/>
|
||||
<Column header={__('Scadenza', 'gepafin')}
|
||||
{/*<Column header={__('Scadenza', 'gepafin')}
|
||||
filterField="callEndDate" dataType="date"
|
||||
style={{ minWidth: '8rem' }}
|
||||
body={dateEndBodyTemplate} filter filterElement={dateFilterTemplate}/>
|
||||
body={dateEndBodyTemplate} filter filterElement={dateFilterTemplate}/>*/}
|
||||
<Column field="status" header={__('Stato', 'gepafin')}
|
||||
style={{ minWidth: '8rem' }} body={statusBodyTemplate}/>
|
||||
<Column header={__('Azioni', 'gepafin')}
|
||||
|
||||
@@ -37,7 +37,7 @@ const BeneficiarioDomandeTable = () => {
|
||||
setLocalAsyncRequest(true);
|
||||
ApplicationService.getApplications(getApplCallback, errGetApplCallback, [
|
||||
['companyId', chosenCompanyId],
|
||||
['statuses', ['SOCCORSO', 'APPROVED', 'REJECTED', 'EVALUATION', 'SUBMIT']]
|
||||
['statuses', ['SOCCORSO', 'APPROVED', 'REJECTED', 'EVALUATION', 'SUBMIT']] // 'NDG', 'ADMISSIBLE', 'APPOINTMENT'
|
||||
]);
|
||||
}
|
||||
}, [chosenCompanyId]);
|
||||
@@ -156,8 +156,10 @@ const BeneficiarioDomandeTable = () => {
|
||||
emptyMessage={translationStrings.emptyMessage}
|
||||
onFilter={(e) => setFilters(e.filters)}>
|
||||
<Column field="id" header={__('ID domanda', 'gepafin')}
|
||||
sortable
|
||||
filterPlaceholder={__('Cerca il nome', 'gepafin')}
|
||||
sortable filterPlaceholder={__('Cerca', 'gepafin')}
|
||||
style={{ minWidth: '6rem' }}/>
|
||||
<Column field="protocolNumber" header={__('Protocollo', 'gepafin')}
|
||||
sortable filterPlaceholder={__('Cerca', 'gepafin')}
|
||||
style={{ minWidth: '6rem' }}/>
|
||||
<Column field="callTitle" header={__('Titolo bando', 'gepafin')}
|
||||
filter sortable
|
||||
|
||||
@@ -3,6 +3,7 @@ import { __, sprintf } from '@wordpress/i18n';
|
||||
import { classNames } from 'primereact/utils';
|
||||
import { isEmpty, isNil } from 'ramda';
|
||||
import hotkeys from 'hotkeys-js';
|
||||
import { useSearchParams } from 'react-router-dom';
|
||||
|
||||
// store
|
||||
import { storeSet, useStore } from '../../store';
|
||||
@@ -13,7 +14,6 @@ import AuthenticationService from '../../service/authentication-service';
|
||||
// components
|
||||
import LogoIcon from '../../icons/LogoIcon';
|
||||
import { Messages } from 'primereact/messages';
|
||||
import { useSearchParams } from 'react-router-dom';
|
||||
import { Dialog } from 'primereact/dialog';
|
||||
import { Accordion } from 'primereact/accordion';
|
||||
import { AccordionTab } from 'primereact/accordion';
|
||||
@@ -98,7 +98,9 @@ const Login = () => {
|
||||
}, [isMaintenance])
|
||||
|
||||
useEffect(() => {
|
||||
if (!isEmpty(token)) {
|
||||
const queryParams = Object.fromEntries(searchParams);
|
||||
|
||||
if (!isEmpty(token) && isNil(queryParams.redirectReason)) {
|
||||
window.location.replace('/')
|
||||
}
|
||||
}, [token]);
|
||||
@@ -116,7 +118,7 @@ const Login = () => {
|
||||
/*if ('t7jh5wfg9QXylNaTZkPoE' === APP_HUB_ID) {
|
||||
setIsMaintenance(true);
|
||||
}*/
|
||||
hotkeys('command+x', function(event, handler){
|
||||
hotkeys('command+x,ctrl+x', function(event, handler){
|
||||
window.location.replace('/loginadmin')
|
||||
});
|
||||
}, []);
|
||||
|
||||
@@ -341,7 +341,9 @@ const ProfileCompany = () => {
|
||||
useEffect(() => {
|
||||
if (formInitialData.id) {
|
||||
storeSet.main.setAsyncRequest();
|
||||
CompanyService.getCompanyDelega(formInitialData.id, getDellegaCallback, errDellegaCallback);
|
||||
CompanyService.getCompanyDelega(getDellegaCallback, errDellegaCallback, [
|
||||
['companyId', formInitialData.id]
|
||||
]);
|
||||
}
|
||||
}, [formInitialData])
|
||||
|
||||
|
||||
@@ -407,6 +407,7 @@ const SoccorsoEditPreInstructor = () => {
|
||||
errors={errors}
|
||||
defaultValue={formInitialData[o.fieldId] ? formInitialData[o.fieldId] : []}
|
||||
accept={[]}
|
||||
source="AMENDMENT"
|
||||
sourceId={data.applicationId}
|
||||
multiple={true}
|
||||
/>
|
||||
|
||||
@@ -54,7 +54,7 @@ const PreInstructorSoccorsiTable = ({ openDialogFn }) => {
|
||||
const getFormattedData = (data) => {
|
||||
return data.map((d) => {
|
||||
d.startDate = is(String, d.startDate) ? new Date(d.startDate) : (d.startDate ? d.startDate : '');
|
||||
d.expirationDate = is(String, d.expirationDate) ? new Date(d.expirationDate) : (d.expirationDate ? d.expirationDate : '');
|
||||
d.evaluationEndDate = is(String, d.evaluationEndDate) ? new Date(d.evaluationEndDate) : (d.evaluationEndDate ? d.evaluationEndDate : '');
|
||||
return d;
|
||||
});
|
||||
};
|
||||
@@ -86,7 +86,7 @@ const PreInstructorSoccorsiTable = ({ openDialogFn }) => {
|
||||
operator: FilterOperator.AND,
|
||||
constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }]
|
||||
},
|
||||
expirationDate: {
|
||||
evaluationEndDate: {
|
||||
operator: FilterOperator.AND,
|
||||
constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }]
|
||||
}
|
||||
@@ -106,7 +106,7 @@ const PreInstructorSoccorsiTable = ({ openDialogFn }) => {
|
||||
};
|
||||
|
||||
const dateExpirationBodyTemplate = (rowData) => {
|
||||
return rowData.expirationDate ? formatDate(rowData.expirationDate) : '';
|
||||
return rowData.evaluationEndDate ? formatDate(rowData.evaluationEndDate) : '';
|
||||
};
|
||||
|
||||
const dateFilterTemplate = (options) => {
|
||||
@@ -141,7 +141,10 @@ const PreInstructorSoccorsiTable = ({ openDialogFn }) => {
|
||||
emptyMessage={translationStrings.emptyMessage}
|
||||
onFilter={(e) => setFilters(e.filters)}>
|
||||
<Column field="applicationId" header={__('ID domanda', 'gepafin')}
|
||||
filter filterPlaceholder={__('Cerca', 'gepafin')}
|
||||
sortable filterPlaceholder={__('Cerca', 'gepafin')}
|
||||
style={{ minWidth: '6rem' }}/>
|
||||
<Column field="protocolNumber" header={__('Protocollo', 'gepafin')}
|
||||
sortable filterPlaceholder={__('Cerca', 'gepafin')}
|
||||
style={{ minWidth: '6rem' }}/>
|
||||
<Column field="callName" header={__('Bando', 'gepafin')}
|
||||
filter filterPlaceholder={__('Cerca', 'gepafin')}
|
||||
@@ -154,7 +157,7 @@ const PreInstructorSoccorsiTable = ({ openDialogFn }) => {
|
||||
style={{ minWidth: '8rem' }}
|
||||
body={dateStartBodyTemplate} filter filterElement={dateFilterTemplate}/>
|
||||
<Column header={__('Scadenza', 'gepafin')}
|
||||
filterField="expirationDate" dataType="date"
|
||||
filterField="evaluationEndDate" dataType="date"
|
||||
style={{ minWidth: '8rem' }}
|
||||
body={dateExpirationBodyTemplate} filter filterElement={dateFilterTemplate}/>
|
||||
<Column field="status" header={__('Stato', 'gepafin')}
|
||||
|
||||
Reference in New Issue
Block a user