Skip to content

Commit f33cde2

Browse files
cpathipamjac0bscoliu-akamai
authored
upcoming: [M3-10421] - IAM: Rename Account section to Administration in the top right menu (linode#12640)
* Added new feature flag to support PrimaryNav changes * Add Administration section to the primary Nav * Update PrimaryNav.tsx * Added changeset: Added a new feature flag and Administration section in the Primary Nav * Test coverage * disable the flag in cypress tests * Rename Account section to Administration in the top right menu * Added changeset: IAM: Rename Account section to Administration in the top right menu * Show new chip next to Identity and Access link * Update packages/manager/.changeset/pr-12633-upcoming-features-1754346094060.md Co-authored-by: Mariah Jacobs <[email protected]> * Mock the iamRbacPrimaryNavChanges feature flag to be disabled in Cypress tests * upadate primarynav * Replace new feature chip with Beta chip - @aaleksee-akamai * Update packages/manager/.changeset/pr-12640-upcoming-features-1754423037270.md Co-authored-by: Connie Liu <[email protected]> * Add login history link - @coliu-akamai --------- Co-authored-by: Mariah Jacobs <[email protected]> Co-authored-by: Connie Liu <[email protected]>
1 parent 18509e2 commit f33cde2

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Upcoming Features
3+
---
4+
5+
IAM: Rename Account section to Administration and add navigation for IAM in the top right menu ([#12640](https://github.com/linode/manager/pull/12640))

packages/manager/src/features/TopMenu/UserMenu/UserMenuPopover.tsx

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useAccount, useGrants, useProfile } from '@linode/queries';
2-
import { Box, Divider, Stack, Typography } from '@linode/ui';
2+
import { BetaChip, Box, Divider, Stack, Typography } from '@linode/ui';
33
import { styled } from '@mui/material';
44
import Grid from '@mui/material/Grid';
55
import Popover from '@mui/material/Popover';
@@ -10,6 +10,7 @@ import { Link } from 'src/components/Link';
1010
import { switchAccountSessionContext } from 'src/context/switchAccountSessionContext';
1111
import { SwitchAccountButton } from 'src/features/Account/SwitchAccountButton';
1212
import { useIsParentTokenExpired } from 'src/features/Account/SwitchAccounts/useIsParentTokenExpired';
13+
import { useIsIAMEnabled } from 'src/features/IAM/hooks/useIsIAMEnabled';
1314
import { useFlags } from 'src/hooks/useFlags';
1415
import { useRestrictedGlobalGrantCheck } from 'src/hooks/useRestrictedGlobalGrantCheck';
1516
import { sendSwitchAccountEvent } from 'src/utilities/analytics/customEventAnalytics';
@@ -28,6 +29,7 @@ interface MenuLink {
2829
display: string;
2930
hide?: boolean;
3031
href: string;
32+
isBeta?: boolean;
3133
}
3234

3335
const profileLinks: MenuLink[] = [
@@ -57,6 +59,7 @@ export const UserMenuPopover = (props: UserMenuPopoverProps) => {
5759
const { data: account } = useAccount();
5860
const { data: profile } = useProfile();
5961
const { data: grants } = useGrants();
62+
const { isIAMEnabled } = useIsIAMEnabled();
6063

6164
const isChildAccountAccessRestricted = useRestrictedGlobalGrantCheck({
6265
globalGrantType: 'child_account_access',
@@ -103,15 +106,26 @@ export const UserMenuPopover = (props: UserMenuPopoverProps) => {
103106
},
104107
// Restricted users can't view the Users tab regardless of their grants
105108
{
106-
display: 'Users & Grants',
109+
display:
110+
flags?.iamRbacPrimaryNavChanges && isIAMEnabled
111+
? 'Identity & Access'
112+
: 'Users & Grants',
107113
hide: isRestrictedUser,
108-
href: '/account/users',
114+
href:
115+
flags?.iamRbacPrimaryNavChanges && isIAMEnabled
116+
? '/iam'
117+
: '/account/users',
118+
isBeta: flags?.iamRbacPrimaryNavChanges && isIAMEnabled,
109119
},
110120
{
111121
display: 'Quotas',
112122
hide: !flags.limitsEvolution?.enabled,
113123
href: '/account/quotas',
114124
},
125+
{
126+
display: 'Login History',
127+
href: '/account/login-history',
128+
},
115129
// Restricted users can't view the Transfers tab regardless of their grants
116130
{
117131
display: 'Service Transfers',
@@ -129,7 +143,7 @@ export const UserMenuPopover = (props: UserMenuPopoverProps) => {
129143
href: '/account/settings',
130144
},
131145
],
132-
[hasFullAccountAccess, isRestrictedUser]
146+
[hasFullAccountAccess, isRestrictedUser, isIAMEnabled, flags]
133147
);
134148

135149
const renderLink = (link: MenuLink) => {
@@ -239,7 +253,9 @@ export const UserMenuPopover = (props: UserMenuPopoverProps) => {
239253
</Box>
240254
{hasAccountAccess && (
241255
<Box>
242-
<Heading>Account</Heading>
256+
<Heading>
257+
{flags?.iamRbacPrimaryNavChanges ? 'Administration' : 'Account'}
258+
</Heading>
243259
<Divider />
244260
<Stack
245261
gap={(theme) => theme.tokens.spacing.S8}
@@ -258,6 +274,7 @@ export const UserMenuPopover = (props: UserMenuPopoverProps) => {
258274
to={menuLink.href}
259275
>
260276
{menuLink.display}
277+
{menuLink?.isBeta ? <BetaChip component="span" /> : null}
261278
</Link>
262279
)
263280
)}

0 commit comments

Comments
 (0)