fix: Document history menu item should toggle history sidebar
This commit is contained in:
parent
5263d8a315
commit
66197a967a
|
@ -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<Props> {
|
|||
};
|
||||
|
||||
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<>) => {
|
||||
|
|
|
@ -378,6 +378,7 @@ class DocumentScene extends React.Component<Props> {
|
|||
{!isShare && (
|
||||
<Header
|
||||
document={document}
|
||||
isRevision={!!revision}
|
||||
isDraft={document.isDraft}
|
||||
isEditing={this.isEditing}
|
||||
isSaving={this.isSaving}
|
||||
|
|
|
@ -32,6 +32,7 @@ type Props = {
|
|||
document: Document,
|
||||
isDraft: boolean,
|
||||
isEditing: boolean,
|
||||
isRevision: boolean,
|
||||
isSaving: boolean,
|
||||
isPublishing: boolean,
|
||||
publishingIsDisabled: boolean,
|
||||
|
@ -103,6 +104,7 @@ class Header extends React.Component<Props> {
|
|||
isEditing,
|
||||
isDraft,
|
||||
isPublishing,
|
||||
isRevision,
|
||||
isSaving,
|
||||
savingIsDisabled,
|
||||
publishingIsDisabled,
|
||||
|
@ -243,6 +245,7 @@ class Header extends React.Component<Props> {
|
|||
<Action>
|
||||
<DocumentMenu
|
||||
document={document}
|
||||
isRevision={isRevision}
|
||||
showToggleEmbeds={canToggleEmbeds}
|
||||
showPrint
|
||||
/>
|
||||
|
|
Reference in New Issue