🔥(frontend) remove temporarily team feature
We want to make a first realease, but the team feature is not ready yet. So we will hide it for now by hiding the menu. We will still let the feature in dev environment.
This commit is contained in:
@@ -1 +1,2 @@
|
||||
NEXT_PUBLIC_API_ORIGIN=http://localhost:8071
|
||||
NEXT_PUBLIC_FEATURE_TEAM=true
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
NEXT_PUBLIC_API_ORIGIN=http://test.jest
|
||||
NEXT_PUBLIC_FEATURE_TEAM=true
|
||||
|
||||
@@ -11,7 +11,7 @@ export function MainLayout({ children }: PropsWithChildren) {
|
||||
<Box $height="100vh">
|
||||
<Header />
|
||||
<Box $css="flex: 1;" $direction="row">
|
||||
<Menu />
|
||||
{process.env.NEXT_PUBLIC_FEATURE_TEAM === 'true' && <Menu />}
|
||||
<Box
|
||||
as="main"
|
||||
$height={`calc(100vh - ${HEADER_HEIGHT})`}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
import '@testing-library/jest-dom';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
|
||||
import { AppWrapper } from '@/tests/utils';
|
||||
|
||||
import { MainLayout } from '../MainLayout';
|
||||
|
||||
jest.mock('next/navigation', () => ({
|
||||
...jest.requireActual('next/navigation'),
|
||||
usePathname: () => '/',
|
||||
}));
|
||||
|
||||
describe('MainLayout', () => {
|
||||
it('checks menu rendering', () => {
|
||||
render(<MainLayout />, { wrapper: AppWrapper });
|
||||
|
||||
expect(
|
||||
screen.getByRole('button', {
|
||||
name: /Teams button/i,
|
||||
}),
|
||||
).toBeInTheDocument();
|
||||
|
||||
expect(
|
||||
screen.getByRole('button', {
|
||||
name: /Mail Domains button/i,
|
||||
}),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('checks menu rendering without team feature', () => {
|
||||
process.env.NEXT_PUBLIC_FEATURE_TEAM = 'false';
|
||||
|
||||
render(<MainLayout />, { wrapper: AppWrapper });
|
||||
|
||||
expect(
|
||||
screen.queryByRole('button', {
|
||||
name: /Teams button/i,
|
||||
}),
|
||||
).not.toBeInTheDocument();
|
||||
|
||||
expect(
|
||||
screen.queryByRole('button', {
|
||||
name: /Mail Domains button/i,
|
||||
}),
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
@@ -21,6 +21,11 @@ export const Panel = () => {
|
||||
$minWidth: '0',
|
||||
};
|
||||
|
||||
const styleNoTeam = process.env.NEXT_PUBLIC_FEATURE_TEAM !== 'true' && {
|
||||
$display: 'none',
|
||||
tabIndex: -1,
|
||||
};
|
||||
|
||||
const transition = 'all 0.5s ease-in-out';
|
||||
|
||||
return (
|
||||
@@ -52,6 +57,7 @@ export const Panel = () => {
|
||||
transition: ${transition};
|
||||
`}
|
||||
onClick={() => setIsOpen(!isOpen)}
|
||||
{...styleNoTeam}
|
||||
>
|
||||
<IconOpenClose width={24} height={24} aria-hidden="true" />
|
||||
</BoxButton>
|
||||
|
||||
@@ -1,16 +1,6 @@
|
||||
import type { ReactElement } from 'react';
|
||||
import MailDomains from './mail-domains';
|
||||
import Teams from './teams';
|
||||
|
||||
import { TeamLayout } from '@/features/teams/team-management';
|
||||
import { NextPageWithLayout } from '@/types/next';
|
||||
|
||||
import Teams from './teams/';
|
||||
|
||||
const Page: NextPageWithLayout = () => {
|
||||
return <Teams />;
|
||||
};
|
||||
|
||||
Page.getLayout = function getLayout(page: ReactElement) {
|
||||
return <TeamLayout>{page}</TeamLayout>;
|
||||
};
|
||||
|
||||
export default Page;
|
||||
export default process.env.NEXT_PUBLIC_FEATURE_TEAM === 'true'
|
||||
? Teams
|
||||
: MailDomains;
|
||||
|
||||
Reference in New Issue
Block a user