- 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 { defaultMaxFileSize, mimeTypes, rejectionReasons } from '../../configData';
|
||||
import getFormatedFileSizeText from '../../helpers/getFormatedFileSizeText';
|
||||
import ArchiveDocument from './components/ArchiveDocument';
|
||||
|
||||
const APP_EVALUATION_FLOW_ID = process.env.REACT_APP_EVALUATION_FLOW_ID;
|
||||
const APP_HUB_ID = process.env.REACT_APP_HUB_ID;
|
||||
@@ -225,7 +226,7 @@ const DomandaEditPreInstructor = () => {
|
||||
const getCallback = (resp) => {
|
||||
if (resp.status === 'SUCCESS') {
|
||||
setData(getFormattedData(resp.data));
|
||||
setFinalDialogData((prev) => ({...prev, motivation: resp.data.motivation}));
|
||||
setFinalDialogData((prev) => ({ ...prev, motivation: resp.data.motivation }));
|
||||
updateFlagsForSoccorso(resp.data);
|
||||
|
||||
if (resp.data.evaluationVersion === 'V2') {
|
||||
@@ -1167,7 +1168,7 @@ const DomandaEditPreInstructor = () => {
|
||||
? <div className="appPageSection__message info">
|
||||
<i className="pi pi-info-circle"></i>
|
||||
<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>
|
||||
{rejectionFiles()}
|
||||
</div>
|
||||
@@ -1329,6 +1330,31 @@ const DomandaEditPreInstructor = () => {
|
||||
|
||||
{data.evaluationVersion === 'V2'
|
||||
? <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>
|
||||
{!isEmpty(data.files)
|
||||
? <ListOfFiles
|
||||
@@ -1441,6 +1467,31 @@ const DomandaEditPreInstructor = () => {
|
||||
</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>
|
||||
{!isEmpty(data.files)
|
||||
? <ListOfFiles
|
||||
@@ -1592,7 +1643,8 @@ const DomandaEditPreInstructor = () => {
|
||||
</div> : null}
|
||||
{operationType === 'reject' && APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE'
|
||||
? <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')}
|
||||
</label>
|
||||
<Dropdown
|
||||
@@ -1619,7 +1671,8 @@ const DomandaEditPreInstructor = () => {
|
||||
style={{ width: '100%' }}/>
|
||||
</div> : null}
|
||||
<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')}
|
||||
</label>
|
||||
<div translate="no">
|
||||
@@ -1666,13 +1719,19 @@ const DomandaEditPreInstructor = () => {
|
||||
icon: 'pi pi-plus'
|
||||
}}
|
||||
itemTemplate={(file, props) => {
|
||||
return(
|
||||
return (
|
||||
<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">
|
||||
{file.name}
|
||||
</div>
|
||||
<span data-pc-section="filesize">{getFormatedFileSizeText(file.size)}</span>
|
||||
<span
|
||||
data-pc-section="filesize">{getFormatedFileSizeText(file.size)}</span>
|
||||
</div>
|
||||
<div data-pc-section="actions">
|
||||
<Button
|
||||
@@ -1751,8 +1810,10 @@ const DomandaEditPreInstructor = () => {
|
||||
onHide={hidePreTecEvalDialog}>
|
||||
<div className="appForm__field">
|
||||
<label
|
||||
className={classNames({ 'p-error': isEmpty(preTecEvalData.amount)
|
||||
|| isNaN(parseFloat(preTecEvalData.amount)) || parseFloat(preTecEvalData.amount) <= 0 })}>
|
||||
className={classNames({
|
||||
'p-error': isEmpty(preTecEvalData.amount)
|
||||
|| isNaN(parseFloat(preTecEvalData.amount)) || parseFloat(preTecEvalData.amount) <= 0
|
||||
})}>
|
||||
{__('Importo', 'gepafin')}
|
||||
</label>
|
||||
<InputNumber
|
||||
|
||||
Reference in New Issue
Block a user