- added remove application functionality;
This commit is contained in:
@@ -57,6 +57,23 @@ const MyLatestSubmissionsTable = () => {
|
||||
setLocalAsyncRequest(false);
|
||||
}
|
||||
|
||||
const handleDeleteApplication = (id) => {
|
||||
setLocalAsyncRequest(true);
|
||||
ApplicationService.deleteApplication(id, (resp) => delApplCallback(resp, id), errDelApplCallback)
|
||||
}
|
||||
|
||||
const delApplCallback = (resp, id) => {
|
||||
if (resp.status === 'SUCCESS') {
|
||||
const newItems = items.filter(o => o.id !== id);
|
||||
setItems(newItems);
|
||||
}
|
||||
setLocalAsyncRequest(false);
|
||||
}
|
||||
|
||||
const errDelApplCallback = (data) => {
|
||||
setLocalAsyncRequest(false);
|
||||
}
|
||||
|
||||
const getFormattedBandiData = (data) => {
|
||||
return [...(data || [])].map((d) => {
|
||||
d.callEndDate = new Date(d.callEndDate);
|
||||
@@ -130,7 +147,8 @@ const MyLatestSubmissionsTable = () => {
|
||||
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"
|
||||
itemTemplate={statusItemTemplate} placeholder={translationStrings.selectOneLabel}
|
||||
className="p-column-filter"
|
||||
showClear/>;
|
||||
};
|
||||
|
||||
@@ -143,13 +161,24 @@ const MyLatestSubmissionsTable = () => {
|
||||
};
|
||||
|
||||
const actionsBodyTemplate = (rowData) => {
|
||||
return <Link to={`/imieibandi/${rowData.id}`}>
|
||||
{'DRAFT' === rowData.status
|
||||
? <Button severity="info" label={__('Modifica', 'gepafin')} icon="pi pi-pencil" size="small"
|
||||
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>
|
||||
<Button severity="danger"
|
||||
onClick={() => handleDeleteApplication(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"/>
|
||||
: <Button severity="info" label={__('Mostra', 'gepafin')} icon="pi pi-eye" size="small"
|
||||
iconPos="right"/>}
|
||||
</Link>
|
||||
|
||||
}
|
||||
|
||||
const header = renderHeader();
|
||||
|
||||
Reference in New Issue
Block a user