- updaated styles;
- added saving evaluation on opening amendment;
This commit is contained in:
@@ -251,6 +251,7 @@
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.appPageSection__checklist {
|
||||
|
||||
@@ -53,10 +53,9 @@ const DomandaEditPreInstructor = () => {
|
||||
|
||||
const doNewSoccorso = () => {
|
||||
if (connectedSoccorsoId !== 0) {
|
||||
navigate(`/domande/${id}/soccorso/${connectedSoccorsoId}`);
|
||||
doSaveDraft(`/domande/${id}/soccorso/${connectedSoccorsoId}`)
|
||||
} else {
|
||||
|
||||
navigate(`/domande/${id}/aggiungi-soccorso/`);
|
||||
doSaveDraft(`/domande/${id}/aggiungi-soccorso/`)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,17 +116,22 @@ const DomandaEditPreInstructor = () => {
|
||||
setData(newData);
|
||||
}
|
||||
|
||||
const doSaveDraft = () => {
|
||||
const doSaveDraft = (doRedirect = '') => {
|
||||
const formData = {
|
||||
criteria: klona(data.criteria),
|
||||
checklist: klona(data.checklist),
|
||||
files: klona(data.files),
|
||||
note: data.note
|
||||
}
|
||||
ApplicationEvaluationService.updateEvaluation(data.assignedApplicationId, formData, updateCallback, errUpdateCallback);
|
||||
ApplicationEvaluationService.updateEvaluation(
|
||||
data.assignedApplicationId,
|
||||
formData,
|
||||
(data) => updateCallback(data, doRedirect),
|
||||
errUpdateCallback
|
||||
);
|
||||
}
|
||||
|
||||
const updateCallback = (data) => {
|
||||
const updateCallback = (data, doRedirect = '') => {
|
||||
if (data.status === 'SUCCESS') {
|
||||
setData(getFormattedData(data.data));
|
||||
if (toast.current) {
|
||||
@@ -137,6 +141,9 @@ const DomandaEditPreInstructor = () => {
|
||||
detail: data.message
|
||||
});
|
||||
}
|
||||
if (!isEmpty(doRedirect)) {
|
||||
navigate(doRedirect);
|
||||
}
|
||||
}
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ const SoccorsoEditPreInstructor = () => {
|
||||
}, []);
|
||||
|
||||
const submitData = {
|
||||
applicationFormFields: newFormValues,
|
||||
applicationFormFields: newFormValues
|
||||
}
|
||||
storeSet.main.setAsyncRequest();
|
||||
AmendmentsService.updateSoccorso(amendmentId, submitData, updateAmendmentCallback, errUpdateAmendmentCallback);
|
||||
@@ -366,9 +366,10 @@ const SoccorsoEditPreInstructor = () => {
|
||||
<h3>{__('Documenti Richiesti', 'gepafin')}</h3>
|
||||
<ol className="appPageSection__list">
|
||||
{data.formFields
|
||||
? data.formFields.map((o, i) => <li key={o.fieldId} style={{ flexDirection: 'row' }}>
|
||||
<span>{o.label}</span>
|
||||
</li>) : null}
|
||||
? data.formFields.map((o, i) => <li key={o.fieldId}
|
||||
style={{ flexDirection: 'row' }}>
|
||||
<span>{o.label}</span>
|
||||
</li>) : null}
|
||||
</ol>
|
||||
</div>
|
||||
<div>
|
||||
@@ -393,26 +394,44 @@ const SoccorsoEditPreInstructor = () => {
|
||||
<form className="appForm" onSubmit={handleSubmit(onSubmit)}>
|
||||
{data.formFields
|
||||
? data.formFields.map((o, i) => {
|
||||
return <FormField
|
||||
key={o.fieldId}
|
||||
disabled={data.status === 'CLOSE'}
|
||||
type="fileupload"
|
||||
setDataFn={setValue}
|
||||
saveFormCallback={doUpdateAmendment}
|
||||
fieldName={o.fieldId}
|
||||
label={o.label}
|
||||
control={control}
|
||||
register={register}
|
||||
errors={errors}
|
||||
defaultValue={formInitialData[o.fieldId] ? formInitialData[o.fieldId] : []}
|
||||
accept={[]}
|
||||
sourceId={data.applicationId}
|
||||
multiple={true}
|
||||
/>
|
||||
}) : null}
|
||||
return <FormField
|
||||
key={o.fieldId}
|
||||
disabled={data.status === 'CLOSE'}
|
||||
type="fileupload"
|
||||
setDataFn={setValue}
|
||||
saveFormCallback={doUpdateAmendment}
|
||||
fieldName={o.fieldId}
|
||||
label={o.label}
|
||||
control={control}
|
||||
register={register}
|
||||
errors={errors}
|
||||
defaultValue={formInitialData[o.fieldId] ? formInitialData[o.fieldId] : []}
|
||||
accept={[]}
|
||||
sourceId={data.applicationId}
|
||||
multiple={true}
|
||||
/>
|
||||
}) : null}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div className="appForm__field">
|
||||
<label>{__('Motivazioni / Note Interne', 'gepafin')}</label>
|
||||
<div style={{ position: 'relative' }}>
|
||||
<BlockingOverlay shouldDisplay={data.status === 'CLOSE'}/>
|
||||
<Editor
|
||||
value={data.internalNote}
|
||||
readOnly={data.status === 'CLOSE'}
|
||||
placeholder={__('Digita qui il messagio', 'gepafin')}
|
||||
headerTemplate={header}
|
||||
onTextChange={(e) => updateNewAmendmentData(
|
||||
e.htmlValue,
|
||||
'internalNote'
|
||||
)}
|
||||
style={{ height: 80 * 3, width: '100%' }}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="appPage__spacer"></div>
|
||||
|
||||
<div className="appPageSection__hr">
|
||||
@@ -437,6 +456,12 @@ const SoccorsoEditPreInstructor = () => {
|
||||
label={__('Estendi Scadenza', 'gepafin')}
|
||||
icon="pi pi-stopwatch"
|
||||
/>
|
||||
{/*<Button
|
||||
type="button"
|
||||
onClick={doUpdateAmendment}
|
||||
disabled={isAsyncRequest || data.status === 'CLOSE'}
|
||||
label={__('Salva bozza', 'gepafin')}
|
||||
icon="pi pi-save" iconPos="right"/>*/}
|
||||
<Button
|
||||
type="button"
|
||||
onClick={doCloseAmendment}
|
||||
@@ -446,24 +471,6 @@ const SoccorsoEditPreInstructor = () => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="appForm__field" style={{ marginTop: '-40px' }}>
|
||||
<label>{__('Note Interne', 'gepafin')}</label>
|
||||
<div style={{position: 'relative'}}>
|
||||
<BlockingOverlay shouldDisplay={data.status === 'CLOSE'}/>
|
||||
<Editor
|
||||
value={data.internalNote}
|
||||
readOnly={data.status === 'CLOSE'}
|
||||
placeholder={__('Digita qui il messagio', 'gepafin')}
|
||||
headerTemplate={header}
|
||||
onTextChange={(e) => updateNewAmendmentData(
|
||||
e.htmlValue,
|
||||
'internalNote'
|
||||
)}
|
||||
style={{ height: 80 * 3, width: '100%' }}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<Dialog
|
||||
|
||||
Reference in New Issue
Block a user