- updated config;
This commit is contained in:
@@ -35,15 +35,22 @@ import { Badge } from 'primereact/badge';
|
||||
|
||||
const REACT_APP_HUB_ID = process.env.REACT_APP_HUB_ID;
|
||||
|
||||
const AllBandiAccordion = ({ showOnlyPreferred = false }) => {
|
||||
const AllBandiAccordion = ({ showOnlyPreferred = false, isAntiMoneylaundry = false }) => {
|
||||
const chosenCompanyId = useStoreValue('chosenCompanyId');
|
||||
const antiMoneyLaundryCalls = useStoreValue('antiMoneyLaundryCalls');
|
||||
const companies = useStoreValue('companies');
|
||||
const isAsyncRequest = useStoreValue('isAsyncRequest');
|
||||
const [items, setItems] = useState(null);
|
||||
const [items, setItems] = useState([]);
|
||||
const [filters, setFilters] = useState(null);
|
||||
const [expandedRows, setExpandedRows] = useState(null);
|
||||
const [statuses, setStatuses] = useState([]);
|
||||
const navigate = useNavigate();
|
||||
let filteredItems = items;
|
||||
if (REACT_APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE') {
|
||||
filteredItems = isAntiMoneylaundry
|
||||
? items.filter(o => antiMoneyLaundryCalls.includes(o.id))
|
||||
: items.filter(o => !antiMoneyLaundryCalls.includes(o.id));
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
const existingCompany = head(companies.filter(o => o.id === chosenCompanyId));
|
||||
@@ -228,7 +235,7 @@ const AllBandiAccordion = ({ showOnlyPreferred = false }) => {
|
||||
|
||||
return(
|
||||
<div className="appPageSection__table">
|
||||
<DataTable value={items}
|
||||
<DataTable value={filteredItems}
|
||||
paginator
|
||||
rows={5}
|
||||
loading={isAsyncRequest}
|
||||
@@ -243,8 +250,10 @@ const AllBandiAccordion = ({ showOnlyPreferred = false }) => {
|
||||
<Column field="name" header={__('Bando', 'gepafin')}
|
||||
body={nameBodyTemplate}
|
||||
style={{ minWidth: '12rem' }}/>
|
||||
<Column header={__('Importo totale', 'gepafin')} filterField="amount"
|
||||
{!isAntiMoneylaundry
|
||||
? <Column header={__('Importo totale', 'gepafin')} filterField="amount"
|
||||
style={{ minWidth: '10rem' }} body={amountBodyTemplate}/>
|
||||
: null}
|
||||
<Column field="status" header={__('Stato', 'gepafin')} filterMenuStyle={{ width: '14rem' }}
|
||||
style={{ width: '8rem' }} body={statusBodyTemplate} filter sortable
|
||||
filterElement={statusFilterTemplate}/>
|
||||
|
||||
@@ -10,6 +10,8 @@ import { useStoreValue } from '../../store';
|
||||
import AllBandiAccordion from './components/AllBandiAccordion';
|
||||
import ErrorBoundary from '../../components/ErrorBoundary';
|
||||
|
||||
const REACT_APP_HUB_ID = process.env.REACT_APP_HUB_ID;
|
||||
|
||||
const BandiBeneficiario = () => {
|
||||
const chosenCompanyId = useStoreValue('chosenCompanyId');
|
||||
const companies = useStoreValue('companies');
|
||||
@@ -31,7 +33,7 @@ const BandiBeneficiario = () => {
|
||||
<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>
|
||||
<Link to={`/agguingi-azienda`} style={{ marginLeft: '0.5ch' }}>{__('qua', 'gepafin')}</Link>
|
||||
</span>
|
||||
</div>
|
||||
<div className="appPage__spacer"></div>
|
||||
@@ -40,6 +42,16 @@ const BandiBeneficiario = () => {
|
||||
<div className="appPageSection">
|
||||
<ErrorBoundary><AllBandiAccordion/></ErrorBoundary>
|
||||
</div>
|
||||
|
||||
{REACT_APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE'
|
||||
? <>
|
||||
<div className="appPage__spacer"></div>
|
||||
<div className="appPageSection">
|
||||
<h2>{__('Questionario Antiriciclaggio', 'gepafin')}</h2>
|
||||
<ErrorBoundary><AllBandiAccordion isAntiMoneylaundry={true}/></ErrorBoundary>
|
||||
</div>
|
||||
</>
|
||||
: null}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ const BandoView = () => {
|
||||
disabled={true}
|
||||
onClick={() => {
|
||||
}}
|
||||
label={__('Presenta Domanda', 'gepafin')}
|
||||
label={__('Compila form', 'gepafin')}
|
||||
icon="pi pi-save" iconPos="right"/>
|
||||
{/*<Button
|
||||
type="button"
|
||||
|
||||
@@ -98,15 +98,15 @@ const BandoViewBeneficiario = () => {
|
||||
|
||||
const submitBtnLabel = () => {
|
||||
if (REACT_APP_HUB_ID === 't7jh5wfg9QXylNaTZkPoE') {
|
||||
return __('Presenta domanda', 'gepafin');
|
||||
return __('Compila form', 'gepafin');
|
||||
} else {
|
||||
if (data.allowMultipleApplications) {
|
||||
return __('Presenta domanda', 'gepafin');
|
||||
return __('Compila form', 'gepafin');
|
||||
} else {
|
||||
if (applicationObj && applicationObj.id) {
|
||||
return __('Vai alla domanda', 'gepafin');
|
||||
} else {
|
||||
return __('Presenta domanda', 'gepafin');
|
||||
return __('Compila form', 'gepafin');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user