Skip to content

Commit 43c8d13

Browse files
UIE-10778: IAM LA/New flag fix
1 parent 56cab84 commit 43c8d13

7 files changed

Lines changed: 14 additions & 40 deletions

File tree

packages/manager/src/components/PrimaryNav/PrimaryNav.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ export const PrimaryNav = (props: PrimaryNavProps) => {
137137
const { isDatabasesEnabled, isDatabasesV2Beta } = useIsDatabasesEnabled();
138138

139139
const { isIAMEnabled } = useIsIAMEnabled();
140-
const showLimitedAvailabilityBadges = flags.iamLimitedAvailabilityBadges;
141140

142141
const { isNetworkLoadBalancerEnabled } = useIsNetworkLoadBalancerEnabled();
143142

@@ -314,7 +313,7 @@ export const PrimaryNav = (props: PrimaryNavProps) => {
314313
display: 'Identity & Access',
315314
hide: !isIAMEnabled,
316315
to: '/iam',
317-
isNew: isIAMEnabled && showLimitedAvailabilityBadges,
316+
isNew: isIAMEnabled && flags.iamNewBadge,
318317
},
319318
{
320319
display: 'Quotas',

packages/manager/src/dev-tools/FeatureFlagTool.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ const options: { flag: keyof Flags; label: string }[] = [
7272
{ flag: 'apicliButtonCopy', label: 'APICLI Button Copy' },
7373
{ flag: 'iam', label: 'IAM enabled & Beta' },
7474
{
75-
flag: 'iamLimitedAvailabilityBadges',
76-
label: 'IAM Limited Availability Badges',
75+
flag: 'iamNewBadge',
76+
label: 'IAM New Badge',
7777
},
7878
{ flag: 'iamDelegation', label: 'IAM Delegation (Parent/Child)' },
7979
{

packages/manager/src/featureFlags.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ export interface Flags {
251251
hostnameEndpoints: boolean;
252252
iam: BaseFeatureFlag;
253253
iamDelegation: BaseFeatureFlag;
254-
iamLimitedAvailabilityBadges: boolean;
254+
iamNewBadge: boolean;
255255
ipv6Sharing: boolean;
256256
kubernetesBlackwellPlans: boolean;
257257
limitsEvolution: LimitsEvolution;

packages/manager/src/features/IAM/IAMLanding.tsx

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Chip, NewFeatureChip, styled } from '@linode/ui';
1+
import { NewFeatureChip } from '@linode/ui';
22
import { Outlet, useLocation, useNavigate } from '@tanstack/react-router';
33
import * as React from 'react';
44

@@ -20,8 +20,7 @@ import { IAM_DOCS_LINK, ROLES_LEARN_MORE_LINK } from './Shared/constants';
2020
export const IdentityAccessLanding = React.memo(() => {
2121
const flags = useFlags();
2222
const { isIAMEnabled } = useIsIAMEnabled();
23-
const showLimitedAvailabilityBadges =
24-
flags.iamLimitedAvailabilityBadges && isIAMEnabled;
23+
const showNewBadge = flags.iamNewBadge && isIAMEnabled;
2524
const location = useLocation();
2625
const navigate = useNavigate();
2726
const { isParentUserType } = useDelegationRole();
@@ -62,12 +61,7 @@ export const IdentityAccessLanding = React.memo(() => {
6261
{...landingHeaderProps}
6362
breadcrumbProps={{
6463
labelOptions: {
65-
suffixComponent: showLimitedAvailabilityBadges ? (
66-
<>
67-
<NewFeatureChip />
68-
<StyledLimitedAvailabilityChip label="Limited availability" />
69-
</>
70-
) : null,
64+
suffixComponent: showNewBadge ? <NewFeatureChip /> : null,
7165
},
7266
removeCrumbX: 1,
7367
}}
@@ -84,20 +78,3 @@ export const IdentityAccessLanding = React.memo(() => {
8478
</>
8579
);
8680
});
87-
88-
const StyledLimitedAvailabilityChip = styled(Chip, {
89-
label: 'StyledLimitedAvailabilityChip',
90-
shouldForwardProp: (prop) => prop !== 'color',
91-
})(({ theme }) => ({
92-
'& .MuiChip-label': {
93-
padding: 0,
94-
},
95-
background: theme.tokens.component.Badge.Informative.Subtle.Background,
96-
color: theme.tokens.component.Badge.Informative.Subtle.Text,
97-
font: theme.font.bold,
98-
fontSize: '12px',
99-
lineHeight: '12px',
100-
height: 16,
101-
letterSpacing: '.22px',
102-
padding: theme.spacingFunction(4),
103-
}));

packages/manager/src/features/IAM/Roles/Defaults/DefaultsLanding.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ export const DefaultsLanding = () => {
1818
const navigate = useNavigate();
1919
const flags = useFlags();
2020
const { isIAMEnabled } = useIsIAMEnabled();
21-
const showLimitedAvailabilityBadges =
22-
flags.iamLimitedAvailabilityBadges && isIAMEnabled;
21+
const showNewBadge = flags.iamNewBadge && isIAMEnabled;
2322

2423
const { tabs, tabIndex, handleTabChange } = useTabs([
2524
{
@@ -46,7 +45,7 @@ export const DefaultsLanding = () => {
4645
label: (
4746
<>
4847
{IAM_LABEL}
49-
{showLimitedAvailabilityBadges ? (
48+
{showNewBadge ? (
5049
<NewFeatureChip sx={{ position: 'relative', top: -1 }} />
5150
) : null}
5251
</>

packages/manager/src/features/IAM/Users/UserDetailsLanding.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ export const UserDetailsLanding = () => {
2626
const flags = useFlags();
2727
const theme = useTheme();
2828
const { isIAMEnabled } = useIsIAMEnabled();
29-
const showLimitedAvailabilityBadges =
30-
flags.iamLimitedAvailabilityBadges && isIAMEnabled;
29+
const showNewBadge = flags.iamNewBadge && isIAMEnabled;
3130
const { username } = useParams({ from: '/iam/users/$username' });
3231
const { isIAMDelegationEnabled } = useIsIAMDelegationEnabled();
3332
const { isParentUserType } = useDelegationRole();
@@ -68,7 +67,7 @@ export const UserDetailsLanding = () => {
6867
label: (
6968
<>
7069
{IAM_LABEL}
71-
{showLimitedAvailabilityBadges ? (
70+
{showNewBadge ? (
7271
<NewFeatureChip
7372
component="span"
7473
sx={{ position: 'relative', top: -1 }}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ interface MenuLink {
5151
export const UserMenuPopover = (props: UserMenuPopoverProps) => {
5252
const { anchorEl, isDrawerOpen, onClose, onDrawerOpen } = props;
5353
const sessionContext = React.useContext(switchAccountSessionContext);
54-
const { limitsEvolution, iamLimitedAvailabilityBadges } = useFlags();
54+
const { limitsEvolution, iamNewBadge } = useFlags();
5555
const {
5656
isProxyOrDelegateUserType,
5757
isParentUserType,
@@ -142,7 +142,7 @@ export const UserMenuPopover = (props: UserMenuPopoverProps) => {
142142
{
143143
display: isIAMEnabled ? 'Identity & Access' : 'Users & Grants',
144144
to: isIAMEnabled ? '/iam' : '/users',
145-
isNew: isIAMEnabled && iamLimitedAvailabilityBadges,
145+
isNew: isIAMEnabled && iamNewBadge,
146146
},
147147
{
148148
display: 'Quotas',
@@ -166,7 +166,7 @@ export const UserMenuPopover = (props: UserMenuPopoverProps) => {
166166
to: '/account-settings',
167167
},
168168
],
169-
[isIAMEnabled, limitsEvolution, iamLimitedAvailabilityBadges]
169+
[isIAMEnabled, limitsEvolution, iamNewBadge]
170170
);
171171

172172
const renderLink = (link: MenuLink) => {

0 commit comments

Comments
 (0)