Skip to content

Commit

Permalink
[desk-tool] Bring back ability to delete a draft (#1393)
Browse files Browse the repository at this point in the history
This fixes a regression introduced in the previous release that accidentally removed the ability to to delete a draft
  • Loading branch information
bjoerge committed Jun 25, 2019
1 parent 6d3e7f4 commit c149970
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 77 deletions.
62 changes: 0 additions & 62 deletions packages/@sanity/desk-tool/src/components/ConfirmDiscard.js

This file was deleted.

16 changes: 2 additions & 14 deletions packages/@sanity/desk-tool/src/pane/Editor/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import Hotkeys from 'part:@sanity/components/typography/hotkeys'
import copyDocument from '../../utils/copyDocument'
import ConfirmUnpublish from '../../components/ConfirmUnpublish'
import ConfirmDelete from '../../components/ConfirmDelete'
import ConfirmDiscard from '../../components/ConfirmDiscard'
import InspectView from '../../components/InspectView'
import DocTitle from '../../components/DocTitle'
import History from '../History'
Expand Down Expand Up @@ -414,10 +413,8 @@ export default withRouterHOC(
}

handleConfirmDelete = () => {
const {onDelete, published} = this.props
if (published) {
onDelete()
}
const {onDelete} = this.props
onDelete()
this.setState({showConfirmDelete: false})
}

Expand Down Expand Up @@ -702,7 +699,6 @@ export default withRouterHOC(
inspect,
showConfirmDelete,
showConfirmUnpublish,
showConfirmDiscard,
didPublish,
historyState
} = this.state
Expand Down Expand Up @@ -788,14 +784,6 @@ export default withRouterHOC(
onConfirm={this.handleConfirmUnpublish}
/>
)}
{showConfirmDiscard && (
<ConfirmDiscard
draft={draft}
published={published}
onCancel={this.handleCancelDiscard}
onConfirm={this.handleConfirmDiscard}
/>
)}
{isReconnecting && (
<Snackbar kind="warning">
<WarningIcon /> Connection lost. Reconnecting…
Expand Down
1 change: 0 additions & 1 deletion packages/@sanity/desk-tool/src/pane/HistoryItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export default class HistoryItem extends React.PureComponent {
rev: PropTypes.string.isRequired,
type: PropTypes.oneOf([
'created',
'discardDraft',
'edited',
'published',
'unpublished',
Expand Down

0 comments on commit c149970

Please sign in to comment.