Update collection permissions UI (#6917)

This commit is contained in:
Tom Moor
2024-05-16 19:45:09 -04:00
committed by GitHub
parent 728c68be58
commit cae013837b
34 changed files with 1088 additions and 287 deletions

View File

@@ -18,6 +18,7 @@ import Switch from "~/components/Switch";
import Text from "~/components/Text";
import useBoolean from "~/hooks/useBoolean";
import useCurrentTeam from "~/hooks/useCurrentTeam";
import { Feature, FeatureFlags } from "~/utils/FeatureFlags";
export interface FormData {
name: string;
@@ -138,16 +139,18 @@ export const CollectionForm = observer(function CollectionForm_({
/>
)}
{team.sharing && !collection && (
<Switch
id="sharing"
label={t("Public document sharing")}
note={t(
"Allow documents within this collection to be shared publicly on the internet."
)}
{...register("sharing")}
/>
)}
{team.sharing &&
(!collection ||
FeatureFlags.isEnabled(Feature.newCollectionSharing)) && (
<Switch
id="sharing"
label={t("Public document sharing")}
note={t(
"Allow documents within this collection to be shared publicly on the internet."
)}
{...register("sharing")}
/>
)}
<Flex justify="flex-end">
<Button