Skip to content

Commit d05be26

Browse files
cpathipamjac0bscoliu-akamai
authored
upcoming: [M3-10414] - Redirect /account/billing → /billing when feature flag is enabled (linode#12670)
* 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 * Add billing page route * upadate primarynav * Add billing landing page * Add Billing details page * 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 * Add billing link in the UserMenuPopover * Update the all sublinks in billing page wrt new billing route * Added changeset: Redirect /account/billing → /billing when feature flag is enabled * disabel the iamRbacPrimaryNavChanges in cypress tests * Code cleanup add redirects at router level * Fix the broken cypress tests and pr feedback - @dwiley-akamai * catch invalid billing routes --------- Co-authored-by: Mariah Jacobs <[email protected]> Co-authored-by: Connie Liu <[email protected]>
1 parent 8fb14a2 commit d05be26

File tree

25 files changed

+389
-35
lines changed

25 files changed

+389
-35
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+
Redirect /account/billing → /billing when feature flag is enabled ([#12670](https://github.com/linode/manager/pull/12670))

packages/manager/cypress/e2e/core/account/quotas-nav.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ describe('Quotas accessible when limitsEvolution feature flag enabled', () => {
88
limitsEvolution: {
99
enabled: true,
1010
},
11+
iamRbacPrimaryNavChanges: false,
1112
}).as('getFeatureFlags');
1213
});
1314
it('can navigate directly to Quotas page', () => {
@@ -50,6 +51,7 @@ describe('Quotas inaccessible when limitsEvolution feature flag disabled', () =>
5051
limitsEvolution: {
5152
enabled: false,
5253
},
54+
iamRbacPrimaryNavChanges: false,
5355
}).as('getFeatureFlags');
5456
});
5557
it('Quotas page is inaccessible', () => {

packages/manager/cypress/e2e/core/account/restricted-user-details-pages.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ describe('restricted user details pages', () => {
105105
mockAppendFeatureFlags({
106106
apl: false,
107107
dbaasV2: { beta: false, enabled: false },
108+
iamRbacPrimaryNavChanges: false,
108109
});
109110
});
110111

packages/manager/cypress/e2e/core/billing/billing-contact.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ describe('Billing Contact', () => {
8585
taxId: {
8686
enabled: true,
8787
},
88+
iamRbacPrimaryNavChanges: false,
8889
});
8990
});
9091
it('Mask Contact Info', () => {

packages/manager/cypress/e2e/core/billing/billing-invoices.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
mockGetInvoice,
1010
mockGetInvoiceItems,
1111
} from 'support/intercepts/account';
12+
import { mockAppendFeatureFlags } from 'support/intercepts/feature-flags';
1213
import { ui } from 'support/ui';
1314
import { buildArray } from 'support/util/arrays';
1415
import { formatUsd } from 'support/util/currency';
@@ -30,6 +31,11 @@ const getRegionLabel = (regionId: string) => {
3031
};
3132

3233
describe('Account invoices', () => {
34+
beforeEach(() => {
35+
mockAppendFeatureFlags({
36+
iamRbacPrimaryNavChanges: false,
37+
});
38+
});
3339
/*
3440
* - Confirms that invoice items are listed on invoice details page using mock API data.
3541
* - Confirms that each invoice item is displayed with correct accompanying info.

packages/manager/cypress/e2e/core/billing/credit-card-expired-banner.spec.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { mockGetAccount } from 'support/intercepts/account';
2+
import { mockAppendFeatureFlags } from 'support/intercepts/feature-flags';
23
import { mockGetUserPreferences } from 'support/intercepts/profile';
34
import { ui } from 'support/ui';
45

@@ -9,7 +10,12 @@ const creditCardExpiredBannerNotice =
910

1011
describe('Credit Card Expired Banner', () => {
1112
beforeEach(() => {
12-
mockGetUserPreferences({ dismissed_notifications: {} });
13+
mockGetUserPreferences({
14+
dismissed_notifications: {},
15+
});
16+
mockAppendFeatureFlags({
17+
iamRbacPrimaryNavChanges: false,
18+
}).as('getFeatureFlags');
1319
});
1420

1521
it('appears when the expiration date is in the past', () => {

packages/manager/cypress/e2e/core/billing/google-pay.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { mockGetPaymentMethods } from 'support/intercepts/account';
2+
import { mockAppendFeatureFlags } from 'support/intercepts/feature-flags';
23
import { ui } from 'support/ui';
34

45
import type { CreditCardData, PaymentMethod } from '@linode/api-v4';
@@ -56,6 +57,11 @@ const braintreeURL =
5657
'https://+(payments.braintree-api.com|payments.sandbox.braintree-api.com)/*';
5758

5859
describe('Google Pay', () => {
60+
beforeEach(() => {
61+
mockAppendFeatureFlags({
62+
iamRbacPrimaryNavChanges: false,
63+
});
64+
});
5965
it('adds google pay method', () => {
6066
cy.intercept(braintreeURL).as('braintree');
6167
mockGetPaymentMethods(mockPaymentMethods).as('getPaymentMethods');

packages/manager/cypress/e2e/core/billing/restricted-user-billing.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { grantsFactory, profileFactory } from '@linode/utilities';
66
import { paymentMethodFactory } from '@src/factories';
77
import { accountUserFactory } from '@src/factories/accountUsers';
88
import { mockGetPaymentMethods, mockGetUser } from 'support/intercepts/account';
9+
import { mockAppendFeatureFlags } from 'support/intercepts/feature-flags';
910
import {
1011
mockGetProfile,
1112
mockGetProfileGrants,
@@ -223,6 +224,9 @@ const assertMakeAPaymentEnabled = () => {
223224
describe('restricted user billing flows', () => {
224225
beforeEach(() => {
225226
mockGetPaymentMethods(mockPaymentMethods);
227+
mockAppendFeatureFlags({
228+
iamRbacPrimaryNavChanges: false,
229+
});
226230
});
227231

228232
/*

packages/manager/cypress/e2e/core/billing/smoke-billing-activity.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
mockGetPaymentMethods,
99
mockGetPayments,
1010
} from 'support/intercepts/account';
11+
import { mockAppendFeatureFlags } from 'support/intercepts/feature-flags';
1112
import { mockGetProfile, mockUpdateProfile } from 'support/intercepts/profile';
1213
import { ui } from 'support/ui';
1314
import { buildArray } from 'support/util/arrays';
@@ -117,6 +118,11 @@ const assertPaymentInfo = (payment: Payment, timezone: string) => {
117118

118119
authenticate();
119120
describe('Billing Activity Feed', () => {
121+
beforeEach(() => {
122+
mockAppendFeatureFlags({
123+
iamRbacPrimaryNavChanges: false,
124+
});
125+
});
120126
/*
121127
* - Uses mocked API data to confirm that invoices and payments are listed on billing page.
122128
* - Confirms that invoice and payment labels, dates, and totals are displayed as expected.

packages/manager/cypress/e2e/core/linodes/rebuild-linode.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ describe('rebuild linode', () => {
178178
getLatestImage(almaLinuxImageLabel).then((value: Image) => {
179179
almaLinuxImageLabel = value.label;
180180
});
181+
182+
mockAppendFeatureFlags({
183+
iamRbacPrimaryNavChanges: false,
184+
});
181185
});
182186

183187
/*

0 commit comments

Comments
 (0)