Skip to content

Commit

Permalink
fix: Only show new 'Quotas' link in user menu when feature flag is en…
Browse files Browse the repository at this point in the history
…abled (linode#11565)

* API spec update

* Create feature-flagged placeholder Account Quotas tab

* Add DocumentTitleSegment

* Added changeset: Add placeholder Quotas tab in Accounts page

* Added changeset: Quotas API spec to make region field optional

* PR feedback @abailly-akamai @mjac0bs

* Fix Quotas link appearing in UserMenu when feature flag is off
  • Loading branch information
hkhalil-akamai authored Jan 24, 2025
1 parent cc51ff4 commit 74ebf17
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/manager/src/features/TopMenu/UserMenu/UserMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { switchAccountSessionContext } from 'src/context/switchAccountSessionCon
import { SwitchAccountButton } from 'src/features/Account/SwitchAccountButton';
import { SwitchAccountDrawer } from 'src/features/Account/SwitchAccountDrawer';
import { useIsParentTokenExpired } from 'src/features/Account/SwitchAccounts/useIsParentTokenExpired';
import { useFlags } from 'src/hooks/useFlags';
import { useRestrictedGlobalGrantCheck } from 'src/hooks/useRestrictedGlobalGrantCheck';
import { useAccount } from 'src/queries/account/account';
import { useGrants, useProfile } from 'src/queries/profile/profile';
Expand Down Expand Up @@ -60,6 +61,7 @@ export const UserMenu = React.memo(() => {
const { data: profile } = useProfile();
const { data: grants } = useGrants();
const { enqueueSnackbar } = useSnackbar();
const flags = useFlags();
const sessionContext = React.useContext(switchAccountSessionContext);

const hasGrant = (grant: GlobalGrantTypes) =>
Expand Down Expand Up @@ -133,6 +135,7 @@ export const UserMenu = React.memo(() => {
},
{
display: 'Quotas',
hide: !flags.limitsEvolution?.enabled,
href: '/account/quotas',
},
// Restricted users can't view the Transfers tab regardless of their grants
Expand Down

0 comments on commit 74ebf17

Please sign in to comment.