diff --git a/environments/dev/dev.env b/environments/dev/dev.env index 9ef0c84..38e36ec 100644 --- a/environments/dev/dev.env +++ b/environments/dev/dev.env @@ -4,4 +4,5 @@ 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 -REACT_APP_EVALUATION_FLOW_ID=1 \ No newline at end of file +REACT_APP_EVALUATION_FLOW_ID=1 +REACT_APP_LOCAL_DEVELOPMENT=0 \ No newline at end of file diff --git a/environments/prod/prod.env b/environments/prod/prod.env index 1755a33..ecbe860 100644 --- a/environments/prod/prod.env +++ b/environments/prod/prod.env @@ -4,4 +4,5 @@ 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 -REACT_APP_EVALUATION_FLOW_ID=1 \ No newline at end of file +REACT_APP_EVALUATION_FLOW_ID=1 +REACT_APP_LOCAL_DEVELOPMENT=0 \ No newline at end of file diff --git a/src/assets/scss/components/appPage.scss b/src/assets/scss/components/appPage.scss index da0721a..6e831bd 100644 --- a/src/assets/scss/components/appPage.scss +++ b/src/assets/scss/components/appPage.scss @@ -43,6 +43,10 @@ margin-left: 10px; text-transform: uppercase; } + + span.companyName { + margin: 0; + } } .appPage__spacer { diff --git a/src/assets/scss/components/fieldsRepeater.scss b/src/assets/scss/components/fieldsRepeater.scss new file mode 100644 index 0000000..05b478a --- /dev/null +++ b/src/assets/scss/components/fieldsRepeater.scss @@ -0,0 +1,23 @@ +.fieldsRepeater { + +} + +.fieldsRepeater form { + display: contents; +} + +.fieldsRepeater__panel { + +} + +.fieldsRepeater__heading { + +} + +.fieldsRepeater__fields { + +} + +.fieldsRepeater__addNew { + margin-top: 30px; +} \ No newline at end of file diff --git a/src/assets/scss/theme.scss b/src/assets/scss/theme.scss index 2bd1bad..4ad1ef5 100644 --- a/src/assets/scss/theme.scss +++ b/src/assets/scss/theme.scss @@ -43,4 +43,5 @@ @import "./components/flowBuilder.scss"; @import "./components/error404.scss"; @import "./components/myTable.scss"; -@import "./components/evaluation.scss"; \ No newline at end of file +@import "./components/evaluation.scss"; +@import "./components/fieldsRepeater.scss"; \ No newline at end of file diff --git a/src/pages/Applications/index.js b/src/pages/Applications/index.js index ad3393f..49bdd62 100644 --- a/src/pages/Applications/index.js +++ b/src/pages/Applications/index.js @@ -1,6 +1,10 @@ import React from 'react'; import { __ } from '@wordpress/i18n'; import { useNavigate } from 'react-router-dom'; +import { head } from 'ramda'; + +// store +import { storeGet, useStore } from '../../store'; // components import MyLatestSubmissionsTable from '../DashboardBeneficiario/components/MyLatestSubmissionsTable'; @@ -9,15 +13,20 @@ import ErrorBoundary from '../../components/ErrorBoundary'; const Applications = () => { const navigate = useNavigate(); + const chosenCompanyId = useStore().main.chosenCompanyId(); + const companies = useStore().main.companies(); + const company = head(companies.filter(o => o.id === chosenCompanyId)); const gotToBandiDisponibili = () => { navigate('/bandi') } + console.log('company', company, chosenCompanyId, companies) return(

{__('Domande in Lavorazione', 'gepafin')}

+ {/*{company ? {company.companyName} : null}*/}
diff --git a/src/pages/DomandaEditPreInstructor/components/RepeaterFields/index.js b/src/pages/DomandaEditPreInstructor/components/RepeaterFields/index.js index d824974..46b6708 100644 --- a/src/pages/DomandaEditPreInstructor/components/RepeaterFields/index.js +++ b/src/pages/DomandaEditPreInstructor/components/RepeaterFields/index.js @@ -21,12 +21,14 @@ const RepeaterFields = ({ sourceId, sourceName }) => { setValue, register, trigger, - getValues + getValues, + watch } = useForm({ defaultValues: useMemo(() => { return formInitialData; }, [formInitialData]), mode: 'onChange' }); + const watchName = watch('name'); const onSubmit = () => { }; @@ -49,19 +51,20 @@ const RepeaterFields = ({ sourceId, sourceName }) => { } useEffect(() => { + trigger(); + }, [chosen]); - }, [chosen]) console.log('items', items); return (
{items - ? items.map(o =>
-
- {o.name} + ? items.map(o =>
+
+ {chosen.fieldId === o.fieldId ? watchName : o.name}
{chosen.fieldId === o.fieldId - ?
+ ?
{ ) : null}
-
+ {/*

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

-
+
*/}

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

@@ -589,7 +589,7 @@ const DomandaEditPreInstructor = () => {
-
+ {/*

{__('Documenti di soccorso', 'gepafin')}

{ name="files" ndg={data.ndg} applicationId={id}/> -
+
*/}

{__('Punteggi di valutazione', 'gepafin')}

diff --git a/src/service/network-service.js b/src/service/network-service.js index fd4ba3f..616a800 100644 --- a/src/service/network-service.js +++ b/src/service/network-service.js @@ -8,8 +8,8 @@ export class NetworkService { static REFRESH_TOKEN_KEY static logApiError = (endpoint, status = 0, resp = {}) => { - console.log('status:', status); if (status === 500) { + console.log('status:', status, LOCAL_DEVELOPMENT); if (LOCAL_DEVELOPMENT !== '1') { try { Sentry.init({