Merge branch 'main' of github.com:outline/outline

This commit is contained in:
Tom Moor
2022-03-03 21:51:40 -08:00
3 changed files with 10 additions and 5 deletions

View File

@@ -10,11 +10,11 @@ UTILS_SECRET=generate_a_new_key
# For production point these at your databases, in development the default
# should work out of the box.
DATABASE_URL=postgres://user:pass@localhost:5532/outline
DATABASE_URL_TEST=postgres://user:pass@localhost:5532/outline-test
DATABASE_URL=postgres://user:pass@localhost:5432/outline
DATABASE_URL_TEST=postgres://user:pass@localhost:5432/outline-test
# Uncomment this to disable SSL for connecting to Postgres
# PGSSLMODE=disable
REDIS_URL=redis://localhost:6479
REDIS_URL=redis://localhost:6379
# URL should point to the fully qualified, publicly accessible URL. If using a
# proxy the port in URL and PORT may be different.

View File

@@ -416,8 +416,10 @@ class DocumentScene extends React.Component<Props> {
this.editor.current.getHeadings()
: [];
const hasHeadings = headings.length > 0;
const showContents =
ui.tocVisible && (readOnly || team?.collaborativeEditing);
ui.tocVisible &&
((readOnly && hasHeadings) || team?.collaborativeEditing);
const collaborativeEditing =
team?.collaborativeEditing &&
!document.isArchived &&
@@ -509,6 +511,7 @@ class DocumentScene extends React.Component<Props> {
)}
<Header
document={document}
documentHasHeadings={hasHeadings}
shareId={shareId}
isRevision={!!revision}
isDraft={document.isDraft}

View File

@@ -36,6 +36,7 @@ import ShareButton from "./ShareButton";
type Props = {
document: Document;
documentHasHeadings: boolean;
sharedTree: NavigationNode | undefined;
shareId: string | null | undefined;
isDraft: boolean;
@@ -60,6 +61,7 @@ type Props = {
function DocumentHeader({
document,
documentHasHeadings,
shareId,
isEditing,
isDraft,
@@ -175,7 +177,7 @@ function DocumentHeader({
shareId={shareId}
sharedTree={sharedTree}
>
{toc}
{documentHasHeadings ? toc : null}
</PublicBreadcrumb>
)
}