diff --git a/apps/client/src/components/layouts/global/global-sidebar.tsx b/apps/client/src/components/layouts/global/global-sidebar.tsx index bc9ccace..4d86a264 100644 --- a/apps/client/src/components/layouts/global/global-sidebar.tsx +++ b/apps/client/src/components/layouts/global/global-sidebar.tsx @@ -1,5 +1,5 @@ import { useEffect, useState } from "react"; -import { ScrollArea, Text, Divider, Modal, Tooltip } from "@mantine/core"; +import { ScrollArea, Text, Divider, Modal } from "@mantine/core"; import { IconHome, IconClock, @@ -7,13 +7,10 @@ import { IconLayoutGrid, IconSettings, IconUserPlus, - IconSearch, - IconTemplate, } from "@tabler/icons-react"; import { Link, useLocation } from "react-router-dom"; import classes from "./global-sidebar.module.css"; import { useTranslation } from "react-i18next"; -import { searchSpotlight } from "@/features/search/constants"; import { useAtom } from "jotai"; import { mobileSidebarAtom } from "@/components/layouts/global/hooks/atoms/sidebar-atom"; import { useToggleSidebar } from "@/components/layouts/global/hooks/hooks/use-toggle-sidebar"; @@ -23,15 +20,11 @@ import { useDisclosure } from "@mantine/hooks"; import { WorkspaceInviteForm } from "@/features/workspace/components/members/components/workspace-invite-form"; import { CustomAvatar } from "@/components/ui/custom-avatar"; import { AvatarIconType } from "@/features/attachments/types/attachment.types"; -import { entitlementAtom } from "@/ee/entitlement/entitlement-atom"; -import { Feature } from "@/ee/features"; -import { useUpgradeLabel } from "@/ee/hooks/use-upgrade-label"; const mainNavItems = [ { label: "Home", icon: IconHome, path: "/home" }, { label: "Favorites", icon: IconStar, path: "/favorites" }, { label: "Spaces", icon: IconLayoutGrid, path: "/spaces" }, - { label: "Templates", icon: IconTemplate, path: "/templates", feature: Feature.TEMPLATES }, ]; export default function GlobalSidebar() { @@ -40,10 +33,6 @@ export default function GlobalSidebar() { const [active, setActive] = useState(location.pathname); const [mobileSidebarOpened] = useAtom(mobileSidebarAtom); const toggleMobileSidebar = useToggleSidebar(mobileSidebarAtom); - const [entitlements] = useAtom(entitlementAtom); - const upgradeLabel = useUpgradeLabel(); - const hasFeature = (f: string) => - entitlements?.features?.includes(f) ?? false; const { data: favoriteSpacesData } = useFavoritesQuery("space"); const favoriteSpaces = favoriteSpacesData?.pages.flatMap((p) => p.items) ?? []; const sortedFavoriteSpaces = [...favoriteSpaces] @@ -69,51 +58,18 @@ export default function GlobalSidebar() {
- { - e.preventDefault(); - searchSpotlight.open(); - }} - href="#" - > - - {t("Search")} - - {mainNavItems.map((item) => { - const isDisabled = item.feature && !hasFeature(item.feature); - - const linkElement = ( - { - if (isDisabled) { - e.preventDefault(); - return; - } - handleNavClick(); - }} - style={isDisabled ? { opacity: 0.5, cursor: "not-allowed" } : undefined} - > - - {t(item.label)} - - ); - - if (isDisabled) { - return ( - - {linkElement} - - ); - } - - return linkElement; - })} + {mainNavItems.map((item) => ( + + + {t(item.label)} + + ))}
diff --git a/apps/client/src/ee/security/pages/security.tsx b/apps/client/src/ee/security/pages/security.tsx index e4e35f78..254809c7 100644 --- a/apps/client/src/ee/security/pages/security.tsx +++ b/apps/client/src/ee/security/pages/security.tsx @@ -12,7 +12,7 @@ import { useTranslation } from "react-i18next"; import EnforceMfa from "@/ee/security/components/enforce-mfa.tsx"; import DisablePublicSharing from "@/ee/security/components/disable-public-sharing.tsx"; import TrashRetention from "@/ee/security/components/trash-retention.tsx"; -import AllowMemberTemplates from "@/ee/security/components/allow-member-templates.tsx"; + import { useHasFeature } from "@/ee/hooks/use-feature"; import { Feature } from "@/ee/features"; @@ -44,9 +44,6 @@ export default function Security() { - - - Single sign-on (SSO) diff --git a/apps/client/src/features/space/components/sidebar/space-sidebar.tsx b/apps/client/src/features/space/components/sidebar/space-sidebar.tsx index 18c07359..7bb1c88e 100644 --- a/apps/client/src/features/space/components/sidebar/space-sidebar.tsx +++ b/apps/client/src/features/space/components/sidebar/space-sidebar.tsx @@ -16,7 +16,6 @@ import { IconPlus, IconSearch, IconSettings, - IconTemplate, IconTrash, } from "@tabler/icons-react"; import { @@ -47,9 +46,6 @@ import ExportModal from "@/components/common/export-modal"; import { mobileSidebarAtom } from "@/components/layouts/global/hooks/atoms/sidebar-atom.ts"; import { useToggleSidebar } from "@/components/layouts/global/hooks/hooks/use-toggle-sidebar.ts"; import { searchSpotlight } from "@/features/search/constants"; -import { entitlementAtom } from "@/ee/entitlement/entitlement-atom"; -import { Feature } from "@/ee/features"; -import { useUpgradeLabel } from "@/ee/hooks/use-upgrade-label"; export function SpaceSidebar() { const { t } = useTranslation(); @@ -59,9 +55,7 @@ export function SpaceSidebar() { useDisclosure(false); const [mobileSidebarOpened] = useAtom(mobileSidebarAtom); const toggleMobileSidebar = useToggleSidebar(mobileSidebarAtom); - const [entitlements] = useAtom(entitlementAtom); - const upgradeLabel = useUpgradeLabel(); - const hasTemplates = entitlements?.features?.includes(Feature.TEMPLATES) ?? false; + const { spaceSlug } = useParams(); const { data: space } = useGetSpaceBySlugQuery(spaceSlug); @@ -144,44 +138,6 @@ export function SpaceSidebar() {
- {hasTemplates ? ( - -
- - {t("Templates")} -
-
- ) : ( - - -
- - {t("Templates")} -
-
-
- )} - {spaceAbility.can( SpaceCaslAction.Manage, SpaceCaslSubject.Page,