From 168ad390761d2272d4be30cfa8b5141d91c5eea7 Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 16 Nov 2023 08:16:06 +0800 Subject: [PATCH] chore: add workspace visibility to collection --- .../web/src/components/CreateCollectionDrawer.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/frontend/web/src/components/CreateCollectionDrawer.tsx b/frontend/web/src/components/CreateCollectionDrawer.tsx index 15fefbb..2cd71f9 100644 --- a/frontend/web/src/components/CreateCollectionDrawer.tsx +++ b/frontend/web/src/components/CreateCollectionDrawer.tsx @@ -36,7 +36,15 @@ const CreateCollectionDrawer: React.FC = (props: Props) => { const requestState = useLoading(false); const isCreating = isUndefined(collectionId); const unselectedShortcuts = shortcutList - .filter((shortcut) => (state.collectionCreate.visibility === Visibility.PUBLIC ? shortcut.visibility === "PUBLIC" : true)) + .filter((shortcut) => { + if (state.collectionCreate.visibility === Visibility.PUBLIC) { + return shortcut.visibility === "PUBLIC"; + } else if (state.collectionCreate.visibility === Visibility.WORKSPACE) { + return shortcut.visibility === "PUBLIC" || shortcut.visibility === "WORKSPACE"; + } else { + return true; + } + }) .filter((shortcut) => !selectedShortcuts.find((selectedShortcut) => selectedShortcut.id === shortcut.id)); useEffect(() => { @@ -191,6 +199,7 @@ const CreateCollectionDrawer: React.FC = (props: Props) => {
+