Skip to content

Commit

Permalink
fix: added billing page condition to not show when its not either clo…
Browse files Browse the repository at this point in the history
…ud or enterprise (#4827)
  • Loading branch information
SagarRajput-7 authored Apr 9, 2024
1 parent 31c0b94 commit e9bb05c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 5 additions & 1 deletion frontend/src/AppRoutes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@ function App(): JSX.Element {
}
}

if (isOnBasicPlan || (isLoggedInState && role && role !== 'ADMIN')) {
if (
isOnBasicPlan ||
(isLoggedInState && role && role !== 'ADMIN') ||
!(isCloudUserVal || isEECloudUser())
) {
const newRoutes = routes.filter((route) => route?.path !== ROUTES.BILLING);
setRoutes(newRoutes);
}
Expand Down
10 changes: 7 additions & 3 deletions frontend/src/container/SideNav/SideNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ function SideNav({

const { registerShortcut, deregisterShortcut } = useKeyboardHotkeys();

const isCloudUserVal = isCloudUser();

useEffect(() => {
if (inviteMembers) {
const updatedUserManagementMenuItems = [
Expand Down Expand Up @@ -135,7 +137,11 @@ function SideNav({
license.isCurrent && license.planKey === LICENSE_PLAN_KEY.BASIC_PLAN,
) || licenseData?.payload?.licenses === null;

if (role !== USER_ROLES.ADMIN || isOnBasicPlan) {
if (
role !== USER_ROLES.ADMIN ||
isOnBasicPlan ||
!(isCloudUserVal || isEECloudUser())
) {
items = items.filter((item) => item.key !== ROUTES.BILLING);
}

Expand Down Expand Up @@ -214,8 +220,6 @@ function SideNav({
pathname,
]);

const isCloudUserVal = isCloudUser();

useEffect(() => {
if (isCloudUser() || isEECloudUser()) {
const updatedUserManagementMenuItems = [helpSupportMenuItem];
Expand Down

0 comments on commit e9bb05c

Please sign in to comment.