- updated pre instructor table async - fixed proper date for filter;
This commit is contained in:
35
src/helpers/getQueryParamsForPaginatedEndpoint.js
Normal file
35
src/helpers/getQueryParamsForPaginatedEndpoint.js
Normal file
@@ -0,0 +1,35 @@
|
||||
import { isEmpty, pathOr } from 'ramda';
|
||||
import formatDateString from './formatDateString';
|
||||
|
||||
const getQueryParamsForPaginatedEndpoint = (lazyState, statuses) => {
|
||||
let sortBy = {
|
||||
columnName: 'applicationId',
|
||||
sortDesc: true
|
||||
};
|
||||
|
||||
if (lazyState.sortField) {
|
||||
sortBy = {
|
||||
columnName: lazyState.sortField,
|
||||
sortDesc: lazyState.sortOrder === -1
|
||||
}
|
||||
}
|
||||
return {
|
||||
globalFilters: {
|
||||
page: lazyState.page ? lazyState.page + 1 : 1,
|
||||
limit: lazyState.rows,
|
||||
sortBy
|
||||
},
|
||||
status: statuses,
|
||||
filters: Object.keys(lazyState.filters).reduce((acc, cur) => {
|
||||
const value = pathOr('', ['filters', cur, 'value'], lazyState);
|
||||
if (!isEmpty(value)) {
|
||||
acc[cur] = typeof value.getMonth === 'function'
|
||||
? formatDateString(value)
|
||||
: lazyState.filters[cur];
|
||||
}
|
||||
return acc;
|
||||
}, {}),
|
||||
}
|
||||
}
|
||||
|
||||
export default getQueryParamsForPaginatedEndpoint;
|
||||
@@ -49,7 +49,7 @@ import FileuploadApplicationSignedPdf from '../../components/FileuploadApplicati
|
||||
|
||||
import { defaultMaxFileSize } from '../../configData';
|
||||
|
||||
const APP_HUB_ID = process.env.REACT_APP_HUB_ID;
|
||||
const REACT_APP_HUB_ID = process.env.REACT_APP_HUB_ID;
|
||||
|
||||
const BandoApplication = () => {
|
||||
const chosenCompanyId = useStore().main.chosenCompanyId();
|
||||
@@ -686,7 +686,7 @@ const BandoApplication = () => {
|
||||
setVisibleConfirmation(false);
|
||||
}}>
|
||||
<p>
|
||||
{APP_HUB_ID === 't7jh5wfg9QXylNaTZkPoE'
|
||||
{REACT_APP_HUB_ID === 't7jh5wfg9QXylNaTZkPoE'
|
||||
? __('Grazie, la tua domanda è stata inviata correttamente. Entro 24 ore riceverai una email con data, ora e numero di protocollo.', 'gepafin')
|
||||
: __('Grazie, la tua domanda è stata inviata correttamente. Entro 24 ore riceverai una pec con data, ora e numero di protocollo.', 'gepafin')
|
||||
}
|
||||
|
||||
@@ -15,6 +15,8 @@ import LatestBandiTableAsync from './components/LatestBandiTableAsync';
|
||||
import AllDomandeTableAsync from '../Domande/components/AllDomandeTableAsync';
|
||||
import DraftApplicationsTableAsync from './components/DraftApplicationsTableAsync';
|
||||
|
||||
const REACT_APP_HUB_ID = process.env.REACT_APP_HUB_ID;
|
||||
|
||||
const Dashboard = () => {
|
||||
const navigate = useNavigate();
|
||||
const [mainStats, setMainStats] = useState({});
|
||||
@@ -64,7 +66,8 @@ const Dashboard = () => {
|
||||
|
||||
<div className="appPage__spacer"></div>
|
||||
|
||||
<div className={`appPageSection__withBorder${pecUsage > 91 ? ' danger' : ''}`}>
|
||||
{REACT_APP_HUB_ID === 'p4lk3bcx1RStqTaIVVbXs' // only for GEPAFIN
|
||||
? <div className={`appPageSection__withBorder${pecUsage > 91 ? ' danger' : ''}`}>
|
||||
<p className="appPageSection__pMeta">
|
||||
<span>{__('PEC inbox quota', 'gepafin')}</span>
|
||||
<span>{<NumberFlow
|
||||
@@ -73,7 +76,7 @@ const Dashboard = () => {
|
||||
suffix={'%'}
|
||||
locales="it-IT"/>}</span>
|
||||
</p>
|
||||
</div>
|
||||
</div> : null}
|
||||
|
||||
<div className="appPage__spacer"></div>
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ const SoccorsiInstructorManagerMioTableAsync = ({ userId = null }) => {
|
||||
});
|
||||
const statuses = [];
|
||||
|
||||
const getPaginationQuery = useCallback((defaultSortBy = 'id') => {
|
||||
const getPaginationQuery = useCallback(() => {
|
||||
let sortBy = {
|
||||
columnName: 'applicationId',
|
||||
sortDesc: true
|
||||
|
||||
@@ -8,10 +8,11 @@ import translationStrings from '../../../../translationStringsForComponents';
|
||||
// api
|
||||
import AmendmentsService from '../../../../service/amendments-service';
|
||||
|
||||
//
|
||||
// tools
|
||||
import getBandoLabel from '../../../../helpers/getBandoLabel';
|
||||
import getBandoSeverity from '../../../../helpers/getBandoSeverity';
|
||||
import getFormattedDateString from '../../../../helpers/getFormattedDateString';
|
||||
import getQueryParamsForPaginatedEndpoint from '../../../../helpers/getQueryParamsForPaginatedEndpoint';
|
||||
|
||||
// components
|
||||
import { DataTable } from 'primereact/datatable';
|
||||
@@ -36,41 +37,14 @@ const SoccorsiPreInstructorTableAsync = ({ userId = null }) => {
|
||||
applicationId: { value: null, matchMode: 'contains' },
|
||||
callName: { value: null, matchMode: 'contains' },
|
||||
companyName: { value: null, matchMode: 'contains' },
|
||||
startDate: { value: null, matchMode: 'date_is' },
|
||||
expirationDate: { value: null, matchMode: 'date_is' },
|
||||
startDate: { value: null, matchMode: 'dateIs' },
|
||||
expirationDate: { value: null, matchMode: 'dateIs' },
|
||||
status: { value: null, matchMode: 'equals' }
|
||||
}
|
||||
});
|
||||
const statuses = [];
|
||||
|
||||
const getPaginationQuery = useCallback(() => {
|
||||
let sortBy = {
|
||||
columnName: 'applicationId',
|
||||
sortDesc: true
|
||||
};
|
||||
|
||||
if (lazyState.sortField) {
|
||||
sortBy = {
|
||||
columnName: lazyState.sortField,
|
||||
sortDesc: lazyState.sortOrder === -1
|
||||
}
|
||||
}
|
||||
return {
|
||||
globalFilters: {
|
||||
page: lazyState.page ? lazyState.page + 1 : 1,
|
||||
limit: lazyState.rows,
|
||||
sortBy
|
||||
},
|
||||
status: statuses,
|
||||
filters: Object.keys(lazyState.filters).reduce((acc, cur) => {
|
||||
const value = pathOr('', ['filters', cur, 'value'], lazyState);
|
||||
if (!isEmpty(value)) {
|
||||
acc[cur] = lazyState.filters[cur];
|
||||
}
|
||||
return acc;
|
||||
}, {}),
|
||||
}
|
||||
}, [lazyState]);
|
||||
const getPaginationQuery = useCallback(getQueryParamsForPaginatedEndpoint(lazyState, statuses), [lazyState]);
|
||||
|
||||
const onPage = (event) => {
|
||||
setLazyState(event);
|
||||
|
||||
Reference in New Issue
Block a user