- added login and loginAdmin;

- fixed bug with saving application data;
This commit is contained in:
Vitalii Kiiko
2024-09-25 16:25:09 +02:00
parent b008fcd37a
commit 25b1b5ae7d
9 changed files with 226 additions and 112 deletions

View File

@@ -55,10 +55,8 @@ const MyLatestSubmissionsTable = () => {
const getFormattedBandiData = (data) => {
return [...(data || [])].map((d) => {
d.modify_date = new Date();
d.end_date = new Date();
d.name = `Bando ${d.callId}`;
d.progress = 37;
d.callEndDate = new Date(d.callEndDate);
d.modifiedDate = new Date(d.modifiedDate);
return d;
});
@@ -89,9 +87,9 @@ const MyLatestSubmissionsTable = () => {
const initFilters = () => {
setFilters({
global: { value: null, matchMode: FilterMatchMode.CONTAINS },
name: { operator: FilterOperator.AND, constraints: [{ value: null, matchMode: FilterMatchMode.STARTS_WITH }] },
modify_date: { operator: FilterOperator.AND, constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }] },
end_date: { operator: FilterOperator.AND, constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }] },
callTitle: { operator: FilterOperator.AND, constraints: [{ value: null, matchMode: FilterMatchMode.STARTS_WITH }] },
modifiedDate: { operator: FilterOperator.AND, constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }] },
callEndDate: { operator: FilterOperator.AND, constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }] },
status: { operator: FilterOperator.OR, constraints: [{ value: null, matchMode: FilterMatchMode.EQUALS }] },
});
setGlobalFilterValue('');
@@ -110,11 +108,11 @@ const MyLatestSubmissionsTable = () => {
};
const dateModifyBodyTemplate = (rowData) => {
return formatDate(rowData.modify_date);
return formatDate(rowData.modifiedDate);
};
const dateEndBodyTemplate = (rowData) => {
return formatDate(rowData.end_date);
return formatDate(rowData.callEndDate);
};
const dateFilterTemplate = (options) => {
@@ -152,12 +150,12 @@ const MyLatestSubmissionsTable = () => {
globalFilterFields={['name', 'status']}
header={header}
emptyMessage="Nothing found." onFilter={(e) => setFilters(e.filters)}>
<Column field="name" header={__('Bando', 'gepafin')} filter filterPlaceholder="Search by name"
<Column field="callTitle" header={__('Bando', 'gepafin')} filter filterPlaceholder="Search by name"
style={{ minWidth: '12rem' }}/>
<Column header={__('Scadenza', 'gepafin')} filterField="end_date" dataType="date"
<Column header={__('Scadenza', 'gepafin')} filterField="callEndDate" dataType="date"
style={{ minWidth: '10rem' }}
body={dateEndBodyTemplate} filter filterElement={dateFilterTemplate}/>
<Column header={__('Ultima modifica', 'gepafin')} filterField="modify_date" dataType="date"
<Column header={__('Ultima modifica', 'gepafin')} filterField="modifiedDate" dataType="date"
style={{ minWidth: '10rem' }}
body={dateModifyBodyTemplate} filter filterElement={dateFilterTemplate}/>
<Column field="status" header={__('Stato', 'gepafin')} filterMenuStyle={{ width: '14rem' }}