2018-08-22 08:39:42 +00:00
|
|
|
import React from 'react';
|
2018-09-29 10:32:53 +00:00
|
|
|
import PropTypes from 'prop-types';
|
2018-10-16 06:27:21 +00:00
|
|
|
import { gettext } from '../../utils/constants';
|
2018-08-22 08:39:42 +00:00
|
|
|
import { Button, Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';
|
|
|
|
|
2018-09-29 10:32:53 +00:00
|
|
|
const propTypes = {
|
|
|
|
currentNode: PropTypes.object.isRequired,
|
|
|
|
toggleCancel: PropTypes.func.isRequired,
|
|
|
|
handleSubmit: PropTypes.func.isRequired,
|
|
|
|
};
|
2018-08-22 08:39:42 +00:00
|
|
|
|
|
|
|
class Delete extends React.Component {
|
|
|
|
|
|
|
|
toggle = () => {
|
|
|
|
this.props.toggleCancel();
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2019-01-23 08:25:14 +00:00
|
|
|
let name = this.props.currentNode.object.name;
|
2018-08-22 08:39:42 +00:00
|
|
|
return (
|
|
|
|
<Modal isOpen={true} toggle={this.toggle}>
|
2018-11-02 07:34:34 +00:00
|
|
|
<ModalHeader toggle={this.toggle}>{gettext('Delete Tag')}</ModalHeader>
|
2018-08-22 08:39:42 +00:00
|
|
|
<ModalBody>
|
2018-09-29 10:32:53 +00:00
|
|
|
<p>{gettext('Are you sure to delete')}{' '}<b>{name}</b> ?</p>
|
2018-08-22 08:39:42 +00:00
|
|
|
</ModalBody>
|
|
|
|
<ModalFooter>
|
2018-09-29 10:32:53 +00:00
|
|
|
<Button outline color="danger" onClick={this.props.handleSubmit}>{gettext('YES')}</Button>
|
|
|
|
<Button outline color="secondary" onClick={this.toggle}>{gettext('NO')}</Button>
|
2018-08-22 08:39:42 +00:00
|
|
|
</ModalFooter>
|
|
|
|
</Modal>
|
2018-09-29 10:32:53 +00:00
|
|
|
);
|
2018-08-22 08:39:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-09-29 10:32:53 +00:00
|
|
|
Delete.propTypes = propTypes;
|
|
|
|
|
2018-08-22 08:39:42 +00:00
|
|
|
export default Delete;
|