- saving progress;
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React, { useState, useEffect} from 'react';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { __, sprintf } from '@wordpress/i18n';
|
||||
import { is, uniq, isNil, isEmpty } from 'ramda';
|
||||
import { wrap } from 'object-path-immutable';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
@@ -30,6 +30,8 @@ import { Button } from 'primereact/button';
|
||||
// i18n
|
||||
import translationStrings from '../../../../translationStringsForComponents';
|
||||
import isDateTimeInPast from '../../../../helpers/isDateTimeInPast';
|
||||
import isDateTimeInFuture from '../../../../helpers/isDateTimeInFuture';
|
||||
import { Badge } from 'primereact/badge';
|
||||
|
||||
const REACT_APP_HUB_ID = process.env.REACT_APP_HUB_ID;
|
||||
|
||||
@@ -182,18 +184,22 @@ const AllBandiAccordion = ({ showOnlyPreferred = false }) => {
|
||||
|
||||
const rowExpansionTemplate = (data) => {
|
||||
const isCallExpired = isDateTimeInPast(data.dates[1], data.endTime);
|
||||
const isCallScheduled = isDateTimeInFuture(data.dates[0], data.startTime);
|
||||
|
||||
return (
|
||||
<div className="p-3">
|
||||
{renderHtmlContent(data.descriptionShort)}
|
||||
<p>{__('Scadenza', 'gepafin')}: {getDateFromISOstring(data.dates[1])}</p>
|
||||
{!isCallExpired && !isEmpty(chosenCompanyId) && chosenCompanyId !== 0 && (!data.confidi
|
||||
{!isCallExpired && !isCallScheduled && !isEmpty(chosenCompanyId) && chosenCompanyId !== 0 && (!data.confidi
|
||||
|| (data.confidi && data.id === 6 && REACT_APP_HUB_ID === 'p4lk3bcx1RStqTaIVVbXs'))
|
||||
? <Button onClick={() => goToBandoPage(data.id)} severity="info">
|
||||
{__('Partecipa', 'gepafin')}
|
||||
</Button> : null}
|
||||
{isCallExpired
|
||||
? <p>{__('È scaduto', 'gepafin')}</p> : null}
|
||||
{isCallExpired || (!isEmpty(chosenCompanyId) && chosenCompanyId !== 0 && data.confidi
|
||||
? <p><Badge value={__('È scaduto', 'gepafin')} severity="danger"></Badge></p> : null}
|
||||
{isCallScheduled
|
||||
? <p><Badge value={sprintf(__('È programmato. Inizia: %s %s', 'gepafin'), getDateFromISOstring(data.dates[0]), data.startTime)}></Badge></p> : null}
|
||||
{isCallExpired || isCallScheduled || (!isEmpty(chosenCompanyId) && chosenCompanyId !== 0 && data.confidi
|
||||
&& (data.id !== 6 || (data.id === 6 && REACT_APP_HUB_ID !== 'p4lk3bcx1RStqTaIVVbXs')))
|
||||
? <Button onClick={() => goToBandoPage(data.id)} severity="info">
|
||||
{__('Mostra', 'gepafin')}
|
||||
|
||||
@@ -685,7 +685,10 @@ const BandoApplication = () => {
|
||||
|
||||
return acc;
|
||||
}, {});
|
||||
//console.log('validations', validations, o.name)
|
||||
|
||||
/*if (o.name === 'table') {
|
||||
console.log('value:', values[o.id] ? values[o.id] : '')
|
||||
}*/
|
||||
|
||||
return ['paragraph'].includes(o.name) && text
|
||||
? <div key={o.id}>
|
||||
|
||||
@@ -277,14 +277,14 @@ const ElementSettingCriteriaTableColumns = ({
|
||||
<>
|
||||
<div className="formElementSettings__repeater">
|
||||
{stateFieldData.length > 0
|
||||
? <div className="formElementSettings__repeaterItem">
|
||||
? <div className="formElementSettings__repeaterItem tableRow">
|
||||
<div>{__('Colonne', 'gepafin')}</div>
|
||||
<div>{__('Tipo', 'gepafin')}</div>
|
||||
<div>{__('Calcola', 'gepafin')}</div>
|
||||
<div>{__('Predefinito?', 'gepafin')}</div>
|
||||
<div></div>
|
||||
</div> : null}
|
||||
{stateFieldData.map((o, i) => <div key={i} className="formElementSettings__repeaterItem">
|
||||
{stateFieldData.map((o, i) => <div key={i} className="formElementSettings__repeaterItem tableRow">
|
||||
{properFields(o, i)}
|
||||
</div>)}
|
||||
<Button
|
||||
|
||||
@@ -268,14 +268,14 @@ const ElementSettingTableColumns = ({
|
||||
<>
|
||||
<div className="formElementSettings__repeater">
|
||||
{stateFieldData.length > 0
|
||||
? <div className="formElementSettings__repeaterItem">
|
||||
? <div className="formElementSettings__repeaterItem tableRow">
|
||||
<div>{__('Colonne', 'gepafin')}</div>
|
||||
<div>{__('Tipo', 'gepafin')}</div>
|
||||
<div>{__('Calcola', 'gepafin')}</div>
|
||||
<div>{__('Predefinito?', 'gepafin')}</div>
|
||||
<div></div>
|
||||
</div> : null}
|
||||
{stateFieldData.map((o, i) => <div key={i} className="formElementSettings__repeaterItem">
|
||||
{stateFieldData.map((o, i) => <div key={i} className="formElementSettings__repeaterItem tableRow">
|
||||
{properFields(o, i)}
|
||||
</div>)}
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user