From 66197a967a3222e8d699bc70bf8f506e49fc9429 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Tue, 15 Oct 2019 21:42:07 -0700 Subject: [PATCH] fix: Document history menu item should toggle history sidebar --- app/menus/DocumentMenu.js | 8 +++++++- app/scenes/Document/Document.js | 1 + app/scenes/Document/components/Header.js | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/menus/DocumentMenu.js b/app/menus/DocumentMenu.js index f37eed36b..abd08545e 100644 --- a/app/menus/DocumentMenu.js +++ b/app/menus/DocumentMenu.js @@ -10,6 +10,7 @@ import AuthStore from 'stores/AuthStore'; import CollectionStore from 'stores/CollectionsStore'; import PoliciesStore from 'stores/PoliciesStore'; import { + documentUrl, documentMoveUrl, documentEditUrl, documentHistoryUrl, @@ -25,6 +26,7 @@ type Props = { collections: CollectionStore, policies: PoliciesStore, className: string, + isRevision?: boolean, showPrint?: boolean, showToggleEmbeds?: boolean, showPin?: boolean, @@ -51,7 +53,11 @@ class DocumentMenu extends React.Component { }; handleDocumentHistory = () => { - this.redirectTo = documentHistoryUrl(this.props.document); + if (this.props.isRevision) { + this.redirectTo = documentUrl(this.props.document); + } else { + this.redirectTo = documentHistoryUrl(this.props.document); + } }; handleMove = (ev: SyntheticEvent<>) => { diff --git a/app/scenes/Document/Document.js b/app/scenes/Document/Document.js index 27cfa1549..04e02e570 100644 --- a/app/scenes/Document/Document.js +++ b/app/scenes/Document/Document.js @@ -378,6 +378,7 @@ class DocumentScene extends React.Component { {!isShare && (
{ isEditing, isDraft, isPublishing, + isRevision, isSaving, savingIsDisabled, publishingIsDisabled, @@ -243,6 +245,7 @@ class Header extends React.Component {