diff --git a/src/pages/DomandaBeneficiario/index.js b/src/pages/DomandaBeneficiario/index.js index 2aee3a5..081b39c 100644 --- a/src/pages/DomandaBeneficiario/index.js +++ b/src/pages/DomandaBeneficiario/index.js @@ -207,35 +207,39 @@ const DomandaBeneficiario = () => {
{data.id ?
-

- {__('ID domanda', 'gepafin')} - {data.applicationId} -

-

- {__('Bando', 'gepafin')} - {data.callName} -

-

- {__('Beneficiario', 'gepafin')} - {data.beneficiaryName} -

-

- {__('Inizio', 'gepafin')} - {getDateFromISOstring(data.startDate)} -

-

- {__('Scadenza', 'gepafin')} - {getDateFromISOstring(data.expirationDate)} -

-

- {__('Stato', 'gepafin')} - {getBandoLabel(data.status)} -

-
: null} +

+ {__('ID domanda', 'gepafin')} + {data.applicationId} +

+

+ {__('Bando', 'gepafin')} + {data.callName} +

+

+ {__('Beneficiario', 'gepafin')} + {data.beneficiaryName} +

+

+ {__('Azienda', 'gepafin')} + +

+

+ {__('Inizio', 'gepafin')} + {getDateFromISOstring(data.startDate)} +

+

+ {__('Scadenza', 'gepafin')} + {getDateFromISOstring(data.expirationDate)} +

+

+ {__('Stato', 'gepafin')} + {getBandoLabel(data.status)} +

+
: null} {dataAppl.id ?

- {__('ID domanda', 'gepafin')} + {__('ID domanda', 'gepafin')} {dataAppl.id}

diff --git a/src/pages/DomandaEditPreInstructor/components/DownloadApplicationArchive/index.js b/src/pages/DomandaEditPreInstructor/components/DownloadApplicationArchive/index.js new file mode 100644 index 0000000..dd19bed --- /dev/null +++ b/src/pages/DomandaEditPreInstructor/components/DownloadApplicationArchive/index.js @@ -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 + ?

-
-
-

{__('Punteggi di valutazione', 'gepafin')}

- {data.criteria - ? - - - - - - - - - {data.criteria.map((o, i) => - - - - )} - - - - - - - - - - - -
{__('Parametro', 'gepafin')}{__('Punteggio', 'gepafin')}{__('Stato', 'gepafin')}
{o.label} -
- updateEvaluationValue( - e.value, - `criteria.${i}.score`, - o.maxScore - )}/> - - / {o.maxScore} - -
-
-
- {!isEmpty(o.criteriaMappedFields) - ?
-
{__('Punteggio:', 'gepafin')}{sum(data.criteria.map(o => o.score))} - {isAdmissible - ? : null} - {!isAdmissible - ? : null} -
{sprintf(__('Punteggio minimo per l\'ammissione: %d'), data.minScore)}
: null} +

{__('Scarica documenti della domanda', 'gepafin')}

+
@@ -635,6 +564,85 @@ const DomandaEditPreInstructor = () => {
+
+

{__('Punteggi di valutazione', 'gepafin')}

+ {data.criteria + ? + + + + + + + + + {data.criteria.map((o, i) => + + + + )} + + + + + + + + + + + +
{__('Parametro', 'gepafin')}{__('Punteggio', 'gepafin')}{__('Stato', 'gepafin')}
{o.label} +
+ updateEvaluationValue( + e.value, + `criteria.${i}.score`, + o.maxScore + )}/> + + / {o.maxScore} + +
+
+
+ {!isEmpty(o.criteriaMappedFields) + ?
+
{__('Punteggio:', 'gepafin')}{sum(data.criteria.map(o => o.score))} + {isAdmissible + ? : null} + {!isAdmissible + ? : null} +
{sprintf(__('Punteggio minimo per l\'ammissione: %d'), data.minScore)}
: null} +
+
@@ -645,19 +653,19 @@ const DomandaEditPreInstructor = () => {
{['EVALUATION', 'SOCCORSO', 'CLOSE'].includes(data.applicationStatus) ?