Skip to content

Commit 7003542

Browse files
authored
fix: [M3-10497], [M3-10495], [M3-10493], [M3-10494] - Fix Invoice pagination, unwanted hyphen in service transfers breadcrumb, restricted message in quotas and open make a payment drawer when IAM nav is enabled (linode#12726)
* Fix Invoice navigation when IAM nav is enabled * Update the Administration links in Goto.tsx * update the /account/billing -> /billing when IAM flag is enabled * Redirect to /quotas when IAM navigation is enabled and Quotas is disabled * Remove hyphen in breadcrumb in the transfers details page * revert - Redirect to /quotas * Show a restricted-access message on the Quotas landing page if the user has no access * Added changeset: Cannot navigate invoice pagination when IAM nav is enabled * Added changeset: Service transfers details page breadcrumb contains hyphen * Added changeset: Redirect does not occur when IAM navigation is enabled and Quotas is disabled * Update Quotas.tsx * update quotas unit test * Update Quotas.test.tsx * PR feedback - @jdamore-linode
1 parent 28ba6c0 commit 7003542

File tree

16 files changed

+83
-19
lines changed

16 files changed

+83
-19
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Fixed
3+
---
4+
5+
Cannot open payment method "Make a Payment" drawer when IAM nav is enabled ([#12726](https://github.com/linode/manager/pull/12726))
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Fixed
3+
---
4+
5+
Cannot navigate invoice pagination when IAM nav is enabled ([#12726](https://github.com/linode/manager/pull/12726))
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Fixed
3+
---
4+
5+
Service transfers details page breadcrumb contains hyphen ([#12726](https://github.com/linode/manager/pull/12726))
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Fixed
3+
---
4+
5+
Redirect does not occur when IAM navigation is enabled and Quotas is disabled ([#12726](https://github.com/linode/manager/pull/12726))

packages/manager/src/GoTo.tsx

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import * as React from 'react';
55

66
import { useIsDatabasesEnabled } from './features/Databases/utilities';
77
import { useIsPlacementGroupsEnabled } from './features/PlacementGroups/utils';
8+
import { useFlags } from './hooks/useFlags';
89
import { useGlobalKeyboardListener } from './hooks/useGlobalKeyboardListener';
910

1011
import type { SelectOption } from '@linode/ui';
@@ -16,6 +17,8 @@ export const GoTo = React.memo(() => {
1617
const { data: grants } = useGrants();
1718
const { data: profile } = useProfile();
1819

20+
const { iamRbacPrimaryNavChanges } = useFlags();
21+
1922
const isManagedAccount = accountSettings?.managed ?? false;
2023

2124
const hasAccountAccess =
@@ -103,11 +106,22 @@ export const GoTo = React.memo(() => {
103106
display: 'Marketplace',
104107
href: '/linodes/create/marketplace',
105108
},
106-
{
107-
display: 'Account',
108-
hide: !hasAccountAccess,
109-
href: '/account/billing',
110-
},
109+
...(iamRbacPrimaryNavChanges
110+
? [
111+
{ display: 'Billing', href: '/billing' },
112+
{ display: 'Identity & Access', href: '/iam' },
113+
{ display: 'Login History', href: '/login-history' },
114+
{ display: 'Service Transfers', href: '/service-transfers' },
115+
{ display: 'Maintenance', href: '/maintenance' },
116+
{ display: 'Settings', href: '/settings' },
117+
]
118+
: [
119+
{
120+
display: 'Account',
121+
hide: !hasAccountAccess,
122+
href: '/account/billing',
123+
},
124+
]),
111125
{
112126
display: 'Help & Support',
113127
href: '/support',
@@ -117,7 +131,12 @@ export const GoTo = React.memo(() => {
117131
href: '/profile/display',
118132
},
119133
],
120-
[hasAccountAccess, isManagedAccount, isPlacementGroupsEnabled]
134+
[
135+
hasAccountAccess,
136+
isManagedAccount,
137+
isPlacementGroupsEnabled,
138+
iamRbacPrimaryNavChanges,
139+
]
121140
);
122141

123142
const options: SelectOption<string>[] = React.useMemo(

packages/manager/src/components/PaymentMethodRow/PaymentMethodRow.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import * as React from 'react';
88
import { ActionMenu } from 'src/components/ActionMenu/ActionMenu';
99
import CreditCard from 'src/features/Billing/BillingPanels/BillingSummary/PaymentDrawer/CreditCard';
1010
import { usePermissions } from 'src/features/IAM/hooks/usePermissions';
11+
import { useFlags } from 'src/hooks/useFlags';
1112

1213
import { ThirdPartyPayment } from './ThirdPartyPayment';
1314

@@ -39,6 +40,7 @@ export const PaymentMethodRow = (props: Props) => {
3940
const { is_default, type } = paymentMethod;
4041
const { enqueueSnackbar } = useSnackbar();
4142
const navigate = useNavigate();
43+
const flags = useFlags();
4244

4345
const { mutateAsync: makePaymentMethodDefault } =
4446
useMakeDefaultPaymentMethodMutation(props.paymentMethod.id);
@@ -63,7 +65,7 @@ export const PaymentMethodRow = (props: Props) => {
6365
disabled: isChildUser || !permissions.make_billing_payment,
6466
onClick: () => {
6567
navigate({
66-
to: '/account/billing',
68+
to: flags?.iamRbacPrimaryNavChanges ? '/billing' : '/account/billing',
6769
search: (prev) => ({
6870
...prev,
6971
action: 'make-payment',

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ export const PrimaryNav = (props: PrimaryNavProps) => {
327327
isIAMBeta,
328328
isIAMEnabled,
329329
iamRbacPrimaryNavChanges,
330+
limitsEvolution,
330331
]
331332
);
332333

packages/manager/src/features/Account/AccountLanding.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const AccountLanding = () => {
3737
});
3838
const { data: account } = useAccount();
3939
const { data: profile } = useProfile();
40-
const { limitsEvolution } = useFlags();
40+
const { iamRbacPrimaryNavChanges, limitsEvolution } = useFlags();
4141

4242
const { data: permissions } = usePermissions('account', [
4343
'make_billing_payment',
@@ -104,10 +104,10 @@ export const AccountLanding = () => {
104104
React.useEffect(() => {
105105
if (match.routeId === '/account/quotas' && !showQuotasTab) {
106106
navigate({
107-
to: '/account/billing',
107+
to: iamRbacPrimaryNavChanges ? '/quotas' : '/account/billing',
108108
});
109109
}
110-
}, [match.routeId, showQuotasTab, navigate]);
110+
}, [match.routeId, showQuotasTab, navigate, iamRbacPrimaryNavChanges]);
111111

112112
const handleAccountSwitch = () => {
113113
if (isParentTokenExpired) {

packages/manager/src/features/Account/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export const grantTypeMap = {
1414
longview: 'Longview Clients',
1515
nodebalancer: 'NodeBalancers',
1616
placementGroups: 'Placement Groups',
17+
quotas: 'Quotas',
1718
stackscript: 'StackScripts',
1819
volume: 'Volumes',
1920
vpc: 'VPCs',

packages/manager/src/features/Billing/BillingLanding/BillingLanding.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export const BillingLanding = () => {
100100
search: { action: 'make-payment' },
101101
})
102102
: {},
103-
title: 'Account',
103+
title: 'Billing',
104104
};
105105

106106
return (

0 commit comments

Comments
 (0)