* fix: remove unused imports and variables (part 1) Resolve oxlint no-unused-vars warnings in packages/*, apps/admin, apps/space, apps/live, and apps/web (non-core). * fix: resolve CI check failures * fix: resolve check:types failures * fix: resolve check:types and check:format failures - Use destructuring alias for activeCycleResolvedPath - Format propel tab-navigation file * fix: format propel button helper with oxfmt Reorder Tailwind classes to match oxfmt canonical ordering.
47 lines
1.7 KiB
TypeScript
47 lines
1.7 KiB
TypeScript
/**
|
|
* Copyright (c) 2023-present Plane Software, Inc. and contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
* See the LICENSE file for details.
|
|
*/
|
|
|
|
import { isEmpty } from "lodash-es";
|
|
import { observer } from "mobx-react";
|
|
// plane helpers
|
|
import { EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
|
|
// components
|
|
import { SidebarWrapper } from "@/components/sidebar/sidebar-wrapper";
|
|
import { SidebarFavoritesMenu } from "@/components/workspace/sidebar/favorites/favorites-menu";
|
|
import { SidebarProjectsList } from "@/components/workspace/sidebar/projects-list";
|
|
import { SidebarQuickActions } from "@/components/workspace/sidebar/quick-actions";
|
|
import { SidebarMenuItems } from "@/components/workspace/sidebar/sidebar-menu-items";
|
|
// hooks
|
|
import { useFavorite } from "@/hooks/store/use-favorite";
|
|
import { useUserPermissions } from "@/hooks/store/user";
|
|
// plane web components
|
|
import { SidebarTeamsList } from "@/plane-web/components/workspace/sidebar/teams-sidebar-list";
|
|
|
|
export const AppSidebar = observer(function AppSidebar() {
|
|
// store hooks
|
|
const { allowPermissions } = useUserPermissions();
|
|
const { groupedFavorites } = useFavorite();
|
|
|
|
// derived values
|
|
const canPerformWorkspaceMemberActions = allowPermissions(
|
|
[EUserPermissions.ADMIN, EUserPermissions.MEMBER],
|
|
EUserPermissionsLevel.WORKSPACE
|
|
);
|
|
|
|
const isFavoriteEmpty = isEmpty(groupedFavorites);
|
|
|
|
return (
|
|
<SidebarWrapper title="Projects" quickActions={<SidebarQuickActions />}>
|
|
<SidebarMenuItems />
|
|
{/* Favorites Menu */}
|
|
{canPerformWorkspaceMemberActions && !isFavoriteEmpty && <SidebarFavoritesMenu />}
|
|
{/* Teams List */}
|
|
<SidebarTeamsList />
|
|
{/* Projects List */}
|
|
<SidebarProjectsList />
|
|
</SidebarWrapper>
|
|
);
|
|
});
|