- updated async tables;
- fixed typo; - added some QOL;
This commit is contained in:
@@ -74,6 +74,7 @@ const Fileupload = ({
|
||||
}
|
||||
|
||||
const confirmDelete = (event, file) => {
|
||||
console.log('confirmDelete', file)
|
||||
confirmPopup({
|
||||
target: event.currentTarget,
|
||||
message: __('Sei sicuro di cancellare il file?', 'gepafin'),
|
||||
|
||||
@@ -8,6 +8,7 @@ import { __ } from '@wordpress/i18n';
|
||||
import { Editor } from 'primereact/editor';
|
||||
import BlockingOverlay from '../../../BlockingOverlay';
|
||||
import { Button } from 'primereact/button';
|
||||
import { isNil } from 'ramda';
|
||||
|
||||
const Delta = Quill.import('delta');
|
||||
|
||||
@@ -53,15 +54,17 @@ const Wysiwyg = ({
|
||||
<>
|
||||
<BlockingOverlay shouldDisplay={disabled}/>
|
||||
<label htmlFor={fieldName} className={classNames({ 'p-error': errors[fieldName] })}>
|
||||
{label}{config.required || config.isRequired ? <span className="appForm__field--required">*</span> : null}
|
||||
{label}{config.required || config.isRequired ?
|
||||
<span className="appForm__field--required">*</span> : null}
|
||||
</label>
|
||||
<Button
|
||||
label={__('Cancella testo', 'gepafin')}
|
||||
type="button"
|
||||
severity="warning"
|
||||
outlined
|
||||
onClick={handleCleanValue}
|
||||
/>
|
||||
{!isNil(setDataFn)
|
||||
? <Button
|
||||
label={__('Cancella testo', 'gepafin')}
|
||||
type="button"
|
||||
severity="warning"
|
||||
outlined
|
||||
onClick={handleCleanValue}
|
||||
/> : null}
|
||||
<Controller
|
||||
name={fieldName}
|
||||
control={control}
|
||||
@@ -77,8 +80,8 @@ const Wysiwyg = ({
|
||||
modules={{
|
||||
clipboard: {
|
||||
matchers: [
|
||||
[ Node.ELEMENT_NODE, function(node, delta) {
|
||||
const ops = delta.ops.map((op) => ({insert: op.insert}));
|
||||
[Node.ELEMENT_NODE, function (node, delta) {
|
||||
const ops = delta.ops.map((op) => ({ insert: op.insert }));
|
||||
return new Delta(ops)
|
||||
}]
|
||||
]
|
||||
|
||||
@@ -201,7 +201,8 @@ const BandoEditFormStep1 = forwardRef(function ({ initialData, setInitialData, g
|
||||
![
|
||||
'descriptionShort', 'descriptionLong', 'documentationRequested', 'threshold',
|
||||
'aimedTo', 'criteria', 'docs', 'checklist', 'faq', 'amount', 'amountMin', 'amountMax',
|
||||
'email', 'phoneNumber', 'checkList', 'images', 'numberOfCheck', 'appointmentTemplateId'
|
||||
'email', 'phoneNumber', 'checkList', 'images', 'numberOfCheck', 'appointmentTemplateId',
|
||||
'endDate', 'endTime'
|
||||
].includes(fieldName)
|
||||
}
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@ const BandoEditFormStep2 = forwardRef(function ({ initialData, setInitialData, g
|
||||
![
|
||||
'descriptionShort', 'descriptionLong', 'documentationRequested', 'threshold',
|
||||
'aimedTo', 'criteria', 'docs', 'checklist', 'faq', 'amount', 'amountMin', 'amountMax',
|
||||
'email', 'phoneNumber', 'checkList', 'images'
|
||||
'email', 'phoneNumber', 'checkList', 'images', 'endDate', 'endTime'
|
||||
].includes(fieldName)
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
import React, { useState, useEffect, useCallback } from 'react';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { is, pathOr, isEmpty } from 'ramda';
|
||||
|
||||
// store
|
||||
import { useStore } from '../../../../store';
|
||||
|
||||
// api
|
||||
import ApplicationService from '../../../../service/application-service';
|
||||
|
||||
// components
|
||||
import { DataTable } from 'primereact/datatable';
|
||||
import { Column } from 'primereact/column';
|
||||
import { ProgressBar } from 'primereact/progressbar';
|
||||
import { Button } from 'primereact/button';
|
||||
import ProperBandoLabel from '../../../../components/ProperBandoLabel';
|
||||
import { Link } from 'react-router-dom';
|
||||
import translationStrings from '../../../../translationStringsForComponents';
|
||||
|
||||
const DraftApplicationsTableAsync = () => {
|
||||
const chosenCompanyId = useStore().main.chosenCompanyId();
|
||||
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: {
|
||||
id: { value: null, matchMode: 'contains' },
|
||||
callTitle: { value: null, matchMode: 'contains' },
|
||||
companyName: { value: null, matchMode: 'contains' }
|
||||
}
|
||||
});
|
||||
const statuses = ['DRAFT'];
|
||||
|
||||
const getPaginationQuery = useCallback(() => {
|
||||
let sortBy = {
|
||||
columnName: "ID",
|
||||
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 getApplCallback = (resp) => {
|
||||
if (resp.status === 'SUCCESS') {
|
||||
const { body, totalRecords,
|
||||
//currentPage, totalPages, pageSize
|
||||
} = resp.data;
|
||||
setTotalRecordsNum(totalRecords);
|
||||
setItems(getFormattedData(body));
|
||||
}
|
||||
setLocalAsyncRequest(false);
|
||||
}
|
||||
|
||||
const errGetApplCallback = () => {
|
||||
setLocalAsyncRequest(false);
|
||||
}
|
||||
|
||||
const getFormattedData = (data) => {
|
||||
return data.map((d) => {
|
||||
d.callEndDate = is(String, d.callEndDate) ? new Date(d.callEndDate) : (d.callEndDate ? d.callEndDate : '');
|
||||
d.modifiedDate = is(String, d.modifiedDate) ? new Date(d.modifiedDate) : (d.modifiedDate ? d.modifiedDate : '');
|
||||
d.submissionDate = is(String, d.submissionDate) ? new Date(d.submissionDate) : (d.submissionDate ? d.submissionDate : '');
|
||||
return d;
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
setLocalAsyncRequest(true);
|
||||
const paginationQuery = getPaginationQuery();
|
||||
|
||||
ApplicationService.getApplicationsPaginated(paginationQuery, getApplCallback, errGetApplCallback);
|
||||
}, [lazyState, chosenCompanyId]);
|
||||
|
||||
const statusBodyTemplate = (rowData) => {
|
||||
return <ProperBandoLabel status={rowData.status}/>;
|
||||
};
|
||||
|
||||
const progressBodyTemplate = (options) => {
|
||||
return <ProgressBar value={options.progress} color={'#64748B'}></ProgressBar>;
|
||||
};
|
||||
|
||||
const actionsBodyTemplate = (rowData) => {
|
||||
return <Link to={`/domande/${rowData.id}/preview`}>
|
||||
<Button severity="info" label={__('Anteprima', 'gepafin')} icon="pi pi-eye" size="small"
|
||||
iconPos="right"/>
|
||||
</Link>
|
||||
}
|
||||
|
||||
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="id" header={__('ID domanda', 'gepafin')}
|
||||
sortable
|
||||
filterField="id" filter
|
||||
filterMatchModeOptions={translationStrings.textFilterOptions}
|
||||
filterPlaceholder={__('Cerca il nome', 'gepafin')}
|
||||
style={{ minWidth: '8rem' }}/>
|
||||
<Column field="callTitle" header={__('Bando', 'gepafin')}
|
||||
sortable
|
||||
filterField="callTitle" filter
|
||||
filterMatchModeOptions={translationStrings.textFilterOptions}
|
||||
filterPlaceholder={__('Cerca il nome', 'gepafin')}
|
||||
style={{ minWidth: '8rem' }}/>
|
||||
<Column field="companyName" header={__('Azienda', 'gepafin')}
|
||||
sortable
|
||||
filterField="companyName" filter
|
||||
filterMatchModeOptions={translationStrings.textFilterOptions}
|
||||
filterPlaceholder={__('Cerca il nome', 'gepafin')}
|
||||
style={{ minWidth: '8rem' }}/>
|
||||
<Column field="status" header={__('Stato', 'gepafin')}
|
||||
style={{ minWidth: '7rem' }} body={statusBodyTemplate}/>
|
||||
<Column header={__('Progressi', 'gepafin')}
|
||||
style={{ minWidth: '10rem' }} field="progress" body={progressBodyTemplate}/>
|
||||
<Column header={__('Azioni', 'gepafin')}
|
||||
style={{ minWidth: '10rem' }}
|
||||
body={actionsBodyTemplate}/>
|
||||
</DataTable>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default DraftApplicationsTableAsync;
|
||||
@@ -177,6 +177,7 @@ const LatestBandiTableAsync = () => {
|
||||
sortable
|
||||
filterField="name" filter
|
||||
filterMatchModeOptions={translationStrings.textFilterOptions}
|
||||
filterPlaceholder={__('Cerca il nome', 'gepafin')}
|
||||
header={__('Nome Bando', 'gepafin')}
|
||||
style={{ minWidth: '8rem' }}/>
|
||||
<Column header={__('Data Pubblicazione', 'gepafin')}
|
||||
|
||||
@@ -9,11 +9,11 @@ import DashboardService from '../../service/dashboard-service';
|
||||
|
||||
// components
|
||||
import { Button } from 'primereact/button';
|
||||
import DraftApplicationsTable from './components/DraftApplicationsTable';
|
||||
import ChartDomandePerBando from '../../components/ChartDomandePerBando';
|
||||
import ChartStatoDomande from '../../components/ChartStatoDomande';
|
||||
import LatestBandiTableAsync from './components/LatestBandiTableAsync';
|
||||
import AllDomandeTableAsync from '../Domande/components/AllDomandeTableAsync';
|
||||
import DraftApplicationsTableAsync from './components/DraftApplicationsTableAsync';
|
||||
|
||||
const Dashboard = () => {
|
||||
const navigate = useNavigate();
|
||||
@@ -150,16 +150,9 @@ const Dashboard = () => {
|
||||
|
||||
<div className="appPageSection">
|
||||
<h2>{__('Domande in bozza', 'gepafin')}</h2>
|
||||
<DraftApplicationsTable/>
|
||||
<DraftApplicationsTableAsync/>
|
||||
</div>
|
||||
|
||||
{/*<div className="appPage__spacer"></div>
|
||||
|
||||
<div className="appPageSection">
|
||||
<h2>{__('Attività Recenti Utenti', 'gepafin')}</h2>
|
||||
<LatestUsersActivityTable/>
|
||||
</div>*/}
|
||||
|
||||
<div className="appPage__spacer"></div>
|
||||
|
||||
{chartStats.applicationPerCall
|
||||
|
||||
@@ -25,6 +25,7 @@ import ProperBandoLabel from '../../../../components/ProperBandoLabel';
|
||||
import { Link } from 'react-router-dom';
|
||||
import translationStrings from '../../../../translationStringsForComponents';
|
||||
import { ConfirmPopup, confirmPopup } from 'primereact/confirmpopup';
|
||||
import isDateTimeInPast from '../../../../helpers/isDateTimeInPast';
|
||||
|
||||
const MyLatestSubmissionsTable = () => {
|
||||
const chosenCompanyId = useStore().main.chosenCompanyId();
|
||||
@@ -165,25 +166,28 @@ const MyLatestSubmissionsTable = () => {
|
||||
};
|
||||
|
||||
const actionsBodyTemplate = (rowData) => {
|
||||
return 'DRAFT' === rowData.status
|
||||
? <div className="appPageSection__tableActions lessGap">
|
||||
<Link to={`/imieibandi/${rowData.id}`}>
|
||||
<Button severity="info" label={__('Modifica', 'gepafin')} icon="pi pi-pencil" size="small"
|
||||
iconPos="right"/>
|
||||
</Link>
|
||||
const isCallExpired = isDateTimeInPast(rowData.callEndDate, rowData.callEndTime);
|
||||
return <div className="appPageSection__tableActions lessGap">
|
||||
{'DRAFT' === rowData.status && !isCallExpired
|
||||
? <Link to={`/imieibandi/${rowData.id}`}>
|
||||
<Button severity="info" label={__('Modifica', 'gepafin')} icon="pi pi-pencil" size="small"
|
||||
iconPos="right"/>
|
||||
</Link>
|
||||
: null}
|
||||
{'DRAFT' !== rowData.status || isCallExpired
|
||||
? <Link to={`/imieibandi/${rowData.id}`}>
|
||||
<Button severity="info" label={__('Mostra', 'gepafin')} icon="pi pi-eye" size="small"
|
||||
iconPos="right"/>
|
||||
</Link>
|
||||
: null}
|
||||
<ConfirmPopup/>
|
||||
<Button severity="danger"
|
||||
/*onClick={() => handleDeleteApplication(rowData.id)}*/
|
||||
onClick={(event) => confirmDelete(event, rowData.id)}
|
||||
onClick={(event) => confirmDelete(event, rowData.id)}
|
||||
label={__('Cancella', 'gepafin')}
|
||||
icon="pi pi-trash"
|
||||
size="small"
|
||||
iconPos="right"/>
|
||||
</div>
|
||||
: <Link to={`/imieibandi/${rowData.id}`}>
|
||||
<Button severity="info" label={__('Mostra', 'gepafin')} icon="pi pi-eye" size="small"
|
||||
iconPos="right"/>
|
||||
</Link>
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,198 @@
|
||||
import React, { useEffect, useState, useCallback } from 'react';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { isEmpty, pathOr } from 'ramda';
|
||||
|
||||
import translationStrings from '../../../../translationStringsForComponents';
|
||||
|
||||
// api
|
||||
import BandoService from '../../../../service/bando-service';
|
||||
|
||||
// tools
|
||||
import getTimeParsedFromString from '../../../../helpers/getTimeParsedFromString';
|
||||
import getTimeFromISOstring from '../../../../helpers/getTimeFromISOstring';
|
||||
import getFormattedDateString from '../../../../helpers/getFormattedDateString';
|
||||
import getBandoLabel from '../../../../helpers/getBandoLabel';
|
||||
import getBandoSeverity from '../../../../helpers/getBandoSeverity';
|
||||
|
||||
// components
|
||||
import { DataTable } from 'primereact/datatable';
|
||||
import { Column } from 'primereact/column';
|
||||
import ProperBandoLabel from '../../../../components/ProperBandoLabel';
|
||||
import { Dropdown } from 'primereact/dropdown';
|
||||
import { Tag } from 'primereact/tag';
|
||||
import { Calendar } from 'primereact/calendar';
|
||||
|
||||
const LatestBandiTableInstructorManagerAsync = () => {
|
||||
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: {
|
||||
name: { value: null, matchMode: 'contains' },
|
||||
startDate: { value: null, matchMode: 'date_is' },
|
||||
endDate: { value: null, matchMode: 'date_is' },
|
||||
status: { value: null, matchMode: 'equals' }
|
||||
}
|
||||
});
|
||||
const statuses = ['PUBLISH'];
|
||||
|
||||
const getPaginationQuery = useCallback(() => {
|
||||
let sortBy = {
|
||||
columnName: "ID",
|
||||
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 = new Date(d.dates[0]);
|
||||
d.endDate = new Date(d.dates[1]);
|
||||
|
||||
return d;
|
||||
});
|
||||
};
|
||||
|
||||
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="mm/dd/yy" placeholder="mm/dd/yyyy" mask="99/99/9999"/>;
|
||||
};
|
||||
|
||||
const dateStartBodyTemplate = (rowData) => {
|
||||
const startTimeObj = getTimeParsedFromString(rowData.startTime);
|
||||
return getFormattedDateString(rowData.startDate) + ' ' + getTimeFromISOstring(startTimeObj);
|
||||
};
|
||||
|
||||
const dateEndBodyTemplate = (rowData) => {
|
||||
const endTimeObg = getTimeParsedFromString(rowData.endTime);
|
||||
return getFormattedDateString(rowData.endDate) + ' ' + getTimeFromISOstring(endTimeObg);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
setLocalAsyncRequest(true);
|
||||
const paginationQuery = getPaginationQuery();
|
||||
|
||||
BandoService.getBandiPaginated(paginationQuery, getCallback, errGetCallbacks);
|
||||
}, [lazyState]);
|
||||
|
||||
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="name"
|
||||
sortable
|
||||
filterField="name" filter
|
||||
filterMatchModeOptions={translationStrings.textFilterOptions}
|
||||
filterPlaceholder={__('Cerca il nome', 'gepafin')}
|
||||
header={__('Nome Bando', 'gepafin')}
|
||||
style={{ minWidth: '8rem' }}/>
|
||||
<Column header={__('Data Pubblicazione', 'gepafin')}
|
||||
filterElement={dateFilterTemplate} filter
|
||||
filterField="startDate" dataType="date"
|
||||
filterMatchModeOptions={translationStrings.dateFilterOptions}
|
||||
style={{ minWidth: '8rem' }}
|
||||
body={dateStartBodyTemplate}/>
|
||||
<Column header={__('Data Scadenza', 'gepafin')}
|
||||
filterElement={dateFilterTemplate} filter
|
||||
filterField="endDate" dataType="date"
|
||||
filterMatchModeOptions={translationStrings.dateFilterOptions}
|
||||
style={{ minWidth: '8rem' }}
|
||||
body={dateEndBodyTemplate}/>
|
||||
<Column field="status"
|
||||
filterElement={statusFilterTemplate} filter
|
||||
filterMatchModeOptions={translationStrings.statusFilterOptions}
|
||||
header={__('Stato', 'gepafin')}
|
||||
style={{ minWidth: '7rem' }}
|
||||
body={statusBodyTemplate} />
|
||||
</DataTable>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default LatestBandiTableInstructorManagerAsync;
|
||||
@@ -9,11 +9,11 @@ import DashboardService from '../../service/dashboard-service';
|
||||
|
||||
// components
|
||||
import { Button } from 'primereact/button';
|
||||
import LatestBandiTableInstructorManager from './components/LatestBandiTableInstructorManager';
|
||||
import AllDomandeTable from '../Domande/components/AllDomandeTable';
|
||||
import DraftApplicationsTable from '../Dashboard/components/DraftApplicationsTable';
|
||||
import ChartDomandePerBando from '../../components/ChartDomandePerBando';
|
||||
import ChartStatoDomande from '../../components/ChartStatoDomande';
|
||||
import LatestBandiTableInstructorManagerAsync from './components/LatestBandiTableInstructorManagerAsync';
|
||||
import DraftApplicationsTableAsync from '../Dashboard/components/DraftApplicationsTableAsync';
|
||||
import AllDomandeTableAsync from '../Domande/components/AllDomandeTableAsync';
|
||||
|
||||
const DashboardInstructorManager = () => {
|
||||
const navigate = useNavigate();
|
||||
@@ -107,27 +107,23 @@ const DashboardInstructorManager = () => {
|
||||
|
||||
<div className="appPage__spacer"></div>
|
||||
|
||||
{/*<div className="appPageSection">
|
||||
<h2>{__('Panoramica delle domande da valutare', 'gepafin')}</h2>
|
||||
<PreInstructorDomandeTable statuses={['OPEN', 'SOCCORSO']} userId={0}/>
|
||||
</div>*/}
|
||||
<div className="appPageSection">
|
||||
<h2>{__('Ultimi bandi pubblicati', 'gepafin')}</h2>
|
||||
<LatestBandiTableInstructorManager/>
|
||||
<LatestBandiTableInstructorManagerAsync/>
|
||||
</div>
|
||||
|
||||
<div className="appPage__spacer"></div>
|
||||
|
||||
<div className="appPageSection">
|
||||
<h2>{__('Ultime domande pubblicate', 'gepafin')}</h2>
|
||||
<AllDomandeTable/>
|
||||
<AllDomandeTableAsync/>
|
||||
</div>
|
||||
|
||||
<div className="appPage__spacer"></div>
|
||||
|
||||
<div className="appPageSection">
|
||||
<h2>{__('Domande in bozza', 'gepafin')}</h2>
|
||||
<DraftApplicationsTable/>
|
||||
<DraftApplicationsTableAsync/>
|
||||
</div>
|
||||
|
||||
<div className="appPage__spacer"></div>
|
||||
|
||||
@@ -103,7 +103,7 @@ const PreInstructorDomandeTable = ({ userId = null, statuses = [] }) => {
|
||||
operator: FilterOperator.AND,
|
||||
constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }]
|
||||
},
|
||||
status: { operator: FilterOperator.OR, constraints: [{ value: null, matchMode: FilterMatchMode.EQUALS }] }
|
||||
applicationStatus: { operator: FilterOperator.OR, constraints: [{ value: null, matchMode: FilterMatchMode.EQUALS }] }
|
||||
});
|
||||
};
|
||||
|
||||
@@ -128,7 +128,7 @@ const PreInstructorDomandeTable = ({ userId = null, statuses = [] }) => {
|
||||
};
|
||||
|
||||
const statusBodyTemplate = (rowData) => {
|
||||
return <ProperBandoLabel status={rowData.status}/>;
|
||||
return <ProperBandoLabel status={rowData.applicationStatus}/>;
|
||||
};
|
||||
|
||||
const statusFilterTemplate = (options) => {
|
||||
@@ -216,7 +216,7 @@ const PreInstructorDomandeTable = ({ userId = null, statuses = [] }) => {
|
||||
<Column header={__('Scadenza', 'gepafin')} filterField="evaluationEndDate" dataType="date"
|
||||
style={{ minWidth: '8rem' }}
|
||||
body={dateEndBodyTemplate} filter filterElement={dateFilterTemplate}/>
|
||||
<Column field="status" header={__('Stato', 'gepafin')}
|
||||
<Column field="applicationStatus" header={__('Stato', 'gepafin')}
|
||||
style={{ minWidth: '7rem' }} body={statusBodyTemplate} filter
|
||||
filterElement={statusFilterTemplate} />
|
||||
<Column header={__('Azioni', 'gepafin')}
|
||||
|
||||
@@ -973,6 +973,15 @@ const DomandaEditInstructorManager = () => {
|
||||
data,
|
||||
['evaluationDocument']
|
||||
)}
|
||||
updateCallbackFn={(files) => doSaveDraft(
|
||||
null,
|
||||
{
|
||||
evaluationDocument: klona(files.map(o => ({
|
||||
...o,
|
||||
fileValue: o.fileValue[0] ? o.fileValue[0].id : ''
|
||||
})
|
||||
))
|
||||
})}
|
||||
shouldDisable={['APPROVED', 'REJECTED'].includes(data.applicationStatus) || evaluationBlockedForUser(data)}
|
||||
sourceId={data.id}
|
||||
sourceName="evaluation"/>
|
||||
|
||||
@@ -52,7 +52,7 @@ const ApplicationInfo = ({ data }) => {
|
||||
<span>{getDateTimeFromISOstring(data.assignedAt)}</span>
|
||||
</p>
|
||||
<p className="appPageSection__pMeta">
|
||||
<span>{__('Aassegnato a', 'gepafin')}</span>
|
||||
<span>{__('Assegnato a', 'gepafin')}</span>
|
||||
<span>{data.assignedUserName}</span>
|
||||
</p>
|
||||
<p className="appPageSection__pMeta">
|
||||
|
||||
@@ -127,7 +127,7 @@ const RepeaterFields = ({
|
||||
source={sourceName}
|
||||
sourceId={sourceId}
|
||||
multiple={false}
|
||||
deleteOnBackend={false}
|
||||
deleteOnBackend={true}
|
||||
config={{ required: __('È obbligatorio', 'gepafin') }}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -976,6 +976,15 @@ const DomandaEditPreInstructor = () => {
|
||||
data,
|
||||
['evaluationDocument']
|
||||
)}
|
||||
updateCallbackFn={(files) => doSaveDraft(
|
||||
null,
|
||||
{
|
||||
evaluationDocument: klona(files.map(o => ({
|
||||
...o,
|
||||
fileValue: o.fileValue[0] ? o.fileValue[0].id : ''
|
||||
})
|
||||
))
|
||||
})}
|
||||
shouldDisable={['APPROVED', 'REJECTED'].includes(data.applicationStatus) || evaluationBlockedForUser(data)}
|
||||
sourceId={data.id}
|
||||
sourceName="evaluation"/>
|
||||
|
||||
@@ -183,17 +183,19 @@ const AllDomandeTableAsync = ({ openDialogFn, updaterString = '' }) => {
|
||||
sortable
|
||||
filterField="id" filter
|
||||
filterMatchModeOptions={translationStrings.textFilterOptions}
|
||||
filterPlaceholder={__('Cerca', 'gepafin')}
|
||||
style={{ minWidth: '6rem' }}/>
|
||||
<Column field="protocolNumber" header={__('Protocollo', 'gepafin')}
|
||||
filterPlaceholder={__('Cerca', 'gepafin')}
|
||||
style={{ minWidth: '6rem' }}/>
|
||||
<Column field="callTitle" header={__('Bando', 'gepafin')}
|
||||
filterField="callTitle" 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 Ricezione', 'gepafin')}
|
||||
filterElement={dateFilterTemplate} filter
|
||||
@@ -203,8 +205,7 @@ const AllDomandeTableAsync = ({ openDialogFn, updaterString = '' }) => {
|
||||
body={dateAppliedBodyTemplate}/>
|
||||
<Column field="assignedUserName" header={__('Assegnato', 'gepafin')}
|
||||
style={{ minWidth: '8rem' }}/>
|
||||
<Column field="status"
|
||||
header={__('Stato', 'gepafin')}
|
||||
<Column field="status" header={__('Stato', 'gepafin')}
|
||||
filterElement={statusFilterTemplate} filter
|
||||
filterMatchModeOptions={translationStrings.statusFilterOptions}
|
||||
style={{ minWidth: '8rem' }}
|
||||
|
||||
@@ -5,6 +5,7 @@ import { isEmpty, pathOr } from 'ramda';
|
||||
// api
|
||||
import UserService from '../../service/user-service';
|
||||
import AssignedApplicationService from '../../service/assigned-application-service';
|
||||
import DashboardService from '../../service/dashboard-service';
|
||||
|
||||
// store
|
||||
import { storeSet } from '../../store';
|
||||
@@ -14,14 +15,13 @@ import set404FromErrorResponse from '../../helpers/set404FromErrorResponse';
|
||||
import uniqid from '../../helpers/uniqid';
|
||||
|
||||
// components
|
||||
import AllDomandeTable from './components/AllDomandeTable';
|
||||
import { Dialog } from 'primereact/dialog';
|
||||
import { Button } from 'primereact/button';
|
||||
import { classNames } from 'primereact/utils';
|
||||
import { Dropdown } from 'primereact/dropdown';
|
||||
import DraftApplicationsTable from '../Dashboard/components/DraftApplicationsTable';
|
||||
import NumberFlow from '@number-flow/react';
|
||||
import DashboardService from '../../service/dashboard-service';
|
||||
import DraftApplicationsTableAsync from '../Dashboard/components/DraftApplicationsTableAsync';
|
||||
import AllDomandeTableAsync from './components/AllDomandeTableAsync';
|
||||
|
||||
const Domande = () => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
@@ -166,7 +166,7 @@ const Domande = () => {
|
||||
|
||||
<div className="appPageSection">
|
||||
<h2>{__('Domande pubblicate', 'gepafin')}</h2>
|
||||
<AllDomandeTable openDialogFn={openAssignDialog} updaterString={updaterString}/>
|
||||
<AllDomandeTableAsync openDialogFn={openAssignDialog} updaterString={updaterString}/>
|
||||
</div>
|
||||
|
||||
<div className="appPage__spacer"></div>
|
||||
@@ -224,7 +224,7 @@ const Domande = () => {
|
||||
|
||||
<div className="appPageSection">
|
||||
<h2>{__('Domande in bozza', 'gepafin')}</h2>
|
||||
<DraftApplicationsTable/>
|
||||
<DraftApplicationsTableAsync/>
|
||||
</div>
|
||||
|
||||
<Dialog
|
||||
|
||||
@@ -90,7 +90,7 @@ const LoginConfidi = () => {
|
||||
<div className="appPageLogin__wrapper">
|
||||
<LogoIcon/>
|
||||
|
||||
<h1>{__('Accedi', 'gepafin')}</h1>
|
||||
<h1>{__('Accesso CONFIDI', 'gepafin')}</h1>
|
||||
|
||||
<Messages ref={errorMsgs}/>
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ const PreInstructorSoccorsiTable = ({ userId = null }) => {
|
||||
const getFormattedData = (data) => {
|
||||
return data.map((d) => {
|
||||
d.startDate = is(String, d.startDate) ? new Date(d.startDate) : (d.startDate ? d.startDate : '');
|
||||
d.evaluationEndDate = is(String, d.evaluationEndDate) ? new Date(d.evaluationEndDate) : (d.evaluationEndDate ? d.evaluationEndDate : '');
|
||||
d.expirationDate = is(String, d.expirationDate) ? new Date(d.expirationDate) : (d.expirationDate ? d.expirationDate : '');
|
||||
return d;
|
||||
});
|
||||
};
|
||||
@@ -91,7 +91,7 @@ const PreInstructorSoccorsiTable = ({ userId = null }) => {
|
||||
operator: FilterOperator.AND,
|
||||
constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }]
|
||||
},
|
||||
evaluationEndDate: {
|
||||
expirationDate: {
|
||||
operator: FilterOperator.AND,
|
||||
constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }]
|
||||
},
|
||||
@@ -111,7 +111,7 @@ const PreInstructorSoccorsiTable = ({ userId = null }) => {
|
||||
};
|
||||
|
||||
const dateExpirationBodyTemplate = (rowData) => {
|
||||
return rowData.evaluationEndDate ? formatDate(rowData.evaluationEndDate) : '';
|
||||
return rowData.expirationDate ? formatDate(rowData.expirationDate) : '';
|
||||
};
|
||||
|
||||
const dateFilterTemplate = (options) => {
|
||||
@@ -162,7 +162,7 @@ const PreInstructorSoccorsiTable = ({ userId = null }) => {
|
||||
style={{ minWidth: '8rem' }}
|
||||
body={dateStartBodyTemplate} filter filterElement={dateFilterTemplate}/>
|
||||
<Column header={__('Scadenza', 'gepafin')}
|
||||
filterField="evaluationEndDate" dataType="date"
|
||||
filterField="expirationDate" dataType="date"
|
||||
style={{ minWidth: '8rem' }}
|
||||
body={dateExpirationBodyTemplate} filter filterElement={dateFilterTemplate}/>
|
||||
<Column field="status"
|
||||
|
||||
Reference in New Issue
Block a user