- updated logic based on new data from API;
- updated page of archived non completed application for beneficiary; - fixed issue creating soccorso;
This commit is contained in:
@@ -122,6 +122,7 @@ const DomandaEditPreInstructor = () => {
|
||||
|
||||
const updateCallback = (data) => {
|
||||
if (data.status === 'SUCCESS') {
|
||||
setData(getFormattedData(data.data));
|
||||
if (toast.current) {
|
||||
toast.current.show({
|
||||
severity: 'success',
|
||||
@@ -198,28 +199,32 @@ const DomandaEditPreInstructor = () => {
|
||||
const criteriaDataItem = (item) => {
|
||||
let content = '';
|
||||
|
||||
if (is(String, item.fieldValue)) {
|
||||
content = item.fieldValue;
|
||||
} else if (item.fieldValue && item.fieldValue.length && !isNil(item.fieldValue[0].filePath)) {
|
||||
content = <ul>
|
||||
{item.fieldValue.map(o => <li key={o.id}>
|
||||
{o.filePath ? <a href={o.filePath}>{o.name}</a> : null}
|
||||
</li>)}
|
||||
</ul>;
|
||||
} else if (item.fieldValue && item.fieldValue.length && isNil(item.fieldValue[0].filePath)) {
|
||||
const th = Object.keys(item.fieldValue[0]);
|
||||
content = <table>
|
||||
<thead>
|
||||
<tr>
|
||||
{th.map(v => <th key={v}>{v}</th>)}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{item.fieldValue.map((o, i) => <tr key={i}>
|
||||
{Object.values(o).map(v => <td key={v}>{v}</td>)}
|
||||
</tr>)}
|
||||
</tbody>
|
||||
</table>;
|
||||
switch (item.fieldName) {
|
||||
case 'fileupload' :
|
||||
content = <ul>
|
||||
{item.fieldValue.map(o => <li key={o.id}>
|
||||
{o.filePath ? <a href={o.filePath}>{o.name}</a> : null}
|
||||
</li>)}
|
||||
</ul>;
|
||||
break;
|
||||
case 'table' :
|
||||
const th = Object.keys(item.fieldValue[0]);
|
||||
content = <table>
|
||||
<thead>
|
||||
<tr>
|
||||
{th.map(v => <th key={v}>{v}</th>)}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{item.fieldValue.map((o, i) => <tr key={i}>
|
||||
{Object.values(o).map(v => <td key={v}>{v}</td>)}
|
||||
</tr>)}
|
||||
</tbody>
|
||||
</table>;
|
||||
break;
|
||||
default :
|
||||
content = item.fieldValue;
|
||||
break;
|
||||
}
|
||||
|
||||
return <div key={item.id} className="criterionRelatedData__item">
|
||||
@@ -312,7 +317,7 @@ const DomandaEditPreInstructor = () => {
|
||||
</p>
|
||||
<p className="appPageSection__pMeta">
|
||||
<span>{__('Stato', 'gepafin')}</span>
|
||||
<span>{getBandoLabel(data.applicationStatus)}</span>
|
||||
<span>{getBandoLabel(data.status)}</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -333,6 +338,7 @@ const DomandaEditPreInstructor = () => {
|
||||
<td>
|
||||
<div className="p-inputgroup">
|
||||
<InputNumber
|
||||
disabled={data.status === 'CLOSE'}
|
||||
placeholder={__('Punteggio', 'gepafin')}
|
||||
keyfilter="int"
|
||||
value={o.score}
|
||||
@@ -355,6 +361,7 @@ const DomandaEditPreInstructor = () => {
|
||||
onClick={() => displayCriterionData(o.id)}
|
||||
aria-label={__('Mostra', 'gepafin')}/> : null}
|
||||
<Button icon="pi pi-thumbs-up" rounded outlined
|
||||
disabled={data.status === 'CLOSE'}
|
||||
severity={!isNil(o.valid) && o.valid ? 'success' : 'secondary'}
|
||||
onClick={() => updateEvaluationValue(
|
||||
true,
|
||||
@@ -362,6 +369,7 @@ const DomandaEditPreInstructor = () => {
|
||||
)}
|
||||
aria-label={__('Su', 'gepafin')}/>
|
||||
<Button icon="pi pi-thumbs-down" rounded outlined
|
||||
disabled={data.status === 'CLOSE'}
|
||||
severity={!isNil(o.valid) && !o.valid ? 'danger' : 'secondary'}
|
||||
onClick={() => updateEvaluationValue(
|
||||
false,
|
||||
@@ -402,6 +410,7 @@ const DomandaEditPreInstructor = () => {
|
||||
<div className="appPageSection__checklist">
|
||||
{data.checklist.map((o, i) => <div key={o.id}>
|
||||
<Checkbox
|
||||
disabled={data.status === 'CLOSE'}
|
||||
inputId={`checklist_${o.id}`}
|
||||
onChange={(e) => updateEvaluationValue(
|
||||
e.checked,
|
||||
@@ -417,6 +426,7 @@ const DomandaEditPreInstructor = () => {
|
||||
<div>
|
||||
<Editor
|
||||
value={data.note}
|
||||
readOnly={data.status === 'CLOSE'}
|
||||
placeholder={__('Digita qui il messagio', 'gepafin')}
|
||||
headerTemplate={header}
|
||||
onTextChange={(e) => updateEvaluationValue(
|
||||
@@ -444,6 +454,7 @@ const DomandaEditPreInstructor = () => {
|
||||
outlined severity="info"
|
||||
aria-label={__('Mostra', 'gepafin')}/> : null}
|
||||
<Button icon="pi pi-thumbs-up" rounded outlined
|
||||
disabled={data.status === 'CLOSE'}
|
||||
severity={!isNil(o.valid) && o.valid ? 'success' : 'secondary'}
|
||||
onClick={() => updateEvaluationValue(
|
||||
true,
|
||||
@@ -451,6 +462,7 @@ const DomandaEditPreInstructor = () => {
|
||||
)}
|
||||
aria-label={__('Su', 'gepafin')}/>
|
||||
<Button icon="pi pi-thumbs-down" rounded outlined
|
||||
disabled={data.status === 'CLOSE'}
|
||||
severity={!isNil(o.valid) && !o.valid ? 'danger' : 'secondary'}
|
||||
onClick={() => updateEvaluationValue(
|
||||
false,
|
||||
@@ -499,7 +511,7 @@ const DomandaEditPreInstructor = () => {
|
||||
<div className="appPageSection__actions">
|
||||
<Button
|
||||
type="button"
|
||||
disabled={!data.id}
|
||||
disabled={!data.id || data.status === 'CLOSE'}
|
||||
onClick={doNewSoccorso}
|
||||
outlined
|
||||
label={<>
|
||||
@@ -512,6 +524,7 @@ const DomandaEditPreInstructor = () => {
|
||||
{data.id
|
||||
? <Button
|
||||
type="button"
|
||||
disabled={data.status === 'CLOSE'}
|
||||
onClick={doSaveDraft}
|
||||
outlined
|
||||
label={__('Salva bozza valutazione', 'gepafin')}
|
||||
@@ -524,13 +537,14 @@ const DomandaEditPreInstructor = () => {
|
||||
{data.id
|
||||
? <Button
|
||||
type="button"
|
||||
disabled={!isAdmissible}
|
||||
disabled={!isAdmissible || data.status === 'CLOSE'}
|
||||
onClick={doApprove}
|
||||
label={__('Approva Domanda', 'gepafin')}
|
||||
icon="pi pi-check" iconPos="right"/> : null}
|
||||
{data.id
|
||||
? <Button
|
||||
type="button"
|
||||
disabled={data.status === 'CLOSE'}
|
||||
onClick={doReject}
|
||||
label={__('Respingi Domanda', 'gepafin')}
|
||||
icon="pi pi-times" iconPos="right"/> : null}
|
||||
|
||||
Reference in New Issue
Block a user