diff --git a/packages/api-v4/.changeset/pr-11413-removed-1734030444142.md b/packages/api-v4/.changeset/pr-11413-removed-1734030444142.md new file mode 100644 index 00000000000..a28c9d775a8 --- /dev/null +++ b/packages/api-v4/.changeset/pr-11413-removed-1734030444142.md @@ -0,0 +1,5 @@ +--- +"@linode/api-v4": Removed +--- + +getAccountInfoBeta endpoint ([#11413](https://github.com/linode/manager/pull/11413)) diff --git a/packages/api-v4/src/account/account.ts b/packages/api-v4/src/account/account.ts index 0b704f230b6..b612da3d082 100644 --- a/packages/api-v4/src/account/account.ts +++ b/packages/api-v4/src/account/account.ts @@ -35,18 +35,6 @@ export const getAccountInfo = () => { return Request(setURL(`${API_ROOT}/account`), setMethod('GET')); }; -/** - * getAccountInfoBeta - * - * Return beta endpoint account information, - * including contact and billing info. - * - * @TODO LKE-E - M3-8838: Clean up after released to GA, if not otherwise in use - */ -export const getAccountInfoBeta = () => { - return Request(setURL(`${BETA_API_ROOT}/account`), setMethod('GET')); -}; - /** * getNetworkUtilization * diff --git a/packages/manager/.changeset/pr-11413-upcoming-features-1734030483336.md b/packages/manager/.changeset/pr-11413-upcoming-features-1734030483336.md new file mode 100644 index 00000000000..4a2c8ce0a22 --- /dev/null +++ b/packages/manager/.changeset/pr-11413-upcoming-features-1734030483336.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Upcoming Features +--- + +Switch from v4beta to v4 account endpoint for LKE-E ([#11413](https://github.com/linode/manager/pull/11413)) diff --git a/packages/manager/cypress/e2e/core/kubernetes/lke-create.spec.ts b/packages/manager/cypress/e2e/core/kubernetes/lke-create.spec.ts index 9df410ee18f..f26046455a2 100644 --- a/packages/manager/cypress/e2e/core/kubernetes/lke-create.spec.ts +++ b/packages/manager/cypress/e2e/core/kubernetes/lke-create.spec.ts @@ -1158,7 +1158,13 @@ describe('LKE Cluster Creation with LKE-E', () => { }); it('disables the Cluster Type selection without the LKE-E account capability', () => { + mockGetAccount( + accountFactory.build({ + capabilities: [], + }) + ).as('getAccount'); cy.visitWithLogin('/kubernetes/clusters'); + cy.wait(['@getAccount']); ui.button .findByTitle('Create Cluster') diff --git a/packages/manager/src/features/Kubernetes/CreateCluster/ClusterTypePanel.tsx b/packages/manager/src/features/Kubernetes/CreateCluster/ClusterTypePanel.tsx index 106537bcc31..fa4836c177c 100644 --- a/packages/manager/src/features/Kubernetes/CreateCluster/ClusterTypePanel.tsx +++ b/packages/manager/src/features/Kubernetes/CreateCluster/ClusterTypePanel.tsx @@ -4,7 +4,7 @@ import React from 'react'; import { DocsLink } from 'src/components/DocsLink/DocsLink'; import { SelectionCard } from 'src/components/SelectionCard/SelectionCard'; -import { useAccountBeta } from 'src/queries/account/account'; +import { useAccount } from 'src/queries/account/account'; import { StyledDocsLinkContainer } from './CreateCluster.styles'; @@ -19,7 +19,7 @@ interface Props { export const ClusterTypePanel = (props: Props) => { const { handleClusterTypeSelection, selectedTier } = props; - const { data: account } = useAccountBeta(); + const { data: account } = useAccount(); const mdDownBreakpoint = useMediaQuery((theme: Theme) => theme.breakpoints.down('md') diff --git a/packages/manager/src/features/Kubernetes/kubeUtils.test.ts b/packages/manager/src/features/Kubernetes/kubeUtils.test.ts index 9f621dfb6f3..bc122c879f3 100644 --- a/packages/manager/src/features/Kubernetes/kubeUtils.test.ts +++ b/packages/manager/src/features/Kubernetes/kubeUtils.test.ts @@ -16,7 +16,7 @@ import { } from './kubeUtils'; const queryMocks = vi.hoisted(() => ({ - useAccountBeta: vi.fn().mockReturnValue({}), + useAccount: vi.fn().mockReturnValue({}), useAccountBetaQuery: vi.fn().mockReturnValue({}), useFlags: vi.fn().mockReturnValue({}), })); @@ -25,7 +25,7 @@ vi.mock('src/queries/account/account', () => { const actual = vi.importActual('src/queries/account/account'); return { ...actual, - useAccountBeta: queryMocks.useAccountBeta, + useAccount: queryMocks.useAccount, }; }); @@ -165,7 +165,7 @@ describe('helper functions', () => { describe('useIsLkeEnterpriseEnabled', () => { it('returns false for feature enablement if the account does not have the capability', () => { - queryMocks.useAccountBeta.mockReturnValue({ + queryMocks.useAccount.mockReturnValue({ data: { capabilities: [], }, @@ -188,7 +188,7 @@ describe('useIsLkeEnterpriseEnabled', () => { }); it('returns true for LA feature enablement if the account has the capability + enabled LA feature flag values', () => { - queryMocks.useAccountBeta.mockReturnValue({ + queryMocks.useAccount.mockReturnValue({ data: { capabilities: ['Kubernetes Enterprise'], }, @@ -211,7 +211,7 @@ describe('useIsLkeEnterpriseEnabled', () => { }); it('returns true for GA feature enablement if the account has the capability + enabled GA feature flag values', () => { - queryMocks.useAccountBeta.mockReturnValue({ + queryMocks.useAccount.mockReturnValue({ data: { capabilities: ['Kubernetes Enterprise'], }, diff --git a/packages/manager/src/features/Kubernetes/kubeUtils.ts b/packages/manager/src/features/Kubernetes/kubeUtils.ts index ff7882d843b..7d8e6c84aec 100644 --- a/packages/manager/src/features/Kubernetes/kubeUtils.ts +++ b/packages/manager/src/features/Kubernetes/kubeUtils.ts @@ -1,5 +1,5 @@ import { useFlags } from 'src/hooks/useFlags'; -import { useAccountBeta } from 'src/queries/account/account'; +import { useAccount } from 'src/queries/account/account'; import { useAccountBetaQuery } from 'src/queries/account/betas'; import { isFeatureEnabledV2 } from 'src/utilities/accountCapabilities'; import { getBetaStatus } from 'src/utilities/betaUtils'; @@ -195,7 +195,7 @@ export const getLatestVersion = ( */ export const useIsLkeEnterpriseEnabled = () => { const flags = useFlags(); - const { data: account } = useAccountBeta(); + const { data: account } = useAccount(); const isLkeEnterpriseLAFlagEnabled = Boolean( flags?.lkeEnterprise?.enabled && flags.lkeEnterprise.la diff --git a/packages/manager/src/queries/account/account.ts b/packages/manager/src/queries/account/account.ts index 6511deba3db..2d9c787c57e 100644 --- a/packages/manager/src/queries/account/account.ts +++ b/packages/manager/src/queries/account/account.ts @@ -11,7 +11,6 @@ import { import { useSnackbar } from 'notistack'; import { useIsTaxIdEnabled } from 'src/features/Account/utils'; -import { useFlags } from 'src/hooks/useFlags'; import { useGrants, useProfile } from 'src/queries/profile/profile'; import { queryPresets } from '../base'; @@ -37,21 +36,6 @@ export const useAccount = () => { }); }; -/** - * @TODO LKE-E - M3-8838: Clean up after released to GA, if not otherwise in use - */ -export const useAccountBeta = () => { - const { data: profile } = useProfile(); - const flags = useFlags(); - - return useQuery({ - ...accountQueries.accountBeta, - ...queryPresets.oneTimeFetch, - ...queryPresets.noRetry, - enabled: !profile?.restricted && flags.lkeEnterprise?.enabled, - }); -}; - export const useMutateAccount = () => { const queryClient = useQueryClient(); const { enqueueSnackbar } = useSnackbar(); diff --git a/packages/manager/src/queries/account/queries.ts b/packages/manager/src/queries/account/queries.ts index d3629773c99..a874bd50381 100644 --- a/packages/manager/src/queries/account/queries.ts +++ b/packages/manager/src/queries/account/queries.ts @@ -3,7 +3,6 @@ import { getAccountBeta, getAccountBetas, getAccountInfo, - getAccountInfoBeta, getAccountLogins, getAccountMaintenance, getAccountSettings, @@ -33,13 +32,6 @@ export const accountQueries = createQueryKeys('account', { queryFn: getAccountInfo, queryKey: null, }, - /** - * @TODO LKE-E - M3-8838: Clean up after released to GA, if not otherwise in use - */ - accountBeta: { - queryFn: getAccountInfoBeta, - queryKey: null, - }, agreements: { queryFn: getAccountAgreements, queryKey: null,