- added company name to tables with applications;
- added form and file inputs to the page of editing/viewing soccorso for beneficiary;
This commit is contained in:
@@ -102,7 +102,7 @@ const DomandaEditPreInstructor = () => {
|
||||
const updateEvaluationValue = (value, path, maxValue) => {
|
||||
let finalValue = value;
|
||||
|
||||
if (maxValue) {
|
||||
if (maxValue || maxValue === 0) {
|
||||
finalValue = value > maxValue ? maxValue : value;
|
||||
}
|
||||
|
||||
@@ -258,6 +258,10 @@ const DomandaEditPreInstructor = () => {
|
||||
const errGetAmendmentsCallback = () => {
|
||||
}
|
||||
|
||||
const shouldDisableField = (fieldName) => {
|
||||
return !['EVALUATION'].includes(data.status) || ['ADMISSIBLE'].includes(data.status) && fieldName !== 'criteria'
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
const maxScore = pathOr(0, ['minScore'], data);
|
||||
const criteria = pathOr([], ['criteria'], data);
|
||||
@@ -329,9 +333,7 @@ const DomandaEditPreInstructor = () => {
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="appPageSection">
|
||||
|
||||
</div>
|
||||
<div className="appPageSection"></div>
|
||||
|
||||
<div className="appPageSection">
|
||||
<h2>{__('Punteggi di valutazione', 'gepafin')}</h2>
|
||||
@@ -350,7 +352,7 @@ const DomandaEditPreInstructor = () => {
|
||||
<td>
|
||||
<div className="p-inputgroup">
|
||||
<InputNumber
|
||||
disabled={data.status === 'CLOSE'}
|
||||
disabled={shouldDisableField('criteria')}
|
||||
placeholder={__('Punteggio', 'gepafin')}
|
||||
keyfilter="int"
|
||||
value={o.score}
|
||||
@@ -373,7 +375,7 @@ const DomandaEditPreInstructor = () => {
|
||||
onClick={() => displayCriterionData(o.id)}
|
||||
aria-label={__('Mostra', 'gepafin')}/> : null}
|
||||
<Button icon="pi pi-thumbs-up" rounded outlined
|
||||
disabled={data.status === 'CLOSE'}
|
||||
disabled={shouldDisableField('criteria')}
|
||||
severity={!isNil(o.valid) && o.valid ? 'success' : 'secondary'}
|
||||
onClick={() => updateEvaluationValue(
|
||||
true,
|
||||
@@ -381,7 +383,7 @@ const DomandaEditPreInstructor = () => {
|
||||
)}
|
||||
aria-label={__('Su', 'gepafin')}/>
|
||||
<Button icon="pi pi-thumbs-down" rounded outlined
|
||||
disabled={data.status === 'CLOSE'}
|
||||
disabled={shouldDisableField('criteria')}
|
||||
severity={!isNil(o.valid) && !o.valid ? 'danger' : 'secondary'}
|
||||
onClick={() => updateEvaluationValue(
|
||||
false,
|
||||
@@ -422,7 +424,7 @@ const DomandaEditPreInstructor = () => {
|
||||
<div className="appPageSection__checklist">
|
||||
{data.checklist.map((o, i) => <div key={o.id}>
|
||||
<Checkbox
|
||||
disabled={data.status === 'CLOSE'}
|
||||
disabled={shouldDisableField('checklist')}
|
||||
inputId={`checklist_${o.id}`}
|
||||
onChange={(e) => updateEvaluationValue(
|
||||
e.checked,
|
||||
@@ -438,7 +440,7 @@ const DomandaEditPreInstructor = () => {
|
||||
<div>
|
||||
<Editor
|
||||
value={data.note}
|
||||
readOnly={data.status === 'CLOSE'}
|
||||
readOnly={shouldDisableField('note')}
|
||||
placeholder={__('Digita qui il messagio', 'gepafin')}
|
||||
headerTemplate={header}
|
||||
onTextChange={(e) => updateEvaluationValue(
|
||||
@@ -466,7 +468,7 @@ const DomandaEditPreInstructor = () => {
|
||||
outlined severity="info"
|
||||
aria-label={__('Mostra', 'gepafin')}/> : null}
|
||||
<Button icon="pi pi-thumbs-up" rounded outlined
|
||||
disabled={data.status === 'CLOSE'}
|
||||
disabled={shouldDisableField('files')}
|
||||
severity={!isNil(o.valid) && o.valid ? 'success' : 'secondary'}
|
||||
onClick={() => updateEvaluationValue(
|
||||
true,
|
||||
@@ -474,7 +476,7 @@ const DomandaEditPreInstructor = () => {
|
||||
)}
|
||||
aria-label={__('Su', 'gepafin')}/>
|
||||
<Button icon="pi pi-thumbs-down" rounded outlined
|
||||
disabled={data.status === 'CLOSE'}
|
||||
disabled={shouldDisableField('files')}
|
||||
severity={!isNil(o.valid) && !o.valid ? 'danger' : 'secondary'}
|
||||
onClick={() => updateEvaluationValue(
|
||||
false,
|
||||
|
||||
Reference in New Issue
Block a user