- added remove application functionality;
This commit is contained in:
@@ -57,6 +57,23 @@ const MyLatestSubmissionsTable = () => {
|
|||||||
setLocalAsyncRequest(false);
|
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) => {
|
const getFormattedBandiData = (data) => {
|
||||||
return [...(data || [])].map((d) => {
|
return [...(data || [])].map((d) => {
|
||||||
d.callEndDate = new Date(d.callEndDate);
|
d.callEndDate = new Date(d.callEndDate);
|
||||||
@@ -130,7 +147,8 @@ const MyLatestSubmissionsTable = () => {
|
|||||||
const statusFilterTemplate = (options) => {
|
const statusFilterTemplate = (options) => {
|
||||||
return <Dropdown value={options.value} options={statuses}
|
return <Dropdown value={options.value} options={statuses}
|
||||||
onChange={(e) => options.filterCallback(e.value, options.index)}
|
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/>;
|
showClear/>;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -143,13 +161,24 @@ const MyLatestSubmissionsTable = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const actionsBodyTemplate = (rowData) => {
|
const actionsBodyTemplate = (rowData) => {
|
||||||
return <Link to={`/imieibandi/${rowData.id}`}>
|
return 'DRAFT' === rowData.status
|
||||||
{'DRAFT' === rowData.status
|
? <div className="appPageSection__tableActions lessGap">
|
||||||
? <Button severity="info" label={__('Modifica', 'gepafin')} icon="pi pi-pencil" size="small"
|
<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"/>
|
iconPos="right"/>
|
||||||
: <Button severity="info" label={__('Mostra', 'gepafin')} icon="pi pi-eye" size="small"
|
|
||||||
iconPos="right"/>}
|
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const header = renderHeader();
|
const header = renderHeader();
|
||||||
|
|||||||
@@ -48,6 +48,10 @@ export default class ApplicationService {
|
|||||||
NetworkService.delete(`${API_BASE_URL}/application/${id}/signedDocument`, {}, callback, errCallback);
|
NetworkService.delete(`${API_BASE_URL}/application/${id}/signedDocument`, {}, callback, errCallback);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static deleteApplication = (id, callback, errCallback) => {
|
||||||
|
NetworkService.delete(`${API_BASE_URL}/application/${id}`, {}, callback, errCallback);
|
||||||
|
};
|
||||||
|
|
||||||
static downloadCompleteZip = (id, callback, errCallback, queryParams) => {
|
static downloadCompleteZip = (id, callback, errCallback, queryParams) => {
|
||||||
NetworkService.getBlob(`${API_BASE_URL}/application/${id}/documents/zip`, callback, errCallback, queryParams);
|
NetworkService.getBlob(`${API_BASE_URL}/application/${id}/documents/zip`, callback, errCallback, queryParams);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user