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
This commit is contained in:
Tom Moor 2020-02-26 21:08:36 -08:00
parent afba1edae4
commit 148affb52e
3 changed files with 5 additions and 3 deletions

View File

@ -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;

View File

@ -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 <DataLoader key={urlId} {...this.props} />;
return <DataLoader key={[urlId, revisionId].join('/')} {...this.props} />;
}
}

View File

@ -190,7 +190,8 @@ class Header extends React.Component<Props> {
</React.Fragment>
)}
{can.update &&
isDraft && (
isDraft &&
!isRevision && (
<Action>
<Tooltip
tooltip="Publish"