@@ -8,7 +8,11 @@ const NumericFormulaCell = ({ getValue, row: { index }, column: { id }, table })
|
||||
e.target.select();
|
||||
}
|
||||
|
||||
const onChange = (value) => {
|
||||
/*const onChange = (value) => {
|
||||
table.options.meta?.updateData(index, id, value);
|
||||
};*/
|
||||
|
||||
const onBlur = (value) => {
|
||||
table.options.meta?.updateData(index, id, value);
|
||||
};
|
||||
|
||||
@@ -16,8 +20,9 @@ const NumericFormulaCell = ({ getValue, row: { index }, column: { id }, table })
|
||||
<InputNumber
|
||||
disabled={disabled}
|
||||
value={initialValue}
|
||||
onValueChange={(e) => onChange(e.value)}
|
||||
/*onValueChange={(e) => onChange(e.value)}*/
|
||||
onFocus={onFocus}
|
||||
onBlur={(e) => onBlur(e.target.value)}
|
||||
minFractionDigits={0}
|
||||
maxFractionDigits={2}
|
||||
locale='it-IT'
|
||||
|
||||
@@ -8,7 +8,12 @@ const NumericFormulaCell = ({ getValue, row: { index }, column: { id }, table })
|
||||
e.target.select();
|
||||
}
|
||||
|
||||
const onChange = (value) => {
|
||||
/*const onChange = (value) => {
|
||||
console.log('table.options.meta', table.options.meta)
|
||||
table.options.meta?.updateData(index, id, value);
|
||||
};*/
|
||||
|
||||
const onBlur = (value) => {
|
||||
table.options.meta?.updateData(index, id, value);
|
||||
};
|
||||
|
||||
@@ -16,8 +21,9 @@ const NumericFormulaCell = ({ getValue, row: { index }, column: { id }, table })
|
||||
<InputNumber
|
||||
disabled={disabled}
|
||||
value={initialValue}
|
||||
onValueChange={(e) => onChange(e.value)}
|
||||
/*onValueChange={(e) => onChange(e.value)}*/
|
||||
onFocus={onFocus}
|
||||
onBlur={(e) => onBlur(e.target.value)}
|
||||
minFractionDigits={0}
|
||||
maxFractionDigits={2}
|
||||
locale='it-IT'
|
||||
|
||||
@@ -122,13 +122,8 @@ const Table = ({
|
||||
|
||||
useEffect(() => {
|
||||
const stateFieldData = pathOr([], ['stateFieldData'], tableColumns);
|
||||
/*const obj = stateFieldData
|
||||
.reduce((acc, cur) => {
|
||||
acc[cur.name] = ''
|
||||
return acc;
|
||||
}, {});*/
|
||||
let rowsData = pathOr([], ['rowsData'], tableColumns);
|
||||
//rowsData = isEmpty(rowsData) ? [obj] : rowsData;
|
||||
|
||||
setColumnsCfg(stateFieldData);
|
||||
setRowsCfg(rowsData);
|
||||
|
||||
|
||||
@@ -5,6 +5,10 @@ import { uniq } from 'ramda';
|
||||
// api
|
||||
import BandoService from '../../../../service/bando-service';
|
||||
|
||||
// tools
|
||||
import getTimeParsedFromString from '../../../../helpers/getTimeParsedFromString';
|
||||
import getTimeFromISOstring from '../../../../helpers/getTimeFromISOstring';
|
||||
|
||||
// components
|
||||
import { FilterMatchMode, FilterOperator } from 'primereact/api';
|
||||
import { DataTable } from 'primereact/datatable';
|
||||
@@ -13,10 +17,8 @@ import { Button } from 'primereact/button';
|
||||
import { Calendar } from 'primereact/calendar';
|
||||
import ProperBandoLabel from '../../../../components/ProperBandoLabel';
|
||||
import { Link } from 'react-router-dom';
|
||||
import translationStrings from '../../../../translationStringsForComponents';
|
||||
import getTimeParsedFromString from '../../../../helpers/getTimeParsedFromString';
|
||||
import getTimeFromISOstring from '../../../../helpers/getTimeFromISOstring';
|
||||
|
||||
import translationStrings from '../../../../translationStringsForComponents';
|
||||
|
||||
const LatestBandiTable = () => {
|
||||
const [items, setItems] = useState(null);
|
||||
|
||||
@@ -4,8 +4,12 @@ import { Link } from 'react-router-dom';
|
||||
|
||||
import translationStrings from '../../../../translationStringsForComponents';
|
||||
|
||||
// store
|
||||
import { storeGet, useStoreValue } from '../../../../store';
|
||||
|
||||
// api
|
||||
import BandoService from '../../../../service/bando-service';
|
||||
import PreferredBandoService from '../../../../service/preferred-bando-service';
|
||||
|
||||
// tools
|
||||
import getTimeParsedFromString from '../../../../helpers/getTimeParsedFromString';
|
||||
@@ -14,6 +18,7 @@ import getFormattedDateString from '../../../../helpers/getFormattedDateString';
|
||||
import getBandoLabel from '../../../../helpers/getBandoLabel';
|
||||
import getBandoSeverity from '../../../../helpers/getBandoSeverity';
|
||||
import getQueryParamsForPaginatedEndpoint from '../../../../helpers/getQueryParamsForPaginatedEndpoint';
|
||||
import set404FromErrorResponse from '../../../../helpers/set404FromErrorResponse';
|
||||
|
||||
// components
|
||||
import { DataTable } from 'primereact/datatable';
|
||||
@@ -24,11 +29,9 @@ import { Dropdown } from 'primereact/dropdown';
|
||||
import { Tag } from 'primereact/tag';
|
||||
import { Calendar } from 'primereact/calendar';
|
||||
import { isNil } from 'ramda';
|
||||
import { storeGet } from '../../../../store';
|
||||
import PreferredBandoService from '../../../../service/preferred-bando-service';
|
||||
import set404FromErrorResponse from '../../../../helpers/set404FromErrorResponse';
|
||||
|
||||
const LatestBandiBeneficiarioTableAsync = () => {
|
||||
const chosenCompanyId = useStoreValue('chosenCompanyId');
|
||||
const [localAsyncRequest, setLocalAsyncRequest] = useState(false);
|
||||
const [items, setItems] = useState(null);
|
||||
const [totalRecordsNum, setTotalRecordsNum] = useState(0);
|
||||
@@ -197,9 +200,19 @@ const LatestBandiBeneficiarioTableAsync = () => {
|
||||
useEffect(() => {
|
||||
setLocalAsyncRequest(true);
|
||||
const paginationQuery = getPaginationQuery();
|
||||
const role = storeGet('getRole');
|
||||
|
||||
BandoService.getBandiPaginated(paginationQuery, getCallback, errGetCallbacks);
|
||||
}, [lazyState]);
|
||||
if (role === 'ROLE_CONFIDI') {
|
||||
BandoService.getBandiPaginated(paginationQuery, getCallback, errGetCallbacks, [
|
||||
['companyId', chosenCompanyId],
|
||||
['onlyConfidiCall', true]
|
||||
]);
|
||||
} else {
|
||||
BandoService.getBandiPaginated(paginationQuery, getCallback, errGetCallbacks, [
|
||||
['companyId', chosenCompanyId]
|
||||
]);
|
||||
}
|
||||
}, [lazyState, chosenCompanyId]);
|
||||
|
||||
return (
|
||||
<div className="appPageSection__table">
|
||||
|
||||
@@ -33,7 +33,7 @@ const LatestBandiTable = () => {
|
||||
|
||||
useEffect(() => {
|
||||
setLoading(true);
|
||||
const role = storeGet('getRole')
|
||||
const role = storeGet('getRole');
|
||||
|
||||
if (role === 'ROLE_CONFIDI') {
|
||||
BandoService.getBandi(getCallback, errGetCallbacks, [
|
||||
|
||||
@@ -31,7 +31,6 @@ import { ProgressBar } from 'primereact/progressbar';
|
||||
|
||||
const MyLatestSubmissionsTableAsync = () => {
|
||||
const chosenCompanyId = useStoreValue('chosenCompanyId');
|
||||
const companies = useStoreValue('companies');
|
||||
const [localAsyncRequest, setLocalAsyncRequest] = useState(false);
|
||||
const [items, setItems] = useState(null);
|
||||
const [totalRecordsNum, setTotalRecordsNum] = useState(0);
|
||||
@@ -194,13 +193,15 @@ const MyLatestSubmissionsTableAsync = () => {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
setLocalAsyncRequest(true);
|
||||
const paginationQuery = getPaginationQuery();
|
||||
if (chosenCompanyId && chosenCompanyId !== 0) {
|
||||
setLocalAsyncRequest(true);
|
||||
const paginationQuery = getPaginationQuery();
|
||||
|
||||
ApplicationService.getApplicationsPaginated(paginationQuery, getCallback, errGetCallbacks, [
|
||||
['companyId', chosenCompanyId]
|
||||
]);
|
||||
}, [lazyState, chosenCompanyId, companies]);
|
||||
ApplicationService.getApplicationsPaginated(paginationQuery, getCallback, errGetCallbacks, [
|
||||
['companyId', chosenCompanyId]
|
||||
]);
|
||||
}
|
||||
}, [lazyState, chosenCompanyId]);
|
||||
|
||||
return (
|
||||
<div className="appPageSection__table">
|
||||
|
||||
@@ -14,7 +14,7 @@ import DashboardService from '../../service/dashboard-service';
|
||||
import { Button } from 'primereact/button';
|
||||
import ErrorBoundary from '../../components/ErrorBoundary';
|
||||
import MyLatestSubmissionsTableAsync from '../DashboardBeneficiario/components/MyLatestSubmissionsTableAsync';
|
||||
import LatestBandiTable from '../DashboardBeneficiario/components/LatestBandiTable';
|
||||
import LatestBandiBeneficiarioTableAsync from '../DashboardBeneficiario/components/LatestBandiBeneficiarioTableAsync';
|
||||
|
||||
const DashboardBeneficiarioConfidi = () => {
|
||||
const navigate = useNavigate();
|
||||
@@ -108,7 +108,7 @@ const DashboardBeneficiarioConfidi = () => {
|
||||
|
||||
<div className="appPageSection">
|
||||
<h2>{__('Bandi disponibili', 'gepafin')}</h2>
|
||||
<ErrorBoundary><LatestBandiTable/></ErrorBoundary>
|
||||
<ErrorBoundary><LatestBandiBeneficiarioTableAsync/></ErrorBoundary>
|
||||
</div>
|
||||
|
||||
<div className="appPage__spacer"></div>
|
||||
|
||||
Reference in New Issue
Block a user