- added translation config;
- implemented 'bandi osservati' page;
This commit is contained in:
@@ -9,6 +9,10 @@ import { useStore } from '../../../../store';
|
||||
// api
|
||||
import AssignedApplicationService from '../../../../service/assigned-application-service';
|
||||
|
||||
// tools
|
||||
import getBandoLabel from '../../../../helpers/getBandoLabel';
|
||||
import getBandoSeverity from '../../../../helpers/getBandoSeverity';
|
||||
|
||||
// components
|
||||
import { FilterMatchMode, FilterOperator } from 'primereact/api';
|
||||
import { DataTable } from 'primereact/datatable';
|
||||
@@ -19,7 +23,10 @@ import { InputIcon } from 'primereact/inputicon';
|
||||
import { Button } from 'primereact/button';
|
||||
import { Calendar } from 'primereact/calendar';
|
||||
import ProperBandoLabel from '../../../../components/ProperBandoLabel';
|
||||
import { Dropdown } from 'primereact/dropdown';
|
||||
import { Tag } from 'primereact/tag';
|
||||
|
||||
import translationStrings from '../../../../translationStringsForComponents';
|
||||
|
||||
const PreInstructorDomandeTable = () => {
|
||||
const userData = useStore().main.userData();
|
||||
@@ -126,6 +133,14 @@ const PreInstructorDomandeTable = () => {
|
||||
return <ProperBandoLabel status={rowData.status}/>;
|
||||
};
|
||||
|
||||
const statusFilterTemplate = (options) => {
|
||||
return <Dropdown value={options.value} options={statuses} onChange={(e) => options.filterCallback(e.value, options.index)} itemTemplate={statusItemTemplate} placeholder={translationStrings.selectOneLabel} className="p-column-filter" showClear />;
|
||||
};
|
||||
|
||||
const statusItemTemplate = (option) => {
|
||||
return <Tag value={getBandoLabel(option)} severity={getBandoSeverity(option)} />;
|
||||
};
|
||||
|
||||
const actionsBodyTemplate = (rowData) => {
|
||||
return <Link to={`/domande/${rowData.applicationId}`}>
|
||||
<Button severity="info" label={__('Valuta', 'gepafin')} icon="pi pi-eye" size="small" iconPos="right"/>
|
||||
@@ -140,7 +155,7 @@ const PreInstructorDomandeTable = () => {
|
||||
filters={filters}
|
||||
globalFilterFields={['name', 'status']}
|
||||
header={header}
|
||||
emptyMessage={__('Nessun dato disponibile', 'gepafin')}
|
||||
emptyMessage={translationStrings.emptyMessage}
|
||||
onFilter={(e) => setFilters(e.filters)}>
|
||||
<Column field="applicationId" header={__('ID domanda', 'gepafin')}
|
||||
filter filterPlaceholder={__('Cerca', 'gepafin')}
|
||||
@@ -155,7 +170,8 @@ const PreInstructorDomandeTable = () => {
|
||||
style={{ minWidth: '8rem' }}
|
||||
body={dateEndBodyTemplate} filter filterElement={dateFilterTemplate}/>
|
||||
<Column field="status" header={__('Stato', 'gepafin')}
|
||||
style={{ minWidth: '7rem' }} body={statusBodyTemplate} />
|
||||
style={{ minWidth: '7rem' }} body={statusBodyTemplate} filter
|
||||
filterElement={statusFilterTemplate} />
|
||||
<Column header={__('Azioni', 'gepafin')}
|
||||
body={actionsBodyTemplate}/>
|
||||
</DataTable>
|
||||
|
||||
Reference in New Issue
Block a user