Commit 7949b4cc authored by Matija Obreza's avatar Matija Obreza
Browse files

Confirm Partner delete

parent 2517c7bf
......@@ -59,6 +59,8 @@ class CropEditPage extends React.Component<IDescriptorEditPageProps, any> {
abortLabel: 'Cancel',
}).then(() => {
deleteCrop(crop);
}).catch(() => {
// don't delete
});
}
......
......@@ -6,6 +6,7 @@ import {bindActionCreators} from 'redux';
import {loadPartner, editPartner, deletePartner} from 'actions/partner';
import {Partner} from 'model/partner.model';
import confirm from 'utilities/confirmAlert';
import Markdown from 'ui/common/markdown';
import {FaoWiewsLink} from 'ui/common/Links';
......@@ -79,7 +80,16 @@ class PartnerPage extends React.Component<IPartnerPageProps, any> {
private onDeletePartner = (e) => {
const {partner, deletePartner} = this.props;
deletePartner(partner);
confirm(<span>Delete <b>{ partner.name }</b>?</span>, {
description: `Deleting the partner record is only possible when there is no associated data.`,
confirmLabel: 'Delete',
abortLabel: 'Cancel',
}).then(() => {
deletePartner(partner);
}).catch(() => {
// don't delete
});
}
public render() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment