- 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:
Vitalii Kiiko
2024-10-04 11:31:47 +02:00
parent af52610b30
commit 7804a67fd2
36 changed files with 520 additions and 637 deletions

View File

@@ -1,9 +1,10 @@
import React, { useState, useEffect} from 'react';
import { __ } from '@wordpress/i18n';
import { is, uniq } from 'ramda';
import { is, uniq, isNil } from 'ramda';
import { wrap } from 'object-path-immutable';
// store
import { storeSet, storeGet } from '../../../../store';
import { storeSet, useStore } from '../../../../store';
// tools
import getBandoSeverity from '../../../../helpers/getBandoSeverity';
@@ -23,12 +24,13 @@ import getNumberWithCurrency from '../../../../helpers/getNumberWithCurrency';
import renderHtmlContent from '../../../../helpers/renderHtmlContent';
import { Button } from 'primereact/button';
import { useNavigate } from 'react-router-dom';
import set404FromErrorResponse from '../../../../helpers/set404FromErrorResponse';
const AllBandiAccordion = () => {
const isAsyncRequest = useStore().main.isAsyncRequest();
const [items, setItems] = useState(null);
const [filters, setFilters] = useState(null);
const [loading, setLoading] = useState(false);
const [expandedRows, setExpandedRows] = useState(null);
const [statuses, setStatuses] = useState([]);
const navigate = useNavigate();
@@ -47,7 +49,7 @@ const AllBandiAccordion = () => {
}
const errGetCallbacks = (data) => {
console.log('errGetCallbacks', data)
set404FromErrorResponse(data);
storeSet.main.unsetAsyncRequest();
}
@@ -58,6 +60,22 @@ const AllBandiAccordion = () => {
});
};
const nameBodyTemplate = (rowData) => {
return <span
className="appPageSection__titleClickable"
onClick={() => {
let newExpandedRows;
if (isNil(expandedRows) || isNil(expandedRows[rowData.id])) {
newExpandedRows = isNil(expandedRows)
? wrap({}).set([rowData.id], true).value()
: wrap(expandedRows).set([rowData.id], true).value();
} else {
newExpandedRows = wrap(expandedRows).del([rowData.id]).value();
}
setExpandedRows(newExpandedRows);
}}>{rowData.name}</span>
}
const amountBodyTemplate = (rowData) => {
return getNumberWithCurrency(rowData.amount);
};
@@ -108,13 +126,16 @@ const AllBandiAccordion = () => {
return(
<div className="appPageSection__table">
<DataTable value={items} paginator rows={10} loading={loading} dataKey="id"
<DataTable value={items} paginator rows={10} loading={isAsyncRequest} dataKey="id"
filters={filters} emptyMessage="Nothing found."
expandedRows={expandedRows} onRowToggle={(e) => setExpandedRows(e.data)}
expandedRows={expandedRows}
onRowToggle={(e) => setExpandedRows(e.data)}
rowExpansionTemplate={rowExpansionTemplate}
onFilter={(e) => setFilters(e.filters)}>
<Column expander={allowExpansion} style={{ width: '5rem' }} />
<Column field="name" header={__('Bando', 'gepafin')} style={{ minWidth: '12rem' }}/>
<Column field="name" header={__('Bando', 'gepafin')}
body={nameBodyTemplate}
style={{ minWidth: '12rem' }}/>
<Column header={__('Importo totale', 'gepafin')} filterField="amount"
style={{ minWidth: '10rem' }} body={amountBodyTemplate} sortable/>
<Column field="status" header={__('Stato', 'gepafin')} filterMenuStyle={{ width: '14rem' }}