- added message for beneficiary about requirement of adding company;
This commit is contained in:
@@ -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 = () => {
|
||||
<div className="p-3">
|
||||
{renderHtmlContent(data.descriptionShort)}
|
||||
<p>{__('Scadenza', 'gepafin')}: {getDateFromISOstring(data.dates[1])}</p>
|
||||
{!data.confidi
|
||||
{!isEmpty(chosenCompanyId) && chosenCompanyId !== 0 && !data.confidi
|
||||
? <Button onClick={() => goToBandoPage(data.id)} severity="info">
|
||||
{__('Partecipa', 'gepafin')}
|
||||
</Button> : null}
|
||||
{data.confidi
|
||||
{!isEmpty(chosenCompanyId) && chosenCompanyId !== 0 && data.confidi
|
||||
? <Button onClick={() => goToBandoPage(data.id)} severity="info">
|
||||
{__('Mostra', 'gepafin')}
|
||||
</Button> : null}
|
||||
|
||||
@@ -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 (
|
||||
<div className="appPage">
|
||||
<div className="appPage__pageHeader">
|
||||
<h1>{__('Bandi disponibili', 'gepafin')}</h1>
|
||||
@@ -15,6 +19,19 @@ const BandiBeneficiario = () => {
|
||||
|
||||
<div className="appPage__spacer"></div>
|
||||
|
||||
{isEmpty(chosenCompanyId) || chosenCompanyId === 0
|
||||
? <>
|
||||
<div className="appPageSection__message warning">
|
||||
<i className="pi pi-exclamation-triangle"></i>
|
||||
<span className="summary">{__('Attenzione', 'gepafin')}</span>
|
||||
<span>
|
||||
{__('Per applicare ai bandi devi Registare un Azienda clicca', 'gepafin')}
|
||||
<Link to={`/agguingi-azienda`} style={{marginLeft: '0.5ch'}}>{__('qua', 'gepafin')}</Link>
|
||||
</span>
|
||||
</div>
|
||||
<div className="appPage__spacer"></div>
|
||||
</> : null}
|
||||
|
||||
<div className="appPageSection">
|
||||
<AllBandiAccordion/>
|
||||
</div>
|
||||
|
||||
@@ -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}/>
|
||||
<Column field="status" header={__('Stato', 'gepafin')}
|
||||
style={{ minWidth: '7rem' }} body={statusBodyTemplate} />
|
||||
<Column header={__('Azioni', 'gepafin')}
|
||||
body={actionsBodyTemplate}/>
|
||||
{!isEmpty(chosenCompanyId) && chosenCompanyId !== 0
|
||||
? <Column header={__('Azioni', 'gepafin')}
|
||||
body={actionsBodyTemplate}/> : null}
|
||||
</DataTable>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -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 (
|
||||
<div className="appPage">
|
||||
<div className="appPage__pageHeader">
|
||||
<h1>{__('Dashboard', 'gepafin')}</h1>
|
||||
@@ -61,21 +62,21 @@ const DashboardBeneficiario = () => {
|
||||
<span><NumberFlow
|
||||
value={getStatValue('numberOfApplications', 0)}
|
||||
format={{ notation: 'compact' }}
|
||||
locales="it-IT" /></span>
|
||||
locales="it-IT"/></span>
|
||||
</div>
|
||||
<div className="statsBigBadges__gridItem">
|
||||
<span>{__('Bandi osservati', 'gepafin')}</span>
|
||||
<span><NumberFlow
|
||||
value={getStatValue('numberOfCalls', 0)}
|
||||
format={{ notation: 'compact' }}
|
||||
locales="it-IT" /></span>
|
||||
locales="it-IT"/></span>
|
||||
</div>
|
||||
<div className="statsBigBadges__gridItem">
|
||||
<span>{__('Documenti da integrare', 'gepafin')}</span>
|
||||
<span><NumberFlow
|
||||
value={getStatValue('numberOfIntegratedDocuments', 0)}
|
||||
format={{ notation: 'compact' }}
|
||||
locales="it-IT" /></span>
|
||||
locales="it-IT"/></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -89,6 +90,19 @@ const DashboardBeneficiario = () => {
|
||||
|
||||
<div className="appPage__spacer"></div>
|
||||
|
||||
{isEmpty(chosenCompanyId) || chosenCompanyId === 0
|
||||
? <>
|
||||
<div className="appPageSection__message warning">
|
||||
<i className="pi pi-exclamation-triangle"></i>
|
||||
<span className="summary">{__('Attenzione', 'gepafin')}</span>
|
||||
<span>
|
||||
{__('Per applicare ai bandi devi Registare un Azienda clicca', 'gepafin')}
|
||||
<Link to={`/agguingi-azienda`} style={{marginLeft: '0.5ch'}}>{__('qua', 'gepafin')}</Link>
|
||||
</span>
|
||||
</div>
|
||||
<div className="appPage__spacer"></div>
|
||||
</> : null}
|
||||
|
||||
<div className="appPageSection">
|
||||
<h2>{__('Bandi disponibili', 'gepafin')}</h2>
|
||||
<LatestBandiTable/>
|
||||
|
||||
Reference in New Issue
Block a user