- fixed issue with checkboxes;
This commit is contained in:
@@ -58,7 +58,7 @@ const Checkboxes = ({
|
|||||||
name={fieldName}
|
name={fieldName}
|
||||||
value={o.name}
|
value={o.name}
|
||||||
onChange={(e) => onCheckboxesChange(e, field.onChange)}
|
onChange={(e) => onCheckboxesChange(e, field.onChange)}
|
||||||
checked={field.value.includes(o.name)}
|
checked={field.value && field.value.includes ? field.value.includes(o.name) : false}
|
||||||
className={classNames({ 'p-invalid': fieldState.invalid })}/>
|
className={classNames({ 'p-invalid': fieldState.invalid })}/>
|
||||||
<label htmlFor={`${fieldName}_${o.name}`}>{o.label}</label>
|
<label htmlFor={`${fieldName}_${o.name}`}>{o.label}</label>
|
||||||
</div>)}/>
|
</div>)}/>
|
||||||
|
|||||||
@@ -324,6 +324,41 @@ const BandoApplication = () => {
|
|||||||
{!isAsyncRequest
|
{!isAsyncRequest
|
||||||
? <div className="appPage__content">
|
? <div className="appPage__content">
|
||||||
<form className="appForm" onSubmit={handleSubmit(onSubmit)}>
|
<form className="appForm" onSubmit={handleSubmit(onSubmit)}>
|
||||||
|
<div className="appPageSection">
|
||||||
|
<div className="appPageSection__actions">
|
||||||
|
{activeStep > 1 && activeStep <= totalSteps
|
||||||
|
? <Button
|
||||||
|
type="button"
|
||||||
|
disabled={'SUBMIT' === applicationStatus}
|
||||||
|
onClick={goBackward}
|
||||||
|
label={__('Vai indietro', 'gepafin')}
|
||||||
|
icon="pi pi-arrow-left"
|
||||||
|
iconPos="left"/> : null}
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
disabled={isAsyncRequest || 'SUBMIT' === applicationStatus}
|
||||||
|
onClick={saveDraft}
|
||||||
|
outlined
|
||||||
|
label={__('Salva bozza', 'gepafin')} icon="pi pi-save" iconPos="right"/>
|
||||||
|
{activeStep < totalSteps
|
||||||
|
//&& activeStep === completedSteps
|
||||||
|
? <Button
|
||||||
|
type="button"
|
||||||
|
disabled={'SUBMIT' === applicationStatus}
|
||||||
|
onClick={goForward}
|
||||||
|
label={__('Vai avanti', 'gepafin')}
|
||||||
|
icon="pi pi-arrow-right"
|
||||||
|
iconPos="right"/> : null}
|
||||||
|
<Button
|
||||||
|
disabled={completedSteps === 0 || completedSteps !== totalSteps || 'SUBMIT' === applicationStatus}
|
||||||
|
label={__('Invia', 'gepafin')}
|
||||||
|
icon="pi pi-check"
|
||||||
|
iconPos="right"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{formInitialData
|
{formInitialData
|
||||||
? formData.map(o => {
|
? formData.map(o => {
|
||||||
const label = head(o.settings.filter(o => o.name === 'label'));
|
const label = head(o.settings.filter(o => o.name === 'label'));
|
||||||
|
|||||||
Reference in New Issue
Block a user