Skip to content

Commit

Permalink
Merge pull request #3860 from novuhq/NV-2602-hide-tenant-functionalit…
Browse files Browse the repository at this point in the history
…y-under-the-feature-flag

NV 2602 - Hide Tenant functionality under the feature flag
  • Loading branch information
djabarovgeorge authored Jul 30, 2023
2 parents eb55742 + b0eb86c commit 5dcfd48
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
8 changes: 4 additions & 4 deletions apps/api/src/app/tenant/e2e/get-tenants.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ describe('Get Tenants List- /tenants (GET)', function () {
expect(data.pageSize).to.equal(10);
expect(data.hasMore).to.equal(false);
expect(data.data.length).to.equal(5);
expect(data.data[0].identifier).to.equal('identifier_0');
expect(data.data[4].identifier).to.equal('identifier_4');
expect(data.data[0].identifier).to.equal('identifier_4');
expect(data.data[4].identifier).to.equal('identifier_0');
});

it('should get second page of tenants', async function () {
Expand All @@ -53,8 +53,8 @@ describe('Get Tenants List- /tenants (GET)', function () {
expect(data.pageSize).to.equal(5);
expect(data.hasMore).to.equal(false);
expect(data.data.length).to.equal(4);
expect(data.data[0].identifier).to.equal('identifier_5');
expect(data.data[3].identifier).to.equal('identifier_8');
expect(data.data[0].identifier).to.equal('identifier_3');
expect(data.data[3].identifier).to.equal('identifier_0');
});

it('should get tenants by pagination', async function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export class GetTenants {
{
limit: command.limit,
skip: command.page * command.limit,
sort: { createdAt: -1 },
}
);

Expand Down
11 changes: 9 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 Down Expand Up @@ -89,7 +90,13 @@ export function SideNav({}: Props) {
testId: 'side-nav-quickstart-link',
},
{ icon: <Bolt />, link: ROUTES.WORKFLOWS, label: 'Workflows', testId: 'side-nav-templates-link' },
{ icon: <Buildings />, link: ROUTES.TENANTS, label: 'Tenants', testId: 'side-nav-tenants-link' },
{
condition: isMultiTenancyEnabled,
icon: <Buildings />,
link: ROUTES.TENANTS,
label: 'Tenants',
testId: 'side-nav-tenants-link',
},
{
icon: <Team />,
link: ROUTES.SUBSCRIBERS,
Expand Down

0 comments on commit 5dcfd48

Please sign in to comment.