Clarify nested document public access note

This commit is contained in:
Tom Moor
2024-01-31 20:49:58 -05:00
parent 7417514e7c
commit 0f125886b7
3 changed files with 26 additions and 22 deletions

View File

@@ -2,7 +2,7 @@ import invariant from "invariant";
import debounce from "lodash/debounce";
import isEmpty from "lodash/isEmpty";
import { observer } from "mobx-react";
import { CopyIcon, GlobeIcon } from "outline-icons";
import { CopyIcon, GlobeIcon, InfoIcon } from "outline-icons";
import * as React from "react";
import { Trans, useTranslation } from "react-i18next";
import { Link } from "react-router-dom";
@@ -22,6 +22,7 @@ import CopyToClipboard from "../CopyToClipboard";
import NudeButton from "../NudeButton";
import { ResizingHeightContainer } from "../ResizingHeightContainer";
import Squircle from "../Squircle";
import Text from "../Text";
import Tooltip from "../Tooltip";
import { StyledListItem } from "./MemberListItem";
@@ -132,14 +133,7 @@ function PublicAccess({ document, share, sharedParent }: Props) {
, is shared
</Trans>
) : (
<>
{t("Allow anyone with the link to access")}
{share?.published && !share.includeChildDocuments
? `. ${t(
"Child documents are not shared, toggling sharing to enable"
)}.`
: ""}
</>
t("Allow anyone with the link to access")
)}
</>
}
@@ -186,11 +180,28 @@ function PublicAccess({ document, share, sharedParent }: Props) {
{copyButton}
</ShareLinkInput>
) : null}
{share?.published && !share.includeChildDocuments ? (
<Text as="p" type="tertiary" size="xsmall">
<StyledInfoIcon size={18} />
<span>
{t(
"Nested documents are not shared on the web. Toggle sharing to enable access, this will be the default behavior in the future"
)}
.
</span>
</Text>
) : null}
</ResizingHeightContainer>
</Wrapper>
);
}
const StyledInfoIcon = styled(InfoIcon)`
vertical-align: bottom;
margin-right: 2px;
`;
const Wrapper = styled.div`
margin-bottom: 8px;
`;
@@ -211,6 +222,7 @@ const ShareLinkInput = styled(Input)`
${NativeInput} {
padding: 4px 8px;
flex: 1;
}
`;

View File

@@ -323,7 +323,9 @@ const Picker = observer(
const suggestions = React.useMemo(
() =>
users.notInDocument(document.id, query).filter((u) => u.id !== user.id),
users
.notInDocument(document.id, query)
.filter((u) => u.id !== user.id && !user.isSuspended),
[users, users.orderedData, document.id, document.members, user.id, query]
);
@@ -340,17 +342,7 @@ const Picker = observer(
key={suggestion.id}
onClick={() => onInvite(suggestion)}
title={suggestion.name}
subtitle={
suggestion.isSuspended
? t("Suspended")
: suggestion.isInvited
? t("Invited")
: suggestion.isViewer
? t("Viewer")
: suggestion.email
? suggestion.email
: t("Member")
}
subtitle={suggestion.isViewer ? t("Viewer") : t("Editor")}
image={
<Avatar
model={suggestion}

View File

@@ -257,8 +257,8 @@
"Web": "Web",
"Anyone with the link can access because the parent document, <2>{{documentTitle}}</2>, is shared": "Anyone with the link can access because the parent document, <2>{{documentTitle}}</2>, is shared",
"Allow anyone with the link to access": "Allow anyone with the link to access",
"Child documents are not shared, toggling sharing to enable": "Child documents are not shared, toggling sharing to enable",
"Publish to internet": "Publish to internet",
"Nested documents are not shared on the web. Toggle sharing to enable access, this will be the default behavior in the future": "Nested documents are not shared on the web. Toggle sharing to enable access, this will be the default behavior in the future",
"{{ userName }} was invited to the document": "{{ userName }} was invited to the document",
"Done": "Done",
"Invite by name": "Invite by name",