Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
82 changes: 0 additions & 82 deletions packages/manager/cypress/e2e/core/account/quotas-nav.spec.ts
Original file line number Diff line number Diff line change
@@ -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');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -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', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
},
});
});

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { mockAppendFeatureFlags } from 'support/intercepts/feature-flags';
import { pages } from 'support/ui/constants';

import type { Page } from 'support/ui/constants';
Expand All @@ -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', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down Expand Up @@ -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');
});
Expand Down Expand Up @@ -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)
Expand Down
36 changes: 7 additions & 29 deletions packages/manager/src/GoTo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ 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 { useIsPlacementGroupsEnabled } from './features/PlacementGroups/utils';
import { useFlags } from './hooks/useFlags';
import { useGlobalKeyboardListener } from './hooks/useGlobalKeyboardListener';

import type { SelectOption } from '@linode/ui';
Expand All @@ -16,12 +14,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 { goToOpen, setGoToOpen } = useGlobalKeyboardListener();
Expand Down Expand Up @@ -104,22 +98,12 @@ export const GoTo = React.memo(() => {
display: 'Marketplace',
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',
Expand All @@ -129,13 +113,7 @@ export const GoTo = React.memo(() => {
href: '/profile/display',
},
],
[
permissions.is_account_admin,
isDatabasesEnabled,
isManagedAccount,
isPlacementGroupsEnabled,
iamRbacPrimaryNavChanges,
]
[isDatabasesEnabled, isManagedAccount, isPlacementGroupsEnabled]
);

const options: SelectOption<string>[] = React.useMemo(
Expand Down
Loading
Loading