diff --git a/packages/manager/.changeset/pr-11036-changed-1727881220211.md b/packages/manager/.changeset/pr-11036-changed-1727881220211.md new file mode 100644 index 00000000000..9b3e23e21a8 --- /dev/null +++ b/packages/manager/.changeset/pr-11036-changed-1727881220211.md @@ -0,0 +1,5 @@ +--- +'@linode/manager': Changed +--- + +Remove the 512GB plan selection from DBaaS ([#11036](https://github.com/linode/manager/pull/11036)) diff --git a/packages/manager/src/features/components/PlansPanel/constants.ts b/packages/manager/src/features/components/PlansPanel/constants.ts index 40c10140dbd..0f39829526a 100644 --- a/packages/manager/src/features/components/PlansPanel/constants.ts +++ b/packages/manager/src/features/components/PlansPanel/constants.ts @@ -1,4 +1,3 @@ -import type { PlanSelectionType } from './types'; import type { ExtendedType } from 'src/utilities/extendType'; export const LIMITED_AVAILABILITY_COPY = @@ -81,70 +80,6 @@ export const DEDICATED_512_GB_PLAN: ExtendedType = { vcpus: 64, }; -export const DBAAS_DEDICATED_512_GB_PLAN: PlanSelectionType = { - class: 'dedicated', - disk: 7372800, - // engines: { - // mysql: [ - // { - // price: { - // hourly: 12.48, - // monthly: 8320, - // }, - // quantity: 1, - // }, - // { - // price: { - // hourly: 24.96, - // monthly: 16640, - // }, - // quantity: 2, - // }, - // { - // price: { - // hourly: 37.44, - // monthly: 24960, - // }, - // quantity: 3, - // }, - // ], - // postgresql: [ - // { - // price: { - // hourly: 12.48, - // monthly: 8320, - // }, - // quantity: 1, - // }, - // { - // price: { - // hourly: 24.96, - // monthly: 16640, - // }, - // quantity: 2, - // }, - // { - // price: { - // hourly: 37.44, - // monthly: 24960, - // }, - // quantity: 3, - // }, - // ], - // }, - formattedLabel: 'Dedicated 512 GB', - heading: 'Dedicated 512 GB', - id: 'g6-dedicated-64', - label: 'DBaaS - Dedicated 512GB', - memory: 524288, - price: { - hourly: 12.48, - monthly: 8320, - }, - subHeadings: ['$8320/mo ($12.48/hr)', '64 CPU, 7200 GB Storage, 512 GB RAM'], - vcpus: 64, -}; - export const PREMIUM_512_GB_PLAN: ExtendedType = { addons: { backups: { diff --git a/packages/manager/src/features/components/PlansPanel/utils.test.ts b/packages/manager/src/features/components/PlansPanel/utils.test.ts index 04377043f3f..97d282236bf 100644 --- a/packages/manager/src/features/components/PlansPanel/utils.test.ts +++ b/packages/manager/src/features/components/PlansPanel/utils.test.ts @@ -10,6 +10,7 @@ import { getIsLimitedAvailability, getPlanSelectionsByPlanType, planTypeOrder, + replaceOrAppendPlaceholder512GbPlans, } from './utils'; import type { PlanSelectionType } from './types'; @@ -417,4 +418,39 @@ describe('extractPlansInformation', () => { expect(result).toBe(PLAN_IS_CURRENTLY_UNAVAILABLE_COPY); }); }); + + describe('replaceOrAppendPlaceholder512GbPlans', () => { + it('should not append to DBaaS plans', () => { + const plans = [ + { + id: 'g6-dedicated-56', + label: 'DBaaS - Dedicated 256GB', + }, + ] as PlanSelectionType[]; + const results = replaceOrAppendPlaceholder512GbPlans(plans); + expect(results.length).toEqual(1); + }); + + it('should append to Linode plans', () => { + const plans = [ + { + id: 'g6-dedicated-56', + label: 'Dedicated 256GB', + }, + ] as PlanSelectionType[]; + const results = replaceOrAppendPlaceholder512GbPlans(plans); + expect(results.length).toEqual(3); + }); + + it('should replace the Linode plan', () => { + const plans = [ + { + id: 'not-the-right-id', + label: 'Premium 512GB', + }, + ] as PlanSelectionType[]; + const results = replaceOrAppendPlaceholder512GbPlans(plans); + expect(results[0].id).toEqual('g7-premium-64'); + }); + }); }); diff --git a/packages/manager/src/features/components/PlansPanel/utils.ts b/packages/manager/src/features/components/PlansPanel/utils.ts index e79a52c9cfe..5441ff30905 100644 --- a/packages/manager/src/features/components/PlansPanel/utils.ts +++ b/packages/manager/src/features/components/PlansPanel/utils.ts @@ -2,7 +2,6 @@ import { arrayToList } from 'src/utilities/arrayToList'; import { ExtendedType } from 'src/utilities/extendType'; import { - DBAAS_DEDICATED_512_GB_PLAN, DEDICATED_512_GB_PLAN, LIMITED_AVAILABILITY_COPY, PLAN_IS_CURRENTLY_UNAVAILABLE_COPY, @@ -223,7 +222,11 @@ export const planTabInfoContent = { export const replaceOrAppendPlaceholder512GbPlans = ( types: (ExtendedType | PlanSelectionType)[] ) => { + // DBaaS does not currently offer a 512 GB plan const isInDatabasesFlow = types.some((type) => type.label.includes('DBaaS')); + if (isInDatabasesFlow) { + return types; + } // Function to replace or append a specific plan const replaceOrAppendPlan = ( @@ -239,13 +242,9 @@ export const replaceOrAppendPlaceholder512GbPlans = ( } }; - if (isInDatabasesFlow) { - replaceOrAppendPlan('DBaaS - Dedicated 512GB', DBAAS_DEDICATED_512_GB_PLAN); - } else { - // For Linodes and LKE - replaceOrAppendPlan('Dedicated 512GB', DEDICATED_512_GB_PLAN); - replaceOrAppendPlan('Premium 512GB', PREMIUM_512_GB_PLAN); - } + // For Linodes and LKE + replaceOrAppendPlan('Dedicated 512GB', DEDICATED_512_GB_PLAN); + replaceOrAppendPlan('Premium 512GB', PREMIUM_512_GB_PLAN); return types; };