diff --git a/frontend/web/src/components/setting/WorkspaceSection.tsx b/frontend/web/src/components/setting/WorkspaceSection.tsx index 78aff97..3d32969 100644 --- a/frontend/web/src/components/setting/WorkspaceSection.tsx +++ b/frontend/web/src/components/setting/WorkspaceSection.tsx @@ -1,4 +1,4 @@ -import { Button, Input, Select, Textarea, Option, Switch, Link } from "@mui/joy"; +import { Button, Input, Link, Option, Select, Switch, Textarea } from "@mui/joy"; import { isEqual } from "lodash-es"; import { useRef, useState } from "react"; import toast from "react-hot-toast"; @@ -8,6 +8,13 @@ import { useWorkspaceStore } from "@/stores"; import { Visibility } from "@/types/proto/api/v1/common"; import { WorkspaceSetting } from "@/types/proto/api/v1/workspace_service"; +const getDefaultVisibility = (visibility?: Visibility) => { + if (!visibility || [Visibility.VISIBILITY_UNSPECIFIED, Visibility.UNRECOGNIZED].includes(visibility)) { + return Visibility.PRIVATE; + } + return visibility; +}; + const WorkspaceSection = () => { const { t } = useTranslation(); const workspaceStore = useWorkspaceStore(); @@ -101,8 +108,36 @@ const WorkspaceSection = () => { onChange={(event) => handleInstanceUrlChange(event.target.value)} /> +
+
+

{t("settings.workspace.enable-user-signup.self")}

+

{t("settings.workspace.enable-user-signup.description")}

+
+
+ handleEnableSignUpChange(event.target.checked)} + /> +
+
+
+
+

{t("settings.workspace.default-visibility")}

+

The default visibility of new shortcuts/collections.

+
+ +
-

Favicon Provider

+

Favicon provider

e.g.{" "} @@ -127,34 +162,8 @@ const WorkspaceSection = () => { onChange={(event) => handleCustomStyleChange(event.target.value)} />

-
-
-

{t("settings.workspace.enable-user-signup.self")}

-

{t("settings.workspace.enable-user-signup.description")}

-
-
- handleEnableSignUpChange(event.target.checked)} - /> -
-
-
-
- {t("settings.workspace.default-visibility")} -
- -
-
diff --git a/frontend/web/src/pages/WorkspaceSetting.tsx b/frontend/web/src/pages/WorkspaceSetting.tsx index b463c78..644d710 100644 --- a/frontend/web/src/pages/WorkspaceSetting.tsx +++ b/frontend/web/src/pages/WorkspaceSetting.tsx @@ -8,7 +8,7 @@ import { useUserStore, useWorkspaceStore } from "@/stores"; import { stringifyPlanType } from "@/stores/subscription"; import { Role } from "@/types/proto/api/v1/user_service"; -const WorkspaceSetting: React.FC = () => { +const WorkspaceSetting = () => { const workspaceStore = useWorkspaceStore(); const currentUser = useUserStore().getCurrentUser(); const isAdmin = currentUser.role === Role.ADMIN;