- saving progress - amendment page works for both instructor and beneficiary;
This commit is contained in:
@@ -3,6 +3,7 @@ import { Button } from 'primereact/button';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { isNil } from 'ramda';
|
||||
import ArchiveDocument from '../ArchiveDocument';
|
||||
import renderHtmlContent from '../../../../helpers/renderHtmlContent';
|
||||
|
||||
const ListOfFiles = ({ files, updateFn, shouldDisableFieldFn, name, ndg, applicationId }) => {
|
||||
|
||||
@@ -10,32 +11,32 @@ const ListOfFiles = ({ files, updateFn, shouldDisableFieldFn, name, ndg, applica
|
||||
<ol className="appPageSection__list">
|
||||
{files.map((o, i) => <li key={o.id} className="appPageSection__listItem">
|
||||
<div className="appPageSection__listItemRow">
|
||||
<span>{o.label}</span>
|
||||
{o.fileDetail && o.fileDetail.length === 1
|
||||
? <div className="appPageSection__iconActions">
|
||||
<Button icon="pi pi-eye" rounded
|
||||
onClick={() => {
|
||||
window.open(o.fileDetail[0].filePath, '_blank').focus()
|
||||
}}
|
||||
outlined severity="info"
|
||||
aria-label={__('Mostra', 'gepafin')}/>
|
||||
<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> : null}
|
||||
<div>{renderHtmlContent(o.label)}</div>
|
||||
<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={{
|
||||
|
||||
@@ -605,34 +605,34 @@ const DomandaEditPreInstructor = () => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/*<div className="appPageSection">
|
||||
<div className="appPageSection">
|
||||
<h2>{__('Documenti di soccorso', 'gepafin')}</h2>
|
||||
{data.amendmentDetails
|
||||
.filter(o => o.amendmentDocuments && !isEmpty(o.amendmentDocuments)
|
||||
|| o.formFieldDocuments && !isEmpty(o.formFieldDocuments))
|
||||
.map(o => {
|
||||
const aDocs = pathOr([],['amendmentDocuments'], o)
|
||||
.map(o => ({
|
||||
id: o.fieldId,
|
||||
label: o.nameValue,
|
||||
fileDetail: o.fileValue,
|
||||
valid: o.valid
|
||||
}));
|
||||
const aDocs = pathOr([],['amendmentDocuments'], o);
|
||||
const aNotes = pathOr('',['amendmentNotes'], o);
|
||||
const aValid = pathOr(null,['valid'], o);
|
||||
const aDocsObj = {
|
||||
id: o.amendmentId,
|
||||
label: aNotes,
|
||||
fileDetail: aDocs,
|
||||
valid: aValid
|
||||
}
|
||||
const fDocs = pathOr([],['formFieldDocuments'], o);
|
||||
|
||||
return {
|
||||
id: o.id,
|
||||
files: [...aDocs, ...fDocs]
|
||||
files: [aDocsObj, ...fDocs]
|
||||
}
|
||||
})
|
||||
.map(o => <ListOfFiles
|
||||
.map((o, i) => <ListOfFiles
|
||||
key={`list_${i}`}
|
||||
files={o.files}
|
||||
updateFn={updateEvaluationValue}
|
||||
shouldDisableFieldFn={shouldDisableField}
|
||||
name="files"
|
||||
name="amendmentDetails"
|
||||
ndg={data.ndg}
|
||||
applicationId={id}/>)}
|
||||
</div>*/}
|
||||
</div>
|
||||
|
||||
<div className="appPageSection">
|
||||
<h2>{__('Punteggi di valutazione', 'gepafin')}</h2>
|
||||
|
||||
Reference in New Issue
Block a user