committed by
David Calavera
parent
8ffe6730fa
commit
3c7b8d2322
@ -13,6 +13,7 @@ class UnpublishedListing extends React.Component {
|
||||
entries: ImmutablePropTypes.orderedMap,
|
||||
handleChangeStatus: PropTypes.func.isRequired,
|
||||
handlePublish: PropTypes.func.isRequired,
|
||||
handleDelete: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
handleChangeStatus = (newStatus, dragProps) => {
|
||||
@ -22,6 +23,11 @@ class UnpublishedListing extends React.Component {
|
||||
this.props.handleChangeStatus(collection, slug, oldStatus, newStatus);
|
||||
};
|
||||
|
||||
requestDelete = (collection, slug, ownStatus) => {
|
||||
if (window.confirm('Are you sure you want to delete this entry?')) {
|
||||
this.props.handleDelete(collection, slug, ownStatus);
|
||||
}
|
||||
};
|
||||
requestPublish = (collection, slug, ownStatus) => {
|
||||
if (ownStatus !== status.last()) return;
|
||||
if (window.confirm('Are you sure you want to publish this entry?')) {
|
||||
@ -82,6 +88,10 @@ class UnpublishedListing extends React.Component {
|
||||
<Link to={link}>
|
||||
<Button>Edit</Button>
|
||||
</Link>
|
||||
<Button
|
||||
onClick={this.requestDelete.bind(this, collection, slug, ownStatus)}>
|
||||
Delete
|
||||
</Button>
|
||||
{
|
||||
(ownStatus === status.last() && !entry.get('isPersisting', false)) &&
|
||||
<Button
|
||||
|
Reference in New Issue
Block a user