Skip to content

Commit 8fbaaea

Browse files
authored
Merge pull request #12545 from linode/staging
Release v1.146.2 - staging → master
2 parents c90671b + 7c7179d commit 8fbaaea

File tree

6 files changed

+24
-22
lines changed

6 files changed

+24
-22
lines changed

packages/manager/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## [2025-07-21] - v1.146.2
8+
9+
### Fixed:
10+
11+
- Resort to payment id for edit billing flow ([#12544](https://github.com/linode/manager/pull/12544))
12+
713
## [2025-07-16] - v1.146.1
814

915

packages/manager/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "linode-manager",
33
"author": "Linode",
44
"description": "The Linode Manager website",
5-
"version": "1.146.1",
5+
"version": "1.146.2",
66
"private": true,
77
"type": "module",
88
"bugs": {

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

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -243,17 +243,7 @@ describe('Payment Method Row', () => {
243243

244244
expect(navigate).toHaveBeenCalledWith({
245245
search: {
246-
paymentMethod: {
247-
created: '2021-05-21T14:27:51',
248-
data: {
249-
card_type: 'Visa',
250-
expiry: '12/2022',
251-
last_four: '1881',
252-
},
253-
id: 9,
254-
is_default: false,
255-
type: 'credit_card',
256-
},
246+
paymentMethodId: 9,
257247
},
258248
to: '/account/billing/make-payment',
259249
});

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ export const PaymentMethodRow = (props: Props) => {
6161
onClick: () => {
6262
navigate({
6363
to: '/account/billing/make-payment',
64-
search: { paymentMethod },
64+
search: {
65+
paymentMethodId: paymentMethod.id,
66+
},
6567
});
6668
},
6769
title: 'Make a Payment',

packages/manager/src/features/Billing/BillingPanels/BillingSummary/BillingSummary.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,12 @@ export const BillingSummary = (props: BillingSummaryProps) => {
5555

5656
const navigate = useNavigate();
5757
const match = useMatch({ strict: false });
58-
const { paymentMethod } = useSearch({
58+
const search = useSearch({
5959
strict: false,
6060
});
6161

62+
const { paymentMethodId } = search;
63+
6264
const routeForMakePayment = '/account/billing/make-payment';
6365
const makePaymentRouteMatch = match?.routeId === routeForMakePayment;
6466

@@ -91,13 +93,17 @@ export const BillingSummary = (props: BillingSummaryProps) => {
9193
return;
9294
}
9395

94-
const selectedPaymentMethod =
95-
paymentMethod ??
96-
paymentMethods?.find((payment) => payment.is_default) ??
97-
undefined;
96+
const selectedPaymentMethod = paymentMethodId
97+
? paymentMethods?.find((payment) => payment.id === paymentMethodId)
98+
: (paymentMethods?.find((payment) => payment.is_default) ?? undefined);
9899

99100
openPaymentDrawer(selectedPaymentMethod);
100-
}, [paymentMethods, openPaymentDrawer, makePaymentRouteMatch, paymentMethod]);
101+
}, [
102+
paymentMethods,
103+
openPaymentDrawer,
104+
makePaymentRouteMatch,
105+
paymentMethodId,
106+
]);
101107

102108
//
103109
// Account Balance logic

packages/manager/src/routes/account/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@ import { createRoute, redirect } from '@tanstack/react-router';
33
import { rootRoute } from '../root';
44
import { AccountRoute } from './AccountRoute';
55

6-
import type { PaymentMethod } from '@linode/api-v4';
7-
86
interface AccountBillingSearch {
97
contactDrawerOpen?: boolean;
108
focusEmail?: boolean;
119
}
1210

1311
interface AccountBillingMakePaymentSearch {
14-
paymentMethod?: PaymentMethod;
12+
paymentMethodId?: number;
1513
}
1614

1715
const accountRoute = createRoute({

0 commit comments

Comments
 (0)