- added archiving of signed application PDF;
This commit is contained in:
@@ -60,6 +60,7 @@ import { SplitButton } from 'primereact/splitbutton';
|
|||||||
import { FileUpload } from 'primereact/fileupload';
|
import { FileUpload } from 'primereact/fileupload';
|
||||||
import { defaultMaxFileSize, mimeTypes, rejectionReasons } from '../../configData';
|
import { defaultMaxFileSize, mimeTypes, rejectionReasons } from '../../configData';
|
||||||
import getFormatedFileSizeText from '../../helpers/getFormatedFileSizeText';
|
import getFormatedFileSizeText from '../../helpers/getFormatedFileSizeText';
|
||||||
|
import ArchiveDocument from '../DomandaEditPreInstructor/components/ArchiveDocument';
|
||||||
|
|
||||||
const APP_EVALUATION_FLOW_ID = process.env.REACT_APP_EVALUATION_FLOW_ID;
|
const APP_EVALUATION_FLOW_ID = process.env.REACT_APP_EVALUATION_FLOW_ID;
|
||||||
const APP_HUB_ID = process.env.REACT_APP_HUB_ID;
|
const APP_HUB_ID = process.env.REACT_APP_HUB_ID;
|
||||||
@@ -225,7 +226,7 @@ const DomandaEditInstructorManager = () => {
|
|||||||
const getCallback = (resp) => {
|
const getCallback = (resp) => {
|
||||||
if (resp.status === 'SUCCESS') {
|
if (resp.status === 'SUCCESS') {
|
||||||
setData(getFormattedData(resp.data));
|
setData(getFormattedData(resp.data));
|
||||||
setFinalDialogData((prev) => ({...prev, motivation: resp.data.motivation}));
|
setFinalDialogData((prev) => ({ ...prev, motivation: resp.data.motivation }));
|
||||||
updateFlagsForSoccorso(resp.data);
|
updateFlagsForSoccorso(resp.data);
|
||||||
|
|
||||||
if (resp.data.evaluationVersion === 'V2') {
|
if (resp.data.evaluationVersion === 'V2') {
|
||||||
@@ -1167,7 +1168,7 @@ const DomandaEditInstructorManager = () => {
|
|||||||
? <div className="appPageSection__message info">
|
? <div className="appPageSection__message info">
|
||||||
<i className="pi pi-info-circle"></i>
|
<i className="pi pi-info-circle"></i>
|
||||||
<span className="summary">{__('Motivazione:', 'gepafin')}</span>
|
<span className="summary">{__('Motivazione:', 'gepafin')}</span>
|
||||||
<div style={{display: 'flex', flexDirection: 'column', gap: 10}}>
|
<div style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>
|
||||||
<span>{renderHtmlContent(data.motivation)}</span>
|
<span>{renderHtmlContent(data.motivation)}</span>
|
||||||
{rejectionFiles()}
|
{rejectionFiles()}
|
||||||
</div>
|
</div>
|
||||||
@@ -1329,6 +1330,31 @@ const DomandaEditInstructorManager = () => {
|
|||||||
|
|
||||||
{data.evaluationVersion === 'V2'
|
{data.evaluationVersion === 'V2'
|
||||||
? <div className="appPageSection">
|
? <div className="appPageSection">
|
||||||
|
<h2>{__('Domanda PDF firmato', 'gepafin')}</h2>
|
||||||
|
{data.signedDocument && !isEmpty(data.signedDocument)
|
||||||
|
? <ol className="appPageSection__list">
|
||||||
|
<li className="appPageSection__listItem">
|
||||||
|
<div className="appPageSection__listItemRow">
|
||||||
|
<div>{renderHtmlContent(data.signedDocument.fileName)}</div>
|
||||||
|
<div className="appPageSection__iconActions">
|
||||||
|
<ArchiveDocument
|
||||||
|
ndg={data.ndg}
|
||||||
|
applicationId={id}
|
||||||
|
fileDescr={renderHtmlContent(data.signedDocument.fileName)}
|
||||||
|
fileId={data.signedDocument.id}
|
||||||
|
updateFn={(attachId) => {
|
||||||
|
setData((prev) => ({
|
||||||
|
...prev,
|
||||||
|
documentAttachmentId: attachId
|
||||||
|
}));
|
||||||
|
}}
|
||||||
|
isSignedDocument={true}
|
||||||
|
docAttachmentId={data.signedDocument.documentAttachmentId}/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
: <p>{__('Nessun documento firmato', 'gepafin')}</p>}
|
||||||
<h2>{__('Documenti allegati', 'gepafin')}</h2>
|
<h2>{__('Documenti allegati', 'gepafin')}</h2>
|
||||||
{!isEmpty(data.files)
|
{!isEmpty(data.files)
|
||||||
? <ListOfFiles
|
? <ListOfFiles
|
||||||
@@ -1441,6 +1467,31 @@ const DomandaEditInstructorManager = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
<h3>{__('Domanda PDF firmato', 'gepafin')}</h3>
|
||||||
|
{data.signedDocument && !isEmpty(data.signedDocument)
|
||||||
|
? <ol className="appPageSection__list">
|
||||||
|
<li className="appPageSection__listItem">
|
||||||
|
<div className="appPageSection__listItemRow">
|
||||||
|
<div>{renderHtmlContent(data.signedDocument.fileName)}</div>
|
||||||
|
<div className="appPageSection__iconActions">
|
||||||
|
<ArchiveDocument
|
||||||
|
ndg={data.ndg}
|
||||||
|
applicationId={id}
|
||||||
|
fileDescr={renderHtmlContent(data.signedDocument.fileName)}
|
||||||
|
fileId={data.signedDocument.id}
|
||||||
|
updateFn={(attachId) => {
|
||||||
|
setData((prev) => ({
|
||||||
|
...prev,
|
||||||
|
documentAttachmentId: attachId
|
||||||
|
}));
|
||||||
|
}}
|
||||||
|
isSignedDocument={true}
|
||||||
|
docAttachmentId={data.signedDocument.documentAttachmentId}/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
: <p>{__('Nessun documento firmato', 'gepafin')}</p>}
|
||||||
<h3>{__('Documenti allegati', 'gepafin')}</h3>
|
<h3>{__('Documenti allegati', 'gepafin')}</h3>
|
||||||
{!isEmpty(data.files)
|
{!isEmpty(data.files)
|
||||||
? <ListOfFiles
|
? <ListOfFiles
|
||||||
@@ -1592,7 +1643,8 @@ const DomandaEditInstructorManager = () => {
|
|||||||
</div> : null}
|
</div> : null}
|
||||||
{operationType === 'reject' && APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE'
|
{operationType === 'reject' && APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE'
|
||||||
? <div className="appForm__field">
|
? <div className="appForm__field">
|
||||||
<label className={classNames({ 'p-error': !finalDialogData.reason || isEmpty(finalDialogData.reason) })}>
|
<label
|
||||||
|
className={classNames({ 'p-error': !finalDialogData.reason || isEmpty(finalDialogData.reason) })}>
|
||||||
{__('Oggetto', 'gepafin')}
|
{__('Oggetto', 'gepafin')}
|
||||||
</label>
|
</label>
|
||||||
<Dropdown
|
<Dropdown
|
||||||
@@ -1619,7 +1671,8 @@ const DomandaEditInstructorManager = () => {
|
|||||||
style={{ width: '100%' }}/>
|
style={{ width: '100%' }}/>
|
||||||
</div> : null}
|
</div> : null}
|
||||||
<div className="appForm__field">
|
<div className="appForm__field">
|
||||||
<label className={classNames({ 'p-error': !finalDialogData.motivation || isEmpty(finalDialogData.motivation) })}>
|
<label
|
||||||
|
className={classNames({ 'p-error': !finalDialogData.motivation || isEmpty(finalDialogData.motivation) })}>
|
||||||
{__('Motivazione', 'gepafin')}
|
{__('Motivazione', 'gepafin')}
|
||||||
</label>
|
</label>
|
||||||
<div translate="no">
|
<div translate="no">
|
||||||
@@ -1666,13 +1719,19 @@ const DomandaEditInstructorManager = () => {
|
|||||||
icon: 'pi pi-plus'
|
icon: 'pi pi-plus'
|
||||||
}}
|
}}
|
||||||
itemTemplate={(file, props) => {
|
itemTemplate={(file, props) => {
|
||||||
return(
|
return (
|
||||||
<div className="p-fileupload-row" data-pc-section="file">
|
<div className="p-fileupload-row" data-pc-section="file">
|
||||||
<div data-pc-section="details" style={{display: 'flex', flexDirection: 'column', gap: '10px', textAlign: 'left'}}>
|
<div data-pc-section="details" style={{
|
||||||
|
display: 'flex',
|
||||||
|
flexDirection: 'column',
|
||||||
|
gap: '10px',
|
||||||
|
textAlign: 'left'
|
||||||
|
}}>
|
||||||
<div className="p-fileupload-filename" data-pc-section="filename">
|
<div className="p-fileupload-filename" data-pc-section="filename">
|
||||||
{file.name}
|
{file.name}
|
||||||
</div>
|
</div>
|
||||||
<span data-pc-section="filesize">{getFormatedFileSizeText(file.size)}</span>
|
<span
|
||||||
|
data-pc-section="filesize">{getFormatedFileSizeText(file.size)}</span>
|
||||||
</div>
|
</div>
|
||||||
<div data-pc-section="actions">
|
<div data-pc-section="actions">
|
||||||
<Button
|
<Button
|
||||||
@@ -1751,8 +1810,10 @@ const DomandaEditInstructorManager = () => {
|
|||||||
onHide={hidePreTecEvalDialog}>
|
onHide={hidePreTecEvalDialog}>
|
||||||
<div className="appForm__field">
|
<div className="appForm__field">
|
||||||
<label
|
<label
|
||||||
className={classNames({ 'p-error': isEmpty(preTecEvalData.amount)
|
className={classNames({
|
||||||
|| isNaN(parseFloat(preTecEvalData.amount)) || parseFloat(preTecEvalData.amount) <= 0 })}>
|
'p-error': isEmpty(preTecEvalData.amount)
|
||||||
|
|| isNaN(parseFloat(preTecEvalData.amount)) || parseFloat(preTecEvalData.amount) <= 0
|
||||||
|
})}>
|
||||||
{__('Importo', 'gepafin')}
|
{__('Importo', 'gepafin')}
|
||||||
</label>
|
</label>
|
||||||
<InputNumber
|
<InputNumber
|
||||||
|
|||||||
@@ -28,7 +28,8 @@ const ArchiveDocument = ({
|
|||||||
fileId = 0,
|
fileId = 0,
|
||||||
fileDescr = '',
|
fileDescr = '',
|
||||||
docAttachmentId = null,
|
docAttachmentId = null,
|
||||||
updateFn = () => {}
|
updateFn = () => {},
|
||||||
|
isSignedDocument = false
|
||||||
}) => {
|
}) => {
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [isVisibleDialog, setIsVisibleDialog] = useState(false);
|
const [isVisibleDialog, setIsVisibleDialog] = useState(false);
|
||||||
@@ -93,7 +94,9 @@ const ArchiveDocument = ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AppointmentService.archiveDocument(applicationId, fileId, submitData, submitCallback, errSubmitCallback)
|
AppointmentService.archiveDocument(applicationId, fileId, submitData, submitCallback, errSubmitCallback, [
|
||||||
|
['isSignedDocument', isSignedDocument]
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ import { SplitButton } from 'primereact/splitbutton';
|
|||||||
import { FileUpload } from 'primereact/fileupload';
|
import { FileUpload } from 'primereact/fileupload';
|
||||||
import { defaultMaxFileSize, mimeTypes, rejectionReasons } from '../../configData';
|
import { defaultMaxFileSize, mimeTypes, rejectionReasons } from '../../configData';
|
||||||
import getFormatedFileSizeText from '../../helpers/getFormatedFileSizeText';
|
import getFormatedFileSizeText from '../../helpers/getFormatedFileSizeText';
|
||||||
|
import ArchiveDocument from './components/ArchiveDocument';
|
||||||
|
|
||||||
const APP_EVALUATION_FLOW_ID = process.env.REACT_APP_EVALUATION_FLOW_ID;
|
const APP_EVALUATION_FLOW_ID = process.env.REACT_APP_EVALUATION_FLOW_ID;
|
||||||
const APP_HUB_ID = process.env.REACT_APP_HUB_ID;
|
const APP_HUB_ID = process.env.REACT_APP_HUB_ID;
|
||||||
@@ -225,7 +226,7 @@ const DomandaEditPreInstructor = () => {
|
|||||||
const getCallback = (resp) => {
|
const getCallback = (resp) => {
|
||||||
if (resp.status === 'SUCCESS') {
|
if (resp.status === 'SUCCESS') {
|
||||||
setData(getFormattedData(resp.data));
|
setData(getFormattedData(resp.data));
|
||||||
setFinalDialogData((prev) => ({...prev, motivation: resp.data.motivation}));
|
setFinalDialogData((prev) => ({ ...prev, motivation: resp.data.motivation }));
|
||||||
updateFlagsForSoccorso(resp.data);
|
updateFlagsForSoccorso(resp.data);
|
||||||
|
|
||||||
if (resp.data.evaluationVersion === 'V2') {
|
if (resp.data.evaluationVersion === 'V2') {
|
||||||
@@ -1167,7 +1168,7 @@ const DomandaEditPreInstructor = () => {
|
|||||||
? <div className="appPageSection__message info">
|
? <div className="appPageSection__message info">
|
||||||
<i className="pi pi-info-circle"></i>
|
<i className="pi pi-info-circle"></i>
|
||||||
<span className="summary">{__('Motivazione:', 'gepafin')}</span>
|
<span className="summary">{__('Motivazione:', 'gepafin')}</span>
|
||||||
<div style={{display: 'flex', flexDirection: 'column', gap: 10}}>
|
<div style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>
|
||||||
<span>{renderHtmlContent(data.motivation)}</span>
|
<span>{renderHtmlContent(data.motivation)}</span>
|
||||||
{rejectionFiles()}
|
{rejectionFiles()}
|
||||||
</div>
|
</div>
|
||||||
@@ -1329,6 +1330,31 @@ const DomandaEditPreInstructor = () => {
|
|||||||
|
|
||||||
{data.evaluationVersion === 'V2'
|
{data.evaluationVersion === 'V2'
|
||||||
? <div className="appPageSection">
|
? <div className="appPageSection">
|
||||||
|
<h2>{__('Domanda PDF firmato', 'gepafin')}</h2>
|
||||||
|
{data.signedDocument && !isEmpty(data.signedDocument)
|
||||||
|
? <ol className="appPageSection__list">
|
||||||
|
<li className="appPageSection__listItem">
|
||||||
|
<div className="appPageSection__listItemRow">
|
||||||
|
<div>{renderHtmlContent(data.signedDocument.fileName)}</div>
|
||||||
|
<div className="appPageSection__iconActions">
|
||||||
|
<ArchiveDocument
|
||||||
|
ndg={data.ndg}
|
||||||
|
applicationId={id}
|
||||||
|
fileDescr={renderHtmlContent(data.signedDocument.fileName)}
|
||||||
|
fileId={data.signedDocument.id}
|
||||||
|
updateFn={(attachId) => {
|
||||||
|
setData((prev) => ({
|
||||||
|
...prev,
|
||||||
|
documentAttachmentId: attachId
|
||||||
|
}));
|
||||||
|
}}
|
||||||
|
isSignedDocument={true}
|
||||||
|
docAttachmentId={data.signedDocument.documentAttachmentId}/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
: <p>{__('Nessun documento firmato', 'gepafin')}</p>}
|
||||||
<h2>{__('Documenti allegati', 'gepafin')}</h2>
|
<h2>{__('Documenti allegati', 'gepafin')}</h2>
|
||||||
{!isEmpty(data.files)
|
{!isEmpty(data.files)
|
||||||
? <ListOfFiles
|
? <ListOfFiles
|
||||||
@@ -1441,6 +1467,31 @@ const DomandaEditPreInstructor = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
<h3>{__('Domanda PDF firmato', 'gepafin')}</h3>
|
||||||
|
{data.signedDocument && !isEmpty(data.signedDocument)
|
||||||
|
? <ol className="appPageSection__list">
|
||||||
|
<li className="appPageSection__listItem">
|
||||||
|
<div className="appPageSection__listItemRow">
|
||||||
|
<div>{renderHtmlContent(data.signedDocument.fileName)}</div>
|
||||||
|
<div className="appPageSection__iconActions">
|
||||||
|
<ArchiveDocument
|
||||||
|
ndg={data.ndg}
|
||||||
|
applicationId={id}
|
||||||
|
fileDescr={renderHtmlContent(data.signedDocument.fileName)}
|
||||||
|
fileId={data.signedDocument.id}
|
||||||
|
updateFn={(attachId) => {
|
||||||
|
setData((prev) => ({
|
||||||
|
...prev,
|
||||||
|
documentAttachmentId: attachId
|
||||||
|
}));
|
||||||
|
}}
|
||||||
|
isSignedDocument={true}
|
||||||
|
docAttachmentId={data.signedDocument.documentAttachmentId}/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
: <p>{__('Nessun documento firmato', 'gepafin')}</p>}
|
||||||
<h3>{__('Documenti allegati', 'gepafin')}</h3>
|
<h3>{__('Documenti allegati', 'gepafin')}</h3>
|
||||||
{!isEmpty(data.files)
|
{!isEmpty(data.files)
|
||||||
? <ListOfFiles
|
? <ListOfFiles
|
||||||
@@ -1592,7 +1643,8 @@ const DomandaEditPreInstructor = () => {
|
|||||||
</div> : null}
|
</div> : null}
|
||||||
{operationType === 'reject' && APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE'
|
{operationType === 'reject' && APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE'
|
||||||
? <div className="appForm__field">
|
? <div className="appForm__field">
|
||||||
<label className={classNames({ 'p-error': !finalDialogData.reason || isEmpty(finalDialogData.reason) })}>
|
<label
|
||||||
|
className={classNames({ 'p-error': !finalDialogData.reason || isEmpty(finalDialogData.reason) })}>
|
||||||
{__('Oggetto', 'gepafin')}
|
{__('Oggetto', 'gepafin')}
|
||||||
</label>
|
</label>
|
||||||
<Dropdown
|
<Dropdown
|
||||||
@@ -1619,7 +1671,8 @@ const DomandaEditPreInstructor = () => {
|
|||||||
style={{ width: '100%' }}/>
|
style={{ width: '100%' }}/>
|
||||||
</div> : null}
|
</div> : null}
|
||||||
<div className="appForm__field">
|
<div className="appForm__field">
|
||||||
<label className={classNames({ 'p-error': !finalDialogData.motivation || isEmpty(finalDialogData.motivation) })}>
|
<label
|
||||||
|
className={classNames({ 'p-error': !finalDialogData.motivation || isEmpty(finalDialogData.motivation) })}>
|
||||||
{__('Motivazione', 'gepafin')}
|
{__('Motivazione', 'gepafin')}
|
||||||
</label>
|
</label>
|
||||||
<div translate="no">
|
<div translate="no">
|
||||||
@@ -1666,13 +1719,19 @@ const DomandaEditPreInstructor = () => {
|
|||||||
icon: 'pi pi-plus'
|
icon: 'pi pi-plus'
|
||||||
}}
|
}}
|
||||||
itemTemplate={(file, props) => {
|
itemTemplate={(file, props) => {
|
||||||
return(
|
return (
|
||||||
<div className="p-fileupload-row" data-pc-section="file">
|
<div className="p-fileupload-row" data-pc-section="file">
|
||||||
<div data-pc-section="details" style={{display: 'flex', flexDirection: 'column', gap: '10px', textAlign: 'left'}}>
|
<div data-pc-section="details" style={{
|
||||||
|
display: 'flex',
|
||||||
|
flexDirection: 'column',
|
||||||
|
gap: '10px',
|
||||||
|
textAlign: 'left'
|
||||||
|
}}>
|
||||||
<div className="p-fileupload-filename" data-pc-section="filename">
|
<div className="p-fileupload-filename" data-pc-section="filename">
|
||||||
{file.name}
|
{file.name}
|
||||||
</div>
|
</div>
|
||||||
<span data-pc-section="filesize">{getFormatedFileSizeText(file.size)}</span>
|
<span
|
||||||
|
data-pc-section="filesize">{getFormatedFileSizeText(file.size)}</span>
|
||||||
</div>
|
</div>
|
||||||
<div data-pc-section="actions">
|
<div data-pc-section="actions">
|
||||||
<Button
|
<Button
|
||||||
@@ -1751,8 +1810,10 @@ const DomandaEditPreInstructor = () => {
|
|||||||
onHide={hidePreTecEvalDialog}>
|
onHide={hidePreTecEvalDialog}>
|
||||||
<div className="appForm__field">
|
<div className="appForm__field">
|
||||||
<label
|
<label
|
||||||
className={classNames({ 'p-error': isEmpty(preTecEvalData.amount)
|
className={classNames({
|
||||||
|| isNaN(parseFloat(preTecEvalData.amount)) || parseFloat(preTecEvalData.amount) <= 0 })}>
|
'p-error': isEmpty(preTecEvalData.amount)
|
||||||
|
|| isNaN(parseFloat(preTecEvalData.amount)) || parseFloat(preTecEvalData.amount) <= 0
|
||||||
|
})}>
|
||||||
{__('Importo', 'gepafin')}
|
{__('Importo', 'gepafin')}
|
||||||
</label>
|
</label>
|
||||||
<InputNumber
|
<InputNumber
|
||||||
|
|||||||
Reference in New Issue
Block a user