From ee47a48f99c66443f036b9e6cc96db6c6e0340d4 Mon Sep 17 00:00:00 2001 From: Vitalii Kiiko Date: Thu, 14 Nov 2024 11:45:06 +0100 Subject: [PATCH 1/6] - saving progress; --- src/pages/BandiBeneficiario/index.js | 2 - .../components/BandoEditFormStep1/index.js | 39 +++++++++++-------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/pages/BandiBeneficiario/index.js b/src/pages/BandiBeneficiario/index.js index 66942d3..8165092 100644 --- a/src/pages/BandiBeneficiario/index.js +++ b/src/pages/BandiBeneficiario/index.js @@ -1,10 +1,8 @@ import React from 'react'; import { __ } from '@wordpress/i18n'; -import { useNavigate } from 'react-router-dom'; // components import AllBandiAccordion from './components/AllBandiAccordion'; -import { Button } from 'primereact/button'; const BandiBeneficiario = () => { return( diff --git a/src/pages/BandoEdit/components/BandoEditFormStep1/index.js b/src/pages/BandoEdit/components/BandoEditFormStep1/index.js index 4117123..8f92b67 100644 --- a/src/pages/BandoEdit/components/BandoEditFormStep1/index.js +++ b/src/pages/BandoEdit/components/BandoEditFormStep1/index.js @@ -176,8 +176,12 @@ const BandoEditFormStep1 = forwardRef(function ({ initialData, getFormErrors, st storeSet.main.unsetAsyncRequest(); } - const shouldDisableField = () => { - return values.status === 'PUBLISH' + const shouldDisableField = (fieldName) => { + return values.status === 'PUBLISH' && + ![ + 'descriptionShort', 'descriptionLong', 'documentationRequested', 'threshold', + 'aimedTo', 'criteria', 'docs', 'checklist', 'faq' + ].includes(fieldName) } useImperativeHandle( @@ -239,7 +243,7 @@ const BandoEditFormStep1 = forwardRef(function ({ initialData, getFormErrors, st Date: Thu, 14 Nov 2024 12:15:37 +0100 Subject: [PATCH 2/6] - modifications as per task #70; - removed html nesting in faq items; - removed html tags in faq item titles in the dropdown; --- src/components/FormFieldRepeaterFaq/index.js | 10 ++++++++-- src/pages/BandoViewBeneficiario/index.js | 20 +++++++++++++++++-- .../components/LatestBandiTable/index.js | 12 ++++------- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/src/components/FormFieldRepeaterFaq/index.js b/src/components/FormFieldRepeaterFaq/index.js index 0d16fa3..2420943 100644 --- a/src/components/FormFieldRepeaterFaq/index.js +++ b/src/components/FormFieldRepeaterFaq/index.js @@ -12,6 +12,7 @@ import { Dialog } from 'primereact/dialog'; import { InputSwitch } from 'primereact/inputswitch'; import renderHtmlContent from '../../helpers/renderHtmlContent'; import { Editor } from 'primereact/editor'; +import DOMPurify from 'dompurify'; const FormFieldRepeaterFaq = ({ data, @@ -143,6 +144,10 @@ const FormFieldRepeaterFaq = ({ const header = renderHeader(); + const faqOptionTemplate = (option) => { + return DOMPurify.sanitize(option.title, {ALLOWED_TAGS: ['#text']}); + } + useEffect(() => { const storeFieldData = data ?? []; setStateFieldData(storeFieldData); @@ -180,6 +185,7 @@ const FormFieldRepeaterFaq = ({ disabled={disabled} optionDisabled={(opt) => usedExistingValues().includes(opt.title)} options={stateOptionsData} + itemTemplate={faqOptionTemplate} placeholder={__('Scegli tra quelli pre-creati', 'gepafin')} optionLabel="title"/> @@ -216,9 +222,9 @@ const FormFieldRepeaterFaq = ({ } > -

+ {renderHtmlContent(o.response)} -

