- updated contract functionality;

This commit is contained in:
Vitalii Kiiko
2025-11-06 12:25:29 +01:00
parent b929f4def1
commit afaa750f43
8 changed files with 45 additions and 28 deletions

View File

@@ -132,7 +132,7 @@ const DashboardBeneficiario = () => {
const getUploadApplicationContractCallback = (data) => {
if (data.status === 'SUCCESS') {
//setData(getFormattedData(data.data));
setContractsData(null);
if (toast.current && data.message) {
toast.current.show({
severity: 'success',
@@ -185,7 +185,7 @@ const DashboardBeneficiario = () => {
<div style={{ display: 'flex', flexDirection: 'column', gap: 10, width: '100%' }}>
<div style={{ display: 'flex', gap: 10 }}>
<i className="pi pi-info-circle"></i>
<span className="summary">{__('You must upload contract for applications:', 'gepafin')}</span>
<span className="summary">{__('Contratti in attesa:', 'gepafin')}</span>
</div>
<ul>
{contractsData.map(o => <li key={o.id}>
@@ -313,7 +313,7 @@ const DashboardBeneficiario = () => {
style={{ maxWidth: '600px', width: '100%' }}
onHide={hideContractDialog}>
<div className="appForm__field">
<p>The administration requires you to download these documents:</p>
<p>Scarica il contratto:</p>
<ul>
{contractFormData?.instructorDocuments
? contractFormData.instructorDocuments.map(o => <li key={o.id}>
@@ -321,18 +321,18 @@ const DashboardBeneficiario = () => {
</li>)
: null}
</ul>
<p>Sign them digitally and upload them back in the form below:</p>
<p>Firmalo digitalmente e ricaricalo</p>
</div>
<div className="appForm__field">
<label
className={classNames({ 'p-error': !contractFormData.files || isEmpty(contractFormData.files) })}>
{__('Files', 'gepafin')}*
{__('Files', 'gepafin')}* (p7m)
</label>
<FileUpload
ref={contractFormFilesRef}
name="files[]"
multiple
accept={mimeTypes.map(o => o.code).join(',')}
accept='.p7m,application/pkcs7-mime,application/x-pkcs7-mime'
maxFileSize={defaultMaxFileSize}
auto={false}
customUpload={true}

View File

@@ -23,7 +23,7 @@ import MyLatestSubmissionsTableAsync from '../DashboardBeneficiario/components/M
import LatestBandiBeneficiarioTableAsync from '../DashboardBeneficiario/components/LatestBandiBeneficiarioTableAsync';
import { classNames } from 'primereact/utils';
import { FileUpload } from 'primereact/fileupload';
import { defaultMaxFileSize, mimeTypes } from '../../configData';
import { defaultMaxFileSize } from '../../configData';
import { Dialog } from 'primereact/dialog';
import { Toast } from 'primereact/toast';
@@ -185,7 +185,7 @@ const DashboardBeneficiarioConfidi = () => {
<div style={{ display: 'flex', flexDirection: 'column', gap: 10, width: '100%' }}>
<div style={{ display: 'flex', gap: 10 }}>
<i className="pi pi-info-circle"></i>
<span className="summary">{__('You must upload contract for applications:', 'gepafin')}</span>
<span className="summary">{__('Contratti in attesa:', 'gepafin')}</span>
</div>
<ul>
{contractsData.map(o => <li key={o.id}>
@@ -313,7 +313,7 @@ const DashboardBeneficiarioConfidi = () => {
style={{ maxWidth: '600px', width: '100%' }}
onHide={hideContractDialog}>
<div className="appForm__field">
<p>The administration requires you to download these documents:</p>
<p>Scarica il contratto:</p>
<ul>
{contractFormData?.instructorDocuments
? contractFormData.instructorDocuments.map(o => <li key={o.id}>
@@ -321,18 +321,18 @@ const DashboardBeneficiarioConfidi = () => {
</li>)
: null}
</ul>
<p>Sign them digitally and upload them back in the form below:</p>
<p>Firmalo digitalmente e ricaricalo</p>
</div>
<div className="appForm__field">
<label
className={classNames({ 'p-error': !contractFormData.files || isEmpty(contractFormData.files) })}>
{__('Files', 'gepafin')}*
{__('Files', 'gepafin')}* (p7m)
</label>
<FileUpload
ref={contractFormFilesRef}
name="files[]"
multiple
accept={mimeTypes.map(o => o.code).join(',')}
accept='.p7m,application/pkcs7-mime,application/x-pkcs7-mime'
maxFileSize={defaultMaxFileSize}
auto={false}
customUpload={true}

View File

@@ -31,9 +31,15 @@ import SoccorsoResendEmails from '../../../SoccorsoEditPreInstructor/components/
const APP_HUB_ID = process.env.REACT_APP_HUB_ID;
const DomandeTablePreInstructorAsync = ({ userId = null, statuses = [],
applicationStatuses = ['EVALUATION', 'SOCCORSO', 'NDG', 'APPOINTMENT', 'ADMISSIBLE',
'AWAITING_TECHNICAL_EVALUATION', 'TECHNICAL_EVALUATION']}) => {
const DomandeTablePreInstructorAsync = ({
userId = null,
statuses = [],
applicationStatuses = [
'EVALUATION', 'SOCCORSO', 'NDG', 'APPOINTMENT', 'ADMISSIBLE',
'AWAITING_TECHNICAL_EVALUATION', 'TECHNICAL_EVALUATION',
'AWAITING_CONTRACT', 'CONTRACT_SIGNED'
]
}) => {
const navigate = useNavigate();
const userData = useStoreValue('userData');
const [localAsyncRequest, setLocalAsyncRequest] = useState(false);
@@ -244,7 +250,7 @@ const DomandeTablePreInstructorAsync = ({ userId = null, statuses = [],
AssignedApplicationService.assignApplicationPaginated(paginationQuery, getCallback, errGetCallbacks);
}
}, [lazyState]);
return (
<div className="appPageSection__table">
<DataTable
@@ -300,7 +306,7 @@ const DomandeTablePreInstructorAsync = ({ userId = null, statuses = [],
<Column field="assignedUserName" header={__('Assegnato', 'gepafin')}
filterField="assignedUserName" filter
filterMatchModeOptions={translationStrings.textFilterOptions}
style={{ minWidth: '8rem' }}/>
style={{ minWidth: '8rem' }}/>
<Column field="applicationStatus" header={__('Stato', 'gepafin')}
style={{ minWidth: '7rem' }} body={statusBodyTemplate}
filter

View File

@@ -1078,7 +1078,11 @@ const DomandaEditInstructorManager = () => {
const getUploadApplicationContractCallback = (data) => {
if (data.status === 'SUCCESS') {
//setData(getFormattedData(data.data));
setData((prev) => ({
...prev,
applicationStatus: 'AWAITING_CONTRACT',
contract: data.data
}));
if (toast.current && data.message) {
toast.current.show({
severity: 'success',

View File

@@ -1078,7 +1078,11 @@ const DomandaEditPreInstructor = () => {
const getUploadApplicationContractCallback = (data) => {
if (data.status === 'SUCCESS') {
//setData(getFormattedData(data.data));
setData((prev) => ({
...prev,
applicationStatus: 'AWAITING_CONTRACT',
contract: data.data
}));
if (toast.current && data.message) {
toast.current.show({
severity: 'success',

View File

@@ -44,7 +44,7 @@ const AllDomandeBeneficiarioTableAsync = ({ statuses }) => {
companyName: { value: null, matchMode: 'contains' },
submissionDate: { value: null, matchMode: 'dateIs' },
assignedUserName: { value: null, matchMode: 'equals' },
status: { value: null, matchMode: 'equals' }
applicationStatus: { value: null, matchMode: 'equals' }
}
});
@@ -122,13 +122,14 @@ const AllDomandeBeneficiarioTableAsync = ({ statuses }) => {
options.filterCallback(e.value, options.index)
const filters = { ...lazyState.filters };
if (e.value) {
filters['status'] = { value: e.value, matchMode: 'equals' };
filters['applicationStatus'] = { value: e.value, matchMode: 'equals' };
} else {
delete filters['status'];
delete filters['applicationStatus'];
}
setLazyState({ ...lazyState, filters, first: 0 });
}}
itemTemplate={statusItemTemplate} placeholder={translationStrings.selectOneLabel} className="p-column-filter"/>;
itemTemplate={statusItemTemplate} placeholder={translationStrings.selectOneLabel}
className="p-column-filter"/>;
};
const dateFilterTemplate = (options) => {
@@ -182,7 +183,7 @@ const AllDomandeBeneficiarioTableAsync = ({ statuses }) => {
filterMatchModeOptions={translationStrings.dateFilterOptions}
style={{ minWidth: '8rem' }}
body={dateAppliedBodyTemplate}/>
<Column field="status" header={__('Stato', 'gepafin')}
<Column field="applicationStatus" header={__('Stato', 'gepafin')}
filterElement={statusFilterTemplate} filter
filterMatchModeOptions={translationStrings.statusFilterOptions}
style={{ minWidth: '8rem' }}

View File

@@ -23,8 +23,10 @@ const DomandeBeneficiario = () => {
<div className="appPage__spacer"></div>
<div className="appPageSection">
<AllDomandeBeneficiarioTableAsync statuses={['SOCCORSO', 'APPROVED', 'REJECTED', 'EVALUATION', 'SUBMIT',
'APPOINTMENT', 'NDG', 'ADMISSIBLE', 'AWAITING_TECHNICAL_EVALUATION', 'TECHNICAL_EVALUATION']}/>
<AllDomandeBeneficiarioTableAsync
statuses={['SOCCORSO', 'APPROVED', 'REJECTED', 'EVALUATION', 'SUBMIT',
'APPOINTMENT', 'NDG', 'ADMISSIBLE', 'AWAITING_TECHNICAL_EVALUATION', 'TECHNICAL_EVALUATION',
'AWAITING_CONTRACT', 'CONTRACT_SIGNED']}/>
</div>
</div>
)