From d38cc5db682397fc54e8ac07ab65983a670232fb Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Tue, 2 Jan 2024 08:47:56 -0500 Subject: [PATCH] fix: Popover states collection members have access to drafts --- app/components/Sharing/DocumentMemberList.tsx | 4 ++-- app/components/Sharing/SharePopover.tsx | 8 +------- shared/i18n/locales/en_US/translation.json | 5 +++-- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/app/components/Sharing/DocumentMemberList.tsx b/app/components/Sharing/DocumentMemberList.tsx index 9352900a2a..9c3428cc6a 100644 --- a/app/components/Sharing/DocumentMemberList.tsx +++ b/app/components/Sharing/DocumentMemberList.tsx @@ -131,7 +131,7 @@ function DocumentMembersList({ document, children }: Props) { permission, }); toast.success( - t(`{{ userName }} permissions were updated`, { + t(`Permissions for {{ userName }} updated`, { userName: user.name, }) ); @@ -176,7 +176,7 @@ function DocumentMembersList({ document, children }: Props) { value={query} onChangeInput={handleQuery} onSelectOption={handleSelect} - listLabel={t("Team members")} + listLabel={t("Workspace members")} placeholder={`${t("Find by name")}…`} autoFocus /> diff --git a/app/components/Sharing/SharePopover.tsx b/app/components/Sharing/SharePopover.tsx index 45d5b996b7..a1200adc32 100644 --- a/app/components/Sharing/SharePopover.tsx +++ b/app/components/Sharing/SharePopover.tsx @@ -39,15 +39,9 @@ function SharePopover({ }: Props) { const team = useCurrentTeam(); const { t } = useTranslation(); - const [expandedOptions, setExpandedOptions] = React.useState(false); const buttonRef = React.useRef(null); const collection = document.collection; - React.useEffect(() => { - if (!visible && expandedOptions) { - setExpandedOptions(false); - } - }, [visible]); // eslint-disable-line react-hooks/exhaustive-deps useKeyDown("Escape", onRequestClose); React.useEffect(() => { @@ -75,7 +69,7 @@ function SharePopover({ border={false} small /> - ) : collection ? ( + ) : collection && !document.isDraft ? ( } title={t("Collection members")} diff --git a/shared/i18n/locales/en_US/translation.json b/shared/i18n/locales/en_US/translation.json index b1cbc18baa..6e92e1faa3 100644 --- a/shared/i18n/locales/en_US/translation.json +++ b/shared/i18n/locales/en_US/translation.json @@ -243,9 +243,9 @@ "No results for {{query}}": "No results for {{query}}", "{{ userName }} was removed from the document": "{{ userName }} was removed from the document", "Could not remove user": "Could not remove user", - "{{ userName }} permissions were updated": "{{ userName }} permissions were updated", + "Permissions for {{ userName }} updated": "Permissions for {{ userName }} updated", "Could not update user": "Could not update user", - "Team members": "Team members", + "Workspace members": "Workspace members", "Find by name": "Find by name", "Share link copied": "Share link copied", "Only lowercase letters, digits and dashes allowed": "Only lowercase letters, digits and dashes allowed", @@ -500,6 +500,7 @@ "Never signed in": "Never signed in", "Invited": "Invited", "{{ userName }} was removed from the collection": "{{ userName }} was removed from the collection", + "{{ userName }} permissions were updated": "{{ userName }} permissions were updated", "The {{ groupName }} group was removed from the collection": "The {{ groupName }} group was removed from the collection", "Could not remove group": "Could not remove group", "{{ groupName }} permissions were updated": "{{ groupName }} permissions were updated",