fix: added billing page condition to not show when its not either cloud or enterprise (#4827)

This commit is contained in:
SagarRajput-7 2024-04-09 12:05:39 +05:30 committed by GitHub
parent 31c0b94ae6
commit e9bb05cc5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 4 deletions

View File

@ -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); const newRoutes = routes.filter((route) => route?.path !== ROUTES.BILLING);
setRoutes(newRoutes); setRoutes(newRoutes);
} }

View File

@ -96,6 +96,8 @@ function SideNav({
const { registerShortcut, deregisterShortcut } = useKeyboardHotkeys(); const { registerShortcut, deregisterShortcut } = useKeyboardHotkeys();
const isCloudUserVal = isCloudUser();
useEffect(() => { useEffect(() => {
if (inviteMembers) { if (inviteMembers) {
const updatedUserManagementMenuItems = [ const updatedUserManagementMenuItems = [
@ -135,7 +137,11 @@ function SideNav({
license.isCurrent && license.planKey === LICENSE_PLAN_KEY.BASIC_PLAN, license.isCurrent && license.planKey === LICENSE_PLAN_KEY.BASIC_PLAN,
) || licenseData?.payload?.licenses === null; ) || 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); items = items.filter((item) => item.key !== ROUTES.BILLING);
} }
@ -214,8 +220,6 @@ function SideNav({
pathname, pathname,
]); ]);
const isCloudUserVal = isCloudUser();
useEffect(() => { useEffect(() => {
if (isCloudUser() || isEECloudUser()) { if (isCloudUser() || isEECloudUser()) {
const updatedUserManagementMenuItems = [helpSupportMenuItem]; const updatedUserManagementMenuItems = [helpSupportMenuItem];