+ )} { return !isNaN(parsed) ? parsed : 0; } + const submitBtnLabel = () => { + if (applicationObj && applicationObj.id) { + return __('Vai alla domanda', 'gepafin'); + } else { + return __('Presenta domanda', 'gepafin'); + } + } + + const submitBtnIcon = () => { + if (applicationObj && applicationObj.id) { + return 'pi pi-arrow-right'; + } else { + return 'pi pi-save'; + } + } + const submitApplication = () => { if (data.confidi) { displayConfidiPopup(); @@ -425,8 +441,8 @@ const BandoViewBeneficiario = () => { type="button" disabled={isAsyncRequest || chosenCompanyId === 0} onClick={submitApplication} - label={__('Presenta Domanda', 'gepafin')} - icon="pi pi-save" iconPos="right"/> + label={submitBtnLabel()} + icon={submitBtnIcon()} iconPos="right"/> {/* : null} - {data.confidi + {!isEmpty(chosenCompanyId) && chosenCompanyId !== 0 && data.confidi ? : null} diff --git a/src/pages/BandoViewBeneficiario/index.js b/src/pages/BandoViewBeneficiario/index.js index c452129..3496c13 100644 --- a/src/pages/BandoViewBeneficiario/index.js +++ b/src/pages/BandoViewBeneficiario/index.js @@ -247,13 +247,15 @@ const BandoViewBeneficiario = () => { const header = renderHeader(); useEffect(() => { - const bandoId = getBandoId(); - storeSet.main.setAsyncRequest(); - BandoService.getBando(bandoId, getBandoCallback, errGetBandoCallback); - ApplicationService.getApplications(getApplCallback, errGetApplCallback, [ - ['callId', bandoId], - ['companyId', chosenCompanyId] - ]) + if (!isEmpty(chosenCompanyId) && chosenCompanyId !== 0) { + const bandoId = getBandoId(); + storeSet.main.setAsyncRequest(); + BandoService.getBando(bandoId, getBandoCallback, errGetBandoCallback); + ApplicationService.getApplications(getApplCallback, errGetApplCallback, [ + ['callId', bandoId], + ['companyId', chosenCompanyId] + ]); + } }, [id, chosenCompanyId]); return ( diff --git a/src/pages/DashboardBeneficiario/components/LatestBandiTable/index.js b/src/pages/DashboardBeneficiario/components/LatestBandiTable/index.js index 5e381d9..a5dd246 100644 --- a/src/pages/DashboardBeneficiario/components/LatestBandiTable/index.js +++ b/src/pages/DashboardBeneficiario/components/LatestBandiTable/index.js @@ -1,10 +1,10 @@ import React, { useState, useEffect } from 'react'; import { __ } from '@wordpress/i18n'; -import { uniq } from 'ramda'; +import { isEmpty, uniq } from 'ramda'; import { Link } from 'react-router-dom'; // store -import { storeSet } from '../../../../store'; +import { storeSet, useStore } from '../../../../store'; // api import BandoService from '../../../../service/bando-service'; @@ -22,6 +22,7 @@ import ProperBandoLabel from '../../../../components/ProperBandoLabel'; const LatestBandiTable = () => { + const chosenCompanyId = useStore().main.chosenCompanyId(); const [items, setItems] = useState(null); const [filters, setFilters] = useState(null); const [loading, setLoading] = useState(false); @@ -145,8 +146,9 @@ const LatestBandiTable = () => { body={dateEndBodyTemplate} filter filterElement={dateFilterTemplate}/> - + {!isEmpty(chosenCompanyId) && chosenCompanyId !== 0 + ? : null} ) diff --git a/src/pages/DashboardBeneficiario/components/MyLatestSubmissionsTable/index.js b/src/pages/DashboardBeneficiario/components/MyLatestSubmissionsTable/index.js index 608b2ba..ce3f987 100644 --- a/src/pages/DashboardBeneficiario/components/MyLatestSubmissionsTable/index.js +++ b/src/pages/DashboardBeneficiario/components/MyLatestSubmissionsTable/index.js @@ -1,6 +1,6 @@ import React, { useState, useEffect } from 'react'; import { __ } from '@wordpress/i18n'; -import { uniq, is } from 'ramda'; +import { uniq, is, isEmpty } from 'ramda'; // tools import getBandoLabel from '../../../../helpers/getBandoLabel'; @@ -36,11 +36,13 @@ const MyLatestSubmissionsTable = () => { const [statuses, setStatuses] = useState([]); useEffect(() => { - setLocalAsyncRequest(true); - ApplicationService.getApplications(getApplCallback, errGetApplCallback, [ - ['companyId', chosenCompanyId], - ['statuses', ['DRAFT', 'AWAITING', 'READY']] - ]) + if (!isEmpty(chosenCompanyId) && chosenCompanyId !== 0) { + setLocalAsyncRequest(true); + ApplicationService.getApplications(getApplCallback, errGetApplCallback, [ + ['companyId', chosenCompanyId], + ['statuses', ['DRAFT', 'AWAITING', 'READY']] + ]); + } }, [chosenCompanyId]); const getApplCallback = (data) => { diff --git a/src/pages/DomandeBeneficiario/components/BeneficiarioDomandeTable/index.js b/src/pages/DomandeBeneficiario/components/BeneficiarioDomandeTable/index.js index d97fd2e..22ac157 100644 --- a/src/pages/DomandeBeneficiario/components/BeneficiarioDomandeTable/index.js +++ b/src/pages/DomandeBeneficiario/components/BeneficiarioDomandeTable/index.js @@ -1,6 +1,6 @@ import React, { useState, useEffect } from 'react'; import { __ } from '@wordpress/i18n'; -import { is, uniq } from 'ramda'; +import { is, isEmpty, uniq } from 'ramda'; import { Link } from 'react-router-dom'; // store @@ -36,11 +36,13 @@ const BeneficiarioDomandeTable = () => { const [statuses, setStatuses] = useState([]); useEffect(() => { - setLocalAsyncRequest(true); - ApplicationService.getApplications(getApplCallback, errGetApplCallback, [ - ['companyId', chosenCompanyId], - ['statuses', ['SOCCORSO', 'APPROVED', 'REJECTED', 'EVALUATION']] - ]) + if (!isEmpty(chosenCompanyId) && chosenCompanyId !== 0) { + setLocalAsyncRequest(true); + ApplicationService.getApplications(getApplCallback, errGetApplCallback, [ + ['companyId', chosenCompanyId], + ['statuses', ['SOCCORSO', 'APPROVED', 'REJECTED', 'EVALUATION']] + ]); + } }, [chosenCompanyId]); const getApplCallback = (data) => { From 11a1c351088797e3599b35a67264fd1948833d37 Mon Sep 17 00:00:00 2001 From: Vitalii Kiiko Date: Fri, 15 Nov 2024 14:28:23 +0100 Subject: [PATCH 5/6] - updates in labels and some refactoring; --- src/configData.js | 31 ++++++++++++++++++- .../components/BandoEditFormActions/index.js | 6 ++-- .../components/BandoEditFormStep1/index.js | 2 +- .../components/BandoEditFormStep2/index.js | 2 +- src/pages/BandoFlowEdit/index.js | 2 +- src/pages/BandoForms/index.js | 4 +-- .../ElementSettingTableColumns/index.js | 4 ++- .../BuilderElementSettings/index.js | 3 +- src/pages/BandoFormsEdit/index.js | 2 +- src/pages/DomandaEditPreInstructor/index.js | 4 +++ 10 files changed, 48 insertions(+), 12 deletions(-) diff --git a/src/configData.js b/src/configData.js index a7d3d1c..5de2560 100644 --- a/src/configData.js +++ b/src/configData.js @@ -13,4 +13,33 @@ export const mimeTypes = [ } ]; -export const defaultMaxFileSize = 314572800; // 314572800 = 300 Mb \ No newline at end of file +export const defaultMaxFileSize = 314572800; // 314572800 = 300 Mb + +const dynamicDataForTextinput = [ + { label: 'company name', value: 'company.companyName' }, + { label: 'company piva', 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' } +] + +export const dynamicDataOptions = { + datepicker: [ + { label: 'user dateOfBirth', value: 'user.dateOfBirth' } + ], + textinput: dynamicDataForTextinput, + textarea: dynamicDataForTextinput +} \ No newline at end of file diff --git a/src/pages/BandoEdit/components/BandoEditFormActions/index.js b/src/pages/BandoEdit/components/BandoEditFormActions/index.js index b431c89..4658387 100644 --- a/src/pages/BandoEdit/components/BandoEditFormActions/index.js +++ b/src/pages/BandoEdit/components/BandoEditFormActions/index.js @@ -5,7 +5,7 @@ import { isNil } from 'ramda'; // components import { Button } from 'primereact/button'; -const BandoEditFormActions = ({ id, openPreview, openPreviewEvaluation, submitFn, status }) => { +const BandoEditFormActions = ({ id, openPreview, submitFn, status }) => { return (
@@ -21,13 +21,13 @@ const BandoEditFormActions = ({ id, openPreview, openPreviewEvaluation, submitFn outlined onClick={openPreview} label={__('Anteprima beneficiario', 'gepafin')} icon="pi pi-eye" iconPos="right"/> -
) diff --git a/src/pages/BandoEdit/components/BandoEditFormStep1/index.js b/src/pages/BandoEdit/components/BandoEditFormStep1/index.js index 4e3d009..0baca40 100644 --- a/src/pages/BandoEdit/components/BandoEditFormStep1/index.js +++ b/src/pages/BandoEdit/components/BandoEditFormStep1/index.js @@ -112,7 +112,7 @@ const BandoEditFormStep1 = forwardRef(function ({ initialData, getFormErrors, st toast.current.show({ severity: 'success', summary: '', - detail: __('Il bando è stato aggiornato corretamente!', 'gepafin') + detail: __('Il bando è stato aggiornato correttamente!', 'gepafin') }); } const values = getValues(); diff --git a/src/pages/BandoEdit/components/BandoEditFormStep2/index.js b/src/pages/BandoEdit/components/BandoEditFormStep2/index.js index d861c97..5b8e098 100644 --- a/src/pages/BandoEdit/components/BandoEditFormStep2/index.js +++ b/src/pages/BandoEdit/components/BandoEditFormStep2/index.js @@ -104,7 +104,7 @@ const BandoEditFormStep2 = forwardRef(function ({ initialData, getFormErrors, st toast.current.show({ severity: 'success', summary: '', - detail: __('Il bando è stato aggiornato corretamente!', 'gepafin') + detail: __('Il bando è stato aggiornato correttamente!', 'gepafin') }); const newFormData = {...formInitialData, ...data.data}; setFormInitialData(newFormData); diff --git a/src/pages/BandoFlowEdit/index.js b/src/pages/BandoFlowEdit/index.js index f10d9e0..e6b210d 100644 --- a/src/pages/BandoFlowEdit/index.js +++ b/src/pages/BandoFlowEdit/index.js @@ -112,7 +112,7 @@ const BandoFlowEdit = () => { toast.current.show({ severity: 'success', summary: '', - detail: __('Il flusso è stato aggiornato corretamente!', 'gepafin') + detail: __('Il flusso è stato aggiornato correttamente!', 'gepafin') }); } } diff --git a/src/pages/BandoForms/index.js b/src/pages/BandoForms/index.js index ea70e59..cee1051 100644 --- a/src/pages/BandoForms/index.js +++ b/src/pages/BandoForms/index.js @@ -91,7 +91,7 @@ const BandoForms = () => { toast.current.show({ severity: 'success', summary: '', - detail: __('Il form è stato aggiornato corretamente!', 'gepafin') + detail: __('Il form è stato aggiornato correttamente!', 'gepafin') }); } @@ -235,7 +235,7 @@ const BandoForms = () => { outlined disabled={!selectedForm} onClick={goToEditForm} - label={'PUBLISH' === bandoStatus ? __('Mostra', 'gepafin') : __('Modifica', 'gepafin')} + label={__('Modifica', 'gepafin')} icon="pi pi-cog" iconPos="right"/> diff --git a/src/pages/BandoFormsEdit/components/BuilderElementSettings/components/ElementSettingTableColumns/index.js b/src/pages/BandoFormsEdit/components/BuilderElementSettings/components/ElementSettingTableColumns/index.js index 9681540..5537956 100644 --- a/src/pages/BandoFormsEdit/components/BuilderElementSettings/components/ElementSettingTableColumns/index.js +++ b/src/pages/BandoFormsEdit/components/BuilderElementSettings/components/ElementSettingTableColumns/index.js @@ -137,7 +137,9 @@ const ElementSettingTableColumns = ({ return
{properSubField(c, k, o.name)} -
diff --git a/src/pages/BandoFormsEdit/components/BuilderElementSettings/index.js b/src/pages/BandoFormsEdit/components/BuilderElementSettings/index.js index a22a4ac..79b8671 100644 --- a/src/pages/BandoFormsEdit/components/BuilderElementSettings/index.js +++ b/src/pages/BandoFormsEdit/components/BuilderElementSettings/index.js @@ -16,6 +16,7 @@ import { InputSwitch } from 'primereact/inputswitch'; import ElementSetting from './components/ElementSetting'; import { Dropdown } from 'primereact/dropdown'; import { MultiSelect } from 'primereact/multiselect'; +import { dynamicDataOptions } from '../../../../configData'; const BuilderElementSettings = ({ closeSettingsFn, bandoStatus }) => { const elements = useStore().main.formElements(); @@ -166,7 +167,7 @@ const BuilderElementSettings = ({ closeSettingsFn, bandoStatus }) => { changeFn={onChange} updateDataFn={onUpdateOptions}/>) : null} - {['textinput', 'datepicker'].includes(activeElementData.name) + {!isNil(dynamicDataOptions[activeElementData.name]) ?
{ toast.current.show({ severity: 'success', summary: '', - detail: __('Il form è stato aggiornato corretamente!', 'gepafin') + detail: __('Il form è stato aggiornato correttamente!', 'gepafin') }); } } diff --git a/src/pages/DomandaEditPreInstructor/index.js b/src/pages/DomandaEditPreInstructor/index.js index e3871e3..82d1dd3 100644 --- a/src/pages/DomandaEditPreInstructor/index.js +++ b/src/pages/DomandaEditPreInstructor/index.js @@ -329,6 +329,10 @@ const DomandaEditPreInstructor = () => {

+
+ +
+

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

{data.criteria From 7803816e219784a5b806190d6858123bb00426d3 Mon Sep 17 00:00:00 2001 From: Vitalii Kiiko Date: Fri, 15 Nov 2024 16:07:03 +0100 Subject: [PATCH 6/6] - added message for beneficiary about requirement of adding company; --- src/assets/scss/components/appPage.scss | 4 +++ src/assets/scss/components/layout.scss | 8 +++++ .../components/AllBandiAccordion/index.js | 7 +++-- src/pages/BandiBeneficiario/index.js | 21 +++++++++++-- .../components/LatestBandiTable/index.js | 10 ++++--- src/pages/DashboardBeneficiario/index.js | 30 ++++++++++++++----- 6 files changed, 63 insertions(+), 17 deletions(-) diff --git a/src/assets/scss/components/appPage.scss b/src/assets/scss/components/appPage.scss index c280975..54a8fba 100644 --- a/src/assets/scss/components/appPage.scss +++ b/src/assets/scss/components/appPage.scss @@ -276,6 +276,10 @@ .summary { font-weight: bold; } + + a { + color: inherit; + } } @container section_with_border (max-width: 600px) { diff --git a/src/assets/scss/components/layout.scss b/src/assets/scss/components/layout.scss index 7c6eb60..e226e1a 100644 --- a/src/assets/scss/components/layout.scss +++ b/src/assets/scss/components/layout.scss @@ -28,6 +28,14 @@ body { } } +a { + color: inherit; + + &:hover { + text-decoration: none; + } +} + #root, .wrapper { min-height: 100%; display: flex; diff --git a/src/pages/BandiBeneficiario/components/AllBandiAccordion/index.js b/src/pages/BandiBeneficiario/components/AllBandiAccordion/index.js index 8d167f8..a4cdef6 100644 --- a/src/pages/BandiBeneficiario/components/AllBandiAccordion/index.js +++ b/src/pages/BandiBeneficiario/components/AllBandiAccordion/index.js @@ -1,6 +1,6 @@ import React, { useState, useEffect} from 'react'; import { __ } from '@wordpress/i18n'; -import { is, uniq, isNil } from 'ramda'; +import { is, uniq, isNil, isEmpty } from 'ramda'; import { wrap } from 'object-path-immutable'; // store @@ -28,6 +28,7 @@ import set404FromErrorResponse from '../../../../helpers/set404FromErrorResponse const AllBandiAccordion = () => { + const chosenCompanyId = useStore().main.chosenCompanyId(); const isAsyncRequest = useStore().main.isAsyncRequest(); const [items, setItems] = useState(null); const [filters, setFilters] = useState(null); @@ -113,11 +114,11 @@ const AllBandiAccordion = () => {
{renderHtmlContent(data.descriptionShort)}

{__('Scadenza', 'gepafin')}: {getDateFromISOstring(data.dates[1])}

- {!data.confidi + {!isEmpty(chosenCompanyId) && chosenCompanyId !== 0 && !data.confidi ? : null} - {data.confidi + {!isEmpty(chosenCompanyId) && chosenCompanyId !== 0 && data.confidi ? : null} diff --git a/src/pages/BandiBeneficiario/index.js b/src/pages/BandiBeneficiario/index.js index 66942d3..ba0571d 100644 --- a/src/pages/BandiBeneficiario/index.js +++ b/src/pages/BandiBeneficiario/index.js @@ -1,13 +1,17 @@ import React from 'react'; import { __ } from '@wordpress/i18n'; -import { useNavigate } from 'react-router-dom'; +import { Link, useNavigate } from 'react-router-dom'; // components import AllBandiAccordion from './components/AllBandiAccordion'; import { Button } from 'primereact/button'; +import { isEmpty } from 'ramda'; +import { useStore } from '../../store'; const BandiBeneficiario = () => { - return( + const chosenCompanyId = useStore().main.chosenCompanyId(); + + return (

{__('Bandi disponibili', 'gepafin')}

@@ -15,6 +19,19 @@ const BandiBeneficiario = () => {
+ {isEmpty(chosenCompanyId) || chosenCompanyId === 0 + ? <> +
+ + {__('Attenzione', 'gepafin')} + + {__('Per applicare ai bandi devi Registare un Azienda clicca', 'gepafin')} + {__('qua', 'gepafin')} + +
+
+ : null} +
diff --git a/src/pages/DashboardBeneficiario/components/LatestBandiTable/index.js b/src/pages/DashboardBeneficiario/components/LatestBandiTable/index.js index 5e381d9..61bb789 100644 --- a/src/pages/DashboardBeneficiario/components/LatestBandiTable/index.js +++ b/src/pages/DashboardBeneficiario/components/LatestBandiTable/index.js @@ -1,10 +1,10 @@ import React, { useState, useEffect } from 'react'; import { __ } from '@wordpress/i18n'; -import { uniq } from 'ramda'; +import { uniq, isEmpty } from 'ramda'; import { Link } from 'react-router-dom'; // store -import { storeSet } from '../../../../store'; +import { storeSet, useStore } from '../../../../store'; // api import BandoService from '../../../../service/bando-service'; @@ -22,6 +22,7 @@ import ProperBandoLabel from '../../../../components/ProperBandoLabel'; const LatestBandiTable = () => { + const chosenCompanyId = useStore().main.chosenCompanyId(); const [items, setItems] = useState(null); const [filters, setFilters] = useState(null); const [loading, setLoading] = useState(false); @@ -145,8 +146,9 @@ const LatestBandiTable = () => { body={dateEndBodyTemplate} filter filterElement={dateFilterTemplate}/> - + {!isEmpty(chosenCompanyId) && chosenCompanyId !== 0 + ? : null}
) diff --git a/src/pages/DashboardBeneficiario/index.js b/src/pages/DashboardBeneficiario/index.js index 4500f0c..6503111 100644 --- a/src/pages/DashboardBeneficiario/index.js +++ b/src/pages/DashboardBeneficiario/index.js @@ -1,7 +1,7 @@ import React, { useEffect, useState } from 'react'; -import { __ } from '@wordpress/i18n'; -import { useNavigate } from 'react-router-dom'; -import { head, pathOr } from 'ramda'; +import { __, sprintf } from '@wordpress/i18n'; +import { Link, useNavigate } from 'react-router-dom'; +import { head, isEmpty, pathOr } from 'ramda'; import NumberFlow from '@number-flow/react'; // store @@ -35,7 +35,8 @@ const DashboardBeneficiario = () => { } } - const errGetStats = () => {} + const errGetStats = () => { + } useEffect(() => { const existingCompany = head(companies.filter(o => o.id === chosenCompanyId)); @@ -45,7 +46,7 @@ const DashboardBeneficiario = () => { } }, [companies, chosenCompanyId]); - return( + return (

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

@@ -61,21 +62,21 @@ const DashboardBeneficiario = () => { + locales="it-IT"/>
{__('Bandi osservati', 'gepafin')} + locales="it-IT"/>
{__('Documenti da integrare', 'gepafin')} + locales="it-IT"/>
@@ -89,6 +90,19 @@ const DashboardBeneficiario = () => {
+ {isEmpty(chosenCompanyId) || chosenCompanyId === 0 + ? <> +
+ + {__('Attenzione', 'gepafin')} + + {__('Per applicare ai bandi devi Registare un Azienda clicca', 'gepafin')} + {__('qua', 'gepafin')} + +
+
+ : null} +

{__('Bandi disponibili', 'gepafin')}