Merge pull request #40 from Kitzanos/master-sync/25-03-2025
Master sync/25 03 2025
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -14,6 +14,7 @@ package-lock.json
|
|||||||
|
|
||||||
# misc
|
# misc
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
.env
|
||||||
.env.local
|
.env.local
|
||||||
.env.development.local
|
.env.development.local
|
||||||
.env.test.local
|
.env.test.local
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
"copy-to-clipboard": "3.3.3",
|
"copy-to-clipboard": "3.3.3",
|
||||||
"deep-object-diff": "1.1.9",
|
"deep-object-diff": "1.1.9",
|
||||||
"dompurify": "3.2.3",
|
"dompurify": "3.2.3",
|
||||||
"expression-language": "^1.2.0",
|
"expression-language": "1.2.0",
|
||||||
"fast-deep-equal": "3.1.3",
|
"fast-deep-equal": "3.1.3",
|
||||||
"hotkeys-js": "3.13.9",
|
"hotkeys-js": "3.13.9",
|
||||||
"html-react-parser": "5.2.2",
|
"html-react-parser": "5.2.2",
|
||||||
@@ -26,8 +26,8 @@
|
|||||||
"klona": "2.0.6",
|
"klona": "2.0.6",
|
||||||
"leader-line-new": "1.1.9",
|
"leader-line-new": "1.1.9",
|
||||||
"luxon": "3.5.0",
|
"luxon": "3.5.0",
|
||||||
"mathjs": "^14.0.1",
|
"mathjs": "14.0.1",
|
||||||
"mustache": "^4.2.0",
|
"mustache": "4.2.0",
|
||||||
"object-path-immutable": "4.1.2",
|
"object-path-immutable": "4.1.2",
|
||||||
"primeicons": "7.0.0",
|
"primeicons": "7.0.0",
|
||||||
"primereact": "10.9.2",
|
"primereact": "10.9.2",
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
"react-router-dom": "7.1.3",
|
"react-router-dom": "7.1.3",
|
||||||
"react-scripts": "5.0.1",
|
"react-scripts": "5.0.1",
|
||||||
"recharts": "2.15.0",
|
"recharts": "2.15.0",
|
||||||
"sockjs-client": "^1.6.1",
|
"sockjs-client": "1.6.1",
|
||||||
"validate.js": "0.13.1",
|
"validate.js": "0.13.1",
|
||||||
"zustand": "4.5.4",
|
"zustand": "4.5.4",
|
||||||
"zustand-x": "3.0.4"
|
"zustand-x": "3.0.4"
|
||||||
|
|||||||
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,8 @@ const AllBandiTable = () => {
|
|||||||
|
|
||||||
const getFormattedBandiData = (data) => {
|
const getFormattedBandiData = (data) => {
|
||||||
return data.map((d) => {
|
return data.map((d) => {
|
||||||
d.dates = d.dates.map(v => is(String, v) ? new Date(v) : (v ? v : ''));
|
d.dateStart = is(String, d.dates[0]) ? new Date(d.dates[0]) : (d.dates[0] ? d.dates[0] : '');
|
||||||
|
d.dateEnd = is(String, d.dates[1]) ? new Date(d.dates[1]) : (d.dates[1] ? d.dates[1] : '');
|
||||||
return d;
|
return d;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -62,8 +63,8 @@ const AllBandiTable = () => {
|
|||||||
setFilters({
|
setFilters({
|
||||||
global: { value: null, matchMode: FilterMatchMode.CONTAINS },
|
global: { value: null, matchMode: FilterMatchMode.CONTAINS },
|
||||||
name: { operator: FilterOperator.AND, constraints: [{ value: null, matchMode: FilterMatchMode.STARTS_WITH }] },
|
name: { operator: FilterOperator.AND, constraints: [{ value: null, matchMode: FilterMatchMode.STARTS_WITH }] },
|
||||||
start_date: { operator: FilterOperator.AND, constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }] },
|
dateStart: { operator: FilterOperator.AND, constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }] },
|
||||||
end_date: { operator: FilterOperator.AND, constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }] },
|
dateEnd: { operator: FilterOperator.AND, constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }] },
|
||||||
status: { operator: FilterOperator.OR, constraints: [{ value: null, matchMode: FilterMatchMode.EQUALS }] },
|
status: { operator: FilterOperator.OR, constraints: [{ value: null, matchMode: FilterMatchMode.EQUALS }] },
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -81,15 +82,15 @@ const AllBandiTable = () => {
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
const dateStartBodyTemplate = (rowData) => {
|
const dateStartBodyTemplate = (rowData) => {
|
||||||
return getDateFromISOstring(rowData.dates[0]);
|
return getDateFromISOstring(rowData.dateStart);
|
||||||
};
|
};
|
||||||
|
|
||||||
const dateEndBodyTemplate = (rowData) => {
|
const dateEndBodyTemplate = (rowData) => {
|
||||||
return getDateFromISOstring(rowData.dates[1]);
|
return getDateFromISOstring(rowData.dateEnd);
|
||||||
};
|
};
|
||||||
|
|
||||||
const dateFilterTemplate = (options) => {
|
const dateFilterTemplate = (options) => {
|
||||||
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)} dateFormat="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999" />;
|
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)} dateFormat="dd/mm/yy" placeholder="dd/mm/yyyy" mask="99/99/9999" />;
|
||||||
};
|
};
|
||||||
|
|
||||||
const statusBodyTemplate = (rowData) => {
|
const statusBodyTemplate = (rowData) => {
|
||||||
@@ -130,14 +131,17 @@ const AllBandiTable = () => {
|
|||||||
filter sortable
|
filter sortable
|
||||||
filterPlaceholder={__('Cerca', 'gepafin')}
|
filterPlaceholder={__('Cerca', 'gepafin')}
|
||||||
style={{ minWidth: '8rem' }}/>
|
style={{ minWidth: '8rem' }}/>
|
||||||
<Column header={__('Data Pubblicazione', 'gepafin')} filterField="start_date" dataType="date"
|
<Column header={__('Data Pubblicazione', 'gepafin')} filterField="dateStart" dataType="date"
|
||||||
style={{ minWidth: '8rem' }}
|
style={{ minWidth: '8rem' }}
|
||||||
body={dateStartBodyTemplate} filter filterElement={dateFilterTemplate}/>
|
body={dateStartBodyTemplate} filter
|
||||||
<Column header={__('Data Scadenza', 'gepafin')} filterField="end_date" dataType="date"
|
filterElement={dateFilterTemplate}/>
|
||||||
|
<Column header={__('Data Scadenza', 'gepafin')} filterField="dateEnd" dataType="date"
|
||||||
style={{ minWidth: '8rem' }}
|
style={{ minWidth: '8rem' }}
|
||||||
body={dateEndBodyTemplate} filter filterElement={dateFilterTemplate}/>
|
body={dateEndBodyTemplate} filter
|
||||||
|
filterElement={dateFilterTemplate}/>
|
||||||
<Column field="status" header={__('Stato', 'gepafin')} filterMenuStyle={{ width: '14rem' }}
|
<Column field="status" header={__('Stato', 'gepafin')} filterMenuStyle={{ width: '14rem' }}
|
||||||
style={{ minWidth: '7rem' }} body={statusBodyTemplate} filter
|
style={{ minWidth: '7rem' }} body={statusBodyTemplate}
|
||||||
|
filter sortable
|
||||||
filterElement={statusFilterTemplate}/>
|
filterElement={statusFilterTemplate}/>
|
||||||
<Column header={__('Azioni', 'gepafin')}
|
<Column header={__('Azioni', 'gepafin')}
|
||||||
body={actionsBodyTemplate}/>
|
body={actionsBodyTemplate}/>
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ const AllBandiAccordion = ({ showOnlyPreferred = false }) => {
|
|||||||
['onlyPreferredCall', showOnlyPreferred]
|
['onlyPreferredCall', showOnlyPreferred]
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}, [chosenCompanyId]);
|
}, [chosenCompanyId, companies]);
|
||||||
|
|
||||||
const getCallback = (data) => {
|
const getCallback = (data) => {
|
||||||
if (data.status === 'SUCCESS') {
|
if (data.status === 'SUCCESS') {
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ const AllBandiTable = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const dateFilterTemplate = (options) => {
|
const dateFilterTemplate = (options) => {
|
||||||
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)} dateFormat="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999" />;
|
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)} dateFormat="dd/mm/yy" placeholder="dd/mm/yyyy" mask="99/99/9999" />;
|
||||||
};
|
};
|
||||||
|
|
||||||
const statusBodyTemplate = (rowData) => {
|
const statusBodyTemplate = (rowData) => {
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ const AllBandiPreferredAccordion = () => {
|
|||||||
['userId', userData.id]
|
['userId', userData.id]
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}, [chosenCompanyId]);
|
}, [chosenCompanyId, companies]);
|
||||||
|
|
||||||
const getCallback = (data) => {
|
const getCallback = (data) => {
|
||||||
if (data.status === 'SUCCESS') {
|
if (data.status === 'SUCCESS') {
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ import FileuploadApplicationSignedPdf from '../../components/FileuploadApplicati
|
|||||||
|
|
||||||
import { defaultMaxFileSize } from '../../configData';
|
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 BandoApplication = () => {
|
||||||
const chosenCompanyId = useStore().main.chosenCompanyId();
|
const chosenCompanyId = useStore().main.chosenCompanyId();
|
||||||
@@ -554,7 +554,6 @@ const BandoApplication = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const errDocsGetCallbacks = () => {
|
const errDocsGetCallbacks = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -604,13 +603,21 @@ const BandoApplication = () => {
|
|||||||
}, [formValues]);
|
}, [formValues]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (previousStatus.current === applicationStatus || (previousStatus.current !== applicationStatus && isEmpty(previousStatus.current))) {
|
console.log('applicationStatus', previousStatus.current, applicationStatus,
|
||||||
|
previousStatus.current === applicationStatus, (previousStatus.current !== applicationStatus && isEmpty(previousStatus.current)))
|
||||||
|
/*if (previousStatus.current === applicationStatus || (previousStatus.current !== applicationStatus && isEmpty(previousStatus.current))) {
|
||||||
previousStatus.current = applicationStatus;
|
previousStatus.current = applicationStatus;
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
previousStatus.current = applicationStatus;
|
previousStatus.current = applicationStatus;
|
||||||
|
}*/
|
||||||
|
if (previousStatus.current === applicationStatus) {
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
previousStatus.current = applicationStatus;
|
||||||
|
|
||||||
|
console.log('applicationStatus ...')
|
||||||
if ('DRAFT' === applicationStatus && !isRequestForApplData) {
|
if ('DRAFT' === applicationStatus && !isRequestForApplData) {
|
||||||
const applId = getApplicationId();
|
const applId = getApplicationId();
|
||||||
|
|
||||||
@@ -686,7 +693,7 @@ const BandoApplication = () => {
|
|||||||
setVisibleConfirmation(false);
|
setVisibleConfirmation(false);
|
||||||
}}>
|
}}>
|
||||||
<p>
|
<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 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')
|
: __('Grazie, la tua domanda è stata inviata correttamente. Entro 24 ore riceverai una pec con data, ora e numero di protocollo.', 'gepafin')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ import { Button } from 'primereact/button';
|
|||||||
import ProperBandoLabel from '../../../../components/ProperBandoLabel';
|
import ProperBandoLabel from '../../../../components/ProperBandoLabel';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import translationStrings from '../../../../translationStringsForComponents';
|
import translationStrings from '../../../../translationStringsForComponents';
|
||||||
|
import { Dropdown } from 'primereact/dropdown';
|
||||||
|
import { Tag } from 'primereact/tag';
|
||||||
|
import getBandoLabel from '../../../../helpers/getBandoLabel';
|
||||||
|
import getBandoSeverity from '../../../../helpers/getBandoSeverity';
|
||||||
|
|
||||||
const DraftApplicationsTableAsync = () => {
|
const DraftApplicationsTableAsync = () => {
|
||||||
const chosenCompanyId = useStore().main.chosenCompanyId();
|
const chosenCompanyId = useStore().main.chosenCompanyId();
|
||||||
@@ -31,7 +35,8 @@ const DraftApplicationsTableAsync = () => {
|
|||||||
filters: {
|
filters: {
|
||||||
id: { value: null, matchMode: 'contains' },
|
id: { value: null, matchMode: 'contains' },
|
||||||
callTitle: { value: null, matchMode: 'contains' },
|
callTitle: { value: null, matchMode: 'contains' },
|
||||||
companyName: { value: null, matchMode: 'contains' }
|
companyName: { value: null, matchMode: 'contains' },
|
||||||
|
status: { value: null, matchMode: 'contains' }
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const statuses = ['DRAFT', 'AWAITING', 'READY'];
|
const statuses = ['DRAFT', 'AWAITING', 'READY'];
|
||||||
@@ -120,6 +125,26 @@ const DraftApplicationsTableAsync = () => {
|
|||||||
return <ProgressBar value={options.progress} color={'#64748B'}></ProgressBar>;
|
return <ProgressBar value={options.progress} color={'#64748B'}></ProgressBar>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const statusItemTemplate = (option) => {
|
||||||
|
return <Tag value={getBandoLabel(option)} severity={getBandoSeverity(option)}/>;
|
||||||
|
};
|
||||||
|
|
||||||
|
const statusFilterTemplate = (options) => {
|
||||||
|
return <Dropdown value={options.value} options={statuses}
|
||||||
|
onChange={(e) => {
|
||||||
|
options.filterCallback(e.value, options.index)
|
||||||
|
const filters = { ...lazyState.filters };
|
||||||
|
if (e.value) {
|
||||||
|
filters['status'] = { value: e.value, matchMode: 'equals' };
|
||||||
|
} else {
|
||||||
|
delete filters['status'];
|
||||||
|
}
|
||||||
|
setLazyState({ ...lazyState, filters, first: 0 });
|
||||||
|
}}
|
||||||
|
itemTemplate={statusItemTemplate} placeholder={translationStrings.selectOneLabel} className="p-column-filter"
|
||||||
|
showClear/>;
|
||||||
|
};
|
||||||
|
|
||||||
const actionsBodyTemplate = (rowData) => {
|
const actionsBodyTemplate = (rowData) => {
|
||||||
return <Link to={`/domande/${rowData.id}/preview`}>
|
return <Link to={`/domande/${rowData.id}/preview`}>
|
||||||
<Button severity="info" label={__('Anteprima', 'gepafin')} icon="pi pi-eye" size="small"
|
<Button severity="info" label={__('Anteprima', 'gepafin')} icon="pi pi-eye" size="small"
|
||||||
@@ -155,6 +180,8 @@ const DraftApplicationsTableAsync = () => {
|
|||||||
filterPlaceholder={__('Cerca il nome', 'gepafin')}
|
filterPlaceholder={__('Cerca il nome', 'gepafin')}
|
||||||
style={{ minWidth: '8rem' }}/>
|
style={{ minWidth: '8rem' }}/>
|
||||||
<Column field="status" header={__('Stato', 'gepafin')}
|
<Column field="status" header={__('Stato', 'gepafin')}
|
||||||
|
filterElement={statusFilterTemplate} filter
|
||||||
|
filterMatchModeOptions={translationStrings.statusFilterOptions}
|
||||||
style={{ minWidth: '7rem' }} body={statusBodyTemplate}/>
|
style={{ minWidth: '7rem' }} body={statusBodyTemplate}/>
|
||||||
<Column header={__('Progressi', 'gepafin')}
|
<Column header={__('Progressi', 'gepafin')}
|
||||||
style={{ minWidth: '10rem' }} field="progress" body={progressBodyTemplate}/>
|
style={{ minWidth: '10rem' }} field="progress" body={progressBodyTemplate}/>
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ const LatestBandiTable = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const dateFilterTemplate = (options) => {
|
const dateFilterTemplate = (options) => {
|
||||||
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)} dateFormat="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999" />;
|
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)} dateFormat="dd/mm/yy" placeholder="dd/mm/yyyy" mask="99/99/9999" />;
|
||||||
};
|
};
|
||||||
|
|
||||||
const statusBodyTemplate = (rowData) => {
|
const statusBodyTemplate = (rowData) => {
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ const LatestBandiTableAsync = () => {
|
|||||||
|
|
||||||
const dateFilterTemplate = (options) => {
|
const dateFilterTemplate = (options) => {
|
||||||
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
||||||
dateFormat="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999"/>;
|
dateFormat="dd/mm/yy" placeholder="dd/mm/yyyy" mask="99/99/9999"/>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const dateStartBodyTemplate = (rowData) => {
|
const dateStartBodyTemplate = (rowData) => {
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ const LatestUsersActivityTable = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const dateFilterTemplate = (options) => {
|
const dateFilterTemplate = (options) => {
|
||||||
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)} dateFormat="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999" />;
|
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)} dateFormat="dd/mm/yy" placeholder="dd/mm/yyyy" mask="99/99/9999" />;
|
||||||
};
|
};
|
||||||
|
|
||||||
const header = renderHeader();
|
const header = renderHeader();
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ import LatestBandiTableAsync from './components/LatestBandiTableAsync';
|
|||||||
import AllDomandeTableAsync from '../Domande/components/AllDomandeTableAsync';
|
import AllDomandeTableAsync from '../Domande/components/AllDomandeTableAsync';
|
||||||
import DraftApplicationsTableAsync from './components/DraftApplicationsTableAsync';
|
import DraftApplicationsTableAsync from './components/DraftApplicationsTableAsync';
|
||||||
|
|
||||||
|
const REACT_APP_HUB_ID = process.env.REACT_APP_HUB_ID;
|
||||||
|
|
||||||
const Dashboard = () => {
|
const Dashboard = () => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const [mainStats, setMainStats] = useState({});
|
const [mainStats, setMainStats] = useState({});
|
||||||
@@ -64,7 +66,8 @@ const Dashboard = () => {
|
|||||||
|
|
||||||
<div className="appPage__spacer"></div>
|
<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">
|
<p className="appPageSection__pMeta">
|
||||||
<span>{__('PEC inbox quota', 'gepafin')}</span>
|
<span>{__('PEC inbox quota', 'gepafin')}</span>
|
||||||
<span>{<NumberFlow
|
<span>{<NumberFlow
|
||||||
@@ -73,7 +76,7 @@ const Dashboard = () => {
|
|||||||
suffix={'%'}
|
suffix={'%'}
|
||||||
locales="it-IT"/>}</span>
|
locales="it-IT"/>}</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div> : null}
|
||||||
|
|
||||||
<div className="appPage__spacer"></div>
|
<div className="appPage__spacer"></div>
|
||||||
|
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ const LatestBandiTable = () => {
|
|||||||
|
|
||||||
const dateFilterTemplate = (options) => {
|
const dateFilterTemplate = (options) => {
|
||||||
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
||||||
dateFormat="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999"/>;
|
dateFormat="dd/mm/yy" placeholder="dd/mm/yyyy" mask="99/99/9999"/>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const statusBodyTemplate = (rowData) => {
|
const statusBodyTemplate = (rowData) => {
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ const MyLatestSubmissionsTable = () => {
|
|||||||
['statuses', ['DRAFT', 'AWAITING', 'READY']]
|
['statuses', ['DRAFT', 'AWAITING', 'READY']]
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}, [chosenCompanyId]);
|
}, [chosenCompanyId, companies]);
|
||||||
|
|
||||||
const getApplCallback = (data) => {
|
const getApplCallback = (data) => {
|
||||||
if (data.status === 'SUCCESS') {
|
if (data.status === 'SUCCESS') {
|
||||||
@@ -142,7 +142,7 @@ const MyLatestSubmissionsTable = () => {
|
|||||||
|
|
||||||
const dateFilterTemplate = (options) => {
|
const dateFilterTemplate = (options) => {
|
||||||
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
||||||
dateFormat="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999"/>;
|
dateFormat="dd/mm/yy" placeholder="dd/mm/yyyy" mask="99/99/9999"/>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const statusBodyTemplate = (rowData) => {
|
const statusBodyTemplate = (rowData) => {
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ const InstructorManagerMieDomandeTable = ({ userId = null, statuses = [] }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const dateFilterTemplate = (options) => {
|
const dateFilterTemplate = (options) => {
|
||||||
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)} dateFormat="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999" />;
|
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)} dateFormat="dd/mm/yy" placeholder="dd/mm/yyyy" mask="99/99/9999" />;
|
||||||
};
|
};
|
||||||
|
|
||||||
const statusBodyTemplate = (rowData) => {
|
const statusBodyTemplate = (rowData) => {
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ const LatestBandiTable = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const dateFilterTemplate = (options) => {
|
const dateFilterTemplate = (options) => {
|
||||||
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)} dateFormat="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999" />;
|
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)} dateFormat="dd/mm/yy" placeholder="dd/mm/yyyy" mask="99/99/9999" />;
|
||||||
};
|
};
|
||||||
|
|
||||||
const statusBodyTemplate = (rowData) => {
|
const statusBodyTemplate = (rowData) => {
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ const LatestBandiTableInstructorManagerAsync = () => {
|
|||||||
|
|
||||||
const dateFilterTemplate = (options) => {
|
const dateFilterTemplate = (options) => {
|
||||||
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
||||||
dateFormat="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999"/>;
|
dateFormat="dd/mm/yy" placeholder="dd/mm/yyyy" mask="99/99/9999"/>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const dateStartBodyTemplate = (rowData) => {
|
const dateStartBodyTemplate = (rowData) => {
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ const MieDomandeTableInstructorManagerAsync = ({ userId = null, statuses = [] })
|
|||||||
|
|
||||||
const dateFilterTemplate = (options) => {
|
const dateFilterTemplate = (options) => {
|
||||||
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
||||||
dateFormat="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999"/>;
|
dateFormat="dd/mm/yy" placeholder="dd/mm/yyyy" mask="99/99/9999"/>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const dateAppliedBodyTemplate = (rowData) => {
|
const dateAppliedBodyTemplate = (rowData) => {
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ const DomandeTablePreInstructorAsync = ({ userId = null, statuses = [] }) => {
|
|||||||
|
|
||||||
const dateFilterTemplate = (options) => {
|
const dateFilterTemplate = (options) => {
|
||||||
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
||||||
dateFormat="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999"/>;
|
dateFormat="dd/mm/yy" placeholder="dd/mm/yyyy" mask="99/99/9999"/>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const dateAppliedBodyTemplate = (rowData) => {
|
const dateAppliedBodyTemplate = (rowData) => {
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ const PreInstructorDomandeTable = ({ userId = null, statuses = [] }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const dateFilterTemplate = (options) => {
|
const dateFilterTemplate = (options) => {
|
||||||
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)} dateFormat="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999" />;
|
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)} dateFormat="dd/mm/yy" placeholder="dd/mm/yyyy" mask="99/99/9999" />;
|
||||||
};
|
};
|
||||||
|
|
||||||
const statusBodyTemplate = (rowData) => {
|
const statusBodyTemplate = (rowData) => {
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ const DocumentsTable = ({ type, reload = 0 }) => {
|
|||||||
['documentType', type]
|
['documentType', type]
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}, [chosenCompanyId, reload]);
|
}, [chosenCompanyId, reload, companies]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const existingCompany = head(companies.filter(o => o.id === chosenCompanyId));
|
const existingCompany = head(companies.filter(o => o.id === chosenCompanyId));
|
||||||
@@ -113,7 +113,7 @@ const DocumentsTable = ({ type, reload = 0 }) => {
|
|||||||
|
|
||||||
const dateFilterTemplate = (options) => {
|
const dateFilterTemplate = (options) => {
|
||||||
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
||||||
dateFormat="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999"/>;
|
dateFormat="dd/mm/yy" placeholder="dd/mm/yyyy" mask="99/99/9999"/>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const catBodyTemplate = (rowData) => {
|
const catBodyTemplate = (rowData) => {
|
||||||
|
|||||||
@@ -646,6 +646,12 @@ const DomandaEditInstructorManager = () => {
|
|||||||
detail: data.message
|
detail: data.message
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (data.data.ndg) {
|
||||||
|
setData((data) => ({
|
||||||
|
...data,
|
||||||
|
ndg: data.data.ndg
|
||||||
|
}));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
storeSet.main.unsetAsyncRequest();
|
storeSet.main.unsetAsyncRequest();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -646,6 +646,12 @@ const DomandaEditPreInstructor = () => {
|
|||||||
detail: data.message
|
detail: data.message
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (data.data.ndg) {
|
||||||
|
setData((data) => ({
|
||||||
|
...data,
|
||||||
|
ndg: data.data.ndg
|
||||||
|
}));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
storeSet.main.unsetAsyncRequest();
|
storeSet.main.unsetAsyncRequest();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ const AllDomandeTable = ({ openDialogFn, updaterString = '' }) => {
|
|||||||
|
|
||||||
const dateFilterTemplate = (options) => {
|
const dateFilterTemplate = (options) => {
|
||||||
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
||||||
dateFormat="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999"/>;
|
dateFormat="dd/mm/yy" placeholder="dd/mm/yyyy" mask="99/99/9999"/>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const statusBodyTemplate = (rowData) => {
|
const statusBodyTemplate = (rowData) => {
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ const AllDomandeTableAsync = ({ openDialogFn, updaterString = '' }) => {
|
|||||||
|
|
||||||
const dateFilterTemplate = (options) => {
|
const dateFilterTemplate = (options) => {
|
||||||
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
||||||
dateFormat="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999"/>;
|
dateFormat="dd/mm/yy" placeholder="dd/mm/yyyy" mask="99/99/9999"/>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const dateAppliedBodyTemplate = (rowData) => {
|
const dateAppliedBodyTemplate = (rowData) => {
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ const AllDomandeArchiveTable = ({ updaterString = '' }) => {
|
|||||||
|
|
||||||
const dateFilterTemplate = (options) => {
|
const dateFilterTemplate = (options) => {
|
||||||
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
||||||
dateFormat="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999"/>;
|
dateFormat="dd/mm/yy" placeholder="dd/mm/yyyy" mask="99/99/9999"/>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const statusBodyTemplate = (rowData) => {
|
const statusBodyTemplate = (rowData) => {
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ const BeneficiarioDomandeTable = () => {
|
|||||||
['statuses', ['SOCCORSO', 'APPROVED', 'REJECTED', 'EVALUATION', 'SUBMIT']] // 'NDG', 'ADMISSIBLE', 'APPOINTMENT'
|
['statuses', ['SOCCORSO', 'APPROVED', 'REJECTED', 'EVALUATION', 'SUBMIT']] // 'NDG', 'ADMISSIBLE', 'APPOINTMENT'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}, [chosenCompanyId]);
|
}, [chosenCompanyId, companies]);
|
||||||
|
|
||||||
const getApplCallback = (data) => {
|
const getApplCallback = (data) => {
|
||||||
if (data.status === 'SUCCESS') {
|
if (data.status === 'SUCCESS') {
|
||||||
@@ -119,7 +119,7 @@ const BeneficiarioDomandeTable = () => {
|
|||||||
|
|
||||||
const dateFilterTemplate = (options) => {
|
const dateFilterTemplate = (options) => {
|
||||||
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
||||||
dateFormat="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999"/>;
|
dateFormat="dd/mm/yy" placeholder="dd/mm/yyyy" mask="99/99/9999"/>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const statusBodyTemplate = (rowData) => {
|
const statusBodyTemplate = (rowData) => {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { __ } from '@wordpress/i18n';
|
|||||||
import DashboardService from '../../service/dashboard-service';
|
import DashboardService from '../../service/dashboard-service';
|
||||||
import { pathOr } from 'ramda';
|
import { pathOr } from 'ramda';
|
||||||
import NumberFlow from '@number-flow/react';
|
import NumberFlow from '@number-flow/react';
|
||||||
|
//import SoccorsiPreInstructorTableAsync from '../SoccorsoIstruttorioPreInstructor/components/SoccorsiPreInstructorTableAsync';
|
||||||
import PreInstructorSoccorsiTable from '../SoccorsoIstruttorioPreInstructor/components/PreInstructorSoccorsiTable';
|
import PreInstructorSoccorsiTable from '../SoccorsoIstruttorioPreInstructor/components/PreInstructorSoccorsiTable';
|
||||||
|
|
||||||
const SoccorsoIstruttorioInstructorManager = () => {
|
const SoccorsoIstruttorioInstructorManager = () => {
|
||||||
@@ -87,6 +88,7 @@ const SoccorsoIstruttorioInstructorManager = () => {
|
|||||||
|
|
||||||
<div className="appPageSection">
|
<div className="appPageSection">
|
||||||
<PreInstructorSoccorsiTable userId={0}/>
|
<PreInstructorSoccorsiTable userId={0}/>
|
||||||
|
{/*<SoccorsiPreInstructorTableAsync userId={0}/>*/}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ const InstructorManagerSoccorsiTable = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const dateFilterTemplate = (options) => {
|
const dateFilterTemplate = (options) => {
|
||||||
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)} dateFormat="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999" />;
|
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)} dateFormat="dd/mm/yy" placeholder="dd/mm/yyyy" mask="99/99/9999" />;
|
||||||
};
|
};
|
||||||
|
|
||||||
const statusBodyTemplate = (rowData) => {
|
const statusBodyTemplate = (rowData) => {
|
||||||
|
|||||||
@@ -0,0 +1,220 @@
|
|||||||
|
import React, { useEffect, useState, useCallback } from 'react';
|
||||||
|
import { __ } from '@wordpress/i18n';
|
||||||
|
import { is, isEmpty, pathOr } from 'ramda';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
|
import translationStrings from '../../../../translationStringsForComponents';
|
||||||
|
|
||||||
|
// api
|
||||||
|
import AmendmentsService from '../../../../service/amendments-service';
|
||||||
|
|
||||||
|
//
|
||||||
|
import getBandoLabel from '../../../../helpers/getBandoLabel';
|
||||||
|
import getBandoSeverity from '../../../../helpers/getBandoSeverity';
|
||||||
|
import getFormattedDateString from '../../../../helpers/getFormattedDateString';
|
||||||
|
|
||||||
|
// components
|
||||||
|
import { DataTable } from 'primereact/datatable';
|
||||||
|
import { Column } from 'primereact/column';
|
||||||
|
import { Button } from 'primereact/button';
|
||||||
|
import ProperBandoLabel from '../../../../components/ProperBandoLabel';
|
||||||
|
import { Dropdown } from 'primereact/dropdown';
|
||||||
|
import { Tag } from 'primereact/tag';
|
||||||
|
import { Calendar } from 'primereact/calendar';
|
||||||
|
|
||||||
|
const SoccorsiInstructorManagerMioTableAsync = ({ userId = null }) => {
|
||||||
|
const [localAsyncRequest, setLocalAsyncRequest] = useState(false);
|
||||||
|
const [items, setItems] = useState(null);
|
||||||
|
const [totalRecordsNum, setTotalRecordsNum] = useState(0);
|
||||||
|
const [lazyState, setLazyState] = useState({
|
||||||
|
first: 0,
|
||||||
|
rows: 5,
|
||||||
|
page: 0,
|
||||||
|
sortField: null,
|
||||||
|
sortOrder: null,
|
||||||
|
filters: {
|
||||||
|
applicationId: { value: null, matchMode: 'contains' },
|
||||||
|
callName: { value: null, matchMode: 'contains' },
|
||||||
|
companyName: { value: null, matchMode: 'contains' },
|
||||||
|
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 onPage = (event) => {
|
||||||
|
setLazyState(event);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onSort = (event) => {
|
||||||
|
event['first'] = 0;
|
||||||
|
event['page'] = 0;
|
||||||
|
setLazyState(event);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onFilter = useCallback((event) => {
|
||||||
|
event['first'] = 0;
|
||||||
|
event['page'] = 0;
|
||||||
|
setLazyState(event);
|
||||||
|
}, [lazyState]);
|
||||||
|
|
||||||
|
const getCallback = (resp) => {
|
||||||
|
if (resp.status === 'SUCCESS') {
|
||||||
|
const {
|
||||||
|
body, totalRecords,
|
||||||
|
//currentPage, totalPages, pageSize
|
||||||
|
} = resp.data;
|
||||||
|
setTotalRecordsNum(totalRecords);
|
||||||
|
setItems(getFormattedData(body));
|
||||||
|
}
|
||||||
|
setLocalAsyncRequest(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
const errGetCallbacks = () => {
|
||||||
|
setLocalAsyncRequest(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
const getFormattedData = (data) => {
|
||||||
|
return data.map((d) => {
|
||||||
|
d.startDate = is(String, d.startDate) ? new Date(d.startDate) : (d.startDate ? d.startDate : '');
|
||||||
|
d.expirationDate = is(String, d.expirationDate) ? new Date(d.expirationDate) : (d.expirationDate ? d.expirationDate : '');
|
||||||
|
return d;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const actionsBodyTemplate = (rowData) => {
|
||||||
|
return <Link to={`/mie-domande/${rowData.applicationId}/soccorso/${rowData.id}`}>
|
||||||
|
<Button severity="info" label={__('Dettagli', 'gepafin')} size="small"/>
|
||||||
|
</Link>
|
||||||
|
}
|
||||||
|
|
||||||
|
const statusBodyTemplate = (rowData) => {
|
||||||
|
return <ProperBandoLabel status={rowData.status}/>;
|
||||||
|
};
|
||||||
|
|
||||||
|
const statusItemTemplate = (option) => {
|
||||||
|
return <Tag value={getBandoLabel(option)} severity={getBandoSeverity(option)}/>;
|
||||||
|
};
|
||||||
|
|
||||||
|
const statusFilterTemplate = (options) => {
|
||||||
|
return <Dropdown value={options.value} options={statuses}
|
||||||
|
onChange={(e) => {
|
||||||
|
options.filterCallback(e.value, options.index)
|
||||||
|
const filters = { ...lazyState.filters };
|
||||||
|
if (e.value) {
|
||||||
|
filters['status'] = { value: e.value, matchMode: 'equals' };
|
||||||
|
} else {
|
||||||
|
delete filters['status'];
|
||||||
|
}
|
||||||
|
setLazyState({ ...lazyState, filters, first: 0 });
|
||||||
|
}}
|
||||||
|
itemTemplate={statusItemTemplate} placeholder={translationStrings.selectOneLabel}
|
||||||
|
className="p-column-filter"
|
||||||
|
showClear/>;
|
||||||
|
};
|
||||||
|
|
||||||
|
const dateFilterTemplate = (options) => {
|
||||||
|
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
||||||
|
dateFormat="dd/mm/yy" placeholder="dd/mm/yyyy" mask="99/99/9999"/>;
|
||||||
|
};
|
||||||
|
|
||||||
|
const dateStartBodyTemplate = (rowData) => {
|
||||||
|
return getFormattedDateString(rowData.startDate);
|
||||||
|
};
|
||||||
|
|
||||||
|
const dateExpirationBodyTemplate = (rowData) => {
|
||||||
|
return rowData.expirationDate ? getFormattedDateString(rowData.expirationDate) : '';
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setLocalAsyncRequest(true);
|
||||||
|
const paginationQuery = getPaginationQuery();
|
||||||
|
|
||||||
|
AmendmentsService.getSoccorsiPaginated(userId, paginationQuery, getCallback, errGetCallbacks);
|
||||||
|
}, [lazyState, userId]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="appPageSection__table">
|
||||||
|
<DataTable
|
||||||
|
value={items} stripedRows showGridlines
|
||||||
|
lazy filterDisplay="menu" dataKey="id" paginator
|
||||||
|
first={lazyState.first} rows={lazyState.rows} totalRecords={totalRecordsNum} onPage={onPage}
|
||||||
|
onSort={onSort} sortField={lazyState.sortField} sortOrder={lazyState.sortOrder}
|
||||||
|
onFilter={onFilter} filters={lazyState.filters} loading={localAsyncRequest}
|
||||||
|
emptyMessage={translationStrings.emptyMessage}>
|
||||||
|
<Column field="applicationId" header={__('ID domanda', 'gepafin')}
|
||||||
|
sortable
|
||||||
|
filterField="applicationId" filter
|
||||||
|
filterMatchModeOptions={translationStrings.textFilterOptions}
|
||||||
|
filterPlaceholder={__('Cerca', 'gepafin')}
|
||||||
|
style={{ minWidth: '6rem' }}/>
|
||||||
|
<Column field="protocolNumber" header={__('Protocollo', 'gepafin')}
|
||||||
|
style={{ minWidth: '6rem' }}/>
|
||||||
|
<Column field="callName" header={__('Bando', 'gepafin')}
|
||||||
|
filterField="callName" filter
|
||||||
|
filterMatchModeOptions={translationStrings.textFilterOptions}
|
||||||
|
filterPlaceholder={__('Cerca il nome', 'gepafin')}
|
||||||
|
style={{ minWidth: '10rem' }}/>
|
||||||
|
<Column field="companyName" header={__('Azienda Beneficiaria', 'gepafin')}
|
||||||
|
filterField="companyName" filter
|
||||||
|
filterMatchModeOptions={translationStrings.textFilterOptions}
|
||||||
|
filterPlaceholder={__('Cerca il nome', 'gepafin')}
|
||||||
|
style={{ minWidth: '8rem' }}/>
|
||||||
|
<Column header={__('Data richiesta', 'gepafin')}
|
||||||
|
filterElement={dateFilterTemplate} filter
|
||||||
|
filterField="startDate" dataType="date"
|
||||||
|
filterMatchModeOptions={translationStrings.dateFilterOptions}
|
||||||
|
style={{ minWidth: '8rem' }}
|
||||||
|
body={dateStartBodyTemplate}/>
|
||||||
|
<Column header={__('Scadenza', 'gepafin')}
|
||||||
|
filterElement={dateFilterTemplate} filter
|
||||||
|
filterField="expirationDate" dataType="date"
|
||||||
|
filterMatchModeOptions={translationStrings.dateFilterOptions}
|
||||||
|
style={{ minWidth: '8rem' }}
|
||||||
|
body={dateExpirationBodyTemplate}/>
|
||||||
|
|
||||||
|
<Column field="assignedUserName" header={__('Assegnato', 'gepafin')}
|
||||||
|
style={{ minWidth: '8rem' }}/>
|
||||||
|
<Column field="status" header={__('Stato', 'gepafin')}
|
||||||
|
filterElement={statusFilterTemplate} filter
|
||||||
|
filterMatchModeOptions={translationStrings.statusFilterOptions}
|
||||||
|
style={{ minWidth: '8rem' }}
|
||||||
|
body={statusBodyTemplate}/>
|
||||||
|
<Column header={__('Azioni', 'gepafin')}
|
||||||
|
body={actionsBodyTemplate}/>
|
||||||
|
</DataTable>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SoccorsiInstructorManagerMioTableAsync;
|
||||||
@@ -2,9 +2,13 @@ import React from 'react';
|
|||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
|
|
||||||
// components
|
// components
|
||||||
|
//import SoccorsiInstructorManagerMioTableAsync from './components/SoccorsiInstructorManagerMioTableAsync';
|
||||||
|
//import { useStore } from '../../store';
|
||||||
import InstructorManagerSoccorsiTable from './components/InstructorManagerSoccorsiTable';
|
import InstructorManagerSoccorsiTable from './components/InstructorManagerSoccorsiTable';
|
||||||
|
|
||||||
const SoccorsoIstruttorioMioInstructorManager = () => {
|
const SoccorsoIstruttorioMioInstructorManager = () => {
|
||||||
|
//const userData = useStore().main.userData();
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<div className="appPage">
|
<div className="appPage">
|
||||||
<div className="appPage__pageHeader">
|
<div className="appPage__pageHeader">
|
||||||
@@ -14,6 +18,7 @@ const SoccorsoIstruttorioMioInstructorManager = () => {
|
|||||||
<div className="appPage__spacer"></div>
|
<div className="appPage__spacer"></div>
|
||||||
|
|
||||||
<div className="appPageSection">
|
<div className="appPageSection">
|
||||||
|
{/*<SoccorsiInstructorManagerMioTableAsync userId={userData.id}/>*/}
|
||||||
<InstructorManagerSoccorsiTable/>
|
<InstructorManagerSoccorsiTable/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ const PreInstructorSoccorsiTable = ({ userId = null }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const dateFilterTemplate = (options) => {
|
const dateFilterTemplate = (options) => {
|
||||||
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)} dateFormat="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999" />;
|
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)} dateFormat="dd/mm/yy" placeholder="dd/mm/yyyy" mask="99/99/9999" />;
|
||||||
};
|
};
|
||||||
|
|
||||||
const statusBodyTemplate = (rowData) => {
|
const statusBodyTemplate = (rowData) => {
|
||||||
|
|||||||
@@ -0,0 +1,194 @@
|
|||||||
|
import React, { useEffect, useState, useCallback } from 'react';
|
||||||
|
import { __ } from '@wordpress/i18n';
|
||||||
|
import { is, isEmpty, pathOr } from 'ramda';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
|
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';
|
||||||
|
import { Column } from 'primereact/column';
|
||||||
|
import { Button } from 'primereact/button';
|
||||||
|
import ProperBandoLabel from '../../../../components/ProperBandoLabel';
|
||||||
|
import { Dropdown } from 'primereact/dropdown';
|
||||||
|
import { Tag } from 'primereact/tag';
|
||||||
|
import { Calendar } from 'primereact/calendar';
|
||||||
|
|
||||||
|
const SoccorsiPreInstructorTableAsync = ({ userId = null }) => {
|
||||||
|
const [localAsyncRequest, setLocalAsyncRequest] = useState(false);
|
||||||
|
const [items, setItems] = useState(null);
|
||||||
|
const [totalRecordsNum, setTotalRecordsNum] = useState(0);
|
||||||
|
const [lazyState, setLazyState] = useState({
|
||||||
|
first: 0,
|
||||||
|
rows: 5,
|
||||||
|
page: 0,
|
||||||
|
sortField: null,
|
||||||
|
sortOrder: null,
|
||||||
|
filters: {
|
||||||
|
applicationId: { value: null, matchMode: 'contains' },
|
||||||
|
callName: { value: null, matchMode: 'contains' },
|
||||||
|
companyName: { value: null, matchMode: 'contains' },
|
||||||
|
startDate: { value: null, matchMode: 'dateIs' },
|
||||||
|
expirationDate: { value: null, matchMode: 'dateIs' },
|
||||||
|
status: { value: null, matchMode: 'equals' }
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const statuses = [];
|
||||||
|
|
||||||
|
const getPaginationQuery = useCallback(getQueryParamsForPaginatedEndpoint(lazyState, statuses), [lazyState]);
|
||||||
|
|
||||||
|
const onPage = (event) => {
|
||||||
|
setLazyState(event);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onSort = (event) => {
|
||||||
|
event['first'] = 0;
|
||||||
|
event['page'] = 0;
|
||||||
|
setLazyState(event);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onFilter = useCallback((event) => {
|
||||||
|
event['first'] = 0;
|
||||||
|
event['page'] = 0;
|
||||||
|
setLazyState(event);
|
||||||
|
}, [lazyState]);
|
||||||
|
|
||||||
|
const getCallback = (resp) => {
|
||||||
|
if (resp.status === 'SUCCESS') {
|
||||||
|
const {
|
||||||
|
body, totalRecords,
|
||||||
|
//currentPage, totalPages, pageSize
|
||||||
|
} = resp.data;
|
||||||
|
setTotalRecordsNum(totalRecords);
|
||||||
|
setItems(getFormattedData(body));
|
||||||
|
}
|
||||||
|
setLocalAsyncRequest(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
const errGetCallbacks = () => {
|
||||||
|
setLocalAsyncRequest(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
const getFormattedData = (data) => {
|
||||||
|
return data.map((d) => {
|
||||||
|
d.startDate = is(String, d.startDate) ? new Date(d.startDate) : (d.startDate ? d.startDate : '');
|
||||||
|
d.expirationDate = is(String, d.expirationDate) ? new Date(d.expirationDate) : (d.expirationDate ? d.expirationDate : '');
|
||||||
|
return d;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const actionsBodyTemplate = (rowData) => {
|
||||||
|
return <Link to={`/domande/${rowData.applicationId}/soccorso/${rowData.id}`}>
|
||||||
|
<Button severity="info" label={__('Dettagli', 'gepafin')} size="small"/>
|
||||||
|
</Link>
|
||||||
|
}
|
||||||
|
|
||||||
|
const statusBodyTemplate = (rowData) => {
|
||||||
|
return <ProperBandoLabel status={rowData.status}/>;
|
||||||
|
};
|
||||||
|
|
||||||
|
const statusItemTemplate = (option) => {
|
||||||
|
return <Tag value={getBandoLabel(option)} severity={getBandoSeverity(option)}/>;
|
||||||
|
};
|
||||||
|
|
||||||
|
const statusFilterTemplate = (options) => {
|
||||||
|
return <Dropdown value={options.value} options={statuses}
|
||||||
|
onChange={(e) => {
|
||||||
|
options.filterCallback(e.value, options.index)
|
||||||
|
const filters = { ...lazyState.filters };
|
||||||
|
if (e.value) {
|
||||||
|
filters['status'] = { value: e.value, matchMode: 'equals' };
|
||||||
|
} else {
|
||||||
|
delete filters['status'];
|
||||||
|
}
|
||||||
|
setLazyState({ ...lazyState, filters, first: 0 });
|
||||||
|
}}
|
||||||
|
itemTemplate={statusItemTemplate} placeholder={translationStrings.selectOneLabel}
|
||||||
|
className="p-column-filter"
|
||||||
|
showClear/>;
|
||||||
|
};
|
||||||
|
|
||||||
|
const dateFilterTemplate = (options) => {
|
||||||
|
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
||||||
|
dateFormat="dd/mm/yy" placeholder="dd/mm/yyyy" mask="99/99/9999"/>;
|
||||||
|
};
|
||||||
|
|
||||||
|
const dateStartBodyTemplate = (rowData) => {
|
||||||
|
return getFormattedDateString(rowData.startDate);
|
||||||
|
};
|
||||||
|
|
||||||
|
const dateExpirationBodyTemplate = (rowData) => {
|
||||||
|
return rowData.expirationDate ? getFormattedDateString(rowData.expirationDate) : '';
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setLocalAsyncRequest(true);
|
||||||
|
const paginationQuery = getPaginationQuery();
|
||||||
|
|
||||||
|
AmendmentsService.getSoccorsiPaginated(userId, paginationQuery, getCallback, errGetCallbacks);
|
||||||
|
}, [lazyState, userId]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="appPageSection__table">
|
||||||
|
<DataTable
|
||||||
|
value={items} stripedRows showGridlines
|
||||||
|
lazy filterDisplay="menu" dataKey="id" paginator
|
||||||
|
first={lazyState.first} rows={lazyState.rows} totalRecords={totalRecordsNum} onPage={onPage}
|
||||||
|
onSort={onSort} sortField={lazyState.sortField} sortOrder={lazyState.sortOrder}
|
||||||
|
onFilter={onFilter} filters={lazyState.filters} loading={localAsyncRequest}
|
||||||
|
emptyMessage={translationStrings.emptyMessage}>
|
||||||
|
<Column field="applicationId" header={__('ID domanda', 'gepafin')}
|
||||||
|
sortable
|
||||||
|
filterField="applicationId" filter
|
||||||
|
filterMatchModeOptions={translationStrings.textFilterOptions}
|
||||||
|
filterPlaceholder={__('Cerca', 'gepafin')}
|
||||||
|
style={{ minWidth: '6rem' }}/>
|
||||||
|
<Column field="protocolNumber" header={__('Protocollo', 'gepafin')}
|
||||||
|
style={{ minWidth: '6rem' }}/>
|
||||||
|
<Column field="callName" header={__('Bando', 'gepafin')}
|
||||||
|
filterField="callName" filter
|
||||||
|
filterMatchModeOptions={translationStrings.textFilterOptions}
|
||||||
|
filterPlaceholder={__('Cerca il nome', 'gepafin')}
|
||||||
|
style={{ minWidth: '10rem' }}/>
|
||||||
|
<Column field="companyName" header={__('Azienda Beneficiaria', 'gepafin')}
|
||||||
|
filterField="companyName" filter
|
||||||
|
filterMatchModeOptions={translationStrings.textFilterOptions}
|
||||||
|
filterPlaceholder={__('Cerca il nome', 'gepafin')}
|
||||||
|
style={{ minWidth: '8rem' }}/>
|
||||||
|
<Column header={__('Data richiesta', 'gepafin')}
|
||||||
|
filterElement={dateFilterTemplate} filter
|
||||||
|
filterField="startDate" dataType="date"
|
||||||
|
filterMatchModeOptions={translationStrings.dateFilterOptions}
|
||||||
|
style={{ minWidth: '8rem' }}
|
||||||
|
body={dateStartBodyTemplate}/>
|
||||||
|
<Column header={__('Scadenza', 'gepafin')}
|
||||||
|
filterElement={dateFilterTemplate} filter
|
||||||
|
filterField="expirationDate" dataType="date"
|
||||||
|
filterMatchModeOptions={translationStrings.dateFilterOptions}
|
||||||
|
style={{ minWidth: '8rem' }}
|
||||||
|
body={dateExpirationBodyTemplate}/>
|
||||||
|
|
||||||
|
<Column field="assignedUserName" header={__('Assegnato', 'gepafin')}
|
||||||
|
style={{ minWidth: '8rem' }}/>
|
||||||
|
<Column field="status" header={__('Stato', 'gepafin')}
|
||||||
|
filterElement={statusFilterTemplate} filter
|
||||||
|
filterMatchModeOptions={translationStrings.statusFilterOptions}
|
||||||
|
style={{ minWidth: '8rem' }}
|
||||||
|
body={statusBodyTemplate}/>
|
||||||
|
<Column header={__('Azioni', 'gepafin')}
|
||||||
|
body={actionsBodyTemplate}/>
|
||||||
|
</DataTable>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SoccorsiPreInstructorTableAsync;
|
||||||
@@ -7,12 +7,13 @@ import NumberFlow from '@number-flow/react';
|
|||||||
import { useStore } from '../../store';
|
import { useStore } from '../../store';
|
||||||
|
|
||||||
// components
|
// components
|
||||||
import PreInstructorSoccorsiTable from './components/PreInstructorSoccorsiTable';
|
|
||||||
import DashboardService from '../../service/dashboard-service';
|
import DashboardService from '../../service/dashboard-service';
|
||||||
|
//import SoccorsiPreInstructorTableAsync from './components/SoccorsiPreInstructorTableAsync';
|
||||||
|
import PreInstructorSoccorsiTable from './components/PreInstructorSoccorsiTable';
|
||||||
|
|
||||||
const SoccorsoIstruttorioPreInstructor = () => {
|
const SoccorsoIstruttorioPreInstructor = () => {
|
||||||
const [mainStats, setMainStats] = useState({});
|
const [mainStats, setMainStats] = useState({});
|
||||||
const userData = useStore().main.userData()
|
const userData = useStore().main.userData();
|
||||||
|
|
||||||
const getStats = (data) => {
|
const getStats = (data) => {
|
||||||
if (data.status === 'SUCCESS') {
|
if (data.status === 'SUCCESS') {
|
||||||
@@ -90,6 +91,7 @@ const SoccorsoIstruttorioPreInstructor = () => {
|
|||||||
<div className="appPage__spacer"></div>
|
<div className="appPage__spacer"></div>
|
||||||
|
|
||||||
<div className="appPageSection">
|
<div className="appPageSection">
|
||||||
|
{/*<SoccorsiPreInstructorTableAsync userId={userData.id}/>*/}
|
||||||
<PreInstructorSoccorsiTable userId={userData.id}/>
|
<PreInstructorSoccorsiTable userId={userData.id}/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ const BeneficiarioUltimeDomandeTable = () => {
|
|||||||
['statuses', ['SOCCORSO', 'APPROVED', 'REJECTED', 'EVALUATION', 'SUBMIT']] // 'NDG', 'ADMISSIBLE', 'APPOINTMENT'
|
['statuses', ['SOCCORSO', 'APPROVED', 'REJECTED', 'EVALUATION', 'SUBMIT']] // 'NDG', 'ADMISSIBLE', 'APPOINTMENT'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}, [chosenCompanyId]);
|
}, [chosenCompanyId, companies]);
|
||||||
|
|
||||||
const getApplCallback = (resp) => {
|
const getApplCallback = (resp) => {
|
||||||
if (resp.status === 'SUCCESS') {
|
if (resp.status === 'SUCCESS') {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ const StatsBeneficiary = () => {
|
|||||||
if (existingCompany) {
|
if (existingCompany) {
|
||||||
DashboardService.getBeneficiaryStatsPage(chosenCompanyId, getStats, errGetStats);
|
DashboardService.getBeneficiaryStatsPage(chosenCompanyId, getStats, errGetStats);
|
||||||
}
|
}
|
||||||
}, [chosenCompanyId]);
|
}, [chosenCompanyId, companies]);
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<div className="appPage">
|
<div className="appPage">
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ const AllUsersTable = ({ updaterString = '' }) => {
|
|||||||
|
|
||||||
const dateFilterTemplate = (options) => {
|
const dateFilterTemplate = (options) => {
|
||||||
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
return <Calendar value={options.value} onChange={(e) => options.filterCallback(e.value, options.index)}
|
||||||
dateFormat="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999"/>;
|
dateFormat="dd/mm/yy" placeholder="dd/mm/yyyy" mask="99/99/9999"/>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const nameBodyTemplate = (rowData) => {
|
const nameBodyTemplate = (rowData) => {
|
||||||
|
|||||||
@@ -20,6 +20,10 @@ export default class AmendmentsService {
|
|||||||
NetworkService.get(`${API_BASE_URL}/amendments/user`, callback, errCallback, queryParams);
|
NetworkService.get(`${API_BASE_URL}/amendments/user`, callback, errCallback, queryParams);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static getSoccorsiPaginated = (id, callback, errCallback, queryParams) => {
|
||||||
|
NetworkService.post(`${API_BASE_URL}/amendments/user/${id}/pagination`, callback, errCallback, queryParams);
|
||||||
|
};
|
||||||
|
|
||||||
static createSoccorso = (body, callback, errCallback, queryParams) => {
|
static createSoccorso = (body, callback, errCallback, queryParams) => {
|
||||||
NetworkService.post(`${API_BASE_URL}/amendments`, body, callback, errCallback, queryParams);
|
NetworkService.post(`${API_BASE_URL}/amendments`, body, callback, errCallback, queryParams);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user