diff --git a/packages/manager/.changeset/pr-13232-tech-stories-1767359015030.md b/packages/manager/.changeset/pr-13232-tech-stories-1767359015030.md
new file mode 100644
index 00000000000..9726cba0b55
--- /dev/null
+++ b/packages/manager/.changeset/pr-13232-tech-stories-1767359015030.md
@@ -0,0 +1,5 @@
+---
+"@linode/manager": Tech Stories
+---
+
+IAM: Cleanup `iamRbacPrimaryNavChanges` feature flag ([#13232](https://github.com/linode/manager/pull/13232))
diff --git a/packages/manager/cypress/e2e/core/account/account-maintenance.spec.ts b/packages/manager/cypress/e2e/core/account/account-maintenance.spec.ts
index 14e4ada60c6..9890547fdbc 100644
--- a/packages/manager/cypress/e2e/core/account/account-maintenance.spec.ts
+++ b/packages/manager/cypress/e2e/core/account/account-maintenance.spec.ts
@@ -27,8 +27,6 @@ describe('Maintenance', () => {
// TODO When the Host & VM Maintenance feature rolls out, we want to enable the feature flag and update the test.
mockAppendFeatureFlags({
- // TODO M3-10491 - Remove "iamRbacPrimaryNavChanges" feature flag mock once feature flag is deleted.
- iamRbacPrimaryNavChanges: true,
vmHostMaintenance: {
enabled: false,
},
diff --git a/packages/manager/cypress/e2e/core/account/quotas-nav.spec.ts b/packages/manager/cypress/e2e/core/account/quotas-nav.spec.ts
index 6d972eb36b9..bfaf543c4a2 100644
--- a/packages/manager/cypress/e2e/core/account/quotas-nav.spec.ts
+++ b/packages/manager/cypress/e2e/core/account/quotas-nav.spec.ts
@@ -1,94 +1,12 @@
import { mockAppendFeatureFlags } from 'support/intercepts/feature-flags';
import { ui } from 'support/ui';
-describe('Quotas accessible when limitsEvolution feature flag enabled', () => {
- // TODO M3-10491 - Remove `describe` block and move tests to parent scope once `iamRbacPrimaryNavChanges` feature flag is removed.
- describe('When IAM RBAC account navigation feature flag is enabled', () => {
- beforeEach(() => {
- // TODO M3-10003 - Remove mock once `limitsEvolution` feature flag is removed.
- mockAppendFeatureFlags({
- limitsEvolution: {
- enabled: true,
- },
- // TODO M3-10491 - Remove `iamRbacPrimaryNavChanges` mock once feature flag is removed.
- iamRbacPrimaryNavChanges: true,
- }).as('getFeatureFlags');
- });
-
- it('can navigate directly to Quotas page', () => {
- cy.visitWithLogin('/quotas');
- cy.wait('@getFeatureFlags');
- cy.url().should('endWith', '/quotas');
- cy.contains(
- 'View your Object Storage quotas by applying the endpoint filter below'
- ).should('be.visible');
- });
-
- it('can navigate to the Quotas page via the User Menu', () => {
- cy.visitWithLogin('/');
- cy.wait('@getFeatureFlags');
- // Open user menu
- ui.userMenuButton.find().click();
- ui.userMenu.find().within(() => {
- cy.get('[data-testid="menu-item-Quotas"]').should('be.visible').click();
- cy.url().should('endWith', '/quotas');
- });
- });
- });
-
- // TODO M3-10491 - Remove `describe` block and tests once "iamRbacPrimaryNavChanges" feature flag is removed.
- describe('When IAM RBAC account navigation feature flag is disabled', () => {
- beforeEach(() => {
- mockAppendFeatureFlags({
- limitsEvolution: {
- enabled: true,
- },
- iamRbacPrimaryNavChanges: false,
- }).as('getFeatureFlags');
- });
-
- it('can navigate directly to Quotas page', () => {
- cy.visitWithLogin('/account/quotas');
- cy.wait('@getFeatureFlags');
- cy.url().should('endWith', '/account/quotas');
- cy.contains(
- 'View your Object Storage quotas by applying the endpoint filter below'
- ).should('be.visible');
- });
-
- it('can navigate to the Quotas page via the User Menu', () => {
- cy.visitWithLogin('/');
- cy.wait('@getFeatureFlags');
- // Open user menu
- ui.userMenuButton.find().click();
- ui.userMenu.find().within(() => {
- cy.get('[data-testid="menu-item-Quotas"]').should('be.visible').click();
- cy.url().should('endWith', '/quotas');
- });
- });
-
- it('Quotas tab is visible from all other tabs in Account tablist', () => {
- cy.visitWithLogin('/account/billing');
- cy.wait('@getFeatureFlags');
- ui.tabList.find().within(() => {
- cy.get('a').each(($link) => {
- cy.wrap($link).click();
- cy.get('[data-testid="Quotas"]').should('be.visible');
- });
- });
- cy.get('[data-testid="Quotas"]').should('be.visible').click();
- cy.url().should('endWith', '/quotas');
- });
- });
-});
-
describe('Quotas inaccessible when limitsEvolution feature flag disabled', () => {
beforeEach(() => {
mockAppendFeatureFlags({
limitsEvolution: {
enabled: false,
},
- iamRbacPrimaryNavChanges: true,
}).as('getFeatureFlags');
});
diff --git a/packages/manager/cypress/e2e/core/account/restricted-user-details-pages.spec.ts b/packages/manager/cypress/e2e/core/account/restricted-user-details-pages.spec.ts
index 61c93e1f830..a03280a344b 100644
--- a/packages/manager/cypress/e2e/core/account/restricted-user-details-pages.spec.ts
+++ b/packages/manager/cypress/e2e/core/account/restricted-user-details-pages.spec.ts
@@ -106,8 +106,6 @@ describe('restricted user details pages', () => {
mockAppendFeatureFlags({
apl: false,
dbaasV2: { beta: false, enabled: false },
- // TODO M3-10491 - Remove `iamRbacPrimaryNavChanges` feature flag mock once flag is deleted.
- iamRbacPrimaryNavChanges: true,
});
});
diff --git a/packages/manager/cypress/e2e/core/account/service-transfer.spec.ts b/packages/manager/cypress/e2e/core/account/service-transfer.spec.ts
index 6d0d8e4649e..16d14933dab 100644
--- a/packages/manager/cypress/e2e/core/account/service-transfer.spec.ts
+++ b/packages/manager/cypress/e2e/core/account/service-transfer.spec.ts
@@ -14,7 +14,6 @@ import {
mockInitiateEntityTransferError,
mockReceiveEntityTransfer,
} from 'support/intercepts/account';
-import { mockAppendFeatureFlags } from 'support/intercepts/feature-flags';
import { mockGetLinodes } from 'support/intercepts/linodes';
import { ui } from 'support/ui';
import { cleanUp } from 'support/util/cleanup';
@@ -127,14 +126,6 @@ describe('Account service transfers', () => {
cleanUp(['service-transfers', 'linodes', 'lke-clusters']);
});
- beforeEach(() => {
- // Mock the iamRbacPrimaryNavChanges feature flag to be disabled.
- mockAppendFeatureFlags({
- // TODO M3-10491 - Remove `iamRbacPrimaryNavChanges` feature flag mock once flag is deleted.
- iamRbacPrimaryNavChanges: true,
- }).as('getFeatureFlags');
- });
-
/*
* - Confirms user can navigate to service transfer page via user menu.
*/
diff --git a/packages/manager/cypress/e2e/core/account/user-permissions.spec.ts b/packages/manager/cypress/e2e/core/account/user-permissions.spec.ts
index 8efd2e884d0..3a392ef5f89 100644
--- a/packages/manager/cypress/e2e/core/account/user-permissions.spec.ts
+++ b/packages/manager/cypress/e2e/core/account/user-permissions.spec.ts
@@ -170,9 +170,7 @@ const assertBillingAccessSelected = (
describe('User permission management', () => {
beforeEach(() => {
- // TODO M3-10003 - Remove mock once `limitsEvolution` feature flag is removed.
mockAppendFeatureFlags({
- iamRbacPrimaryNavChanges: true,
iam: {
enabled: false,
},
diff --git a/packages/manager/cypress/e2e/core/account/users-landing-page.spec.ts b/packages/manager/cypress/e2e/core/account/users-landing-page.spec.ts
index b343ac638d5..91afe8661f6 100644
--- a/packages/manager/cypress/e2e/core/account/users-landing-page.spec.ts
+++ b/packages/manager/cypress/e2e/core/account/users-landing-page.spec.ts
@@ -81,9 +81,7 @@ const initTestUsers = (profile: Profile, enableChildAccountAccess: boolean) => {
describe('Users landing page', () => {
beforeEach(() => {
- // TODO M3-10003 - Remove mock once `limitsEvolution` feature flag is removed.
mockAppendFeatureFlags({
- iamRbacPrimaryNavChanges: true,
iam: {
enabled: false,
},
diff --git a/packages/manager/cypress/e2e/core/billing/billing-invoices.spec.ts b/packages/manager/cypress/e2e/core/billing/billing-invoices.spec.ts
index 90de20fa000..774e8461400 100644
--- a/packages/manager/cypress/e2e/core/billing/billing-invoices.spec.ts
+++ b/packages/manager/cypress/e2e/core/billing/billing-invoices.spec.ts
@@ -9,7 +9,6 @@ import {
mockGetInvoice,
mockGetInvoiceItems,
} from 'support/intercepts/account';
-import { mockAppendFeatureFlags } from 'support/intercepts/feature-flags';
import { ui } from 'support/ui';
import { buildArray } from 'support/util/arrays';
import { formatUsd } from 'support/util/currency';
@@ -31,12 +30,6 @@ const getRegionLabel = (regionId: string) => {
};
describe('Account invoices', () => {
- beforeEach(() => {
- mockAppendFeatureFlags({
- // TODO M3-10491 - Remove `iamRbacPrimaryNavChanges` feature flag mock once flag is deleted.
- iamRbacPrimaryNavChanges: true,
- });
- });
/*
* - Confirms that invoice items are listed on invoice details page using mock API data.
* - Confirms that each invoice item is displayed with correct accompanying info.
diff --git a/packages/manager/cypress/e2e/core/billing/credit-card-expired-banner.spec.ts b/packages/manager/cypress/e2e/core/billing/credit-card-expired-banner.spec.ts
index 4ebaf70e8be..758d517e18d 100644
--- a/packages/manager/cypress/e2e/core/billing/credit-card-expired-banner.spec.ts
+++ b/packages/manager/cypress/e2e/core/billing/credit-card-expired-banner.spec.ts
@@ -1,5 +1,4 @@
import { mockGetAccount } from 'support/intercepts/account';
-import { mockAppendFeatureFlags } from 'support/intercepts/feature-flags';
import { mockGetUserPreferences } from 'support/intercepts/profile';
import { ui } from 'support/ui';
@@ -13,10 +12,6 @@ describe('Credit Card Expired Banner', () => {
mockGetUserPreferences({
dismissed_notifications: {},
});
- mockAppendFeatureFlags({
- // TODO M3-10491 - Remove `iamRbacPrimaryNavChanges` feature flag mock once flag is deleted.
- iamRbacPrimaryNavChanges: true,
- }).as('getFeatureFlags');
});
it('appears when the expiration date is in the past', () => {
diff --git a/packages/manager/cypress/e2e/core/billing/google-pay.spec.ts b/packages/manager/cypress/e2e/core/billing/google-pay.spec.ts
index b13bfd3f8c9..4b164903407 100644
--- a/packages/manager/cypress/e2e/core/billing/google-pay.spec.ts
+++ b/packages/manager/cypress/e2e/core/billing/google-pay.spec.ts
@@ -1,5 +1,4 @@
import { mockGetPaymentMethods } from 'support/intercepts/account';
-import { mockAppendFeatureFlags } from 'support/intercepts/feature-flags';
import { ui } from 'support/ui';
import type { CreditCardData, PaymentMethod } from '@linode/api-v4';
@@ -57,13 +56,6 @@ const braintreeURL =
'https://+(payments.braintree-api.com|payments.sandbox.braintree-api.com)/*';
describe('Google Pay', () => {
- beforeEach(() => {
- mockAppendFeatureFlags({
- // TODO M3-10491 - Remove `iamRbacPrimaryNavChanges` feature flag mock once flag is deleted.
- iamRbacPrimaryNavChanges: true,
- });
- });
-
it('adds google pay method', () => {
cy.intercept(braintreeURL).as('braintree');
mockGetPaymentMethods(mockPaymentMethods).as('getPaymentMethods');
diff --git a/packages/manager/cypress/e2e/core/billing/restricted-user-billing.spec.ts b/packages/manager/cypress/e2e/core/billing/restricted-user-billing.spec.ts
index febde9e4661..5787d446ce4 100644
--- a/packages/manager/cypress/e2e/core/billing/restricted-user-billing.spec.ts
+++ b/packages/manager/cypress/e2e/core/billing/restricted-user-billing.spec.ts
@@ -6,7 +6,6 @@ import { grantsFactory, profileFactory } from '@linode/utilities';
import { paymentMethodFactory } from '@src/factories';
import { accountUserFactory } from '@src/factories/accountUsers';
import { mockGetPaymentMethods, mockGetUser } from 'support/intercepts/account';
-import { mockAppendFeatureFlags } from 'support/intercepts/feature-flags';
import {
mockGetProfile,
mockGetProfileGrants,
@@ -224,13 +223,6 @@ const assertMakeAPaymentEnabled = () => {
describe('restricted user billing flows', () => {
beforeEach(() => {
mockGetPaymentMethods(mockPaymentMethods);
- // TODO M3-10491 - Remove `iamRbacPrimaryNavChanges` feature flag mock once flag is deleted.
- mockAppendFeatureFlags({
- iamRbacPrimaryNavChanges: true,
- iam: {
- enabled: false,
- },
- });
});
/*
diff --git a/packages/manager/cypress/e2e/core/billing/smoke-billing-activity.spec.ts b/packages/manager/cypress/e2e/core/billing/smoke-billing-activity.spec.ts
index d130776eb56..7d5925f57a8 100644
--- a/packages/manager/cypress/e2e/core/billing/smoke-billing-activity.spec.ts
+++ b/packages/manager/cypress/e2e/core/billing/smoke-billing-activity.spec.ts
@@ -118,8 +118,6 @@ authenticate();
describe('Billing Activity Feed', () => {
beforeEach(() => {
mockAppendFeatureFlags({
- // TODO M3-10491 - Remove `iamRbacPrimaryNavChanges` feature flag mock once flag is deleted.
- iamRbacPrimaryNavChanges: true,
iam: {
enabled: false,
},
diff --git a/packages/manager/cypress/e2e/core/general/smoke-deep-link.spec.ts b/packages/manager/cypress/e2e/core/general/smoke-deep-link.spec.ts
index 183dc7dd047..821ea4a8103 100644
--- a/packages/manager/cypress/e2e/core/general/smoke-deep-link.spec.ts
+++ b/packages/manager/cypress/e2e/core/general/smoke-deep-link.spec.ts
@@ -1,4 +1,3 @@
-import { mockAppendFeatureFlags } from 'support/intercepts/feature-flags';
import { pages } from 'support/ui/constants';
import type { Page } from 'support/ui/constants';
@@ -9,10 +8,6 @@ beforeEach(() => {
describe('smoke - deep links', () => {
beforeEach(() => {
cy.visitWithLogin('/null');
- // TODO M3-10491 - Remove `iamRbacPrimaryNavChanges` feature flag mock once flag is deleted.
- mockAppendFeatureFlags({
- iamRbacPrimaryNavChanges: true,
- }).as('getFeatureFlags');
});
it('Go to each route and validate deep links', () => {
diff --git a/packages/manager/cypress/e2e/core/linodes/maintenance-policy-region-support.spec.ts b/packages/manager/cypress/e2e/core/linodes/maintenance-policy-region-support.spec.ts
index 8126eac56bf..3481b60fa99 100644
--- a/packages/manager/cypress/e2e/core/linodes/maintenance-policy-region-support.spec.ts
+++ b/packages/manager/cypress/e2e/core/linodes/maintenance-policy-region-support.spec.ts
@@ -123,12 +123,6 @@ describe('maintenance policy region support - Linode Details > Settings', () =>
cleanUp(['linodes', 'lke-clusters']);
});
- beforeEach(() => {
- mockAppendFeatureFlags({
- iamRbacPrimaryNavChanges: false,
- }).as('getFeatureFlags');
- });
-
it('disables maintenance policy selector when region does not support it', () => {
// Mock a linode in a region that doesn't support maintenance policies
const mockRegion = regionFactory.build({
diff --git a/packages/manager/cypress/e2e/core/linodes/smoke-linode-landing-table.spec.ts b/packages/manager/cypress/e2e/core/linodes/smoke-linode-landing-table.spec.ts
index 3cacea66f7f..efaa1174406 100644
--- a/packages/manager/cypress/e2e/core/linodes/smoke-linode-landing-table.spec.ts
+++ b/packages/manager/cypress/e2e/core/linodes/smoke-linode-landing-table.spec.ts
@@ -69,9 +69,7 @@ const preferenceOverrides = {
authenticate();
describe('linode landing checks', () => {
beforeEach(() => {
- // TODO M3-10491 - Remove `iamRbacPrimaryNavChanges` feature flag mock once flag is deleted.
mockAppendFeatureFlags({
- iamRbacPrimaryNavChanges: true,
iam: {
enabled: false,
},
@@ -478,10 +476,6 @@ describe('linode landing checks', () => {
describe('linode landing checks for empty state', () => {
beforeEach(() => {
- // TODO M3-10491 - Remove `iamRbacPrimaryNavChanges` feature flag mock once flag is deleted.
- mockAppendFeatureFlags({
- iamRbacPrimaryNavChanges: true,
- });
// Mock setup to display the Linode landing page in an empty state
mockGetLinodes([]).as('getLinodes');
});
@@ -584,10 +578,6 @@ describe('linode landing checks for empty state', () => {
describe('linode landing checks for non-empty state with restricted user', () => {
beforeEach(() => {
- // TODO M3-10491 - Remove `iamRbacPrimaryNavChanges` feature flag mock once flag is deleted.
- mockAppendFeatureFlags({
- iamRbacPrimaryNavChanges: true,
- });
// Mock setup to display the Linode landing page in an non-empty state
const mockLinodes: Linode[] = new Array(1)
.fill(null)
diff --git a/packages/manager/src/GoTo.tsx b/packages/manager/src/GoTo.tsx
index f6221f94afb..791cb6d675c 100644
--- a/packages/manager/src/GoTo.tsx
+++ b/packages/manager/src/GoTo.tsx
@@ -4,11 +4,9 @@ import { useNavigate } from '@tanstack/react-router';
import * as React from 'react';
import { useIsDatabasesEnabled } from './features/Databases/utilities';
-import { usePermissions } from './features/IAM/hooks/usePermissions';
import { useIsMarketplaceV2Enabled } from './features/Marketplace/utils';
import { useIsNetworkLoadBalancerEnabled } from './features/NetworkLoadBalancers/utils';
import { useIsPlacementGroupsEnabled } from './features/PlacementGroups/utils';
-import { useFlags } from './hooks/useFlags';
import { useGlobalKeyboardListener } from './hooks/useGlobalKeyboardListener';
import type { SelectOption } from '@linode/ui';
@@ -18,12 +16,8 @@ export const GoTo = React.memo(() => {
const { data: accountSettings } = useAccountSettings();
- const { iamRbacPrimaryNavChanges } = useFlags();
-
const isManagedAccount = accountSettings?.managed ?? false;
- const { data: permissions } = usePermissions('account', ['is_account_admin']);
-
const { isPlacementGroupsEnabled } = useIsPlacementGroupsEnabled();
const { isDatabasesEnabled } = useIsDatabasesEnabled();
const { isMarketplaceV2FeatureEnabled } = useIsMarketplaceV2Enabled();
@@ -115,22 +109,12 @@ export const GoTo = React.memo(() => {
: 'Quick Deploy Apps',
href: '/linodes/create/marketplace',
},
- ...(iamRbacPrimaryNavChanges
- ? [
- { display: 'Billing', href: '/billing' },
- { display: 'Identity & Access', href: '/iam' },
- { display: 'Login History', href: '/login-history' },
- { display: 'Service Transfers', href: '/service-transfers' },
- { display: 'Maintenance', href: '/maintenance' },
- { display: 'Settings', href: '/settings' },
- ]
- : [
- {
- display: 'Account',
- hide: !permissions.is_account_admin,
- href: '/account/billing',
- },
- ]),
+ { display: 'Billing', href: '/billing' },
+ { display: 'Identity & Access', href: '/iam' },
+ { display: 'Login History', href: '/login-history' },
+ { display: 'Service Transfers', href: '/service-transfers' },
+ { display: 'Maintenance', href: '/maintenance' },
+ { display: 'Settings', href: '/settings' },
{
display: 'Help & Support',
href: '/support',
@@ -141,13 +125,11 @@ export const GoTo = React.memo(() => {
},
],
[
- permissions.is_account_admin,
isDatabasesEnabled,
isManagedAccount,
isMarketplaceV2FeatureEnabled,
isNetworkLoadBalancerEnabled,
isPlacementGroupsEnabled,
- iamRbacPrimaryNavChanges,
]
);
diff --git a/packages/manager/src/components/MaskableText/MaskableTextArea.tsx b/packages/manager/src/components/MaskableText/MaskableTextArea.tsx
index 5075bc68dc9..921e7181ef6 100644
--- a/packages/manager/src/components/MaskableText/MaskableTextArea.tsx
+++ b/packages/manager/src/components/MaskableText/MaskableTextArea.tsx
@@ -1,8 +1,6 @@
import { Typography } from '@linode/ui';
import React from 'react';
-import { useFlags } from 'src/hooks/useFlags';
-
import { Link } from '../Link';
/**
@@ -10,21 +8,11 @@ import { Link } from '../Link';
* Example: Billing Contact info, rather than masking many individual fields
*/
export const MaskableTextAreaCopy = () => {
- const { iamRbacPrimaryNavChanges } = useFlags();
return (
This data is sensitive and hidden for privacy. To unmask all sensitive
data by default, go to{' '}
-
- profile settings
-
- .
+ profile settings.
);
};
diff --git a/packages/manager/src/components/PaymentMethodRow/PaymentMethodRow.test.tsx b/packages/manager/src/components/PaymentMethodRow/PaymentMethodRow.test.tsx
index 62810bba634..f4b47bbceff 100644
--- a/packages/manager/src/components/PaymentMethodRow/PaymentMethodRow.test.tsx
+++ b/packages/manager/src/components/PaymentMethodRow/PaymentMethodRow.test.tsx
@@ -259,6 +259,13 @@ describe('Payment Method Row', () => {
});
it('Opens "Make a Payment" drawer with the payment method preselected if "Make a Payment" action is clicked', async () => {
+ queryMocks.userPermissions.mockReturnValue({
+ data: {
+ make_billing_payment: true,
+ set_default_payment_method: false,
+ delete_payment_method: false,
+ },
+ });
const paymentMethods = [
paymentMethodFactory.build({
type: 'paypal',
@@ -274,23 +281,22 @@ describe('Payment Method Row', () => {
* The component is responsible for rendering the "Make a Payment" drawer,
* and is required for this test. We may want to consider decoupling these components in the future.
*/
- const { getByLabelText, getByTestId, getByText, getAllByTestId } =
- renderWithTheme(
-
-
-
- ,
- {
- initialRoute: '/account/billing',
- }
- );
+ const { getByLabelText, getByText, router } = renderWithTheme(
+
+
+
+ ,
+ {
+ initialRoute: '/billing',
+ }
+ );
const actionMenu = getByLabelText('Action menu for card ending in 1881');
await userEvent.click(actionMenu);
@@ -300,21 +306,12 @@ describe('Payment Method Row', () => {
await userEvent.click(makePaymentButton);
await waitFor(() => {
- expect(getByTestId('drawer')).toBeVisible();
+ expect(router.state.location.pathname).toBe('/billing');
+ });
+ await waitFor(() => {
+ expect(router.state.location.searchStr).toBe(
+ '?action=make-payment&paymentMethodId=12'
+ );
});
-
- expect(getByTestId('drawer-title')).toHaveTextContent('Make a Payment');
-
- const expectedSelectionCard = getAllByTestId('selection-card')[1];
-
- expect(expectedSelectionCard).toBeVisible();
- expect(expectedSelectionCard).toHaveTextContent('1881');
- expect(expectedSelectionCard).toHaveAttribute(
- 'data-qa-selection-card-checked',
- 'true'
- );
-
- // In the future, if we have access to the router's state,
- // we can assert the search params.
});
});
diff --git a/packages/manager/src/components/PaymentMethodRow/PaymentMethodRow.tsx b/packages/manager/src/components/PaymentMethodRow/PaymentMethodRow.tsx
index f01ad45292e..40134cfb8d4 100644
--- a/packages/manager/src/components/PaymentMethodRow/PaymentMethodRow.tsx
+++ b/packages/manager/src/components/PaymentMethodRow/PaymentMethodRow.tsx
@@ -8,7 +8,6 @@ import * as React from 'react';
import { ActionMenu } from 'src/components/ActionMenu/ActionMenu';
import CreditCard from 'src/features/Billing/BillingPanels/BillingSummary/PaymentDrawer/CreditCard';
import { usePermissions } from 'src/features/IAM/hooks/usePermissions';
-import { useFlags } from 'src/hooks/useFlags';
import { ThirdPartyPayment } from './ThirdPartyPayment';
@@ -40,7 +39,6 @@ export const PaymentMethodRow = (props: Props) => {
const { is_default, type } = paymentMethod;
const { enqueueSnackbar } = useSnackbar();
const navigate = useNavigate();
- const flags = useFlags();
const { mutateAsync: makePaymentMethodDefault } =
useMakeDefaultPaymentMethodMutation(props.paymentMethod.id);
@@ -65,7 +63,7 @@ export const PaymentMethodRow = (props: Props) => {
disabled: isChildUser || !permissions.make_billing_payment,
onClick: () => {
navigate({
- to: flags?.iamRbacPrimaryNavChanges ? '/billing' : '/account/billing',
+ to: '/billing',
search: (prev) => ({
...prev,
action: 'make-payment',
diff --git a/packages/manager/src/components/PrimaryNav/PrimaryNav.test.tsx b/packages/manager/src/components/PrimaryNav/PrimaryNav.test.tsx
index 7c078ccc248..de1aa70d4ec 100644
--- a/packages/manager/src/components/PrimaryNav/PrimaryNav.test.tsx
+++ b/packages/manager/src/components/PrimaryNav/PrimaryNav.test.tsx
@@ -494,9 +494,8 @@ describe('PrimaryNav', () => {
expect(queryByTestId('menu-item-Logs')).toBeNull();
});
- it('should show Administration links if iamRbacPrimaryNavChanges flag is enabled', async () => {
+ it('should show Administration links', async () => {
const flags: Partial = {
- iamRbacPrimaryNavChanges: true,
iam: {
beta: true,
enabled: true,
@@ -544,7 +543,6 @@ describe('PrimaryNav', () => {
it('should hide Identity & Access link for non beta users', async () => {
const flags: Partial = {
- iamRbacPrimaryNavChanges: true,
iam: {
beta: true,
enabled: false,
@@ -570,47 +568,6 @@ describe('PrimaryNav', () => {
});
});
- it('should show Account link and hide Administration if iamRbacPrimaryNavChanges flag is disabled', async () => {
- const flags: Partial = {
- iamRbacPrimaryNavChanges: false,
- iam: {
- beta: true,
- enabled: true,
- },
- };
-
- queryMocks.useIsIAMEnabled.mockReturnValue({
- isIAMBeta: true,
- isIAMEnabled: true,
- });
-
- renderWithTheme(, {
- flags,
- });
-
- const adminLink = screen.queryByRole('button', { name: 'Administration' });
- expect(adminLink).toBeNull();
-
- await waitFor(() => {
- expect(screen.queryByRole('link', { name: 'Billing' })).toBeNull();
- expect(screen.queryByRole('link', { name: 'Quotas' })).toBeNull();
- expect(screen.queryByRole('link', { name: 'Login History' })).toBeNull();
- expect(
- screen.queryByRole('link', { name: 'Service Transfers' })
- ).toBeNull();
- expect(screen.queryByRole('link', { name: 'Maintenance' })).toBeNull();
- expect(
- screen.queryByRole('link', { name: 'Account' })
- ).toBeInTheDocument();
- expect(
- screen.queryByRole('link', { name: 'Identity & Access' })
- ).toBeInTheDocument();
- expect(
- screen.queryByRole('link', { name: 'Account Settings' })
- ).toBeNull();
- });
- });
-
it('should show Network Load Balancers menu item if the user has the account capability and the flag is enabled', async () => {
const account = accountFactory.build({
capabilities: ['Network LoadBalancer'],
diff --git a/packages/manager/src/components/PrimaryNav/PrimaryNav.tsx b/packages/manager/src/components/PrimaryNav/PrimaryNav.tsx
index 1a4d0499baa..1aa77fc982f 100644
--- a/packages/manager/src/components/PrimaryNav/PrimaryNav.tsx
+++ b/packages/manager/src/components/PrimaryNav/PrimaryNav.tsx
@@ -114,7 +114,7 @@ export const PrimaryNav = (props: PrimaryNavProps) => {
flags.aclpAlerting?.recentActivity ||
flags.aclpAlerting?.notificationChannels);
- const { iamRbacPrimaryNavChanges, limitsEvolution } = flags;
+ const { limitsEvolution } = flags;
const { isPlacementGroupsEnabled } = useIsPlacementGroupsEnabled();
const { isDatabasesEnabled, isDatabasesV2Beta } = useIsDatabasesEnabled();
@@ -282,36 +282,6 @@ export const PrimaryNav = (props: PrimaryNavProps) => {
name: 'Monitor',
},
{
- icon: ,
- links: [
- {
- display: 'Betas',
- hide: !flags.selfServeBetas,
- to: '/betas',
- },
- {
- display: 'Identity & Access',
- hide: !isIAMEnabled || iamRbacPrimaryNavChanges,
- to: '/iam',
- isBeta: isIAMBeta,
- isNew: !isIAMBeta && showLimitedAvailabilityBadges,
- },
- {
- display: 'Account',
- hide: iamRbacPrimaryNavChanges,
- to: '/account',
- },
- {
- display: 'Help & Support',
- to: '/support',
- },
- ],
- name: 'More',
- },
- ];
-
- if (iamRbacPrimaryNavChanges) {
- groups.splice(groups.length - 1, 0, {
icon: ,
links: [
{
@@ -353,8 +323,23 @@ export const PrimaryNav = (props: PrimaryNavProps) => {
},
],
name: 'Administration',
- });
- }
+ },
+ {
+ icon: ,
+ links: [
+ {
+ display: 'Betas',
+ hide: !flags.selfServeBetas,
+ to: '/betas',
+ },
+ {
+ display: 'Help & Support',
+ to: '/support',
+ },
+ ],
+ name: 'More',
+ },
+ ];
return groups;
},
@@ -369,7 +354,6 @@ export const PrimaryNav = (props: PrimaryNavProps) => {
isACLPLogsEnabled,
isIAMBeta,
isIAMEnabled,
- iamRbacPrimaryNavChanges,
isMarketplaceV2FeatureEnabled,
isNetworkLoadBalancerEnabled,
limitsEvolution,
diff --git a/packages/manager/src/components/TypeToConfirm/TypeToConfirm.test.tsx b/packages/manager/src/components/TypeToConfirm/TypeToConfirm.test.tsx
index 2c18dc04d40..c21a5742fb9 100644
--- a/packages/manager/src/components/TypeToConfirm/TypeToConfirm.test.tsx
+++ b/packages/manager/src/components/TypeToConfirm/TypeToConfirm.test.tsx
@@ -72,7 +72,7 @@ describe('TypeToConfirm Component', () => {
expect(
queryByTestId('instructions-to-enable-or-disable')
).toBeInTheDocument();
- expect(getByRole('link')).toHaveAttribute('href', '/profile/settings');
+ expect(getByRole('link')).toHaveAttribute('href', '/profile/preferences');
});
it('Should not display instructions when toggled to hidden', () => {
diff --git a/packages/manager/src/components/TypeToConfirm/TypeToConfirm.tsx b/packages/manager/src/components/TypeToConfirm/TypeToConfirm.tsx
index 29bb8314cee..389401f1698 100644
--- a/packages/manager/src/components/TypeToConfirm/TypeToConfirm.tsx
+++ b/packages/manager/src/components/TypeToConfirm/TypeToConfirm.tsx
@@ -5,7 +5,6 @@ import type { JSX } from 'react';
import { FormGroup } from 'src/components/FormGroup';
import { Link } from 'src/components/Link';
-import { useFlags } from 'src/hooks/useFlags';
import type { TextFieldProps, TypographyProps } from '@linode/ui';
import type { Theme } from '@mui/material';
@@ -53,8 +52,6 @@ export const TypeToConfirm = (props: TypeToConfirmProps) => {
(preferences) => preferences?.type_to_confirm ?? true
);
- const { iamRbacPrimaryNavChanges } = useFlags();
-
/*
There is an edge case where preferences?.type_to_confirm is undefined
when the user has not yet set a preference as seen in /profile/settings?preferenceEditor=true.
@@ -118,17 +115,7 @@ export const TypeToConfirm = (props: TypeToConfirmProps) => {
sx={{ marginTop: 1 }}
>
To {disableOrEnable} type-to-confirm, go to the Type-to-Confirm
- section of{' '}
-
- {iamRbacPrimaryNavChanges ? 'Preferences' : 'My Settings'}
-
- .
+ section of Preferences.
) : null}
>
diff --git a/packages/manager/src/dev-tools/FeatureFlagTool.tsx b/packages/manager/src/dev-tools/FeatureFlagTool.tsx
index a3b79b4945d..0e6d5373daf 100644
--- a/packages/manager/src/dev-tools/FeatureFlagTool.tsx
+++ b/packages/manager/src/dev-tools/FeatureFlagTool.tsx
@@ -68,7 +68,6 @@ const options: { flag: keyof Flags; label: string }[] = [
label: 'IAM Limited Availability Badges',
},
{ flag: 'iamDelegation', label: 'IAM Delegation (Parent/Child)' },
- { flag: 'iamRbacPrimaryNavChanges', label: 'IAM Primary Nav Changes' },
{
flag: 'linodeCloneFirewall',
label: 'Linode Clone Firewall',
diff --git a/packages/manager/src/featureFlags.ts b/packages/manager/src/featureFlags.ts
index c0bfac6e2fa..b0445bf0f18 100644
--- a/packages/manager/src/featureFlags.ts
+++ b/packages/manager/src/featureFlags.ts
@@ -226,7 +226,6 @@ export interface Flags {
iam: BetaFeatureFlag;
iamDelegation: BaseFeatureFlag;
iamLimitedAvailabilityBadges: boolean;
- iamRbacPrimaryNavChanges: boolean;
ipv6Sharing: boolean;
kubernetesBlackwellPlans: boolean;
limitsEvolution: LimitsEvolution;
diff --git a/packages/manager/src/features/Account/AccountLanding.tsx b/packages/manager/src/features/Account/AccountLanding.tsx
index 0f626cc9850..9e87f756a9b 100644
--- a/packages/manager/src/features/Account/AccountLanding.tsx
+++ b/packages/manager/src/features/Account/AccountLanding.tsx
@@ -1,5 +1,4 @@
import { useAccount, useProfile } from '@linode/queries';
-import { NotFound } from '@linode/ui';
import {
Outlet,
useLocation,
@@ -39,7 +38,7 @@ export const AccountLanding = () => {
});
const { data: account } = useAccount();
const { data: profile } = useProfile();
- const { iamRbacPrimaryNavChanges, limitsEvolution } = useFlags();
+ const { limitsEvolution } = useFlags();
const { data: permissions } = usePermissions('account', [
'make_billing_payment',
@@ -101,16 +100,13 @@ export const AccountLanding = () => {
React.useEffect(() => {
if (match.routeId === '/account/quotas' && !showQuotasTab) {
navigate({
- to: iamRbacPrimaryNavChanges ? '/quotas' : '/account/billing',
+ to: '/quotas',
});
}
- }, [match.routeId, showQuotasTab, navigate, iamRbacPrimaryNavChanges]);
+ }, [match.routeId, showQuotasTab, navigate]);
// This is the default route for the account route, so we need to redirect to the billing tab but keep /account as legacy
if (location.pathname === '/account') {
- if (iamRbacPrimaryNavChanges) {
- return ;
- }
navigate({
to: '/account/billing',
});
@@ -153,7 +149,7 @@ export const AccountLanding = () => {
if (!isAkamaiAccount) {
landingHeaderProps.onButtonClick = () =>
navigate({
- to: iamRbacPrimaryNavChanges ? '/billing' : '/account/billing',
+ to: '/billing',
search: { action: 'make-payment' },
});
}
diff --git a/packages/manager/src/features/Account/AccountLogins.tsx b/packages/manager/src/features/Account/AccountLogins.tsx
index 232a99f4f13..79cdae2ec1c 100644
--- a/packages/manager/src/features/Account/AccountLogins.tsx
+++ b/packages/manager/src/features/Account/AccountLogins.tsx
@@ -15,7 +15,6 @@ import { TableRowEmpty } from 'src/components/TableRowEmpty/TableRowEmpty';
import { TableRowError } from 'src/components/TableRowError/TableRowError';
import { TableRowLoading } from 'src/components/TableRowLoading/TableRowLoading';
import { TableSortCell } from 'src/components/TableSortCell';
-import { useFlags } from 'src/hooks/useFlags';
import { useOrderV2 } from 'src/hooks/useOrderV2';
import { usePaginationV2 } from 'src/hooks/usePaginationV2';
@@ -44,14 +43,11 @@ const useStyles = makeStyles()((theme: Theme) => ({
const AccountLogins = () => {
const { classes } = useStyles();
- const flags = useFlags();
const { data: permissions } = usePermissions('account', [
'list_account_logins',
]);
const pagination = usePaginationV2({
- currentRoute: flags?.iamRbacPrimaryNavChanges
- ? '/login-history'
- : '/account/login-history',
+ currentRoute: '/login-history',
preferenceKey: 'account-logins-pagination',
});
@@ -61,9 +57,7 @@ const AccountLogins = () => {
order: 'desc',
orderBy: 'datetime',
},
- from: flags?.iamRbacPrimaryNavChanges
- ? '/login-history'
- : '/account/login-history',
+ from: '/login-history',
},
preferenceKey: `${preferenceKey}-order`,
});
diff --git a/packages/manager/src/features/Account/Maintenance/MaintenanceTable.tsx b/packages/manager/src/features/Account/Maintenance/MaintenanceTable.tsx
index 8a283a565d7..ec2c6cb9bb7 100644
--- a/packages/manager/src/features/Account/Maintenance/MaintenanceTable.tsx
+++ b/packages/manager/src/features/Account/Maintenance/MaintenanceTable.tsx
@@ -73,9 +73,7 @@ export const MaintenanceTable = ({ type }: Props) => {
const flags = useFlags();
const pagination = usePaginationV2({
- currentRoute: flags?.iamRbacPrimaryNavChanges
- ? `/maintenance`
- : `/account/maintenance`,
+ currentRoute: '/maintenance',
preferenceKey: `${preferenceKey}-${type}`,
queryParamsPrefix: type,
});
@@ -86,9 +84,7 @@ export const MaintenanceTable = ({ type }: Props) => {
order: 'desc',
orderBy: 'status',
},
- from: flags?.iamRbacPrimaryNavChanges
- ? `/maintenance`
- : `/account/maintenance`,
+ from: '/maintenance',
},
preferenceKey: `${preferenceKey}-order-${type}`,
prefix: type,
diff --git a/packages/manager/src/features/Account/Quotas/Quotas.tsx b/packages/manager/src/features/Account/Quotas/Quotas.tsx
index b8517a138a6..c8134935c23 100644
--- a/packages/manager/src/features/Account/Quotas/Quotas.tsx
+++ b/packages/manager/src/features/Account/Quotas/Quotas.tsx
@@ -12,7 +12,6 @@ import * as React from 'react';
import { DocumentTitleSegment } from 'src/components/DocumentTitle';
import { Link } from 'src/components/Link';
-import { useFlags } from 'src/hooks/useFlags';
import { QuotasTable } from './QuotasTable';
import { useGetLocationsForQuotaService } from './utils';
@@ -23,7 +22,6 @@ import type { Theme } from '@mui/material';
export const Quotas = () => {
const navigate = useNavigate();
- const flags = useFlags();
const [selectedLocation, setSelectedLocation] =
React.useState>(null);
@@ -72,9 +70,7 @@ export const Quotas = () => {
value: value?.value,
});
navigate({
- to: flags?.iamRbacPrimaryNavChanges
- ? '/quotas'
- : '/account/quotas',
+ to: '/quotas',
});
}}
options={
diff --git a/packages/manager/src/features/Account/Quotas/QuotasTable.tsx b/packages/manager/src/features/Account/Quotas/QuotasTable.tsx
index c07e4b77882..1f69998f8c7 100644
--- a/packages/manager/src/features/Account/Quotas/QuotasTable.tsx
+++ b/packages/manager/src/features/Account/Quotas/QuotasTable.tsx
@@ -12,7 +12,6 @@ import { TableHead } from 'src/components/TableHead';
import { TableRow } from 'src/components/TableRow/TableRow';
import { TableRowEmpty } from 'src/components/TableRowEmpty/TableRowEmpty';
import { TableRowLoading } from 'src/components/TableRowLoading/TableRowLoading';
-import { useFlags } from 'src/hooks/useFlags';
import { usePaginationV2 } from 'src/hooks/usePaginationV2';
import { QuotasIncreaseForm } from './QuotasIncreaseForm';
@@ -32,12 +31,9 @@ interface QuotasTableProps {
export const QuotasTable = (props: QuotasTableProps) => {
const { selectedLocation, selectedService } = props;
- const flags = useFlags();
const navigate = useNavigate();
const pagination = usePaginationV2({
- currentRoute: flags?.iamRbacPrimaryNavChanges
- ? '/quotas'
- : '/account/quotas',
+ currentRoute: '/quotas',
initialPage: 1,
preferenceKey: 'quotas-table',
});
diff --git a/packages/manager/src/features/AccountSettings/AccountSettingsLanding.tsx b/packages/manager/src/features/AccountSettings/AccountSettingsLanding.tsx
index 4873963450c..2ca48dee716 100644
--- a/packages/manager/src/features/AccountSettings/AccountSettingsLanding.tsx
+++ b/packages/manager/src/features/AccountSettings/AccountSettingsLanding.tsx
@@ -1,27 +1,15 @@
-import { Navigate, useLocation } from '@tanstack/react-router';
import * as React from 'react';
import { DocumentTitleSegment } from 'src/components/DocumentTitle';
import { LandingHeader } from 'src/components/LandingHeader';
import { MaintenanceBannerV2 } from 'src/components/MaintenanceBanner/MaintenanceBannerV2';
import { PlatformMaintenanceBanner } from 'src/components/PlatformMaintenanceBanner/PlatformMaintenanceBanner';
-import { useFlags } from 'src/hooks/useFlags';
import GlobalSettings from '../Account/GlobalSettings';
import type { LandingHeaderProps } from 'src/components/LandingHeader';
export const AccountSettingsLanding = () => {
- const flags = useFlags();
- const location = useLocation();
-
- if (
- !flags?.iamRbacPrimaryNavChanges &&
- location.pathname !== '/account/settings'
- ) {
- return ;
- }
-
const landingHeaderProps: LandingHeaderProps = {
title: 'Account Settings',
};
diff --git a/packages/manager/src/features/Billing/BillingDetail.test.tsx b/packages/manager/src/features/Billing/BillingDetail.test.tsx
index 493a6cd871d..39cd1e25b72 100644
--- a/packages/manager/src/features/Billing/BillingDetail.test.tsx
+++ b/packages/manager/src/features/Billing/BillingDetail.test.tsx
@@ -1,13 +1,43 @@
import * as React from 'react';
+import { accountFactory } from 'src/factories';
import { renderWithTheme } from 'src/utilities/testHelpers';
import { BillingDetail } from './BillingDetail';
-describe('Account Landing', () => {
+const queryMocks = vi.hoisted(() => ({
+ userPermissions: vi.fn(() => ({
+ data: {
+ list_billing_payments: true,
+ },
+ })),
+ useAccount: vi.fn().mockReturnValue({}),
+}));
+
+vi.mock('@linode/queries', async () => {
+ const actual = await vi.importActual('@linode/queries');
+ return {
+ ...actual,
+ useAccount: queryMocks.useAccount,
+ };
+});
+
+vi.mock('src/features/IAM/hooks/usePermissions', () => ({
+ usePermissions: queryMocks.userPermissions,
+}));
+
+describe('Billing Detail', () => {
it('should render', async () => {
+ const account = accountFactory.build({});
+
+ queryMocks.useAccount.mockReturnValue({
+ data: account,
+ isLoading: false,
+ error: null,
+ });
+
const { findByTestId, findByText } = renderWithTheme(, {
- initialRoute: '/account/billing',
+ initialRoute: '/billing',
});
await findByTestId('billing-detail');
await findByText('Account Balance');
diff --git a/packages/manager/src/features/Billing/BillingLanding/BillingLanding.tsx b/packages/manager/src/features/Billing/BillingLanding/BillingLanding.tsx
index 62baffaf790..a79a7d21935 100644
--- a/packages/manager/src/features/Billing/BillingLanding/BillingLanding.tsx
+++ b/packages/manager/src/features/Billing/BillingLanding/BillingLanding.tsx
@@ -1,5 +1,5 @@
import { useAccount, useProfile } from '@linode/queries';
-import { Navigate, useLocation, useNavigate } from '@tanstack/react-router';
+import { useNavigate } from '@tanstack/react-router';
import * as React from 'react';
import { DocumentTitleSegment } from 'src/components/DocumentTitle';
@@ -9,7 +9,6 @@ import { switchAccountSessionContext } from 'src/context/switchAccountSessionCon
import { useIsParentTokenExpired } from 'src/features/Account/SwitchAccounts/useIsParentTokenExpired';
import { getRestrictedResourceText } from 'src/features/Account/utils';
import { useIsIAMDelegationEnabled } from 'src/features/IAM/hooks/useIsIAMEnabled';
-import { useFlags } from 'src/hooks/useFlags';
import { useRestrictedGlobalGrantCheck } from 'src/hooks/useRestrictedGlobalGrantCheck';
import { sendSwitchAccountEvent } from 'src/utilities/analytics/customEventAnalytics';
@@ -22,9 +21,7 @@ import { BillingDetail } from '../BillingDetail';
import type { LandingHeaderProps } from 'src/components/LandingHeader';
export const BillingLanding = () => {
- const flags = useFlags();
const navigate = useNavigate();
- const location = useLocation();
const { data: account } = useAccount();
const { data: profile } = useProfile();
@@ -36,7 +33,6 @@ export const BillingLanding = () => {
const [isDrawerOpen, setIsDrawerOpen] = React.useState(false);
const sessionContext = React.useContext(switchAccountSessionContext);
- const isIAMRbacPrimaryNavChangesEnabled = flags?.iamRbacPrimaryNavChanges;
const isAkamaiAccount = account?.billing_source === 'akamai';
const isProxyUser = profile?.user_type === 'proxy';
const isChildUser = profile?.user_type === 'child';
@@ -52,13 +48,6 @@ export const BillingLanding = () => {
const isReadOnly = !permissions.make_billing_payment || isChildUser;
- if (
- !isIAMRbacPrimaryNavChangesEnabled &&
- location.pathname !== '/account/billing'
- ) {
- return ;
- }
-
const canSwitchBetweenParentOrProxyAccount = isIAMDelegationEnabled
? isParentUser
: (!isChildAccountAccessRestricted && isParentUser) || isProxyUser;
diff --git a/packages/manager/src/features/Billing/BillingPanels/BillingActivityPanel/BillingActivityPanel.tsx b/packages/manager/src/features/Billing/BillingPanels/BillingActivityPanel/BillingActivityPanel.tsx
index 15a423c635c..b979abf6117 100644
--- a/packages/manager/src/features/Billing/BillingPanels/BillingActivityPanel/BillingActivityPanel.tsx
+++ b/packages/manager/src/features/Billing/BillingPanels/BillingActivityPanel/BillingActivityPanel.tsx
@@ -187,9 +187,7 @@ export const BillingActivityPanel = React.memo((props: Props) => {
const flags = useFlags();
const pagination = usePaginationV2({
- currentRoute: flags?.iamRbacPrimaryNavChanges
- ? '/billing'
- : '/account/billing',
+ currentRoute: '/billing',
preferenceKey: 'billing-activity-pagination',
});
const { handleOrderChange, order, orderBy } = useOrderV2({
@@ -198,7 +196,7 @@ export const BillingActivityPanel = React.memo((props: Props) => {
order: 'desc',
orderBy: 'amount',
},
- from: flags?.iamRbacPrimaryNavChanges ? '/billing' : '/account/billing',
+ from: '/billing',
},
preferenceKey: 'billing-activity-order',
});
@@ -560,8 +558,6 @@ interface ActivityFeedItemProps extends ActivityFeedItem {
export const ActivityFeedItem = React.memo((props: ActivityFeedItemProps) => {
const { classes } = useStyles();
- const { iamRbacPrimaryNavChanges } = useFlags();
-
const {
canViewInvoiceDetails,
date,
@@ -594,15 +590,7 @@ export const ActivityFeedItem = React.memo((props: ActivityFeedItemProps) => {
{type === 'invoice' && canViewInvoiceDetails ? (
-
- {label}
-
+ {label}
) : (
label
)}
diff --git a/packages/manager/src/features/Billing/BillingPanels/BillingSummary/BillingSummary.test.tsx b/packages/manager/src/features/Billing/BillingPanels/BillingSummary/BillingSummary.test.tsx
index 51ec9c4a297..550e4b0a934 100644
--- a/packages/manager/src/features/Billing/BillingPanels/BillingSummary/BillingSummary.test.tsx
+++ b/packages/manager/src/features/Billing/BillingPanels/BillingSummary/BillingSummary.test.tsx
@@ -39,7 +39,7 @@ describe('BillingSummary', () => {
,
{
- initialRoute: '/account/billing',
+ initialRoute: '/billing',
}
);
within(screen.getByTestId(accountBalanceText)).getByText(/no balance/i);
@@ -56,7 +56,7 @@ describe('BillingSummary', () => {
/>
,
{
- initialRoute: '/account/billing',
+ initialRoute: '/billing',
}
);
within(screen.getByTestId(accountBalanceText)).getByText(/credit/i);
@@ -73,7 +73,7 @@ describe('BillingSummary', () => {
/>
,
{
- initialRoute: '/account/billing',
+ initialRoute: '/billing',
}
);
within(screen.getByTestId(accountBalanceText)).getByText(/Balance/i);
@@ -86,7 +86,7 @@ describe('BillingSummary', () => {
,
{
- initialRoute: '/account/billing',
+ initialRoute: '/billing',
}
);
expect(screen.queryByText('Promotions')).not.toBeInTheDocument();
@@ -119,7 +119,7 @@ describe('BillingSummary', () => {
/>
,
{
- initialRoute: '/account/billing',
+ initialRoute: '/billing',
}
);
const getByTextWithMarkup = withMarkup(screen.getByText);
@@ -142,7 +142,7 @@ describe('BillingSummary', () => {
promotions={promotions}
/>,
{
- initialRoute: '/account/billing',
+ initialRoute: '/billing',
}
);
expect(screen.queryByText('Applies to: All')).not.toBeInTheDocument();
@@ -155,27 +155,27 @@ describe('BillingSummary', () => {
,
{
- initialRoute: '/account/billing',
+ initialRoute: '/billing',
}
);
within(screen.getByTestId('accrued-charges-value')).getByText('$5.00');
});
it('opens "Make a Payment" drawer when "Make a payment." is clicked', async () => {
- const { getByTestId, getByText } = renderWithTheme(
+ const { getByText, router } = renderWithTheme(
,
{
- initialRoute: '/account/billing',
+ initialRoute: '/billing',
}
);
const paymentButton = getByText('Make a payment', { exact: false });
await userEvent.click(paymentButton);
- expect(getByTestId('drawer')).toBeVisible();
- expect(getByTestId('drawer-title').textContent).toEqual('Make a Payment');
+ expect(router.state.location.pathname).toBe('/billing');
+ expect(router.state.location.searchStr).toBe('?action=make-payment');
});
it('does not display the "Add a promo code" button if user does not have create_promo_code permission', async () => {
@@ -184,7 +184,7 @@ describe('BillingSummary', () => {
,
{
- initialRoute: '/account/billing',
+ initialRoute: '/billing',
}
);
expect(queryByText('Add a promo code')).not.toBeInTheDocument();
@@ -206,7 +206,7 @@ describe('BillingSummary', () => {
/>
,
{
- initialRoute: '/account/billing',
+ initialRoute: '/billing',
}
);
expect(queryByText('Add a promo code')).toBeInTheDocument();
diff --git a/packages/manager/src/features/Billing/BillingPanels/BillingSummary/BillingSummary.tsx b/packages/manager/src/features/Billing/BillingPanels/BillingSummary/BillingSummary.tsx
index c6c827abbfc..c8815233282 100644
--- a/packages/manager/src/features/Billing/BillingPanels/BillingSummary/BillingSummary.tsx
+++ b/packages/manager/src/features/Billing/BillingPanels/BillingSummary/BillingSummary.tsx
@@ -7,7 +7,6 @@ import * as React from 'react';
import { Currency } from 'src/components/Currency';
import { usePermissions } from 'src/features/IAM/hooks/usePermissions';
-import { useFlags } from 'src/hooks/useFlags';
import { isWithinDays } from 'src/utilities/date';
import { BillingPaper } from '../../BillingDetail';
@@ -17,6 +16,7 @@ import { PromoDisplay } from './PromoDisplay';
import type { PaymentMethod } from '@linode/api-v4';
import type { ActivePromotion } from '@linode/api-v4/lib/account/types';
+import type { BillingSearch } from 'src/routes/billing';
interface BillingSummaryProps {
balance: number;
@@ -35,15 +35,13 @@ export const BillingSummary = (props: BillingSummaryProps) => {
'create_promo_code',
]);
- const { iamRbacPrimaryNavChanges } = useFlags();
-
const [isPromoDialogOpen, setIsPromoDialogOpen] =
React.useState(false);
const { data: grants } = useGrants();
const accountAccessGrant = grants?.global?.account_access;
const readOnlyAccountAccess = accountAccessGrant === 'read_only';
- const url = iamRbacPrimaryNavChanges ? '/billing' : '/account/billing';
+ const url = '/billing';
// If a user has a payment_due notification with a severity of critical, it indicates that they are outside of any grace period they may have and payment is due immediately.
const isBalanceOutsideGracePeriod = notifications?.some(
@@ -82,6 +80,10 @@ export const BillingSummary = (props: BillingSummaryProps) => {
setSelectedPaymentMethod(undefined);
navigate({
to: url,
+ search: (prev: BillingSearch) => ({
+ ...prev,
+ action: prev.action === 'make-payment' ? undefined : prev.action,
+ }),
});
}, [navigate]);
diff --git a/packages/manager/src/features/Billing/BillingPanels/ContactInfoPanel/ContactInformation.tsx b/packages/manager/src/features/Billing/BillingPanels/ContactInfoPanel/ContactInformation.tsx
index 22887d2b41e..c11c952ed0a 100644
--- a/packages/manager/src/features/Billing/BillingPanels/ContactInfoPanel/ContactInformation.tsx
+++ b/packages/manager/src/features/Billing/BillingPanels/ContactInfoPanel/ContactInformation.tsx
@@ -11,7 +11,6 @@ import { getRestrictedResourceText } from 'src/features/Account/utils';
import { EDIT_BILLING_CONTACT } from 'src/features/Billing/constants';
import { usePermissions } from 'src/features/IAM/hooks/usePermissions';
import { StyledAutorenewIcon } from 'src/features/TopMenu/NotificationMenu/NotificationMenu';
-import { useFlags } from 'src/hooks/useFlags';
import {
BillingActionButton,
@@ -60,7 +59,6 @@ export const ContactInformation = React.memo((props: Props) => {
zip,
} = props;
- const { iamRbacPrimaryNavChanges } = useFlags();
const navigate = useNavigate();
const { contactDrawerOpen, focusEmail } = useSearch({
strict: false,
@@ -84,7 +82,7 @@ export const ContactInformation = React.memo((props: Props) => {
const handleEditDrawerOpen = () => {
navigate({
- to: iamRbacPrimaryNavChanges ? '/billing' : '/account/billing',
+ to: '/billing',
search: (prev) => ({
...prev,
action: 'edit',
@@ -191,7 +189,7 @@ export const ContactInformation = React.memo((props: Props) => {
{(firstName || lastName) && (
{firstName} {lastName}
@@ -199,7 +197,7 @@ export const ContactInformation = React.memo((props: Props) => {
{company && (
{company}
@@ -259,7 +257,7 @@ export const ContactInformation = React.memo((props: Props) => {
focusEmail={Boolean(focusEmail)}
onClose={() => {
navigate({
- to: iamRbacPrimaryNavChanges ? '/billing' : '/account/billing',
+ to: '/billing',
search: undefined,
});
}}
diff --git a/packages/manager/src/features/Billing/BillingPanels/PaymentInfoPanel/PaymentInformation.test.tsx b/packages/manager/src/features/Billing/BillingPanels/PaymentInfoPanel/PaymentInformation.test.tsx
index 5b200eae0d7..53ba61167c6 100644
--- a/packages/manager/src/features/Billing/BillingPanels/PaymentInfoPanel/PaymentInformation.test.tsx
+++ b/packages/manager/src/features/Billing/BillingPanels/PaymentInfoPanel/PaymentInformation.test.tsx
@@ -68,7 +68,7 @@ describe('Payment Info Panel', () => {
,
{
- initialRoute: '/account/billing',
+ initialRoute: '/billing',
}
);
@@ -81,7 +81,7 @@ describe('Payment Info Panel', () => {
,
{
- initialRoute: '/account/billing',
+ initialRoute: '/billing',
}
);
@@ -105,7 +105,7 @@ describe('Payment Info Panel', () => {
,
{
- initialRoute: '/account/billing',
+ initialRoute: '/billing',
}
);
@@ -122,7 +122,7 @@ describe('Payment Info Panel', () => {
,
{
- initialRoute: '/account/billing',
+ initialRoute: '/billing',
}
);
@@ -139,7 +139,7 @@ describe('Payment Info Panel', () => {
,
{
- initialRoute: '/account/billing',
+ initialRoute: '/billing',
}
);
@@ -168,7 +168,7 @@ describe('Payment Info Panel', () => {
/>
,
{
- initialRoute: '/account/billing',
+ initialRoute: '/billing',
}
);
@@ -195,7 +195,7 @@ describe('Payment Info Panel', () => {
,
{
- initialRoute: '/account/billing',
+ initialRoute: '/billing',
}
);
diff --git a/packages/manager/src/features/Billing/BillingPanels/PaymentInfoPanel/PaymentInformation.tsx b/packages/manager/src/features/Billing/BillingPanels/PaymentInfoPanel/PaymentInformation.tsx
index c7919c408bb..7d1faa87877 100644
--- a/packages/manager/src/features/Billing/BillingPanels/PaymentInfoPanel/PaymentInformation.tsx
+++ b/packages/manager/src/features/Billing/BillingPanels/PaymentInfoPanel/PaymentInformation.tsx
@@ -11,7 +11,6 @@ import { getRestrictedResourceText } from 'src/features/Account/utils';
import { PaymentMethods } from 'src/features/Billing/BillingPanels/PaymentInfoPanel/PaymentMethods';
import { ADD_PAYMENT_METHOD } from 'src/features/Billing/constants';
import { usePermissions } from 'src/features/IAM/hooks/usePermissions';
-import { useFlags } from 'src/hooks/useFlags';
import { getAPIErrorOrDefault } from 'src/utilities/errorUtils';
import {
@@ -24,7 +23,7 @@ import { AddPaymentMethodDrawer } from './AddPaymentMethodDrawer/AddPaymentMetho
import type { Profile } from '@linode/api-v4';
import type { PaymentMethod } from '@linode/api-v4/lib/account';
import type { APIError } from '@linode/api-v4/lib/types';
-
+import type { BillingSearch } from 'src/routes/billing';
interface Props {
error?: APIError[] | null;
isAkamaiCustomer: boolean;
@@ -35,9 +34,8 @@ interface Props {
const PaymentInformation = (props: Props) => {
const { error, isAkamaiCustomer, loading, paymentMethods, profile } = props;
- const { iamRbacPrimaryNavChanges } = useFlags();
const search = useSearch({
- from: iamRbacPrimaryNavChanges ? '/billing' : '/account/billing',
+ from: '/billing',
});
const [addDrawerOpen, setAddDrawerOpen] = React.useState(false);
const navigate = useNavigate();
@@ -81,7 +79,11 @@ const PaymentInformation = (props: Props) => {
const closeAddDrawer = React.useCallback(() => {
setAddDrawerOpen(false);
navigate({
- to: iamRbacPrimaryNavChanges ? '/billing' : '/account/billing',
+ to: '/billing',
+ search: (prev: BillingSearch) => ({
+ ...prev,
+ action: prev.action === 'add-payment-method' ? undefined : prev.action,
+ }),
});
}, [navigate]);
@@ -122,9 +124,7 @@ const PaymentInformation = (props: Props) => {
disableTouchRipple
onClick={() =>
navigate({
- to: iamRbacPrimaryNavChanges
- ? '/billing'
- : '/account/billing',
+ to: '/billing',
search: (prev) => ({
...prev,
action: 'add-payment-method',
diff --git a/packages/manager/src/features/Billing/InvoiceDetail/InvoiceDetail.tsx b/packages/manager/src/features/Billing/InvoiceDetail/InvoiceDetail.tsx
index 2f960224287..26d484a8dec 100644
--- a/packages/manager/src/features/Billing/InvoiceDetail/InvoiceDetail.tsx
+++ b/packages/manager/src/features/Billing/InvoiceDetail/InvoiceDetail.tsx
@@ -37,9 +37,7 @@ export const InvoiceDetail = () => {
const flags = useFlags();
const { invoiceId } = useParams({
- from: flags?.iamRbacPrimaryNavChanges
- ? '/billing/invoices/$invoiceId'
- : '/account/billing/invoices/$invoiceId',
+ from: '/billing/invoices/$invoiceId',
});
const theme = useTheme();
const { data: permissions } = usePermissions('account', [
@@ -150,11 +148,7 @@ export const InvoiceDetail = () => {
{
const navigate = useNavigate();
- const flags = useFlags();
const { error, isPending, mutateAsync: createTransfer } = useCreateTransfer();
const queryClient = useQueryClient();
@@ -79,9 +77,7 @@ export const EntityTransfersCreate = () => {
queryKey: [entityTransfersQueryKey],
});
navigate({
- to: flags?.iamRbacPrimaryNavChanges
- ? '/service-transfers'
- : '/account/service-transfers',
+ to: '/service-transfers',
state: (prev) => ({ ...prev, transfer }),
});
},
@@ -96,7 +92,7 @@ export const EntityTransfersCreate = () => {
crumbOverrides: [
{
label: 'Service Transfers',
- position: flags?.iamRbacPrimaryNavChanges ? 1 : 2,
+ position: 1,
},
],
labelOptions: { noCap: true },
diff --git a/packages/manager/src/features/EntityTransfers/EntityTransfersCreate/LinodeTransferTable.tsx b/packages/manager/src/features/EntityTransfers/EntityTransfersCreate/LinodeTransferTable.tsx
index 5fba61fe051..e3bab7c04ed 100644
--- a/packages/manager/src/features/EntityTransfers/EntityTransfersCreate/LinodeTransferTable.tsx
+++ b/packages/manager/src/features/EntityTransfers/EntityTransfersCreate/LinodeTransferTable.tsx
@@ -11,7 +11,6 @@ import * as React from 'react';
import { SelectableTableRow } from 'src/components/SelectableTableRow/SelectableTableRow';
import { TableCell } from 'src/components/TableCell';
import { TableContentWrapper } from 'src/components/TableContentWrapper/TableContentWrapper';
-import { useFlags } from 'src/hooks/useFlags';
import { usePaginationV2 } from 'src/hooks/usePaginationV2';
import { extendType } from 'src/utilities/extendType';
@@ -37,14 +36,11 @@ export const LinodeTransferTable = React.memo((props: Props) => {
selectedLinodes,
disabled,
} = props;
- const flags = useFlags();
const [searchText, setSearchText] = React.useState('');
const pagination = usePaginationV2({
- currentRoute: flags?.iamRbacPrimaryNavChanges
- ? '/service-transfers/create'
- : '/account/service-transfers/create',
+ currentRoute: '/service-transfers/create',
initialPage: 1,
preferenceKey: 'linode-transfer-table',
});
diff --git a/packages/manager/src/features/EntityTransfers/EntityTransfersLanding/EntityTransfersLanding.tsx b/packages/manager/src/features/EntityTransfers/EntityTransfersLanding/EntityTransfersLanding.tsx
index c25ead2b8d2..1d8222b5564 100644
--- a/packages/manager/src/features/EntityTransfers/EntityTransfersLanding/EntityTransfersLanding.tsx
+++ b/packages/manager/src/features/EntityTransfers/EntityTransfersLanding/EntityTransfersLanding.tsx
@@ -4,7 +4,6 @@ import { useLocation, useNavigate } from '@tanstack/react-router';
import * as React from 'react';
import { usePermissions } from 'src/features/IAM/hooks/usePermissions';
-import { useFlags } from 'src/hooks/useFlags';
import { usePaginationV2 } from 'src/hooks/usePaginationV2';
import { TransfersTable } from '../TransfersTable';
@@ -21,17 +20,14 @@ export const EntityTransfersLanding = () => {
const location = useLocation();
const navigate = useNavigate();
- const flags = useFlags();
- const url = flags?.iamRbacPrimaryNavChanges
- ? '/service-transfers'
- : '/account/service-transfers';
+ const URL = '/service-transfers';
const handleCloseSuccessDialog = () => {
setSuccessDialogOpen(false);
setTransfer(undefined);
navigate({
- to: url,
+ to: URL,
state: (prev) => ({ ...prev, transfer: undefined }),
});
};
@@ -53,19 +49,19 @@ export const EntityTransfersLanding = () => {
const paginationPendingTransfers = usePaginationV2({
initialPage,
- currentRoute: url,
+ currentRoute: URL,
preferenceKey: pendingTransfersTablePreferenceKey,
queryParamsPrefix: pendingTransfersTablePreferenceKey,
});
const paginationReceivedTransfers = usePaginationV2({
initialPage,
- currentRoute: url,
+ currentRoute: URL,
preferenceKey: receivedTransfersTablePreferenceKey,
queryParamsPrefix: receivedTransfersTablePreferenceKey,
});
const paginationSentTransfers = usePaginationV2({
initialPage,
- currentRoute: url,
+ currentRoute: URL,
preferenceKey: sentTransfersTablePreferenceKey,
queryParamsPrefix: sentTransfersTablePreferenceKey,
});
diff --git a/packages/manager/src/features/EntityTransfers/EntityTransfersLanding/TransferControls.tsx b/packages/manager/src/features/EntityTransfers/EntityTransfersLanding/TransferControls.tsx
index 4171b98e4e3..42a768f3616 100644
--- a/packages/manager/src/features/EntityTransfers/EntityTransfersLanding/TransferControls.tsx
+++ b/packages/manager/src/features/EntityTransfers/EntityTransfersLanding/TransferControls.tsx
@@ -1,8 +1,6 @@
import { useNavigate } from '@tanstack/react-router';
import * as React from 'react';
-import { useFlags } from 'src/hooks/useFlags';
-
import { ConfirmTransferDialog } from './ConfirmTransferDialog';
import {
StyledLabelWrapperGrid,
@@ -24,7 +22,6 @@ interface Props {
export const TransferControls = React.memo((props: Props) => {
const { permissions } = props;
- const flags = useFlags();
const [token, setToken] = React.useState('');
const [confirmDialogOpen, setConfirmDialogOpen] = React.useState(false);
@@ -42,9 +39,7 @@ export const TransferControls = React.memo((props: Props) => {
const handleCreateTransfer = () =>
navigate({
- to: flags?.iamRbacPrimaryNavChanges
- ? '/service-transfers/create'
- : '/account/service-transfers/create',
+ to: '/service-transfers/create',
});
return (
diff --git a/packages/manager/src/features/GlobalNotifications/CreditCardExpiredBanner.tsx b/packages/manager/src/features/GlobalNotifications/CreditCardExpiredBanner.tsx
index 2439451324f..e319110e15a 100644
--- a/packages/manager/src/features/GlobalNotifications/CreditCardExpiredBanner.tsx
+++ b/packages/manager/src/features/GlobalNotifications/CreditCardExpiredBanner.tsx
@@ -4,12 +4,10 @@ import { useNavigate } from '@tanstack/react-router';
import * as React from 'react';
import { DismissibleBanner } from 'src/components/DismissibleBanner/DismissibleBanner';
-import { useFlags } from 'src/hooks/useFlags';
import { isCreditCardExpired } from 'src/utilities/creditCard';
export const CreditCardExpiredBanner = () => {
const navigate = useNavigate();
- const flags = useFlags();
const { data: account } = useAccount();
@@ -33,9 +31,7 @@ export const CreditCardExpiredBanner = () => {
buttonType="primary"
onClick={() =>
navigate({
- to: flags?.iamRbacPrimaryNavChanges
- ? '/billing'
- : '/account/billing',
+ to: '/billing',
})
}
>
diff --git a/packages/manager/src/features/GlobalNotifications/EmailBounce.tsx b/packages/manager/src/features/GlobalNotifications/EmailBounce.tsx
index a31a827bcf6..f75a6513c98 100644
--- a/packages/manager/src/features/GlobalNotifications/EmailBounce.tsx
+++ b/packages/manager/src/features/GlobalNotifications/EmailBounce.tsx
@@ -13,8 +13,6 @@ import { useNavigate } from '@tanstack/react-router';
import { useSnackbar } from 'notistack';
import * as React from 'react';
-import { useFlags } from 'src/hooks/useFlags';
-
import { StyledGrid } from './EmailBounce.styles';
import type { Theme } from '@mui/material/styles';
@@ -28,7 +26,6 @@ export const EmailBounceNotificationSection = React.memo(() => {
const { data: profile } = useProfile();
const { mutateAsync: updateProfile } = useMutateProfile();
const { data: notifications } = useNotificationsQuery();
- const flags = useFlags();
const navigate = useNavigate();
@@ -57,9 +54,7 @@ export const EmailBounceNotificationSection = React.memo(() => {
navigate({
- to: flags?.iamRbacPrimaryNavChanges
- ? '/billing'
- : '/account/billing',
+ to: '/billing',
search: { contactDrawerOpen: true, focusEmail: true },
})
}
diff --git a/packages/manager/src/features/GlobalNotifications/TaxCollectionBanner.tsx b/packages/manager/src/features/GlobalNotifications/TaxCollectionBanner.tsx
index daf7e336b1c..f46f027477a 100644
--- a/packages/manager/src/features/GlobalNotifications/TaxCollectionBanner.tsx
+++ b/packages/manager/src/features/GlobalNotifications/TaxCollectionBanner.tsx
@@ -56,7 +56,7 @@ export const TaxCollectionBanner = () => {
buttonType="primary"
onClick={() =>
navigate({
- to: flags?.iamRbacPrimaryNavChanges ? '/billing' : '/account/billing',
+ to: '/billing',
search: { action: 'edit' },
})
}
diff --git a/packages/manager/src/features/LoginHistory/LoginHistoryLanding.tsx b/packages/manager/src/features/LoginHistory/LoginHistoryLanding.tsx
index 64c56618cd6..1ca9509c0ca 100644
--- a/packages/manager/src/features/LoginHistory/LoginHistoryLanding.tsx
+++ b/packages/manager/src/features/LoginHistory/LoginHistoryLanding.tsx
@@ -1,26 +1,14 @@
-import { Navigate, useLocation } from '@tanstack/react-router';
import * as React from 'react';
import { LandingHeader } from 'src/components/LandingHeader';
import { MaintenanceBannerV2 } from 'src/components/MaintenanceBanner/MaintenanceBannerV2';
import { PlatformMaintenanceBanner } from 'src/components/PlatformMaintenanceBanner/PlatformMaintenanceBanner';
-import { useFlags } from 'src/hooks/useFlags';
import AccountLogins from '../Account/AccountLogins';
import type { LandingHeaderProps } from 'src/components/LandingHeader';
export const LoginHistoryLanding = () => {
- const flags = useFlags();
- const location = useLocation();
-
- if (
- !flags?.iamRbacPrimaryNavChanges &&
- location.pathname !== '/account/login-history'
- ) {
- return ;
- }
-
const landingHeaderProps: LandingHeaderProps = {
title: 'Login History',
};
diff --git a/packages/manager/src/features/Maintenance/MaintenanceLanding.tsx b/packages/manager/src/features/Maintenance/MaintenanceLanding.tsx
index 5e8625fd98e..deff1eba5a5 100644
--- a/packages/manager/src/features/Maintenance/MaintenanceLanding.tsx
+++ b/packages/manager/src/features/Maintenance/MaintenanceLanding.tsx
@@ -1,26 +1,14 @@
-import { Navigate, useLocation } from '@tanstack/react-router';
import * as React from 'react';
import { LandingHeader } from 'src/components/LandingHeader';
import { MaintenanceBannerV2 } from 'src/components/MaintenanceBanner/MaintenanceBannerV2';
import { PlatformMaintenanceBanner } from 'src/components/PlatformMaintenanceBanner/PlatformMaintenanceBanner';
-import { useFlags } from 'src/hooks/useFlags';
import { default as AccountMaintenanceLanding } from '../Account/Maintenance/MaintenanceLanding';
import type { LandingHeaderProps } from 'src/components/LandingHeader';
export const MaintenanceLanding = () => {
- const flags = useFlags();
- const location = useLocation();
-
- if (
- !flags?.iamRbacPrimaryNavChanges &&
- location.pathname !== '/account/maintenance'
- ) {
- return ;
- }
-
const landingHeaderProps: LandingHeaderProps = {
title: 'Maintenance',
};
diff --git a/packages/manager/src/features/ObjectStorage/SummaryLanding/hooks/useGetObjUsagePerEndpoint.ts b/packages/manager/src/features/ObjectStorage/SummaryLanding/hooks/useGetObjUsagePerEndpoint.ts
index b0a56513c5d..ead2923c296 100644
--- a/packages/manager/src/features/ObjectStorage/SummaryLanding/hooks/useGetObjUsagePerEndpoint.ts
+++ b/packages/manager/src/features/ObjectStorage/SummaryLanding/hooks/useGetObjUsagePerEndpoint.ts
@@ -1,5 +1,4 @@
import { quotaQueries, useQueries, useQuotasQuery } from '@linode/queries';
-import { useFlags } from 'launchdarkly-react-client-sdk';
import * as React from 'react';
import { getQuotasFilters } from 'src/features/Account/Quotas/utils';
@@ -10,12 +9,8 @@ import type { Filter } from '@linode/api-v4';
const SERVICE = 'object-storage';
export const useGetObjUsagePerEndpoint = (selectedLocation: string) => {
- const flags = useFlags();
-
const pagination = usePaginationV2({
- currentRoute: flags?.iamRbacPrimaryNavChanges
- ? '/quotas'
- : '/account/quotas',
+ currentRoute: '/quotas',
initialPage: 1,
preferenceKey: 'quotas-table',
});
diff --git a/packages/manager/src/features/Profile/Profile.tsx b/packages/manager/src/features/Profile/Profile.tsx
index 1825a7b8929..30440e9bd9c 100644
--- a/packages/manager/src/features/Profile/Profile.tsx
+++ b/packages/manager/src/features/Profile/Profile.tsx
@@ -8,13 +8,11 @@ import { SuspenseLoader } from 'src/components/SuspenseLoader';
import { TabPanels } from 'src/components/Tabs/TabPanels';
import { Tabs } from 'src/components/Tabs/Tabs';
import { TanStackTabLinkList } from 'src/components/Tabs/TanStackTabLinkList';
-import { useFlags } from 'src/hooks/useFlags';
import { useTabs } from 'src/hooks/useTabs';
export const Profile = () => {
const location = useLocation();
const navigate = useNavigate();
- const { iamRbacPrimaryNavChanges } = useFlags();
const { tabs, handleTabChange, tabIndex } = useTabs([
{
@@ -42,14 +40,13 @@ export const Profile = () => {
title: 'OAuth Apps',
},
{
- to: iamRbacPrimaryNavChanges
- ? `/profile/preferences`
- : `/profile/referrals`,
- title: iamRbacPrimaryNavChanges ? 'Preferences' : 'Referrals',
+ to: `/profile/preferences`,
+
+ title: 'Preferences',
},
{
- to: iamRbacPrimaryNavChanges ? `/profile/referrals` : `/profile/settings`,
- title: iamRbacPrimaryNavChanges ? 'Referrals' : 'My Settings',
+ to: `/profile/referrals`,
+ title: 'Referrals',
},
]);
diff --git a/packages/manager/src/features/Profile/Settings/Settings.tsx b/packages/manager/src/features/Profile/Settings/Settings.tsx
index 6174d15904e..7d18fcbe4d7 100644
--- a/packages/manager/src/features/Profile/Settings/Settings.tsx
+++ b/packages/manager/src/features/Profile/Settings/Settings.tsx
@@ -3,7 +3,6 @@ import { useNavigate, useSearch } from '@tanstack/react-router';
import React from 'react';
import { DocumentTitleSegment } from 'src/components/DocumentTitle';
-import { useFlags } from 'src/hooks/useFlags';
import { MaskSensitiveData } from './MaskSensitiveData';
import { Notifications } from './Notifications';
@@ -14,29 +13,22 @@ import { TypeToConfirm } from './TypeToConfirm';
export const ProfileSettings = () => {
const navigate = useNavigate();
- const { iamRbacPrimaryNavChanges } = useFlags();
const { preferenceEditor } = useSearch({
- from: iamRbacPrimaryNavChanges
- ? '/profile/preferences'
- : '/profile/settings',
+ from: '/profile/preferences',
});
const isPreferenceEditorOpen = !!preferenceEditor;
const handleClosePreferenceEditor = () => {
navigate({
- to: iamRbacPrimaryNavChanges
- ? '/profile/preferences'
- : '/profile/settings',
+ to: '/profile/preferences',
search: { preferenceEditor: undefined },
});
};
return (
<>
-
+
diff --git a/packages/manager/src/features/Profile/Settings/settingsLazyRoute.ts b/packages/manager/src/features/Profile/Settings/settingsLazyRoute.ts
index 33e561dae36..90039af7e7e 100644
--- a/packages/manager/src/features/Profile/Settings/settingsLazyRoute.ts
+++ b/packages/manager/src/features/Profile/Settings/settingsLazyRoute.ts
@@ -2,14 +2,6 @@ import { createLazyRoute } from '@tanstack/react-router';
import { ProfileSettings } from './Settings';
-export const settingsLazyRoute = createLazyRoute('/profile/settings')({
- component: ProfileSettings,
-});
-
-/**
- * @todo As part of the IAM Primary Nav flag (iamRbacPrimaryNavChanges) cleanup, /profile/settings will be removed.
- * Adding the lazy route in this file will also require the necessary cleanup work, such as renaming the file and removing settingsLazyRoute(/profile/settings), as part of the flag cleanup.
- */
export const preferencesLazyRoute = createLazyRoute('/profile/preferences')({
component: ProfileSettings,
});
diff --git a/packages/manager/src/features/Quotas/QuotasLanding.tsx b/packages/manager/src/features/Quotas/QuotasLanding.tsx
index 75aa29dcdb2..f695d761c3a 100644
--- a/packages/manager/src/features/Quotas/QuotasLanding.tsx
+++ b/packages/manager/src/features/Quotas/QuotasLanding.tsx
@@ -1,28 +1,14 @@
-import { Navigate, useLocation } from '@tanstack/react-router';
import * as React from 'react';
import { LandingHeader } from 'src/components/LandingHeader';
import { MaintenanceBannerV2 } from 'src/components/MaintenanceBanner/MaintenanceBannerV2';
import { PlatformMaintenanceBanner } from 'src/components/PlatformMaintenanceBanner/PlatformMaintenanceBanner';
-import { useFlags } from 'src/hooks/useFlags';
import { Quotas } from '../Account/Quotas/Quotas';
import type { LandingHeaderProps } from 'src/components/LandingHeader';
export const QuotasLanding = () => {
- const flags = useFlags();
- const location = useLocation();
-
- const isIAMRbacPrimaryNavChangesEnabled = flags?.iamRbacPrimaryNavChanges;
-
- if (
- !isIAMRbacPrimaryNavChangesEnabled &&
- location.pathname !== '/account/quotas'
- ) {
- return ;
- }
-
const landingHeaderProps: LandingHeaderProps = {
breadcrumbProps: {
pathname: '/quotas',
diff --git a/packages/manager/src/features/ServiceTransfers/ServiceTransfersLanding.tsx b/packages/manager/src/features/ServiceTransfers/ServiceTransfersLanding.tsx
index 1dfef2dcfe1..ebd8a905a66 100644
--- a/packages/manager/src/features/ServiceTransfers/ServiceTransfersLanding.tsx
+++ b/packages/manager/src/features/ServiceTransfers/ServiceTransfersLanding.tsx
@@ -1,27 +1,15 @@
-import { Navigate, useLocation } from '@tanstack/react-router';
import * as React from 'react';
import { DocumentTitleSegment } from 'src/components/DocumentTitle';
import { LandingHeader } from 'src/components/LandingHeader';
import { MaintenanceBannerV2 } from 'src/components/MaintenanceBanner/MaintenanceBannerV2';
import { PlatformMaintenanceBanner } from 'src/components/PlatformMaintenanceBanner/PlatformMaintenanceBanner';
-import { useFlags } from 'src/hooks/useFlags';
import { EntityTransfersLanding } from '../EntityTransfers/EntityTransfersLanding/EntityTransfersLanding';
import type { LandingHeaderProps } from 'src/components/LandingHeader';
export const ServiceTransfersLanding = () => {
- const flags = useFlags();
- const location = useLocation();
-
- if (
- !flags?.iamRbacPrimaryNavChanges &&
- location.pathname !== '/account/service-transfers'
- ) {
- return ;
- }
-
const landingHeaderProps: LandingHeaderProps = {
title: 'Service Transfers',
};
diff --git a/packages/manager/src/features/TopMenu/UserMenu/UserMenuPopover.tsx b/packages/manager/src/features/TopMenu/UserMenu/UserMenuPopover.tsx
index 0ee7f5b8ef1..d1a3e9035bd 100644
--- a/packages/manager/src/features/TopMenu/UserMenu/UserMenuPopover.tsx
+++ b/packages/manager/src/features/TopMenu/UserMenu/UserMenuPopover.tsx
@@ -46,11 +46,7 @@ interface MenuLink {
export const UserMenuPopover = (props: UserMenuPopoverProps) => {
const { anchorEl, isDrawerOpen, onClose, onDrawerOpen } = props;
const sessionContext = React.useContext(switchAccountSessionContext);
- const {
- iamRbacPrimaryNavChanges,
- limitsEvolution,
- iamLimitedAvailabilityBadges,
- } = useFlags();
+ const { limitsEvolution, iamLimitedAvailabilityBadges } = useFlags();
const theme = useTheme();
const { data: account } = useAccount();
@@ -87,14 +83,12 @@ export const UserMenuPopover = (props: UserMenuPopoverProps) => {
},
{ display: 'OAuth Apps', to: '/profile/clients' },
{
- display: iamRbacPrimaryNavChanges ? 'Preferences' : 'Referrals',
- to: iamRbacPrimaryNavChanges
- ? '/profile/preferences'
- : '/profile/referrals',
+ display: 'Preferences',
+ to: '/profile/preferences',
},
{
- display: iamRbacPrimaryNavChanges ? 'Referrals' : 'My Settings',
- to: iamRbacPrimaryNavChanges ? '/profile/referrals' : '/profile/settings',
+ display: 'Referrals',
+ to: '/profile/referrals',
},
{ display: 'Log Out', to: '/logout' },
];
@@ -119,57 +113,37 @@ export const UserMenuPopover = (props: UserMenuPopoverProps) => {
() => [
{
display: 'Billing',
- to: iamRbacPrimaryNavChanges ? '/billing' : '/account/billing',
+ to: '/billing',
},
{
- display:
- iamRbacPrimaryNavChanges && isIAMEnabled
- ? 'Identity & Access'
- : 'Users & Grants',
- to:
- iamRbacPrimaryNavChanges && isIAMEnabled
- ? '/iam'
- : iamRbacPrimaryNavChanges && !isIAMEnabled
- ? '/users'
- : '/account/users',
- isBeta: iamRbacPrimaryNavChanges && isIAMEnabled && isIAMBeta,
+ display: isIAMEnabled ? 'Identity & Access' : 'Users & Grants',
+ to: isIAMEnabled ? '/iam' : '/users',
+ isBeta: isIAMEnabled && isIAMBeta,
isNew: isIAMEnabled && !isIAMBeta && iamLimitedAvailabilityBadges,
},
{
display: 'Quotas',
hide: !limitsEvolution?.enabled,
- to: iamRbacPrimaryNavChanges ? '/quotas' : '/account/quotas',
+ to: '/quotas',
},
{
display: 'Login History',
- to: iamRbacPrimaryNavChanges
- ? '/login-history'
- : '/account/login-history',
+ to: '/login-history',
},
{
display: 'Service Transfers',
- to: iamRbacPrimaryNavChanges
- ? '/service-transfers'
- : '/account/service-transfers',
+ to: '/service-transfers',
},
{
display: 'Maintenance',
- to: iamRbacPrimaryNavChanges ? '/maintenance' : '/account/maintenance',
+ to: '/maintenance',
},
{
- display: iamRbacPrimaryNavChanges ? 'Account Settings' : 'Settings',
- to: iamRbacPrimaryNavChanges
- ? '/account-settings'
- : '/account/settings',
+ display: 'Account Settings',
+ to: '/account-settings',
},
],
- [
- isIAMEnabled,
- iamRbacPrimaryNavChanges,
- limitsEvolution,
- iamLimitedAvailabilityBadges,
- isIAMBeta,
- ]
+ [isIAMEnabled, limitsEvolution, iamLimitedAvailabilityBadges, isIAMBeta]
);
const renderLink = (link: MenuLink) => {
@@ -278,9 +252,7 @@ export const UserMenuPopover = (props: UserMenuPopoverProps) => {
-
- {iamRbacPrimaryNavChanges ? 'Administration' : 'Account'}
-
+ Administration
theme.tokens.spacing.S8}
diff --git a/packages/manager/src/features/Users/CreateUserDrawer.tsx b/packages/manager/src/features/Users/CreateUserDrawer.tsx
index aefbe6d8ab6..f94075cd4c7 100644
--- a/packages/manager/src/features/Users/CreateUserDrawer.tsx
+++ b/packages/manager/src/features/Users/CreateUserDrawer.tsx
@@ -10,7 +10,6 @@ import {
import { useNavigate } from '@tanstack/react-router';
import * as React from 'react';
-import { useFlags } from 'src/hooks/useFlags';
import { getAPIErrorOrDefault } from 'src/utilities/errorUtils';
import { getAPIErrorFor } from 'src/utilities/getAPIErrorFor';
@@ -19,7 +18,6 @@ import type { APIError } from '@linode/api-v4/lib/types';
import type { UseNavigateResult } from '@tanstack/react-router';
interface CreateUserDrawerProps {
- iamRbacPrimaryNavChanges?: boolean;
navigate: UseNavigateResult<'/account/users'>;
onClose: () => void;
open: boolean;
@@ -39,14 +37,8 @@ const withNavigation = (
) => {
return (props: CreateUserDrawerProps) => {
const navigate = useNavigate();
- const { iamRbacPrimaryNavChanges } = useFlags();
- return (
-
- );
+
+ return ;
};
};
@@ -97,7 +89,7 @@ class CreateUserDrawerComponent extends React.Component<
};
onSubmit = () => {
- const { onClose, refetch, navigate, iamRbacPrimaryNavChanges } = this.props;
+ const { onClose, refetch, navigate } = this.props;
const { email, restricted, username } = this.state;
this.setState({ errors: [], submitting: true });
createUser({ email, restricted, username })
@@ -106,9 +98,7 @@ class CreateUserDrawerComponent extends React.Component<
onClose();
if (user.restricted) {
navigate({
- to: iamRbacPrimaryNavChanges
- ? '/users/$username/permissions'
- : '/account/users/$username/permissions',
+ to: '/users/$username/permissions',
params: { username: user.username },
});
}
diff --git a/packages/manager/src/features/Users/UserDetail.tsx b/packages/manager/src/features/Users/UserDetail.tsx
index 8f0e04fdb3e..fd902ba5d3a 100644
--- a/packages/manager/src/features/Users/UserDetail.tsx
+++ b/packages/manager/src/features/Users/UserDetail.tsx
@@ -9,18 +9,14 @@ import { SafeTabPanel } from 'src/components/Tabs/SafeTabPanel';
import { TabPanels } from 'src/components/Tabs/TabPanels';
import { Tabs } from 'src/components/Tabs/Tabs';
import { TanStackTabLinkList } from 'src/components/Tabs/TanStackTabLinkList';
-import { useFlags } from 'src/hooks/useFlags';
import { useTabs } from 'src/hooks/useTabs';
import UserPermissions from './UserPermissions';
import { UserProfile } from './UserProfile/UserProfile';
export const UserDetail = () => {
- const { iamRbacPrimaryNavChanges } = useFlags();
const { username } = useParams({
- from: iamRbacPrimaryNavChanges
- ? '/users/$username'
- : '/account/users/$username',
+ from: '/users/$username',
});
const location = useLocation();
@@ -32,15 +28,11 @@ export const UserDetail = () => {
const { tabs, handleTabChange, tabIndex } = useTabs([
{
- to: iamRbacPrimaryNavChanges
- ? '/users/$username/profile'
- : '/account/users/$username/profile',
+ to: '/users/$username/profile',
title: 'User Profile',
},
{
- to: iamRbacPrimaryNavChanges
- ? '/users/$username/permissions'
- : '/account/users/$username/permissions',
+ to: '/users/$username/permissions',
title: 'User Permissions',
},
]);
diff --git a/packages/manager/src/features/Users/UserPermissionsEntitySection.tsx b/packages/manager/src/features/Users/UserPermissionsEntitySection.tsx
index b1a3f0e7230..64e481971fc 100644
--- a/packages/manager/src/features/Users/UserPermissionsEntitySection.tsx
+++ b/packages/manager/src/features/Users/UserPermissionsEntitySection.tsx
@@ -18,7 +18,6 @@ import { TableCell } from 'src/components/TableCell';
import { TableHead } from 'src/components/TableHead';
import { TableRow } from 'src/components/TableRow';
import { grantTypeMap } from 'src/features/Account/constants';
-import { useFlags } from 'src/hooks/useFlags';
import { usePaginationV2 } from 'src/hooks/usePaginationV2';
import type { Grant, GrantLevel, GrantType } from '@linode/api-v4/lib/account';
@@ -35,12 +34,8 @@ interface Props {
export const UserPermissionsEntitySection = React.memo(
({ entity, entitySetAllTo, grants, setGrantTo, showHeading }: Props) => {
const theme: Theme = useTheme();
- const { iamRbacPrimaryNavChanges } = useFlags();
-
const pagination = usePaginationV2({
- currentRoute: iamRbacPrimaryNavChanges
- ? '/users/$username/permissions'
- : '/account/users/$username/permissions',
+ currentRoute: '/users/$username/permissions',
initialPage: 1,
preferenceKey: 'user-permissions-entity-section',
});
diff --git a/packages/manager/src/features/Users/UserProfile/DeleteUserPanel.tsx b/packages/manager/src/features/Users/UserProfile/DeleteUserPanel.tsx
index 1ad3d11b9d3..78683e086d8 100644
--- a/packages/manager/src/features/Users/UserProfile/DeleteUserPanel.tsx
+++ b/packages/manager/src/features/Users/UserProfile/DeleteUserPanel.tsx
@@ -4,7 +4,6 @@ import { useNavigate } from '@tanstack/react-router';
import React, { useState } from 'react';
import { PARENT_USER } from 'src/features/Account/constants';
-import { useFlags } from 'src/hooks/useFlags';
import { UserDeleteConfirmationDialog } from '../UserDeleteConfirmationDialog';
@@ -20,8 +19,6 @@ export const DeleteUserPanel = ({ user }: Props) => {
const { data: profile } = useProfile();
- const { iamRbacPrimaryNavChanges } = useFlags();
-
const isProxyUserProfile = user.user_type === 'proxy';
const tooltipText =
@@ -52,7 +49,7 @@ export const DeleteUserPanel = ({ user }: Props) => {
onClose={() => setIsDeleteDialogOpen(false)}
onSuccess={() =>
navigate({
- to: iamRbacPrimaryNavChanges ? '/users' : '/account/users',
+ to: '/users',
})
}
open={isDeleteDialogOpen}
diff --git a/packages/manager/src/features/Users/UserProfile/UserProfile.tsx b/packages/manager/src/features/Users/UserProfile/UserProfile.tsx
index cdd4eb87c82..d30937d52a3 100644
--- a/packages/manager/src/features/Users/UserProfile/UserProfile.tsx
+++ b/packages/manager/src/features/Users/UserProfile/UserProfile.tsx
@@ -4,7 +4,6 @@ import { useParams } from '@tanstack/react-router';
import React from 'react';
import { DocumentTitleSegment } from 'src/components/DocumentTitle';
-import { useFlags } from 'src/hooks/useFlags';
import { DeleteUserPanel } from './DeleteUserPanel';
import { UserDetailsPanel } from './UserDetailsPanel';
@@ -12,12 +11,8 @@ import { UserEmailPanel } from './UserEmailPanel';
import { UsernamePanel } from './UsernamePanel';
export const UserProfile = () => {
- const { iamRbacPrimaryNavChanges } = useFlags();
-
const { username } = useParams({
- from: iamRbacPrimaryNavChanges
- ? '/users/$username'
- : '/account/users/$username',
+ from: '/users/$username',
});
const { data: user, error, isLoading } = useAccountUser(username ?? '');
diff --git a/packages/manager/src/features/Users/UserProfile/UsernamePanel.tsx b/packages/manager/src/features/Users/UserProfile/UsernamePanel.tsx
index 316f4b026ad..8e40745e246 100644
--- a/packages/manager/src/features/Users/UserProfile/UsernamePanel.tsx
+++ b/packages/manager/src/features/Users/UserProfile/UsernamePanel.tsx
@@ -8,7 +8,6 @@ import React from 'react';
import { Controller, useForm } from 'react-hook-form';
import { RESTRICTED_FIELD_TOOLTIP } from 'src/features/Account/constants';
-import { useFlags } from 'src/hooks/useFlags';
import type { User } from '@linode/api-v4';
@@ -19,7 +18,6 @@ interface Props {
export const UsernamePanel = ({ user }: Props) => {
const navigate = useNavigate();
const { enqueueSnackbar } = useSnackbar();
- const { iamRbacPrimaryNavChanges } = useFlags();
const isProxyUserProfile = user?.user_type === 'proxy';
@@ -42,9 +40,7 @@ export const UsernamePanel = ({ user }: Props) => {
// Because the username changed, we need to update the username in the URL
navigate({
- to: iamRbacPrimaryNavChanges
- ? '/users/$username'
- : '/account/users/$username',
+ to: '/users/$username',
params: { username: user.username },
});
diff --git a/packages/manager/src/features/Users/UsersActionMenu.tsx b/packages/manager/src/features/Users/UsersActionMenu.tsx
index 6b73fc616cd..b4ae0409786 100644
--- a/packages/manager/src/features/Users/UsersActionMenu.tsx
+++ b/packages/manager/src/features/Users/UsersActionMenu.tsx
@@ -6,7 +6,6 @@ import * as React from 'react';
import { ActionMenu } from 'src/components/ActionMenu/ActionMenu';
import { InlineMenuAction } from 'src/components/InlineMenuAction/InlineMenuAction';
-import { useFlags } from 'src/hooks/useFlags';
import type { Theme } from '@mui/material/styles';
import type { Action } from 'src/components/ActionMenu/ActionMenu';
@@ -21,7 +20,6 @@ export const UsersActionMenu = ({ isProxyUser, onDelete, username }: Props) => {
const navigate = useNavigate();
const theme = useTheme();
const matchesSmDown = useMediaQuery(theme.breakpoints.down('md'));
- const { iamRbacPrimaryNavChanges } = useFlags();
const { data: profile } = useProfile();
const profileUsername = profile?.username;
@@ -30,9 +28,7 @@ export const UsersActionMenu = ({ isProxyUser, onDelete, username }: Props) => {
{
onClick: () => {
navigate({
- to: iamRbacPrimaryNavChanges
- ? '/users/$username/permissions'
- : '/account/users/$username/permissions',
+ to: '/users/$username/permissions',
params: { username },
});
},
@@ -44,9 +40,7 @@ export const UsersActionMenu = ({ isProxyUser, onDelete, username }: Props) => {
{
onClick: () => {
navigate({
- to: iamRbacPrimaryNavChanges
- ? '/users/$username'
- : '/account/users/$username',
+ to: '/users/$username',
params: { username },
});
},
@@ -55,9 +49,7 @@ export const UsersActionMenu = ({ isProxyUser, onDelete, username }: Props) => {
{
onClick: () => {
navigate({
- to: iamRbacPrimaryNavChanges
- ? '/users/$username/permissions'
- : '/account/users/$username/permissions',
+ to: '/users/$username/permissions',
params: { username },
});
},
diff --git a/packages/manager/src/features/Users/UsersLanding.tsx b/packages/manager/src/features/Users/UsersLanding.tsx
index 88980591137..3609d727771 100644
--- a/packages/manager/src/features/Users/UsersLanding.tsx
+++ b/packages/manager/src/features/Users/UsersLanding.tsx
@@ -10,7 +10,6 @@ import { PaginationFooter } from 'src/components/PaginationFooter/PaginationFoot
import { Table } from 'src/components/Table';
import { TableBody } from 'src/components/TableBody';
import { PARENT_USER } from 'src/features/Account/constants';
-import { useFlags } from 'src/hooks/useFlags';
import { useOrderV2 } from 'src/hooks/useOrderV2';
import { usePaginationV2 } from 'src/hooks/usePaginationV2';
import { useRestrictedGlobalGrantCheck } from 'src/hooks/useRestrictedGlobalGrantCheck';
@@ -34,11 +33,9 @@ export const UsersLanding = () => {
const matchesSmDown = useMediaQuery(theme.breakpoints.down('sm'));
const matchesLgUp = useMediaQuery(theme.breakpoints.up('lg'));
- const { iamRbacPrimaryNavChanges } = useFlags();
-
const pagination = usePaginationV2({
initialPage: 1,
- currentRoute: iamRbacPrimaryNavChanges ? '/users' : '/account/users',
+ currentRoute: '/users',
preferenceKey: 'account-users-pagination',
});
const order = useOrderV2({
@@ -47,7 +44,7 @@ export const UsersLanding = () => {
order: 'desc',
orderBy: 'username',
},
- from: iamRbacPrimaryNavChanges ? '/users' : '/account/users',
+ from: '/users',
},
preferenceKey: 'account-users-order',
});
diff --git a/packages/manager/src/features/UsersAndGrants/UsersAndGrants.tsx b/packages/manager/src/features/UsersAndGrants/UsersAndGrants.tsx
index 2730b045886..cafeb74b62b 100644
--- a/packages/manager/src/features/UsersAndGrants/UsersAndGrants.tsx
+++ b/packages/manager/src/features/UsersAndGrants/UsersAndGrants.tsx
@@ -1,28 +1,14 @@
-import { Navigate, useLocation } from '@tanstack/react-router';
import * as React from 'react';
import { LandingHeader } from 'src/components/LandingHeader';
import { MaintenanceBannerV2 } from 'src/components/MaintenanceBanner/MaintenanceBannerV2';
import { PlatformMaintenanceBanner } from 'src/components/PlatformMaintenanceBanner/PlatformMaintenanceBanner';
-import { useFlags } from 'src/hooks/useFlags';
import { UsersLanding } from '../Users/UsersLanding';
import type { LandingHeaderProps } from 'src/components/LandingHeader';
export const UsersAndGrants = () => {
- const flags = useFlags();
- const location = useLocation();
-
- const isIAMRbacPrimaryNavChangesEnabled = flags?.iamRbacPrimaryNavChanges;
-
- if (
- !isIAMRbacPrimaryNavChangesEnabled &&
- location.pathname !== '/account/users'
- ) {
- return ;
- }
-
const landingHeaderProps: LandingHeaderProps = {
breadcrumbProps: {
pathname: '/users',
diff --git a/packages/manager/src/routes/account/index.ts b/packages/manager/src/routes/account/index.ts
index 49f8f0b1f9b..460b844465b 100644
--- a/packages/manager/src/routes/account/index.ts
+++ b/packages/manager/src/routes/account/index.ts
@@ -31,13 +31,11 @@ const accountBillingRoute = createRoute({
getParentRoute: () => accountTabsRoute,
path: 'billing',
validateSearch: (search: AccountBillingSearch) => search,
- beforeLoad: ({ context, params }) => {
- if (context?.flags?.iamRbacPrimaryNavChanges) {
- throw redirect({
- to: `/billing`,
- replace: true,
- });
- }
+ beforeLoad: () => {
+ throw redirect({
+ to: `/billing`,
+ replace: true,
+ });
},
}).lazy(() =>
import('src/features/Billing/billingDetailLazyRoute').then(
@@ -58,10 +56,6 @@ const accountUsersRoute = createRoute({
if (isIAMEnabled) {
throw redirect({ to: '/iam/users' });
}
-
- if (context?.flags?.iamRbacPrimaryNavChanges && !isIAMEnabled) {
- throw redirect({ to: '/users' });
- }
},
}).lazy(() =>
import('src/features/Users/usersLandingLazyRoute').then(
@@ -72,13 +66,11 @@ const accountUsersRoute = createRoute({
const accountQuotasRoute = createRoute({
getParentRoute: () => accountTabsRoute,
path: '/quotas',
- beforeLoad: ({ context }) => {
- if (context?.flags?.iamRbacPrimaryNavChanges) {
- throw redirect({
- to: `/quotas`,
- replace: true,
- });
- }
+ beforeLoad: () => {
+ throw redirect({
+ to: `/quotas`,
+ replace: true,
+ });
},
}).lazy(() =>
import('src/features/Account/Quotas/quotasLazyRoute').then(
@@ -90,12 +82,10 @@ const accountLoginHistoryRoute = createRoute({
getParentRoute: () => accountTabsRoute,
path: '/login-history',
beforeLoad: ({ context }) => {
- if (context?.flags?.iamRbacPrimaryNavChanges) {
- throw redirect({
- to: `/login-history`,
- replace: true,
- });
- }
+ throw redirect({
+ to: `/login-history`,
+ replace: true,
+ });
},
}).lazy(() =>
import('src/features/Account/accountLoginsLazyRoute').then(
@@ -106,13 +96,11 @@ const accountLoginHistoryRoute = createRoute({
const accountServiceTransfersRoute = createRoute({
getParentRoute: () => accountTabsRoute,
path: '/service-transfers',
- beforeLoad: ({ context }) => {
- if (context?.flags?.iamRbacPrimaryNavChanges) {
- throw redirect({
- to: `/service-transfers`,
- replace: true,
- });
- }
+ beforeLoad: () => {
+ throw redirect({
+ to: `/service-transfers`,
+ replace: true,
+ });
},
}).lazy(() =>
import(
@@ -123,13 +111,11 @@ const accountServiceTransfersRoute = createRoute({
const accountMaintenanceRoute = createRoute({
getParentRoute: () => accountTabsRoute,
path: '/maintenance',
- beforeLoad: ({ context }) => {
- if (context?.flags?.iamRbacPrimaryNavChanges) {
- throw redirect({
- to: `/maintenance`,
- replace: true,
- });
- }
+ beforeLoad: () => {
+ throw redirect({
+ to: `/maintenance`,
+ replace: true,
+ });
},
}).lazy(() =>
import('src/features/Account/Maintenance/maintenanceLandingLazyRoute').then(
@@ -140,13 +126,11 @@ const accountMaintenanceRoute = createRoute({
const accountSettingsRoute = createRoute({
getParentRoute: () => accountTabsRoute,
path: '/settings',
- beforeLoad: ({ context }) => {
- if (context?.flags?.iamRbacPrimaryNavChanges) {
- throw redirect({
- to: `/account-settings`,
- replace: true,
- });
- }
+ beforeLoad: () => {
+ throw redirect({
+ to: `/account-settings`,
+ replace: true,
+ });
},
}).lazy(() =>
import('src/features/Account/globalSettingsLazyRoute').then(
@@ -182,18 +166,16 @@ const accountUsersUsernameRoute = createRoute({
});
}
- if (context?.flags?.iamRbacPrimaryNavChanges && !isIAMEnabled) {
- const url = location.pathname.endsWith('/profile')
- ? '/users/$username/profile'
- : location.pathname.endsWith('/permissions')
- ? '/users/$username/permissions'
- : '/users/$username';
- throw redirect({
- to: url,
- params: { username },
- replace: true,
- });
- }
+ const url = location.pathname.endsWith('/profile')
+ ? '/users/$username/profile'
+ : location.pathname.endsWith('/permissions')
+ ? '/users/$username/permissions'
+ : '/users/$username';
+ throw redirect({
+ to: url,
+ params: { username },
+ replace: true,
+ });
},
}).lazy(() =>
import('src/features/Users/userDetailLazyRoute').then(
@@ -225,14 +207,12 @@ const accountInvoiceDetailsRoute = createRoute({
invoiceId: Number(params.invoiceId),
}),
path: 'billing/invoices/$invoiceId',
- beforeLoad: ({ context, params }) => {
- if (context?.flags?.iamRbacPrimaryNavChanges) {
- throw redirect({
- to: `/billing/invoices/$invoiceId`,
- params: { invoiceId: params.invoiceId },
- replace: true,
- });
- }
+ beforeLoad: ({ params }) => {
+ throw redirect({
+ to: `/billing/invoices/$invoiceId`,
+ params: { invoiceId: params.invoiceId },
+ replace: true,
+ });
},
}).lazy(() =>
import('src/features/Billing/InvoiceDetail/InvoiceDetail').then(
@@ -243,13 +223,11 @@ const accountInvoiceDetailsRoute = createRoute({
const accountEntityTransfersCreateRoute = createRoute({
getParentRoute: () => accountRoute,
path: 'service-transfers/create',
- beforeLoad: ({ context }) => {
- if (context?.flags?.iamRbacPrimaryNavChanges) {
- throw redirect({
- to: `/service-transfers/create`,
- replace: true,
- });
- }
+ beforeLoad: () => {
+ throw redirect({
+ to: `/service-transfers/create`,
+ replace: true,
+ });
},
}).lazy(() =>
import(
diff --git a/packages/manager/src/routes/accountSettings/index.ts b/packages/manager/src/routes/accountSettings/index.ts
index 4660ed2b201..deef8ecb18f 100644
--- a/packages/manager/src/routes/accountSettings/index.ts
+++ b/packages/manager/src/routes/accountSettings/index.ts
@@ -22,14 +22,6 @@ const accountSettingsCatchAllRoute = createRoute({
const accountSettingsIndexRoute = createRoute({
getParentRoute: () => accountSettingsRoute,
path: '/',
- beforeLoad: ({ context }) => {
- if (!context?.flags?.iamRbacPrimaryNavChanges) {
- throw redirect({
- to: `/account/settings`,
- replace: true,
- });
- }
- },
}).lazy(() =>
import('src/features/AccountSettings/accountSettingsLandingLazyRoute').then(
(m) => m.accountSettingsLandingLazyRoute
diff --git a/packages/manager/src/routes/billing/index.ts b/packages/manager/src/routes/billing/index.ts
index 78705a53a5b..54fcbd6347b 100644
--- a/packages/manager/src/routes/billing/index.ts
+++ b/packages/manager/src/routes/billing/index.ts
@@ -3,7 +3,7 @@ import { createRoute, redirect } from '@tanstack/react-router';
import { rootRoute } from '../root';
import { BillingRoute } from './BillingRoute';
-interface BillingSearch {
+export interface BillingSearch {
action?: 'add-payment-method' | 'edit' | 'make-payment';
contactDrawerOpen?: boolean;
focusEmail?: boolean;
@@ -30,14 +30,6 @@ const billingCatchAllRoute = createRoute({
const billingIndexRoute = createRoute({
getParentRoute: () => billingRoute,
path: '/',
- beforeLoad: ({ context }) => {
- if (!context?.flags?.iamRbacPrimaryNavChanges) {
- throw redirect({
- to: `/account/billing`,
- replace: true,
- });
- }
- },
}).lazy(() =>
import('src/features/Billing/BillingLanding/billingLandingLazyRoute').then(
(m) => m.billingLandingLazyRoute
@@ -50,15 +42,6 @@ const billingInvoiceDetailsRoute = createRoute({
invoiceId: Number(params.invoiceId),
}),
path: 'invoices/$invoiceId',
- beforeLoad: ({ context, params }) => {
- if (!context?.flags?.iamRbacPrimaryNavChanges) {
- throw redirect({
- to: `/account/billing/invoices/$invoiceId`,
- params: { invoiceId: params.invoiceId },
- replace: true,
- });
- }
- },
}).lazy(() =>
import('src/features/Billing/InvoiceDetail/InvoiceDetail').then(
(m) => m.invoiceDetailLazyRoute
diff --git a/packages/manager/src/routes/loginHistory/index.ts b/packages/manager/src/routes/loginHistory/index.ts
index 4fcb408ba49..a99921f68b0 100644
--- a/packages/manager/src/routes/loginHistory/index.ts
+++ b/packages/manager/src/routes/loginHistory/index.ts
@@ -22,14 +22,6 @@ const loginHistoryCatchAllRoute = createRoute({
const loginHistoryIndexRoute = createRoute({
getParentRoute: () => loginHistoryRoute,
path: '/',
- beforeLoad: ({ context }) => {
- if (!context?.flags?.iamRbacPrimaryNavChanges) {
- throw redirect({
- to: `/account/login-history`,
- replace: true,
- });
- }
- },
}).lazy(() =>
import('src/features/LoginHistory/loginHistoryLandingLazyRoute').then(
(m) => m.loginHistoryLandingLazyRoute
diff --git a/packages/manager/src/routes/maintenance/index.ts b/packages/manager/src/routes/maintenance/index.ts
index 7f565775e35..4c5b841aafe 100644
--- a/packages/manager/src/routes/maintenance/index.ts
+++ b/packages/manager/src/routes/maintenance/index.ts
@@ -22,14 +22,6 @@ const maintenanceCatchAllRoute = createRoute({
const maintenanceIndexRoute = createRoute({
getParentRoute: () => maintenanceRoute,
path: '/',
- beforeLoad: ({ context }) => {
- if (!context?.flags?.iamRbacPrimaryNavChanges) {
- throw redirect({
- to: `/account/maintenance`,
- replace: true,
- });
- }
- },
}).lazy(() =>
import('src/features/Maintenance/maintenanceLandingLazyRoute').then(
(m) => m.maintenanceLandingLandingLazyRoute
diff --git a/packages/manager/src/routes/profile/index.ts b/packages/manager/src/routes/profile/index.ts
index 879b6950833..72be9adfed9 100644
--- a/packages/manager/src/routes/profile/index.ts
+++ b/packages/manager/src/routes/profile/index.ts
@@ -98,14 +98,6 @@ const profileReferralsRoute = createRoute({
*/
const profilePreferencesRoute = createRoute({
- beforeLoad: ({ context }) => {
- if (!context?.flags?.iamRbacPrimaryNavChanges) {
- throw redirect({
- to: `/profile/settings`,
- replace: true,
- });
- }
- },
getParentRoute: () => profileRoute,
path: 'preferences',
validateSearch: (search: ProfileSettingsSearchParams) => search,
@@ -116,20 +108,18 @@ const profilePreferencesRoute = createRoute({
);
const profileSettingsRoute = createRoute({
- beforeLoad: ({ context }) => {
- if (context?.flags?.iamRbacPrimaryNavChanges) {
- throw redirect({
- to: `/profile/preferences`,
- replace: true,
- });
- }
+ beforeLoad: () => {
+ throw redirect({
+ to: `/profile/preferences`,
+ replace: true,
+ });
},
getParentRoute: () => profileRoute,
path: 'settings',
validateSearch: (search: ProfileSettingsSearchParams) => search,
}).lazy(() =>
import('src/features/Profile/Settings/settingsLazyRoute').then(
- (m) => m.settingsLazyRoute
+ (m) => m.preferencesLazyRoute
)
);
diff --git a/packages/manager/src/routes/quotas/index.ts b/packages/manager/src/routes/quotas/index.ts
index a8c7c0f8ecc..12567a1b236 100644
--- a/packages/manager/src/routes/quotas/index.ts
+++ b/packages/manager/src/routes/quotas/index.ts
@@ -22,14 +22,6 @@ const quotasCatchAllRoute = createRoute({
const quotasIndexRoute = createRoute({
getParentRoute: () => quotasRoute,
path: '/',
- beforeLoad: ({ context }) => {
- if (!context?.flags?.iamRbacPrimaryNavChanges) {
- throw redirect({
- to: `/account/quotas`,
- replace: true,
- });
- }
- },
}).lazy(() =>
import('src/features/Quotas//quotasLandingLazyRoute').then(
(m) => m.quotasLandingLazyRoute
diff --git a/packages/manager/src/routes/serviceTransfers/index.ts b/packages/manager/src/routes/serviceTransfers/index.ts
index 62056c773d9..6198a415d7e 100644
--- a/packages/manager/src/routes/serviceTransfers/index.ts
+++ b/packages/manager/src/routes/serviceTransfers/index.ts
@@ -22,14 +22,6 @@ const serviceTransfersCatchAllRoute = createRoute({
const serviceTransfersIndexRoute = createRoute({
getParentRoute: () => serviceTransfersRoute,
path: '/',
- beforeLoad: ({ context }) => {
- if (!context?.flags?.iamRbacPrimaryNavChanges) {
- throw redirect({
- to: `/account/service-transfers`,
- replace: true,
- });
- }
- },
}).lazy(() =>
import('src/features/ServiceTransfers/serviceTransfersLandingLazyRoute').then(
(m) => m.serviceTransfersLandingLazyRoute
@@ -39,14 +31,6 @@ const serviceTransfersIndexRoute = createRoute({
const serviceTransfersCreateRoute = createRoute({
getParentRoute: () => serviceTransfersRoute,
path: 'create',
- beforeLoad: ({ context }) => {
- if (!context?.flags?.iamRbacPrimaryNavChanges) {
- throw redirect({
- to: `/account/service-transfers/create`,
- replace: true,
- });
- }
- },
}).lazy(() =>
import('src/features/ServiceTransfers/serviceTransfersCreateLazyRoute').then(
(m) => m.serviceTransfersCreateLazyRoute
diff --git a/packages/manager/src/routes/usersAndGrants/UsersAndGrantsRoute.tsx b/packages/manager/src/routes/usersAndGrants/UsersAndGrantsRoute.tsx
index 386e658183a..9ae03ca7990 100644
--- a/packages/manager/src/routes/usersAndGrants/UsersAndGrantsRoute.tsx
+++ b/packages/manager/src/routes/usersAndGrants/UsersAndGrantsRoute.tsx
@@ -1,17 +1,14 @@
-import { NotFound } from '@linode/ui';
import { Outlet } from '@tanstack/react-router';
import React from 'react';
import { ProductInformationBanner } from 'src/components/ProductInformationBanner/ProductInformationBanner';
import { SuspenseLoader } from 'src/components/SuspenseLoader';
-import { useFlags } from 'src/hooks/useFlags';
export const UsersAndGrantsRoute = () => {
- const { iamRbacPrimaryNavChanges } = useFlags();
return (
}>
- {iamRbacPrimaryNavChanges ? : }
+
);
};