From a5b817e999cdf404779eaebabd1376ae28c8a3e2 Mon Sep 17 00:00:00 2001 From: Vitalii Kiiko Date: Tue, 15 Oct 2024 12:42:10 +0200 Subject: [PATCH 01/25] - updated form element settings; --- .../BuilderElementSettings/index.js | 72 +++++++++++++++++-- 1 file changed, 67 insertions(+), 5 deletions(-) diff --git a/src/pages/BandoFormsEdit/components/BuilderElementSettings/index.js b/src/pages/BandoFormsEdit/components/BuilderElementSettings/index.js index 9ade547..2e91fd9 100644 --- a/src/pages/BandoFormsEdit/components/BuilderElementSettings/index.js +++ b/src/pages/BandoFormsEdit/components/BuilderElementSettings/index.js @@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react'; import { head, isEmpty, isNil } from 'ramda'; import { __, sprintf } from '@wordpress/i18n'; import { klona } from 'klona'; +import { wrap } from 'object-path-immutable'; // store import { storeSet, useStore } from '../../../../store'; @@ -21,6 +22,7 @@ const BuilderElementSettings = ({ closeSettings }) => { const [activeElementData, setActiveElementData] = useState({}); const [settings, setSettings] = useState([]); const [validators, setValidators] = useState({}); + const [dynamicData, setDynamicData] = useState({}); const textBasedValidatorFields = ['min', 'max', 'minLength', 'maxLength', 'pattern']; const customValidationOptions = [ { value: 'isPIVA', label: 'isPIVA' }, @@ -63,9 +65,11 @@ const BuilderElementSettings = ({ closeSettings }) => { } const saveSettings = () => { - activeElementData.settings = settings; - activeElementData.validators = validators; - const newElements = elements.map(o => o.id === activeElementData.id ? activeElementData : o); + let newActiveElementData = klona(activeElementData); + newActiveElementData = wrap(newActiveElementData).set(['settings'], settings).value(); + newActiveElementData = wrap(newActiveElementData).set(['validators'], validators).value(); + newActiveElementData = wrap(newActiveElementData).set(['dynamicData'], dynamicData).value(); + const newElements = elements.map(o => o.id === newActiveElementData.id ? newActiveElementData : o); storeSet.main.formElements(newElements); closeSettings(); } @@ -92,17 +96,49 @@ const BuilderElementSettings = ({ closeSettings }) => { setValidators(newValidators); } + const dynamicDataOptions = (type) => { + switch (type) { + case 'datepicker' : + return [ + {label: 'user dateOfBirth', value: 'user.dateOfBirth'} + ] + default : + return [ + {label: 'company name', value: 'company.companyName'}, + {label: 'company vatNumber', value: 'company.vatNumber'}, + {label: 'company codiceFiscale', value: 'company.codiceFiscale'}, + {label: 'company address', value: 'company.address'}, + {label: 'company phoneNumber', value: 'company.phoneNumber'}, + {label: 'company city', value: 'company.city'}, + {label: 'company province', value: 'company.province'}, + {label: 'company cap', value: 'company.cap'}, + {label: 'company country', value: 'company.country'}, + {label: 'company pec', value: 'company.pec'}, + {label: 'company email', value: 'company.email'}, + {label: 'company contactName', value: 'company.contactName'}, + {label: 'company contactEmail', value: 'company.contactEmail'}, + {label: 'user email', value: 'user.email'}, + {label: 'user firstName', value: 'user.firstName'}, + {label: 'user lastName', value: 'user.lastName'}, + {label: 'user phoneNumber', value: 'user.phoneNumber'}, + {label: 'user codiceFiscale', value: 'user.codiceFiscale'} + ] + } + } + useEffect(() => { const chosen = head(elements.filter(o => o.id === activeElement)); if (chosen) { setActiveElementData(klona(chosen)); setSettings(klona(chosen.settings)); - setValidators(klona(chosen.validators)) + setValidators(klona(chosen.validators)); + setDynamicData(chosen.dynamicData ? chosen.dynamicData : ''); } else { setActiveElementData({}); setSettings([]); - setValidators({}) + setValidators({}); + setDynamicData(''); } }, [activeElement]); @@ -118,6 +154,18 @@ const BuilderElementSettings = ({ closeSettings }) => { changeFn={onChange} updateDataFn={onUpdateOptions}/>) : null} + {['textinput', 'datepicker'].includes(activeElementData.name) + ?
+ + setDynamicData(e.value)} + options={dynamicDataOptions(activeElementData.name)} + optionLabel="label" + optionValue="value" + placeholder={__('Scegli', 'gepafin')}/> +
: null} {!isEmpty(validators) ? @@ -162,6 +210,20 @@ const BuilderElementSettings = ({ closeSettings }) => { : null} ) : null} : null} + {/*{['textinput', 'datepicker'].includes(activeElementData.name) + ? +
+ + onChangeDynamicData(e.value, 'dynamicData')} + options={customValidationOptions} + optionLabel="label" + optionValue="value" + placeholder={__('Scegli', 'gepafin')}/> +
+
: null}*/} + + + + + + + + + + + + ); + }; + + const header = renderHeader(); + useEffect(() => { const parsed = parseInt(id) const entityId = !isNaN(parsed) ? parsed : 0; @@ -75,6 +98,36 @@ const EvaluationEdit = () => { //BandoService.getBando(entityId, getCallback, errGetCallback); }, [id]); + // TODO + const checklist = [ + { + id: 1, + title: 'Requisiti di ammissibilità soddisfatti' + }, + { + id: 2, + title: 'Documentazione completa' + }, + { + id: 3, + title: 'Obiettivi del progetto chiari e misurabili' + } + ]; + const documents = [ + { + id: 1, + title: 'Doc 1' + }, + { + id: 2, + title: 'Bilancio ultimo esercizio Bilancio ultimo esercizio Bilancio ultimo esercizio' + }, + { + id: 3, + title: 'Bilancio ultimo esercizio' + } + ]; + return (
@@ -139,7 +192,16 @@ const EvaluationEdit = () => { {data.criteria.map(o => {o.title} {o.score} - + +
+
+ )} {__('Punteggio:', 'gepafin')} @@ -157,8 +219,49 @@ const EvaluationEdit = () => {

{__('Checklist Valutazione', 'gepafin')}

+
+
+

{__('Lista', 'gepafin')}

+
+
+ {checklist.map(o =>
+ console.log(e.checked)} + checked={false}> + +
)} +
+
- +

{__('Note', 'gepafin')}

+
+ setMessage(e.htmlValue)} + style={{ height: 80 * 3, width: '100%' }} + /> +
+
+
+

{__('Documenti allegati', 'gepafin')}

+
    + {documents.map(o =>
  1. + {o.title} +
    +
    +
  2. )} +
+
+
@@ -174,7 +277,7 @@ const EvaluationEdit = () => { outlined label={<> {__('Richiedi Soccorso Istruttorio', 'gepafin')} - + @@ -199,18 +302,18 @@ const EvaluationEdit = () => { icon="pi pi-save" iconPos="right"/>
: <> - + @@ -224,4 +327,4 @@ const EvaluationEdit = () => { } -export default EvaluationEdit; \ No newline at end of file +export default DomandaEdit; \ No newline at end of file diff --git a/src/pages/Evaluations/index.js b/src/pages/DomandePreInstructor/index.js similarity index 88% rename from src/pages/Evaluations/index.js rename to src/pages/DomandePreInstructor/index.js index 480b27e..1a24b3d 100644 --- a/src/pages/Evaluations/index.js +++ b/src/pages/DomandePreInstructor/index.js @@ -4,7 +4,7 @@ import { __ } from '@wordpress/i18n'; // components import PreInstructorDomandeTable from '../DashboardPreInstructor/components/PreInstructorDomandeTable'; -const Bandi = () => { +const DomandePreInstructor = () => { return(
@@ -20,4 +20,4 @@ const Bandi = () => { ) } -export default Bandi; \ No newline at end of file +export default DomandePreInstructor; \ No newline at end of file diff --git a/src/routes.js b/src/routes.js index da13510..a6f4764 100644 --- a/src/routes.js +++ b/src/routes.js @@ -27,9 +27,9 @@ import AddCompany from './pages/AddCompany'; import ResetPassword from './pages/ResetPassword'; import DashboardPreInstructor from './pages/DashboardPreInstructor'; import ProfileBeneficiario from './pages/ProfileBeneficiario'; -import Evaluations from './pages/Evaluations'; -import EvaluationEdit from './pages/EvaluationEdit'; import Domande from './pages/Domande'; +import DomandePreInstructor from './pages/DomandePreInstructor'; +import DomandaEdit from './pages/DomandaEdit'; const routes = ({ role, chosenCompanyId }) => { @@ -84,12 +84,12 @@ const routes = ({ role, chosenCompanyId }) => { {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} - {'ROLE_PRE_INSTRUCTOR' === role ? : null} + {'ROLE_PRE_INSTRUCTOR' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} - {'ROLE_PRE_INSTRUCTOR' === role ? : null} + {'ROLE_PRE_INSTRUCTOR' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} From b2516bd023160d24dda1d857d768deeba435828a Mon Sep 17 00:00:00 2001 From: Vitalii Kiiko Date: Tue, 29 Oct 2024 16:34:55 +0100 Subject: [PATCH 15/25] - updated; --- .env | 2 +- src/assets/scss/components/appPage.scss | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.env b/.env index ef771f4..0b1a428 100644 --- a/.env +++ b/.env @@ -1,6 +1,6 @@ REACT_APP_TAB_TITLE=Gepafin 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.png +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 diff --git a/src/assets/scss/components/appPage.scss b/src/assets/scss/components/appPage.scss index 34917f0..5196065 100644 --- a/src/assets/scss/components/appPage.scss +++ b/src/assets/scss/components/appPage.scss @@ -110,6 +110,15 @@ margin: 0 0 24px; } + h3 { + color: var(--global-textColor); + font-size: 16px; + font-style: normal; + font-weight: 600; + line-height: normal; + margin: 0 0 16px; + } + .row { display: flex; gap: 1rem; From eeecbf2c6968222d168e28f33307cbd9b173a27f Mon Sep 17 00:00:00 2001 From: Vitalii Kiiko Date: Tue, 29 Oct 2024 16:48:12 +0100 Subject: [PATCH 16/25] - save progress; --- src/pages/BandoViewBeneficiario/index.js | 5 +-- src/pages/SoccorsoEditPreInstructor/index.js | 34 ++++++++++++++++++-- src/service/communication-service.js | 6 +++- 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/src/pages/BandoViewBeneficiario/index.js b/src/pages/BandoViewBeneficiario/index.js index b8b672e..679bfc9 100644 --- a/src/pages/BandoViewBeneficiario/index.js +++ b/src/pages/BandoViewBeneficiario/index.js @@ -406,9 +406,10 @@ const BandoViewBeneficiario = () => { : null}
-

{__('Download Documenti', 'gepafin')}

+ {/*

{__('Download Documenti', 'gepafin')}

*/} +

{__('Partecipa', 'gepafin')}

- {/*
diff --git a/src/service/communication-service.js b/src/service/communication-service.js index 1e13bff..4481621 100644 --- a/src/service/communication-service.js +++ b/src/service/communication-service.js @@ -5,6 +5,10 @@ const API_BASE_URL = process.env.REACT_APP_API_EXECUTION_ADDRESS; export default class CommunicationService { static getCommsByAmendmentId = (id, callback, errCallback, queryParams) => { - NetworkService.get(`${API_BASE_URL}/amendments/applicationEvaluation/${id}`, callback, errCallback, queryParams); + NetworkService.get(`${API_BASE_URL}/communication/${id}`, callback, errCallback, queryParams); + }; + + static getCommsByAmendmentId = (id, callback, errCallback, queryParams) => { + NetworkService.get(`${API_BASE_URL}/communication/${id}`, callback, errCallback, queryParams); }; } From 780cb633a258e4630e1445940bbc5bab99d6a453 Mon Sep 17 00:00:00 2001 From: Vitalii Kiiko Date: Tue, 29 Oct 2024 17:18:07 +0100 Subject: [PATCH 17/25] - saving progress; --- src/pages/SoccorsoAddPreInstructor/index.js | 6 +- src/pages/SoccorsoEditPreInstructor/index.js | 123 +++++++++++++------ src/routes.js | 2 +- src/service/communication-service.js | 4 +- 4 files changed, 90 insertions(+), 45 deletions(-) diff --git a/src/pages/SoccorsoAddPreInstructor/index.js b/src/pages/SoccorsoAddPreInstructor/index.js index 0af256d..8def4b1 100644 --- a/src/pages/SoccorsoAddPreInstructor/index.js +++ b/src/pages/SoccorsoAddPreInstructor/index.js @@ -1,20 +1,17 @@ import React, { useState, useEffect, useRef } from 'react'; import { __ } from '@wordpress/i18n'; import { useNavigate, useParams } from 'react-router-dom'; -import { is, isEmpty } from 'ramda'; +import { isEmpty } from 'ramda'; import { wrap } from 'object-path-immutable'; // store import { storeSet, useStore } from '../../store'; // api -import ApplicationEvaluationService from '../../service/application-evaluation-service'; import AmendmentsService from '../../service/amendments-service'; // tools import set404FromErrorResponse from '../../helpers/set404FromErrorResponse'; -import getBandoLabel from '../../helpers/getBandoLabel'; -import getDateFromISOstring from '../../helpers/getDateFromISOstring'; // components import { Skeleton } from 'primereact/skeleton'; @@ -24,7 +21,6 @@ import { Editor } from 'primereact/editor'; import { InputNumber } from 'primereact/inputnumber'; import BlockingOverlay from '../../components/BlockingOverlay'; import { Toast } from 'primereact/toast'; -import HelpIcon from '../../icons/HelpIcon'; import { InputSwitch } from 'primereact/inputswitch'; const SoccorsoEditPreInstructor = () => { diff --git a/src/pages/SoccorsoEditPreInstructor/index.js b/src/pages/SoccorsoEditPreInstructor/index.js index 13be91a..d0835be 100644 --- a/src/pages/SoccorsoEditPreInstructor/index.js +++ b/src/pages/SoccorsoEditPreInstructor/index.js @@ -1,41 +1,41 @@ import React, { useState, useEffect, useRef } from 'react'; -import { __, sprintf } from '@wordpress/i18n'; +import { __ } from '@wordpress/i18n'; import { useNavigate, useParams } from 'react-router-dom'; -import { is, isEmpty, isNil, sum, pathOr } from 'ramda'; -import { klona } from 'klona'; +import { is, isEmpty, isNil } from 'ramda'; import { wrap } from 'object-path-immutable'; // store import { storeSet, useStore } from '../../store'; // api -import ApplicationEvaluationService from '../../service/application-evaluation-service'; +import AmendmentsService from '../../service/amendments-service'; +import CommunicationService from '../../service/communication-service'; // tools import set404FromErrorResponse from '../../helpers/set404FromErrorResponse'; import getBandoLabel from '../../helpers/getBandoLabel'; import getDateFromISOstring from '../../helpers/getDateFromISOstring'; +import renderHtmlContent from '../../helpers/renderHtmlContent'; // components import { Skeleton } from 'primereact/skeleton'; import { Button } from 'primereact/button'; -import { Tag } from 'primereact/tag'; -import { Checkbox } from 'primereact/checkbox'; -import { Editor } from 'primereact/editor'; -import { InputNumber } from 'primereact/inputnumber'; import BlockingOverlay from '../../components/BlockingOverlay'; import { Toast } from 'primereact/toast'; -import HelpIcon from '../../icons/HelpIcon'; -import AmendmentsService from '../../service/amendments-service'; -import renderHtmlContent from '../../helpers/renderHtmlContent'; -import CommunicationService from '../../service/communication-service'; +import { classNames } from 'primereact/utils'; +import { Dialog } from 'primereact/dialog'; +import { InputText } from 'primereact/inputtext'; +import { InputTextarea } from 'primereact/inputtextarea'; const SoccorsoEditPreInstructor = () => { const isAsyncRequest = useStore().main.isAsyncRequest(); - const { id, amendmendId } = useParams(); + const { id, amendmentId } = useParams(); const navigate = useNavigate(); const [data, setData] = useState({}); const [comms, setComms] = useState([]); + const [isVisibleNewCommDialog, setIsVisibleNewCommDialog] = useState(false); + const [newCommData, setNewCommData] = useState({}); + const [isLoadingCommunication, setIsLoadingCommunication] = useState(false); const toast = useRef(null); const goToEvaluationPage = () => { @@ -107,28 +107,49 @@ const SoccorsoEditPreInstructor = () => { const header = renderHeader(); - const updateEvaluationValue = (value, path, maxValue) => { - let finalValue = value; - - if (maxValue) { - finalValue = value > maxValue ? maxValue : value; - } - - const newData = wrap(data).set(path.split('.'), finalValue).value(); - setData(newData); + const headerEditDialog = () => { + return {__('Aggiungi comunicazione', 'gepafin')} } - /*const doSaveDraft = () => { - const formData = { - criteria: klona(data.criteria), - checklist: klona(data.checklist), - files: klona(data.files), - note: data.note - } - ApplicationEvaluationService.updateEvaluation(id, formData, updateCallback, errUpdateCallback); + const hideEditDialog = () => { + setIsVisibleNewCommDialog(false); + setNewCommData({ + title: '', + comment: '' + }); } - const updateCallback = (data) => { + const footerEditDialog = () => { + 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(newCommData, createCommunicationCallback, errCreateCommunicationCallback, [ + ['amendmentId', amendmentId] + ]); + } + + const createCommunicationCallback = (data) => { if (data.status === 'SUCCESS') { if (toast.current) { toast.current.show({ @@ -137,11 +158,12 @@ const SoccorsoEditPreInstructor = () => { detail: data.message }); } + console.log(data.data) } - storeSet.main.unsetAsyncRequest(); + setIsLoadingCommunication(false); } - const errUpdateCallback = (data) => { + const errCreateCommunicationCallback = (data) => { if (toast.current && data.message) { toast.current.show({ severity: 'error', @@ -150,15 +172,15 @@ const SoccorsoEditPreInstructor = () => { }); } set404FromErrorResponse(data); - storeSet.main.unsetAsyncRequest(); - }*/ + setIsLoadingCommunication(false); + } useEffect(() => { - const parsedSoccorsoId = parseInt(amendmendId) + const parsedSoccorsoId = parseInt(amendmentId); const soccorsoEntityId = !isNaN(parsedSoccorsoId) ? parsedSoccorsoId : 0; AmendmentsService.getSoccorsoById(getCallback, errGetCallback, [['id', soccorsoEntityId]]); - }, [amendmendId]); + }, [amendmentId]); return (
@@ -255,6 +277,7 @@ const SoccorsoEditPreInstructor = () => {
) diff --git a/src/routes.js b/src/routes.js index f94adfe..db2d8de 100644 --- a/src/routes.js +++ b/src/routes.js @@ -99,7 +99,7 @@ const routes = ({ role, chosenCompanyId }) => { {'ROLE_BENEFICIARY' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} }/> - + {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} diff --git a/src/service/communication-service.js b/src/service/communication-service.js index 4481621..758b7fd 100644 --- a/src/service/communication-service.js +++ b/src/service/communication-service.js @@ -8,7 +8,7 @@ export default class CommunicationService { NetworkService.get(`${API_BASE_URL}/communication/${id}`, callback, errCallback, queryParams); }; - static getCommsByAmendmentId = (id, callback, errCallback, queryParams) => { - NetworkService.get(`${API_BASE_URL}/communication/${id}`, callback, errCallback, queryParams); + static createCommunication = (body, callback, errCallback, queryParams) => { + NetworkService.post(`${API_BASE_URL}/communication`, body, callback, errCallback, queryParams); }; } From 579cb2da3b1762e780ff2111eff527bc28f79a1a Mon Sep 17 00:00:00 2001 From: Vitalii Kiiko Date: Wed, 30 Oct 2024 11:38:18 +0100 Subject: [PATCH 18/25] - saving progress; --- src/assets/scss/components/appForm.scss | 1 + src/assets/scss/components/layout.scss | 4 + src/helpers/getBandoLabel.js | 6 + src/helpers/getBandoSeverity.js | 6 + src/pages/BandoViewBeneficiario/index.js | 3 +- src/pages/SoccorsoAddPreInstructor/index.js | 2 +- src/pages/SoccorsoEditPreInstructor/index.js | 368 ++++++++++++++++--- src/service/amendments-service.js | 16 + src/service/communication-service.js | 4 +- 9 files changed, 358 insertions(+), 52 deletions(-) diff --git a/src/assets/scss/components/appForm.scss b/src/assets/scss/components/appForm.scss index 9b8b5c8..bb2c482 100644 --- a/src/assets/scss/components/appForm.scss +++ b/src/assets/scss/components/appForm.scss @@ -2,6 +2,7 @@ display: flex; flex-direction: column; gap: 24px; + width: 100%; } .appForm__field { position: relative; diff --git a/src/assets/scss/components/layout.scss b/src/assets/scss/components/layout.scss index e94353e..714504e 100644 --- a/src/assets/scss/components/layout.scss +++ b/src/assets/scss/components/layout.scss @@ -22,6 +22,10 @@ body { h2, h3, p, label, .appPageSection__hr { color: var(--global-textColor); } + + textarea { + max-width: 100%; + } } #root, .wrapper { diff --git a/src/helpers/getBandoLabel.js b/src/helpers/getBandoLabel.js index 35a850e..43abcd3 100644 --- a/src/helpers/getBandoLabel.js +++ b/src/helpers/getBandoLabel.js @@ -17,6 +17,9 @@ const getBandoLabel = (status) => { case 'READY': return __('Pronto', 'gepafin'); + case 'SOCCORSO': + return __('Soccorso', 'gepafin'); + case 'DRAFT': return __('Bozza', 'gepafin'); @@ -38,6 +41,9 @@ const getBandoLabel = (status) => { case 'EXPIRED': return __('Scaduto', 'gepafin'); + case 'CLOSE': + return __('Chiuso', 'gepafin'); + default: return ''; } diff --git a/src/helpers/getBandoSeverity.js b/src/helpers/getBandoSeverity.js index d090c80..631cfe6 100644 --- a/src/helpers/getBandoSeverity.js +++ b/src/helpers/getBandoSeverity.js @@ -15,6 +15,9 @@ const getBandoSeverity = (status) => { case 'READY': return 'info'; + case 'SOCCORSO': + return 'warning'; + case 'DRAFT': return 'warning'; @@ -36,6 +39,9 @@ const getBandoSeverity = (status) => { case 'EXPIRED': return 'closed'; + case 'CLOSE': + return 'closed'; + default: return 'info'; } diff --git a/src/pages/BandoViewBeneficiario/index.js b/src/pages/BandoViewBeneficiario/index.js index 92d2ac2..c76735f 100644 --- a/src/pages/BandoViewBeneficiario/index.js +++ b/src/pages/BandoViewBeneficiario/index.js @@ -406,8 +406,7 @@ const BandoViewBeneficiario = () => { : null}
- {/*

{__('Download Documenti', 'gepafin')}

*/} -

{__('Partecipa', 'gepafin')}

+

{__('Download Documenti', 'gepafin')}

{/*
- {__('Azioni rapide', 'gepafin')} + {__('Azioni', 'gepafin')}
diff --git a/src/pages/SoccorsoEditPreInstructor/index.js b/src/pages/SoccorsoEditPreInstructor/index.js index d0835be..f048d4e 100644 --- a/src/pages/SoccorsoEditPreInstructor/index.js +++ b/src/pages/SoccorsoEditPreInstructor/index.js @@ -1,7 +1,7 @@ -import React, { useState, useEffect, useRef } from 'react'; +import React, { useState, useEffect, useRef, useMemo } from 'react'; import { __ } from '@wordpress/i18n'; import { useNavigate, useParams } from 'react-router-dom'; -import { is, isEmpty, isNil } from 'ramda'; +import { head, is, isEmpty, isNil, pathOr } from 'ramda'; import { wrap } from 'object-path-immutable'; // store @@ -26,6 +26,13 @@ import { classNames } from 'primereact/utils'; import { Dialog } from 'primereact/dialog'; import { InputText } from 'primereact/inputtext'; import { InputTextarea } from 'primereact/inputtextarea'; +import { klona } from 'klona'; +import { useForm } from 'react-hook-form'; +import FormField from '../../components/FormField'; +import uniqid from '../../helpers/uniqid'; +import { Editor } from 'primereact/editor'; +import { TZDate } from '@date-fns/tz'; +import { InputNumber } from 'primereact/inputnumber'; const SoccorsoEditPreInstructor = () => { const isAsyncRequest = useStore().main.isAsyncRequest(); @@ -36,10 +43,28 @@ const SoccorsoEditPreInstructor = () => { const [isVisibleNewCommDialog, setIsVisibleNewCommDialog] = useState(false); const [newCommData, setNewCommData] = useState({}); const [isLoadingCommunication, setIsLoadingCommunication] = useState(false); + const [isVisibleExtendTimeDialog, setIsVisibleExtendTimeDialog] = useState(false); + const [extendedTime, setExtendedTime] = useState(3); + const [isLoadingExtendingTime, setIsLoadingExtendingTime] = useState(false); const toast = useRef(null); + const [formInitialData, setFormInitialData] = useState({}); + const { + control, + handleSubmit, + formState: { errors, isValid }, + setValue, + register, + trigger, + getValues, + clearErrors + } = useForm({ + defaultValues: useMemo(() => { + return formInitialData; + }, [formInitialData]), mode: 'onChange' + }); const goToEvaluationPage = () => { - //navigate('/domande'); + navigate(`/domande/${id}`); } const getCallback = (data) => { @@ -64,7 +89,7 @@ const SoccorsoEditPreInstructor = () => { const getCommsCallback = (data) => { if (data.status === 'SUCCESS') { - setComms(data.data.commentsList); + setComms(data.data.commentsList.map(o => getFormattedCommsData(o))); } storeSet.main.unsetAsyncRequest(); } @@ -87,31 +112,19 @@ const SoccorsoEditPreInstructor = () => { return data; }; - const renderHeader = () => { - return ( - - - - - - - - - - - - - - ); + 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 header = renderHeader(); - - const headerEditDialog = () => { + const headerNewComDialog = () => { return {__('Aggiungi comunicazione', 'gepafin')} } - const hideEditDialog = () => { + const hideNewComDialog = () => { setIsVisibleNewCommDialog(false); setNewCommData({ title: '', @@ -119,9 +132,9 @@ const SoccorsoEditPreInstructor = () => { }); } - const footerEditDialog = () => { + const footerNewComDialog = () => { return
- + + + + + + + + + + + + ); + }; + + const header = renderHeader(); + + const updateNewAmendmentData = (value, path) => { + const newData = wrap(data).set(path.split('.'), value).value(); + setData(newData); + } + const createCommunication = () => { setIsLoadingCommunication(true); - CommunicationService.createCommunication(newCommData, createCommunicationCallback, errCreateCommunicationCallback, [ - ['amendmentId', amendmentId] - ]); + CommunicationService.createCommunication(amendmentId, newCommData, createCommunicationCallback, errCreateCommunicationCallback); } const createCommunicationCallback = (data) => { @@ -158,7 +194,8 @@ const SoccorsoEditPreInstructor = () => { detail: data.message }); } - console.log(data.data) + setComms([...comms, getFormattedCommsData(data.data)]) + setIsVisibleNewCommDialog(false); } setIsLoadingCommunication(false); } @@ -175,6 +212,150 @@ const SoccorsoEditPreInstructor = () => { setIsLoadingCommunication(false); } + const onSubmit = () => { + }; + + 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 = { + updatedFormFields: newFormValues, + //note: data.internalNote + } + + storeSet.main.setAsyncRequest(); + AmendmentsService.updateSoccorso(amendmentId, submitData, updateAmendmentCallback, errUpdateAmendmentCallback); + } + + const updateAmendmentCallback = (data) => { + if (data.status === 'SUCCESS') { + if (toast.current) { + toast.current.show({ + severity: 'success', + summary: '', + detail: data.message + }); + } + } + storeSet.main.unsetAsyncRequest(); + } + + const errUpdateAmendmentCallback = (data) => { + if (toast.current && data.message) { + toast.current.show({ + severity: 'error', + summary: '', + detail: data.message + }); + } + set404FromErrorResponse(data); + storeSet.main.unsetAsyncRequest(); + } + + const doCloseAmendment = () => { + const submitData = { + internalNote: data.internalNote + } + storeSet.main.setAsyncRequest(); + AmendmentsService.closeSoccorso(amendmentId, submitData, closeAmendmentCallback, errCloseAmendmentCallback); + } + + const closeAmendmentCallback = (data) => { + if (data.status === 'SUCCESS') { + if (toast.current) { + toast.current.show({ + severity: 'success', + summary: '', + detail: data.message + }); + } + if (data.data.status) { + updateNewAmendmentData(data.data.status, 'status') + } + } + storeSet.main.unsetAsyncRequest(); + } + + const errCloseAmendmentCallback = (data) => { + if (toast.current && data.message) { + toast.current.show({ + severity: 'error', + summary: '', + detail: data.message + }); + } + set404FromErrorResponse(data); + storeSet.main.unsetAsyncRequest(); + } + + const headerExtendRespDialog = () => { + return {__('Estendi scadenza', 'gepafin')} + } + + const hideExtendRespDialog = () => { + setIsVisibleExtendTimeDialog(false); + } + + const footerExtendRespDialog = () => { + return
+
+ } + + const openExtendResponseTimeDialog = () => { + setIsVisibleExtendTimeDialog(true); + setExtendedTime(3); + } + + const doExtendTimeResponse = () => { + setIsLoadingExtendingTime(true); + AmendmentsService.extendSoccorso(amendmentId, extendedTime, extendCallback, errExtendCallback); + } + + const extendCallback = (data) => { + if (data.status === 'SUCCESS') { + if (toast.current) { + toast.current.show({ + severity: 'success', + summary: '', + detail: data.message + }); + } + setIsVisibleExtendTimeDialog(false); + } + setIsLoadingExtendingTime(false); + } + + const errExtendCallback = (data) => { + if (toast.current && data.message) { + toast.current.show({ + severity: 'error', + summary: '', + detail: data.message + }); + } + set404FromErrorResponse(data); + setIsLoadingExtendingTime(false); + } + useEffect(() => { const parsedSoccorsoId = parseInt(amendmentId); const soccorsoEntityId = !isNaN(parsedSoccorsoId) ? parsedSoccorsoId : 0; @@ -228,7 +409,7 @@ const SoccorsoEditPreInstructor = () => {

{__('Stato', 'gepafin')} - {getBandoLabel(data.applicationStatus)} + {getBandoLabel(data.status)}

@@ -245,7 +426,8 @@ const SoccorsoEditPreInstructor = () => {

{__('Note e spiegazioni', 'gepafin')}

-
+
{renderHtmlContent(data.note)}
@@ -265,51 +447,121 @@ const SoccorsoEditPreInstructor = () => { {!isNil(comms) && !isEmpty(comms) ? comms.map((o, i) => - - - ) : null} - - - - - - + + {getDateFromISOstring(o.commentedDate)} + + +

{o.title}

+

{o.comment}

+ + ) + : + - + - + }
+
+

{__('Documenti Ricevuti', 'gepafin')}

+ + + {data.formFields.map((o, i) => { + const test = { + 'updatedFormFields': [ + { + 'fieldId': 'a5867bdceb', + 'fieldValue': '136' + }, + { + 'fieldId': 'ab0f00219b', + 'fieldValue': null + } + ] + } + const thisField = head(test.updatedFormFields.filter(j => j.fieldId === o.fieldId)); + const value = pathOr({}, ['fieldValue'], thisField); + console.log('value', value, o.fieldId); + return + })} + + +
+
- {__('Azioni rapide', 'gepafin')} + {__('Azioni', 'gepafin')}
+
+ +
+ updateNewAmendmentData( + e.htmlValue, + 'internalNote' + )} + style={{ height: 80 * 3, width: '100%' }} + /> +
+
+
: <> @@ -325,10 +577,10 @@ const SoccorsoEditPreInstructor = () => { + onHide={hideNewComDialog}>
- updateNewCommData(e.target.value, 'comment')}/> + updateNewCommData(e.target.value, 'comment')}/> +
+
+ + +
+ + setExtendedTime(e.value)}/>
diff --git a/src/service/amendments-service.js b/src/service/amendments-service.js index d7ed4c1..1cacf79 100644 --- a/src/service/amendments-service.js +++ b/src/service/amendments-service.js @@ -15,4 +15,20 @@ export default class AmendmentsService { static createSoccorso = (body, callback, errCallback, queryParams) => { NetworkService.post(`${API_BASE_URL}/amendments`, body, callback, errCallback, queryParams); }; + + static updateSoccorso = (id, body, callback, errCallback, queryParams) => { + NetworkService.put(`${API_BASE_URL}/amendments/${id}`, body, callback, errCallback, queryParams); + }; + + static extendSoccorso = (id, days, callback, errCallback, queryParams) => { + NetworkService.put(`${API_BASE_URL}/amendments/${id}/extendExpiration`, {}, callback, errCallback, [ + ['extendedDays', days] + ]); + }; + + static closeSoccorso = (id, body, callback, errCallback, queryParams) => { + NetworkService.put(`${API_BASE_URL}/amendments`, body, callback, errCallback, [ + ['id', id] + ]); + }; } diff --git a/src/service/communication-service.js b/src/service/communication-service.js index 758b7fd..2b39271 100644 --- a/src/service/communication-service.js +++ b/src/service/communication-service.js @@ -8,7 +8,7 @@ export default class CommunicationService { NetworkService.get(`${API_BASE_URL}/communication/${id}`, callback, errCallback, queryParams); }; - static createCommunication = (body, callback, errCallback, queryParams) => { - NetworkService.post(`${API_BASE_URL}/communication`, body, callback, errCallback, queryParams); + static createCommunication = (id, body, callback, errCallback, queryParams) => { + NetworkService.post(`${API_BASE_URL}/communication/${id}`, body, callback, errCallback, queryParams); }; } From 5ecf4b51816cbb2d59df6d48326aee0dde6771c2 Mon Sep 17 00:00:00 2001 From: Vitalii Kiiko Date: Thu, 31 Oct 2024 10:06:32 +0100 Subject: [PATCH 19/25] - added page with evalutions; - added page with amendements; - implemented communication for amendment; - implemented amendment creation; --- .../PreInstructorDomandeTable/index.js | 6 +- .../components/AllDomandeTable/index.js | 4 +- src/pages/Domande/index.js | 23 +++++++- .../PreInstructorSoccorsiTable/index.js | 55 ++++++++++--------- src/service/amendments-service.js | 4 ++ 5 files changed, 56 insertions(+), 36 deletions(-) diff --git a/src/pages/DashboardPreInstructor/components/PreInstructorDomandeTable/index.js b/src/pages/DashboardPreInstructor/components/PreInstructorDomandeTable/index.js index a6ed4b5..84c5d93 100644 --- a/src/pages/DashboardPreInstructor/components/PreInstructorDomandeTable/index.js +++ b/src/pages/DashboardPreInstructor/components/PreInstructorDomandeTable/index.js @@ -125,11 +125,7 @@ const PreInstructorDomandeTable = () => { }; const actionsBodyTemplate = (rowData) => { - /*return
+ } + + const openNewCommDialog = () => { + setIsVisibleNewCommDialog(true); + setNewCommData({ + title: '', + comment: '' + }); + } + + const updateNewCommData = (value, path) => { + const newData = wrap(newCommData).set(path.split('.'), value).value(); + setNewCommData(newData); + } + + const renderHeader = () => { + return ( + + + + + + + + + + + + + + ); + }; + + const header = renderHeader(); + + const updateNewAmendmentData = (value, path) => { + const newData = wrap(data).set(path.split('.'), value).value(); + setData(newData); + } + + const createCommunication = () => { + setIsLoadingCommunication(true); + const amendmentId = 0 + CommunicationService.createCommunication(amendmentId, newCommData, createCommunicationCallback, errCreateCommunicationCallback); + } + + const createCommunicationCallback = (data) => { + if (data.status === 'SUCCESS') { + if (toast.current) { + toast.current.show({ + severity: 'success', + summary: '', + detail: data.message + }); + } + setComms([...comms, getFormattedCommsData(data.data)]) + setIsVisibleNewCommDialog(false); + } + setIsLoadingCommunication(false); + } + + const errCreateCommunicationCallback = (data) => { + if (toast.current && data.message) { + toast.current.show({ + severity: 'error', + summary: '', + detail: data.message + }); + } + set404FromErrorResponse(data); + setIsLoadingCommunication(false); + } + + useEffect(() => { + const parsedId = parseInt(id); + const entityId = !isNaN(parsedId) ? parsedId : 0; + + AmendmentsService.getSoccorsoByApplId(entityId, getCallback, errGetCallback, [ + ['statuses', 'AWAITING'] + ]); + }, [id]); + + return ( +
+
+

{sprintf(__('Soccorso Istruttorio: richiesta integrazione documenti per domanda #%s', 'gepafin'), id)}

+
+ +
+ + + +
+
+ +
+ +
+
+

+ {__('ID domanda', 'gepafin')} + {data.applicationId} +

+

+ {__('Bando', 'gepafin')} + {data.callName} +

+

+ {__('Beneficiario', 'gepafin')} + {data.beneficiaryName} +

+

+ {__('Inizio', 'gepafin')} + {getDateFromISOstring(data.startDate)} +

+

+ {__('Scadenza', 'gepafin')} + {getDateFromISOstring(data.expirationDate)} +

+

+ {__('Stato', 'gepafin')} + {getBandoLabel(data.status)} +

+
+ +
+

{__('Dettagli Richiesta', 'gepafin')}

+
+
+

{__('Documenti Richiesti', 'gepafin')}

+
    + {data.formFields + ? data.formFields.map((o, i) =>
  1. + {o.label} +
  2. ) : null} +
+
+
+

{__('Note e spiegazioni', 'gepafin')}

+
+ {renderHtmlContent(data.note)} +
+
+ +
+
+ +
+

{__('Comunicazioni', 'gepafin')}

+ + + + + + + + + {!isNil(comms) && !isEmpty(comms) + ? comms.map((o, i) => + + + ) + : + + + } + +
{__('Data', 'gepafin')}{__('Comunicazione', 'gepafin')}
+ {getDateFromISOstring(o.commentedDate)} + +

{o.title}

+

{o.comment}

+
--
+ +
+ +
+ + {__('Attenzione', 'gepafin')} + {__('Inviare la documentazione richiesta completa delle integrazioni esclusivamente via PEC. In caso contarrio l’integrazione non può essere ritenuta valida.', 'gepafin')} +
+ +
+
+
+
+ + +
+ + +
+ + updateNewCommData(e.target.value, 'title')}/> + + + updateNewCommData(e.target.value, 'comment')}/> +
+
+
+ ) + +} + +export default DomandaBeneficiario; \ No newline at end of file diff --git a/src/pages/DomandaEditPreInstructor/index.js b/src/pages/DomandaEditPreInstructor/index.js index 26e9e35..9560664 100644 --- a/src/pages/DomandaEditPreInstructor/index.js +++ b/src/pages/DomandaEditPreInstructor/index.js @@ -1,7 +1,7 @@ import React, { useState, useEffect, useRef } from 'react'; import { __, sprintf } from '@wordpress/i18n'; import { useNavigate, useParams } from 'react-router-dom'; -import { is, isEmpty, isNil, sum, pathOr } from 'ramda'; +import { is, isEmpty, isNil, sum, pathOr, head } from 'ramda'; import { klona } from 'klona'; import { wrap } from 'object-path-immutable'; @@ -26,13 +26,16 @@ import { InputNumber } from 'primereact/inputnumber'; import BlockingOverlay from '../../components/BlockingOverlay'; import { Toast } from 'primereact/toast'; import HelpIcon from '../../icons/HelpIcon'; +import { Dialog } from 'primereact/dialog'; const DomandaEditPreInstructor = () => { const isAsyncRequest = useStore().main.isAsyncRequest(); const { id } = useParams(); const navigate = useNavigate(); const [data, setData] = useState({}); - const [message, setMessage] = useState(''); + const [isVisibleCriterionData, setIsVisibleCriterionData] = useState(0); + const [criterionDataTitle, setCriterionDataTitle] = useState(''); + const [criterionDataContent, setCriterionDataContent] = useState(''); const [isAdmissible, setIsAdmissible] = useState(false); const toast = useRef(null); @@ -107,7 +110,7 @@ const DomandaEditPreInstructor = () => { files: klona(data.files), note: data.note } - ApplicationEvaluationService.updateEvaluation(id, formData, updateCallback, errUpdateCallback); + ApplicationEvaluationService.updateEvaluation(data.assignedApplicationId, formData, updateCallback, errUpdateCallback); } const updateCallback = (data) => { @@ -135,6 +138,66 @@ const DomandaEditPreInstructor = () => { storeSet.main.unsetAsyncRequest(); } + const doApprove = () => { + const formData = { + status: 'APPROVED' + } + ApplicationEvaluationService.updateEvaluation(data.assignedApplicationId, formData, updateStatusCallback, errUpdateStatusCallback); + } + + const doReject = () => { + const formData = { + status: 'REJECTED' + } + ApplicationEvaluationService.updateEvaluation(data.assignedApplicationId, formData, updateStatusCallback, errUpdateStatusCallback); + } + + const updateStatusCallback = (data) => { + if (data.status === 'SUCCESS') { + if (toast.current) { + toast.current.show({ + severity: 'success', + summary: '', + detail: data.message + }); + } + } + storeSet.main.unsetAsyncRequest(); + } + + const errUpdateStatusCallback = (data) => { + if (toast.current && data.message) { + toast.current.show({ + severity: 'error', + summary: '', + detail: data.message + }); + } + set404FromErrorResponse(data); + storeSet.main.unsetAsyncRequest(); + } + + const displayCriterionData = (id) => { + const criterion = head(data.criteria.filter(o => o.id === id)); + console.log(id, criterion); + setCriterionDataTitle(criterion.label); + const content =
+

{__('I campi correlati')}

+ {criterion.criteriaMappedFields.map(o =>
+ {o.fieldLabel} + {o.fieldValue} +
)} +
; + setCriterionDataContent(content); + setIsVisibleCriterionData(id); + } + + const hideCriterionData = () => { + setIsVisibleCriterionData(0); + setCriterionDataTitle(''); + setCriterionDataContent(''); + } + useEffect(() => { const maxScore = pathOr(0, ['minScore'], data); const criteria = pathOr([], ['criteria'], data); @@ -236,7 +299,9 @@ const DomandaEditPreInstructor = () => {
{!isEmpty(o.criteriaMappedFields) - ?
+ {o.fileDetail.length > 1 + ?
    + {o.fileDetail.map((k, i) =>
  • + {k.name} +
    +
    +
  • )} +
+ : null} )} @@ -370,15 +466,25 @@ const DomandaEditPreInstructor = () => {
- } + }*/ const rowExpansionTemplate = (data) => { return ( diff --git a/src/pages/BandoApplication/index.js b/src/pages/BandoApplication/index.js index 4d97627..cbc7d22 100644 --- a/src/pages/BandoApplication/index.js +++ b/src/pages/BandoApplication/index.js @@ -333,6 +333,7 @@ const BandoApplication = () => { }, dynamicData); if (data.data.applicationFormResponse.content) { + // eslint-disable-next-line array-callback-return data.data.applicationFormResponse.content.map((o) => { if (o.dynamicData && !isEmpty(o.dynamicData)) { formDataInitial[o.id] = pathOr('', o.dynamicData.split('.'), dynamicData); diff --git a/src/pages/Dashboard/components/LatestBandiTable/index.js b/src/pages/Dashboard/components/LatestBandiTable/index.js index a85dd9f..b1b1b36 100644 --- a/src/pages/Dashboard/components/LatestBandiTable/index.js +++ b/src/pages/Dashboard/components/LatestBandiTable/index.js @@ -2,13 +2,6 @@ import React, { useState, useEffect} from 'react'; import { __ } from '@wordpress/i18n'; import { uniq } from 'ramda'; -// tools -import getBandoLabel from '../../../../helpers/getBandoLabel'; -import getBandoSeverity from '../../../../helpers/getBandoSeverity'; - -// store -import { storeSet } from '../../../../store'; - // api import BandoService from '../../../../service/bando-service'; @@ -19,11 +12,8 @@ import { Column } from 'primereact/column'; import { InputText } from 'primereact/inputtext'; import { IconField } from 'primereact/iconfield'; import { InputIcon } from 'primereact/inputicon'; -import { Dropdown } from 'primereact/dropdown'; -import { InputNumber } from 'primereact/inputnumber'; import { Button } from 'primereact/button'; import { Calendar } from 'primereact/calendar'; -import { Tag } from 'primereact/tag'; import ProperBandoLabel from '../../../../components/ProperBandoLabel'; import { Link } from 'react-router-dom'; @@ -120,22 +110,10 @@ const LatestBandiTable = () => { return options.filterCallback(e.value, options.index)} dateFormat="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999" />; }; - const balanceFilterTemplate = (options) => { - return options.filterCallback(e.value, options.index)} />; - }; - const statusBodyTemplate = (rowData) => { return ; }; - const statusFilterTemplate = (options) => { - return options.filterCallback(e.value, options.index)} itemTemplate={statusItemTemplate} placeholder="Select One" className="p-column-filter" showClear />; - }; - - const statusItemTemplate = (option) => { - return ; - }; - const actionsBodyTemplate = (rowData) => { return - - - - - - - - - - - - ); - }; - - const header = renderHeader(); - - const updateNewAmendmentData = (value, path) => { - const newData = wrap(data).set(path.split('.'), value).value(); - setData(newData); - } - const createCommunication = () => { setIsLoadingCommunication(true); CommunicationService.createCommunication(data.id, newCommData, createCommunicationCallback, errCreateCommunicationCallback); diff --git a/src/pages/DomandaEditPreInstructor/index.js b/src/pages/DomandaEditPreInstructor/index.js index 3a6d384..117caf0 100644 --- a/src/pages/DomandaEditPreInstructor/index.js +++ b/src/pages/DomandaEditPreInstructor/index.js @@ -189,7 +189,7 @@ const DomandaEditPreInstructor = () => { setCriterionDataTitle(criterion.label); const content =

{__('I campi correlati')}

- {criterion.criteriaMappedFields.map(o => criteriaDataItem(o))} + {criterion.criteriaMappedFields ? criterion.criteriaMappedFields.map(o => criteriaDataItem(o)) : null}
; setCriterionDataContent(content); setIsVisibleCriterionData(id); @@ -438,7 +438,7 @@ const DomandaEditPreInstructor = () => { }}> {o.label}
- {o.fileDetail.length === 1 + {o.fileDetail && o.fileDetail.length === 1 ?
- {o.fileDetail.length > 1 + {o.fileDetail && o.fileDetail.length > 1 ?
    { const [loading, setLoading] = useState(false); diff --git a/src/pages/SoccorsoEditPreInstructor/index.js b/src/pages/SoccorsoEditPreInstructor/index.js index 72e7455..573a43e 100644 --- a/src/pages/SoccorsoEditPreInstructor/index.js +++ b/src/pages/SoccorsoEditPreInstructor/index.js @@ -50,7 +50,7 @@ const SoccorsoEditPreInstructor = () => { const { control, handleSubmit, - formState: { errors, isValid }, + formState: { errors }, setValue, register, trigger, diff --git a/src/pages/SoccorsoIstruttorioPreInstructor/components/PreInstructorSoccorsiTable/index.js b/src/pages/SoccorsoIstruttorioPreInstructor/components/PreInstructorSoccorsiTable/index.js index 9610ba7..31a6a70 100644 --- a/src/pages/SoccorsoIstruttorioPreInstructor/components/PreInstructorSoccorsiTable/index.js +++ b/src/pages/SoccorsoIstruttorioPreInstructor/components/PreInstructorSoccorsiTable/index.js @@ -4,10 +4,10 @@ import { is, uniq } from 'ramda'; import { Link } from 'react-router-dom'; // store -import { storeSet, storeGet } from '../../../../store'; +import { storeGet } from '../../../../store'; // api -import ApplicationService from '../../../../service/application-service'; + // components import { FilterMatchMode, FilterOperator } from 'primereact/api';