diff --git a/.env b/.env
index 0b1a428..9ef0c84 100644
--- a/.env
+++ b/.env
@@ -3,4 +3,5 @@ REACT_APP_API_EXECUTION_ADDRESS=https://api-dev-gepafin.memento.credit/v1
REACT_APP_API_ADDRESS=https://api-dev-gepafin.memento.credit
REACT_APP_LOGO_FILENAME=gepafin-logo.svg
REACT_APP_FAVICON_FILENAME=gepafin-favicon.ico
-REACT_APP_HUB_ID=p4lk3bcx1RStqTaIVVbXs
\ No newline at end of file
+REACT_APP_HUB_ID=p4lk3bcx1RStqTaIVVbXs
+REACT_APP_EVALUATION_FLOW_ID=1
\ No newline at end of file
diff --git a/environments/dev/dev.env b/environments/dev/dev.env
index 0b1a428..9ef0c84 100644
--- a/environments/dev/dev.env
+++ b/environments/dev/dev.env
@@ -3,4 +3,5 @@ REACT_APP_API_EXECUTION_ADDRESS=https://api-dev-gepafin.memento.credit/v1
REACT_APP_API_ADDRESS=https://api-dev-gepafin.memento.credit
REACT_APP_LOGO_FILENAME=gepafin-logo.svg
REACT_APP_FAVICON_FILENAME=gepafin-favicon.ico
-REACT_APP_HUB_ID=p4lk3bcx1RStqTaIVVbXs
\ No newline at end of file
+REACT_APP_HUB_ID=p4lk3bcx1RStqTaIVVbXs
+REACT_APP_EVALUATION_FLOW_ID=1
\ No newline at end of file
diff --git a/environments/prod/prod.env b/environments/prod/prod.env
index 6e25d7d..1755a33 100644
--- a/environments/prod/prod.env
+++ b/environments/prod/prod.env
@@ -3,4 +3,5 @@ REACT_APP_API_EXECUTION_ADDRESS=https://bandi-api.gepafin.it/v1
REACT_APP_API_ADDRESS=https://bandi-api.gepafin.it
REACT_APP_LOGO_FILENAME=gepafin-logo.svg
REACT_APP_FAVICON_FILENAME=gepafin-favicon.ico
-REACT_APP_HUB_ID=p4lk3bcx1RStqTaIVVbXs
\ No newline at end of file
+REACT_APP_HUB_ID=p4lk3bcx1RStqTaIVVbXs
+REACT_APP_EVALUATION_FLOW_ID=1
\ No newline at end of file
diff --git a/src/assets/scss/components/appPage.scss b/src/assets/scss/components/appPage.scss
index 4a1771b..a347c24 100644
--- a/src/assets/scss/components/appPage.scss
+++ b/src/assets/scss/components/appPage.scss
@@ -208,10 +208,18 @@
column-count: 2;
column-width: 4em;
display: block;
- padding-bottom: 0;
+ /*padding-bottom: 0;*/
.appPageSection__pMeta {
margin-bottom: 1em;
+
+ span:nth-of-type(1) {
+ max-width: 30%;
+ }
+ span:nth-of-type(2) {
+ max-width: 60%;
+ text-align: right;
+ }
}
}
}
@@ -221,22 +229,30 @@
flex-direction: column;
padding: 0;
width: 100%;
+ list-style: inside;
+}
- > li {
- padding: 15px;
- border-bottom: 1px solid var(--button-secondary-borderColor);
- display: flex;
- justify-content: space-between;
- align-items: center;
- flex-direction: column;
- gap: 1rem;
-
- &.row {
- flex-direction: row;
- }
+.appPageSection__listItem {
+ padding: 15px;
+ border-bottom: 1px solid var(--button-secondary-borderColor);
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ flex-direction: column;
+ gap: 1rem;
+
+ &.row {
+ flex-direction: row;
}
}
+.appPageSection__listItemRow {
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+ gap: 16px;
+}
+
.appPageSection__checklist {
display: flex;
flex-direction: column;
diff --git a/src/assets/scss/components/myTable.scss b/src/assets/scss/components/myTable.scss
index bbfbb2a..67b3b41 100644
--- a/src/assets/scss/components/myTable.scss
+++ b/src/assets/scss/components/myTable.scss
@@ -23,6 +23,9 @@
border-width: 0 0 1px 0;
padding: 1rem 1rem;
}
+ tr.outgoing {
+ background-color: #DAF0C3B2;
+ }
}
.myTfoot {
diff --git a/src/components/FormField/components/Datepicker/index.js b/src/components/FormField/components/Datepicker/index.js
index b33c13c..f4164c5 100644
--- a/src/components/FormField/components/Datepicker/index.js
+++ b/src/components/FormField/components/Datepicker/index.js
@@ -1,7 +1,7 @@
import React from 'react';
import { classNames } from 'primereact/utils';
import { Controller } from 'react-hook-form';
-import { is } from 'ramda';
+import { is, isEmpty } from 'ramda';
import { Calendar } from 'primereact/calendar';
@@ -30,7 +30,7 @@ const Datepicker = ({
rules={config}
render={({ field, fieldState }) => ( field.onChange(e.value)}
dateFormat="dd/mm/yy"
hourFormat="24"
diff --git a/src/pages/BandoEdit/components/BandoEditFormStep2/index.js b/src/pages/BandoEdit/components/BandoEditFormStep2/index.js
index 8ce097e..d8483b2 100644
--- a/src/pages/BandoEdit/components/BandoEditFormStep2/index.js
+++ b/src/pages/BandoEdit/components/BandoEditFormStep2/index.js
@@ -284,7 +284,7 @@ const BandoEditFormStep2 = forwardRef(function ({ initialData, setInitialData, g
options={checklistOptions}
errors={errors}
register={register}
- label={<>{__('Checklist valutazione Pre-Istruttoria', 'gepafin')}*
+ label={<>{__('Checklist valutazione Istruttoria', 'gepafin')}*
{__('(almeno 1 elemento)', 'gepafin')}>}
config={{
validate: {
diff --git a/src/pages/Dashboard/components/DraftApplicationsTable/index.js b/src/pages/Dashboard/components/DraftApplicationsTable/index.js
index e3d9a5c..a356d68 100644
--- a/src/pages/Dashboard/components/DraftApplicationsTable/index.js
+++ b/src/pages/Dashboard/components/DraftApplicationsTable/index.js
@@ -173,9 +173,15 @@ const DraftApplicationsTable = () => {
emptyMessage={translationStrings.emptyMessage}
onFilter={(e) => setFilters(e.filters)}>
-
+
{/* {
style={{ minWidth: '8rem' }}
body={dateModifyBodyTemplate} filter filterElement={dateFilterTemplate}/>*/}
diff --git a/src/pages/DashboardBeneficiario/components/MyLatestSubmissionsTable/index.js b/src/pages/DashboardBeneficiario/components/MyLatestSubmissionsTable/index.js
index e7a488d..9baac7b 100644
--- a/src/pages/DashboardBeneficiario/components/MyLatestSubmissionsTable/index.js
+++ b/src/pages/DashboardBeneficiario/components/MyLatestSubmissionsTable/index.js
@@ -178,16 +178,26 @@ const MyLatestSubmissionsTable = () => {
header={header}
emptyMessage={translationStrings.emptyMessage}
onFilter={(e) => setFilters(e.filters)}>
-
+
+ body={dateEndBodyTemplate}
+ filter
+ filterElement={dateFilterTemplate}/>
+ body={dateModifyBodyTemplate}
+ filter
+ filterElement={dateFilterTemplate}/>
diff --git a/src/pages/DashboardBeneficiario/index.js b/src/pages/DashboardBeneficiario/index.js
index 6503111..66ac510 100644
--- a/src/pages/DashboardBeneficiario/index.js
+++ b/src/pages/DashboardBeneficiario/index.js
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react';
-import { __, sprintf } from '@wordpress/i18n';
+import { __ } from '@wordpress/i18n';
import { Link, useNavigate } from 'react-router-dom';
import { head, isEmpty, pathOr } from 'ramda';
import NumberFlow from '@number-flow/react';
diff --git a/src/pages/DashboardPreInstructor/components/PreInstructorDomandeTable/index.js b/src/pages/DashboardPreInstructor/components/PreInstructorDomandeTable/index.js
index ab5fe5a..0a8b59a 100644
--- a/src/pages/DashboardPreInstructor/components/PreInstructorDomandeTable/index.js
+++ b/src/pages/DashboardPreInstructor/components/PreInstructorDomandeTable/index.js
@@ -158,10 +158,15 @@ const PreInstructorDomandeTable = () => {
emptyMessage={translationStrings.emptyMessage}
onFilter={(e) => setFilters(e.filters)}>
+
{
const isAsyncRequest = useStore().main.isAsyncRequest();
@@ -34,12 +32,22 @@ const DomandaBeneficiario = () => {
const navigate = useNavigate();
const [data, setData] = useState({});
const [dataAppl, setDataAppl] = useState({});
- const [comms, setComms] = useState([]);
- const [isVisibleNewCommDialog, setIsVisibleNewCommDialog] = useState(false);
- const [newCommData, setNewCommData] = useState({});
- const [isLoadingCommunication, setIsLoadingCommunication] = useState(false);
const [isVisibleEmailDialog, setIsVisibleEmailDialog] = useState(false);
const toast = useRef(null);
+ const [formInitialData, setFormInitialData] = useState({});
+ const {
+ control,
+ handleSubmit,
+ formState: { errors },
+ setValue,
+ register,
+ trigger,
+ getValues
+ } = useForm({
+ defaultValues: useMemo(() => {
+ return formInitialData;
+ }, [formInitialData]), mode: 'onChange'
+ });
const goToArchivePage = () => {
navigate(`/domande`);
@@ -57,8 +65,15 @@ const DomandaBeneficiario = () => {
const getCallback = (data) => {
if (data.status === 'SUCCESS') {
if (data.data.length) {
- setData(getFormattedData(data.data[0]));
- CommunicationService.getCommsByAmendmentId(data.data[0].id, getCommsCallback, errGetCommsCallback);
+ const amendmentObj = data.data[0];
+ setData(getFormattedData(amendmentObj));
+ const formDataInitial = amendmentObj.applicationFormFields.reduce((acc, cur) => {
+ if (cur.fieldValue) {
+ acc[cur.fieldId] = cur.fieldValue;
+ }
+ return acc;
+ }, {});
+ setFormInitialData(formDataInitial);
storeSet.main.unsetAsyncRequest();
} else {
ApplicationService.getApplication(id, getApplCallback, errGetCallback)
@@ -85,25 +100,6 @@ const DomandaBeneficiario = () => {
storeSet.main.unsetAsyncRequest();
}
- const getCommsCallback = (data) => {
- if (data.status === 'SUCCESS') {
- setComms(data.data.commentsList.map(o => getFormattedCommsData(o)));
- }
- storeSet.main.unsetAsyncRequest();
- }
-
- const errGetCommsCallback = (data) => {
- if (toast.current && data.message) {
- toast.current.show({
- severity: 'error',
- summary: '',
- detail: data.message
- });
- }
- set404FromErrorResponse(data);
- storeSet.main.unsetAsyncRequest();
- }
-
const getFormattedData = (data) => {
data.submissionDate = is(String, data.submissionDate) ? new Date(data.submissionDate) : (data.submissionDate ? data.submissionDate : '');
data.startDate = is(String, data.startDate) ? new Date(data.startDate) : (data.startDate ? data.startDate : '');
@@ -111,55 +107,36 @@ const DomandaBeneficiario = () => {
return data;
};
- const getFormattedCommsData = (data) => {
- data.id = isNil(data.id) ? uniqid('id') : data.id;
- data.commentedDate = is(String, data.commentedDate) ? new Date(data.commentedDate) : (data.commentedDate ? data.commentedDate : '');
- data.createdDate = is(String, data.createdDate) ? new Date(data.createdDate) : (data.createdDate ? data.createdDate : '');
- data.updatedDate = is(String, data.updatedDate) ? new Date(data.updatedDate) : (data.updatedDate ? data.updatedDate : '');
- return data;
+ const onSubmit = () => {
};
- const headerNewComDialog = () => {
- return {__('Aggiungi comunicazione', 'gepafin')}
+ const doUpdateAmendment = () => {
+ trigger();
+ let formValues = klona(getValues());
+ const newFormValues = Object.keys(formValues)
+ .reduce((acc, cur) => {
+ let fieldVal = formValues[cur];
+
+ fieldVal = isEmpty(fieldVal) ? null : fieldVal;
+ fieldVal = is(Array, fieldVal) ? fieldVal.map(o => o.id).join(',') : null;
+
+ acc.push({
+ 'fieldId': cur,
+ 'fieldValue': fieldVal
+ });
+ return acc;
+ }, []);
+
+ const submitData = {
+ applicationFormFields: newFormValues,
+ }
+ const amendmentId = data.id;
+
+ storeSet.main.setAsyncRequest();
+ AmendmentsService.updateSoccorso(amendmentId, submitData, updateAmendmentCallback, errUpdateAmendmentCallback);
}
- const hideNewComDialog = () => {
- setIsVisibleNewCommDialog(false);
- setNewCommData({
- title: '',
- comment: ''
- });
- }
-
- const footerNewComDialog = () => {
- return
-
-
- }
-
- const openNewCommDialog = () => {
- setIsVisibleNewCommDialog(true);
- setNewCommData({
- title: '',
- comment: ''
- });
- }
-
- const updateNewCommData = (value, path) => {
- const newData = wrap(newCommData).set(path.split('.'), value).value();
- setNewCommData(newData);
- }
-
- const createCommunication = () => {
- setIsLoadingCommunication(true);
- CommunicationService.createCommunication(data.id, newCommData, createCommunicationCallback, errCreateCommunicationCallback);
- }
-
- const createCommunicationCallback = (data) => {
+ const updateAmendmentCallback = (data) => {
if (data.status === 'SUCCESS') {
if (toast.current) {
toast.current.show({
@@ -168,13 +145,11 @@ const DomandaBeneficiario = () => {
detail: data.message
});
}
- setComms([...comms, getFormattedCommsData(data.data)])
- setIsVisibleNewCommDialog(false);
}
- setIsLoadingCommunication(false);
+ storeSet.main.unsetAsyncRequest();
}
- const errCreateCommunicationCallback = (data) => {
+ const errUpdateAmendmentCallback = (data) => {
if (toast.current && data.message) {
toast.current.show({
severity: 'error',
@@ -183,7 +158,7 @@ const DomandaBeneficiario = () => {
});
}
set404FromErrorResponse(data);
- setIsLoadingCommunication(false);
+ storeSet.main.unsetAsyncRequest();
}
return (
@@ -272,61 +247,53 @@ const DomandaBeneficiario = () => {
{data.id
?
-
{__('Dettagli Richiesta', 'gepafin')}
-
{__('Documenti Richiesti', 'gepafin')}
-
+ {__('Dettagli Richiesta', 'gepafin')}
+ {__('Note e spiegazioni', 'gepafin')}
+
+ {renderHtmlContent(data.note)}
+
+
: null}
+
+ {data.id
+ ?
+
{__('Documenti Richiesti', 'gepafin')}
+
+ {/*
{data.formFields
? data.formFields.map((o, i) => -
{o.label}
) : null}
-
-
: null}
+ */}
+ : null}
{data.id
?
-
{__('Note e spiegazioni', 'gepafin')}
-
- {renderHtmlContent(data.note)}
-
-
: null}
-
- {data.id
- ?
-
{__('Comunicazioni', 'gepafin')}
-
-
-
- | {__('Data', 'gepafin')} |
- {__('Comunicazione', 'gepafin')} |
-
-
-
- {!isNil(comms) && !isEmpty(comms)
- ? comms.map((o, i) =>
- |
- {getDateFromISOstring(o.commentedDate)}
- |
-
- {o.title}
- {o.comment}
- |
-
)
- :
- | - |
- - |
-
}
-
-
-
-
+
{__('Comunicazioni', 'gepafin')}
+
: null}
{data.id
@@ -354,40 +321,8 @@ const DomandaBeneficiario = () => {
icon="pi pi-times" iconPos="right"/>
-
-
-
-
{__('Stato', 'gepafin')}
- {getBandoLabel(data.status)}
+ {getBandoLabel(data.applicationStatus)}
-
-
-
+
{__('Punteggi di valutazione', 'gepafin')}
@@ -350,7 +413,7 @@ const DomandaEditPreInstructor = () => {
{
onClick={() => displayCriterionData(o.id)}
aria-label={__('Mostra', 'gepafin')}/> : null}
|