fix: Various editor header and metadata fixes (#2361)

* fix: Publish button disabled on drafts in read-only mode
fix: Template selector appears on edited documents

* fix: Save button does not immediately come available when selecting a template

* fix: Template menu item alignment
closes #2204

* fixes: Use policy for display of star in document title
closes #2354

* fix: Modified time is sometimes bold when last edited user is current user
closes #2355

* fix: Allow starring of drafts
This commit is contained in:
Tom Moor
2021-07-22 18:17:18 -04:00
committed by GitHub
parent d35b5d2613
commit 84ad7c482c
6 changed files with 33 additions and 16 deletions

View File

@@ -76,6 +76,10 @@ class DocumentScene extends React.Component<Props> {
@observable title: string = this.props.document.title;
getEditorText: () => string = () => this.props.document.text;
componentDidMount() {
this.updateIsDirty();
}
componentDidUpdate(prevProps) {
const { auth, document, t } = this.props;
@@ -113,6 +117,7 @@ class DocumentScene extends React.Component<Props> {
document.injectTemplate = false;
this.title = document.title;
this.isDirty = true;
this.updateIsDirty();
}
}
@@ -529,6 +534,6 @@ const MaxWidth = styled(Flex)`
export default withRouter(
withTranslation()<DocumentScene>(
inject("ui", "auth", "policies", "revisions", "toasts")(DocumentScene)
inject("ui", "auth", "toasts")(DocumentScene)
)
);