- updated condition for multi application for the same company and beneficiary;
This commit is contained in:
@@ -59,6 +59,9 @@ const getBandoLabel = (status) => {
|
|||||||
case 'CLOSE':
|
case 'CLOSE':
|
||||||
return __('Chiuso', 'gepafin');
|
return __('Chiuso', 'gepafin');
|
||||||
|
|
||||||
|
case 'REJECTED':
|
||||||
|
return __('Respinto', 'gepafin');
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,6 +57,9 @@ const getBandoSeverity = (status) => {
|
|||||||
case 'CLOSE':
|
case 'CLOSE':
|
||||||
return 'closed';
|
return 'closed';
|
||||||
|
|
||||||
|
case 'REJECTED':
|
||||||
|
return 'danger';
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 'info';
|
return 'info';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useState, useEffect, useRef } from 'react';
|
import React, { useState, useEffect, useRef } from 'react';
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
import { useNavigate, useParams } from 'react-router-dom';
|
import { useNavigate, useParams } from 'react-router-dom';
|
||||||
import { is, isEmpty, isNil } from 'ramda';
|
import { head, is, isEmpty, isNil } from 'ramda';
|
||||||
import 'quill/dist/quill.core.css';
|
import 'quill/dist/quill.core.css';
|
||||||
|
|
||||||
// store
|
// store
|
||||||
@@ -12,11 +12,13 @@ import getNumberWithCurrency from '../../helpers/getNumberWithCurrency';
|
|||||||
import getDateFromISOstring from '../../helpers/getDateFromISOstring';
|
import getDateFromISOstring from '../../helpers/getDateFromISOstring';
|
||||||
import set404FromErrorResponse from '../../helpers/set404FromErrorResponse';
|
import set404FromErrorResponse from '../../helpers/set404FromErrorResponse';
|
||||||
import renderHtmlContent from '../../helpers/renderHtmlContent';
|
import renderHtmlContent from '../../helpers/renderHtmlContent';
|
||||||
|
import isDateTimeInPast from '../../helpers/isDateTimeInPast';
|
||||||
|
|
||||||
// api
|
// api
|
||||||
import BandoService from '../../service/bando-service';
|
import BandoService from '../../service/bando-service';
|
||||||
import FaqItemService from '../../service/faq-item-service';
|
import FaqItemService from '../../service/faq-item-service';
|
||||||
import ApplicationService from '../../service/application-service';
|
import ApplicationService from '../../service/application-service';
|
||||||
|
import PreferredBandoService from '../../service/preferred-bando-service';
|
||||||
|
|
||||||
// components
|
// components
|
||||||
import { Skeleton } from 'primereact/skeleton';
|
import { Skeleton } from 'primereact/skeleton';
|
||||||
@@ -28,8 +30,6 @@ import { Message } from 'primereact/message';
|
|||||||
import { Toast } from 'primereact/toast';
|
import { Toast } from 'primereact/toast';
|
||||||
import { Editor } from 'primereact/editor';
|
import { Editor } from 'primereact/editor';
|
||||||
import { Dialog } from 'primereact/dialog';
|
import { Dialog } from 'primereact/dialog';
|
||||||
import PreferredBandoService from '../../service/preferred-bando-service';
|
|
||||||
import isDateTimeInPast from '../../helpers/isDateTimeInPast';
|
|
||||||
|
|
||||||
const REACT_APP_HUB_ID = process.env.REACT_APP_HUB_ID;
|
const REACT_APP_HUB_ID = process.env.REACT_APP_HUB_ID;
|
||||||
|
|
||||||
@@ -244,7 +244,10 @@ const BandoViewBeneficiario = () => {
|
|||||||
const getApplCallback = (data) => {
|
const getApplCallback = (data) => {
|
||||||
if (data.status === 'SUCCESS') {
|
if (data.status === 'SUCCESS') {
|
||||||
if (data.data.length) {
|
if (data.data.length) {
|
||||||
setApplicationObj(data.data[0]);
|
const nonRejectedAppl = head(data.data.filter(o => !['REJECTED'].includes(o.status)));
|
||||||
|
if (nonRejectedAppl) {
|
||||||
|
setApplicationObj(nonRejectedAppl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
storeSet.main.unsetAsyncRequest();
|
storeSet.main.unsetAsyncRequest();
|
||||||
|
|||||||
@@ -204,25 +204,28 @@ const DomandaEditInstructorManager = () => {
|
|||||||
setData(getFormattedData(resp.data));
|
setData(getFormattedData(resp.data));
|
||||||
setMotivation(resp.data.motivation);
|
setMotivation(resp.data.motivation);
|
||||||
updateFlagsForSoccorso(resp.data);
|
updateFlagsForSoccorso(resp.data);
|
||||||
setFormData(resp.data.applicationEvaluationFormResponse.content);
|
|
||||||
setFormId(resp.data.applicationEvaluationFormResponse.id);
|
|
||||||
let formDataInitial = {};
|
|
||||||
|
|
||||||
if (resp.data.applicationEvaluationFormResponse.formFields) {
|
if (resp.data.evaluationVersion === 'V2') {
|
||||||
const submitData = resp.data.applicationEvaluationFormResponse.formFields.map((o) => ({
|
setFormData(resp.data.applicationEvaluationFormResponse.content);
|
||||||
fieldId: o.fieldId,
|
setFormId(resp.data.applicationEvaluationFormResponse.id);
|
||||||
fieldValue: o.fieldValue
|
let formDataInitial = {};
|
||||||
}));
|
|
||||||
formDataInitial = submitData.reduce((acc, cur) => {
|
if (resp.data.applicationEvaluationFormResponse.formFields) {
|
||||||
if (cur.fieldValue) {
|
const submitData = resp.data.applicationEvaluationFormResponse.formFields.map((o) => ({
|
||||||
acc[cur.fieldId] = cur.fieldValue;
|
fieldId: o.fieldId,
|
||||||
}
|
fieldValue: o.fieldValue
|
||||||
return acc;
|
}));
|
||||||
}, formDataInitial);
|
formDataInitial = submitData.reduce((acc, cur) => {
|
||||||
|
if (cur.fieldValue) {
|
||||||
|
acc[cur.fieldId] = cur.fieldValue;
|
||||||
|
}
|
||||||
|
return acc;
|
||||||
|
}, formDataInitial);
|
||||||
|
}
|
||||||
|
|
||||||
|
reset();
|
||||||
|
setFormInitialData(formDataInitial);
|
||||||
}
|
}
|
||||||
|
|
||||||
reset();
|
|
||||||
setFormInitialData(formDataInitial);
|
|
||||||
}
|
}
|
||||||
storeSet.main.unsetAsyncRequest();
|
storeSet.main.unsetAsyncRequest();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user