- added step 3 and evaluation form creation for call;

This commit is contained in:
Vitalii Kiiko
2025-01-30 15:56:34 +01:00
parent 9f8dbd4e8c
commit 99dabb607f
7 changed files with 252 additions and 29 deletions

View File

@@ -23,6 +23,7 @@ import { Messages } from 'primereact/messages';
import FormsService from '../../service/forms-service';
import BlockingOverlay from '../../components/BlockingOverlay';
import { Toast } from 'primereact/toast';
import BandoEditFormStep3 from './components/BandoEditFormStep3';
const BandoEdit = () => {
const isAsyncRequest = useStore().main.isAsyncRequest();
@@ -35,28 +36,45 @@ const BandoEdit = () => {
const bandoMsgs = useRef(null);
const toast = useRef(null);
const stepItems = [
{
label: __('Testi', 'gepafin'),
command: () => {
if (activeStep === 0) {
return false
const stepItems = (evalProcessVer) => {
let steps = [
{
label: __('Testi', 'gepafin'),
command: () => {
if (activeStep === 0) {
return false
}
bandoMsgs.current.clear();
goToStep(0);
}
bandoMsgs.current.clear();
goToStep(0);
}
},
{
label: __('Gestione', 'gepafin'),
command: () => {
if (activeStep === 1) {
return false
},
{
label: __('Gestione', 'gepafin'),
command: () => {
if (activeStep === 1) {
return false
}
bandoMsgs.current.clear();
goToStep(1);
}
bandoMsgs.current.clear();
goToStep(1);
}
];
if (evalProcessVer === 'V2') {
steps.push({
label: __('Valutazione', 'gepafin'),
command: () => {
if (activeStep === 2) {
return false
}
bandoMsgs.current.clear();
goToStep(2);
}
})
}
];
return steps;
}
const goToStep = (step) => {
setActiveStep(step);
@@ -238,7 +256,8 @@ const BandoEdit = () => {
if (bandoId === 0) {
setData({
status: null
status: null,
evaluationVersion: 'V2'
});
storeSet.main.unsetAsyncRequest();
@@ -274,7 +293,7 @@ const BandoEdit = () => {
{!isEmpty(data)
? <Steps
model={stepItems}
model={stepItems(data.evaluationVersion)}
activeIndex={activeStep}
readOnly={isNil(data.status)}/>
: null}
@@ -293,6 +312,9 @@ const BandoEdit = () => {
{activeStep === 1
? <BandoEditFormStep2 initialData={data} setInitialData={setData} ref={formRef} status={data.status}/>
: null}
{activeStep === 2 && data.evaluationVersion === 'V2'
? <BandoEditFormStep3/>
: null}
<div className="appPageSection">
<h2>{__('Crea o modifica il Form compilabile dal Beneficiario', 'gepafin')}</h2>