From 148affb52e7ca4fc531c6526f4ecf99842abf162 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 26 Feb 2020 21:08:36 -0800 Subject: [PATCH] fix: Editing with document history open attempts to edit old revision fix: Document history sidebar missing background fix: 'Publish' action should not appear when viewing history of drafts closes #1184 --- app/components/DocumentHistory/DocumentHistory.js | 1 + app/scenes/Document/KeyedDocument.js | 4 ++-- app/scenes/Document/components/Header.js | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/components/DocumentHistory/DocumentHistory.js b/app/components/DocumentHistory/DocumentHistory.js index 693bacb75..2de8c4e1c 100644 --- a/app/components/DocumentHistory/DocumentHistory.js +++ b/app/components/DocumentHistory/DocumentHistory.js @@ -133,6 +133,7 @@ const Loading = styled.div` `; const Wrapper = styled(Flex)` + background: ${props => props.theme.background}; min-width: ${props => props.theme.sidebarWidth}; border-left: 1px solid ${props => props.theme.divider}; overflow: scroll; diff --git a/app/scenes/Document/KeyedDocument.js b/app/scenes/Document/KeyedDocument.js index ba488c32e..edb2d9f81 100644 --- a/app/scenes/Document/KeyedDocument.js +++ b/app/scenes/Document/KeyedDocument.js @@ -9,7 +9,7 @@ class KeyedDocument extends React.Component<*> { } render() { - const { documentSlug } = this.props.match.params; + const { documentSlug, revisionId } = this.props.match.params; // the urlId portion of the url does not include the slugified title // we only want to force a re-mount of the document component when the @@ -18,7 +18,7 @@ class KeyedDocument extends React.Component<*> { const urlParts = documentSlug ? documentSlug.split('-') : []; const urlId = urlParts.length ? urlParts[urlParts.length - 1] : undefined; - return ; + return ; } } diff --git a/app/scenes/Document/components/Header.js b/app/scenes/Document/components/Header.js index 032c8a59a..e4a85d4f6 100644 --- a/app/scenes/Document/components/Header.js +++ b/app/scenes/Document/components/Header.js @@ -190,7 +190,8 @@ class Header extends React.Component { )} {can.update && - isDraft && ( + isDraft && + !isRevision && (