From d2b8d2077af1733d27c923472ff76105a9d97606 Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Sun, 15 Mar 2026 18:21:39 +0000 Subject: [PATCH] fix --- apps/client/src/ee/features.ts | 2 ++ .../components/disable-public-sharing.tsx | 6 ++-- .../ee/security/components/enforce-sso.tsx | 2 +- .../space-public-sharing-toggle.tsx | 12 +++++-- .../security/components/trash-retention.tsx | 10 +++--- .../client/src/ee/security/pages/security.tsx | 32 +++++++------------ .../space/components/space-details.tsx | 5 +-- apps/server/src/ee | 2 +- 8 files changed, 33 insertions(+), 38 deletions(-) diff --git a/apps/client/src/ee/features.ts b/apps/client/src/ee/features.ts index 6ef349d3..70438cba 100644 --- a/apps/client/src/ee/features.ts +++ b/apps/client/src/ee/features.ts @@ -14,4 +14,6 @@ export const Feature = { SCIM: 'scim', PAGE_VERIFICATION: 'page:verification', AUDIT_LOGS: 'audit:logs', + RETENTION: 'retention', + SHARING_CONTROLS: 'sharing:controls', } as const; diff --git a/apps/client/src/ee/security/components/disable-public-sharing.tsx b/apps/client/src/ee/security/components/disable-public-sharing.tsx index c968470c..6816694d 100644 --- a/apps/client/src/ee/security/components/disable-public-sharing.tsx +++ b/apps/client/src/ee/security/components/disable-public-sharing.tsx @@ -33,7 +33,7 @@ function DisablePublicSharingToggle() { const [checked, setChecked] = useState( workspace?.settings?.sharing?.disabled === true, ); - const hasAccess = useHasFeature(Feature.SECURITY_SETTINGS); + const hasSharingControls = useHasFeature(Feature.SHARING_CONTROLS); const upgradeLabel = useUpgradeLabel(); const applyChange = async (value: boolean) => { @@ -75,11 +75,11 @@ function DisablePublicSharingToggle() { }; return ( - + diff --git a/apps/client/src/ee/security/components/enforce-sso.tsx b/apps/client/src/ee/security/components/enforce-sso.tsx index 004706a4..91cfab39 100644 --- a/apps/client/src/ee/security/components/enforce-sso.tsx +++ b/apps/client/src/ee/security/components/enforce-sso.tsx @@ -36,7 +36,7 @@ export function EnforceSsoToggle({ size, label }: EnforceSsoToggleProps) { const { t } = useTranslation(); const [workspace, setWorkspace] = useAtom(workspaceAtom); const [checked, setChecked] = useState(workspace?.enforceSso); - const hasAccess = useHasFeature(Feature.SECURITY_SETTINGS); + const hasAccess = useHasFeature(Feature.SSO_CUSTOM); const upgradeLabel = useUpgradeLabel(); const handleChange = async (event: React.ChangeEvent) => { diff --git a/apps/client/src/ee/security/components/space-public-sharing-toggle.tsx b/apps/client/src/ee/security/components/space-public-sharing-toggle.tsx index f03d18f2..2b8b008f 100644 --- a/apps/client/src/ee/security/components/space-public-sharing-toggle.tsx +++ b/apps/client/src/ee/security/components/space-public-sharing-toggle.tsx @@ -6,6 +6,9 @@ import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { ISpace } from "@/features/space/types/space.types.ts"; import { useUpdateSpaceMutation } from "@/features/space/queries/space-query.ts"; +import { useHasFeature } from "@/ee/hooks/use-feature.ts"; +import { Feature } from "@/ee/features.ts"; +import { useUpgradeLabel } from "@/ee/hooks/use-upgrade-label.ts"; type SpacePublicSharingToggleProps = { space: ISpace; @@ -17,6 +20,9 @@ export default function SpacePublicSharingToggle({ const { t } = useTranslation(); const [workspace] = useAtom(workspaceAtom); const workspaceDisabled = workspace?.settings?.sharing?.disabled === true; + const hasSharingControls = useHasFeature(Feature.SHARING_CONTROLS); + const upgradeLabel = useUpgradeLabel(); + const isDisabled = !hasSharingControls || workspaceDisabled; const [checked, setChecked] = useState( space.settings?.sharing?.disabled === true, ); @@ -68,14 +74,14 @@ export default function SpacePublicSharingToggle({ diff --git a/apps/client/src/ee/security/components/trash-retention.tsx b/apps/client/src/ee/security/components/trash-retention.tsx index 51833d6e..27397029 100644 --- a/apps/client/src/ee/security/components/trash-retention.tsx +++ b/apps/client/src/ee/security/components/trash-retention.tsx @@ -41,7 +41,7 @@ function retentionToDays(amount: number, unit: RetentionUnit): number { export default function TrashRetention() { const { t } = useTranslation(); - const hasAccess = useHasFeature(Feature.SECURITY_SETTINGS); + const hasRetention = useHasFeature(Feature.RETENTION); const upgradeLabel = useUpgradeLabel(); const [workspace, setWorkspace] = useAtom(workspaceAtom); @@ -107,7 +107,7 @@ export default function TrashRetention() { {t("Pages in trash will be permanently deleted after this period.")} - +