- styled asteriks sign;
- fixed issue with validation on registration page; - fixed issue with inputnumber; - fixed issue with editor field;; - added editors for new faq item form; - fixed displaying html as simple text; - fixed saving company data after saving; - added toast for edit bando form; - improved edit forms form; - fixed styles for various elements;
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React, { useState, useEffect, useRef } from 'react';
|
||||
import { __, sprintf } from '@wordpress/i18n';
|
||||
import { useNavigate, useParams } from 'react-router-dom';
|
||||
import { is, isEmpty, pathOr, isNil } from 'ramda';
|
||||
import { is, isEmpty, isNil } from 'ramda';
|
||||
|
||||
// store
|
||||
import { storeSet, useStore } from '../../store';
|
||||
@@ -16,7 +16,6 @@ import renderHtmlContent from '../../helpers/renderHtmlContent';
|
||||
import { Skeleton } from 'primereact/skeleton';
|
||||
import { Accordion } from 'primereact/accordion';
|
||||
import { AccordionTab } from 'primereact/accordion';
|
||||
import { InputTextarea } from 'primereact/inputtextarea';
|
||||
import { Button } from 'primereact/button';
|
||||
import { Messages } from 'primereact/messages';
|
||||
import { Message } from 'primereact/message';
|
||||
@@ -29,14 +28,13 @@ import { Editor } from 'primereact/editor';
|
||||
|
||||
const BandoViewBeneficiario = () => {
|
||||
const isAsyncRequest = useStore().main.isAsyncRequest();
|
||||
const companies = useStore().main.companies();
|
||||
const chosenCompanyId = useStore().main.chosenCompanyId();
|
||||
const { id } = useParams();
|
||||
const navigate = useNavigate();
|
||||
const [data, setData] = useState({});
|
||||
const [newQuestion, setNewQuestion] = useState('');
|
||||
const [applicationObj, setApplicationObj] = useState(true);
|
||||
const bandoMsgs = useRef(null);
|
||||
const chosenCompanyId = pathOr(0, [0, 'id'], companies);
|
||||
|
||||
const scaricaBando = () => {
|
||||
|
||||
@@ -90,12 +88,12 @@ const BandoViewBeneficiario = () => {
|
||||
bandoMsgs.current.clear();
|
||||
}
|
||||
const obj = {
|
||||
"id": null,
|
||||
"lookUpDataId": null,
|
||||
"title": newQuestion,
|
||||
"value": newQuestion,
|
||||
"response": "",
|
||||
"isVisible": false
|
||||
'id': null,
|
||||
'lookUpDataId': null,
|
||||
'title': newQuestion,
|
||||
'value': newQuestion,
|
||||
'response': '',
|
||||
'isVisible': false
|
||||
}
|
||||
storeSet.main.setAsyncRequest();
|
||||
FaqItemService.addQuestion(id, obj, createCallBack, errCreateCallback, [['companyId', chosenCompanyId]])
|
||||
@@ -161,7 +159,7 @@ const BandoViewBeneficiario = () => {
|
||||
|
||||
const getApplCallback = (data) => {
|
||||
if (data.status === 'SUCCESS') {
|
||||
if(data.data.length) {
|
||||
if (data.data.length) {
|
||||
setApplicationObj(data.data[0]);
|
||||
}
|
||||
}
|
||||
@@ -220,10 +218,11 @@ const BandoViewBeneficiario = () => {
|
||||
|
||||
{!isAsyncRequest && !isEmpty(data)
|
||||
? <div className="appPage__content">
|
||||
<picture className="appPageSection__hero">
|
||||
<source srcSet={data.images[0] ? data.images[0].filePath : ''}/>
|
||||
<img src={data.images[0] ? data.images[0].filePath : ''} alt={data.name}/>
|
||||
</picture>
|
||||
{!isEmpty(data.images)
|
||||
? <picture className="appPageSection__hero">
|
||||
<source srcSet={data.images[0] ? data.images[0].filePath : ''}/>
|
||||
<img src={data.images[0] ? data.images[0].filePath : ''} alt={data.name}/>
|
||||
</picture> : null}
|
||||
|
||||
<div className="appPageSection__withBorder">
|
||||
<h2>{__('Descrizione breve', 'gepafin')}</h2>
|
||||
@@ -312,11 +311,11 @@ const BandoViewBeneficiario = () => {
|
||||
<Accordion>
|
||||
{data.faq
|
||||
.filter(o => o.isVisible)
|
||||
.map((o, i) => <AccordionTab key={i} header={o.value}>
|
||||
<p>
|
||||
{o.response}
|
||||
</p>
|
||||
</AccordionTab>)}
|
||||
.map((o, i) => <AccordionTab key={i} header={renderHtmlContent(o.value)}>
|
||||
<p>
|
||||
{renderHtmlContent(o.response)}
|
||||
</p>
|
||||
</AccordionTab>)}
|
||||
</Accordion>
|
||||
</div>
|
||||
|
||||
@@ -345,7 +344,8 @@ const BandoViewBeneficiario = () => {
|
||||
|
||||
{chosenCompanyId === 0
|
||||
? <>
|
||||
<Message severity="error" text={__("Devi creare un'azienda prima di partecipare nei bandi. Vai nel profilo aziendale.", 'gepafin')} />
|
||||
<Message severity="error"
|
||||
text={__('Devi creare un\'azienda prima di partecipare nei bandi. Vai nel profilo aziendale.', 'gepafin')}/>
|
||||
</>
|
||||
: null}
|
||||
|
||||
@@ -387,7 +387,8 @@ const BandoViewBeneficiario = () => {
|
||||
<h2>{__('Contatti per Assistenza', 'gepafin')}</h2>
|
||||
<div className="row rowContent">
|
||||
<p>Email: {data.email}</p>
|
||||
{!isNil(data.phoneNumber) ? <p>{__('Telefono', 'gepafin')}: +39 {data.phoneNumber}</p> : null}
|
||||
{!isNil(data.phoneNumber) ?
|
||||
<p>{__('Telefono', 'gepafin')}: +39 {data.phoneNumber}</p> : null}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user