Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NV 2602 - Hide Tenant functionality under the feature flag #3860

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions apps/web/src/components/layout/components/SideNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
Buildings,
} from '../../../design-system/icons';
import { ChangesCountBadge } from './ChangesCountBadge';
import { useEnvController } from '../../../hooks';
import { useEnvController, useIsMultiTenancyEnabled } from '../../../hooks';
import OrganizationSelect from './OrganizationSelect';
import { useSpotlightContext } from '../../providers/SpotlightProvider';
import { HEADER_HEIGHT } from '../constants';
Expand Down Expand Up @@ -62,6 +62,7 @@ export function SideNav({}: Props) {
const dark = colorScheme === 'dark';
const { addItem, removeItems } = useSpotlightContext();
const { classes } = usePopoverStyles();
const isMultiTenancyEnabled = useIsMultiTenancyEnabled();

useEffect(() => {
removeItems(['toggle-environment']);
Expand All @@ -80,7 +81,7 @@ export function SideNav({}: Props) {
const lastStep = currentOnboardingStep().get();
const getStartedRoute = lastStep === ROUTES.GET_STARTED_PREVIEW ? ROUTES.GET_STARTED : lastStep;

const menuItems = [
let menuItems = [
{
condition: !readonly,
icon: <CheckCircleOutlined />,
Expand Down Expand Up @@ -121,6 +122,10 @@ export function SideNav({}: Props) {
},
];

if (!isMultiTenancyEnabled) {
djabarovgeorge marked this conversation as resolved.
Show resolved Hide resolved
menuItems = menuItems.filter((item) => item.link !== ROUTES.TENANTS);
}

async function handlePopoverForChanges(e) {
e.preventDefault();

Expand Down