diff --git a/packages/manager/.changeset/pr-11156-tech-stories-1729784052355.md b/packages/manager/.changeset/pr-11156-tech-stories-1729784052355.md new file mode 100644 index 00000000000..63b427c420e --- /dev/null +++ b/packages/manager/.changeset/pr-11156-tech-stories-1729784052355.md @@ -0,0 +1,5 @@ +--- +'@linode/manager': Tech Stories +--- + +Remove the feature flag and tracking events used for A/B testing in the API CLI Tools modal, and update the DX Tools modal button copy to 'View Code Snippets ([#11156](https://github.com/linode/manager/pull/11156)) diff --git a/packages/manager/cypress/e2e/core/linodes/create-linode-view-code-snippet.spec.ts b/packages/manager/cypress/e2e/core/linodes/create-linode-view-code-snippet.spec.ts index 7064f974516..0ae05e81ecc 100644 --- a/packages/manager/cypress/e2e/core/linodes/create-linode-view-code-snippet.spec.ts +++ b/packages/manager/cypress/e2e/core/linodes/create-linode-view-code-snippet.spec.ts @@ -6,18 +6,12 @@ import { ui } from 'support/ui'; import { randomLabel, randomString } from 'support/util/random'; import { linodeCreatePage } from 'support/ui/pages'; -import { mockAppendFeatureFlags } from 'support/intercepts/feature-flags'; describe('Create Linode flow to validate code snippet modal', () => { /* * tests for create Linode flow to validate code snippet modal. */ - // TODO Delete these mocks once `testdxtoolabexperiment` feature flag is retired. - beforeEach(() => { - mockAppendFeatureFlags({ - testdxtoolabexperiment: 'Create using command line', - }); - }); + it(`view code snippets in create linode flow`, () => { const linodeLabel = randomLabel(); const rootPass = randomString(32); @@ -33,7 +27,7 @@ describe('Create Linode flow to validate code snippet modal', () => { // View Code Snippets and confirm it's provisioned as expected. ui.button - .findByTitle('Create using command line') + .findByTitle('View Code Snippets') .should('be.visible') .should('be.enabled') .click(); diff --git a/packages/manager/src/components/CodeBlock/CodeBlock.tsx b/packages/manager/src/components/CodeBlock/CodeBlock.tsx index d4b97f6e4ec..695bd8e0fe2 100644 --- a/packages/manager/src/components/CodeBlock/CodeBlock.tsx +++ b/packages/manager/src/components/CodeBlock/CodeBlock.tsx @@ -1,8 +1,5 @@ -import { useLDClient } from 'launchdarkly-react-client-sdk'; import React from 'react'; -import { useFlags } from 'src/hooks/useFlags'; -import { useIsAkamaiAccount } from 'src/hooks/useIsAkamaiAccount'; import { sendApiAwarenessClickEvent } from 'src/utilities/analytics/customEventAnalytics'; import { @@ -22,32 +19,13 @@ export interface CodeBlockProps { handleCopyIconClick?: () => void; /** The command language */ language: SupportedLanguage; - ldTrackingKey?: string; } export const CodeBlock = (props: CodeBlockProps) => { - const flags = useFlags(); - const ldClient = useLDClient(); - const { isAkamaiAccount: isInternalAccount } = useIsAkamaiAccount(); - - const { - command, - commandType, - handleCopyIconClick, - language, - ldTrackingKey, - } = props; - - const apicliButtonCopy = flags?.testdxtoolabexperiment; + const { command, commandType, handleCopyIconClick, language } = props; const _handleCopyIconClick = () => { sendApiAwarenessClickEvent('Copy Icon', commandType); - if (ldTrackingKey && !isInternalAccount) { - ldClient?.track(ldTrackingKey, { - variation: apicliButtonCopy, - }); - ldClient?.flush(); - } }; return ( diff --git a/packages/manager/src/featureFlags.ts b/packages/manager/src/featureFlags.ts index 64f07f0ed54..9a92408132d 100644 --- a/packages/manager/src/featureFlags.ts +++ b/packages/manager/src/featureFlags.ts @@ -124,7 +124,6 @@ export interface Flags { taxCollectionBanner: TaxCollectionBanner; taxId: BaseFeatureFlag; taxes: Taxes; - testdxtoolabexperiment: string; tpaProviders: Provider[]; } diff --git a/packages/manager/src/features/Linodes/LinodeCreate/Actions.test.tsx b/packages/manager/src/features/Linodes/LinodeCreate/Actions.test.tsx index ba5d303d69c..f7ff507d752 100644 --- a/packages/manager/src/features/Linodes/LinodeCreate/Actions.test.tsx +++ b/packages/manager/src/features/Linodes/LinodeCreate/Actions.test.tsx @@ -16,12 +16,12 @@ describe('Actions', () => { expect(button).toHaveAttribute('type', 'submit'); expect(button).toBeEnabled(); }); - it("should render a 'Create using command line' button", () => { + it("should render a ' View Code Snippets' button", () => { const { getByText } = renderWithThemeAndHookFormContext({ component: , }); - const button = getByText('Create Using Command Line').closest('button'); + const button = getByText('View Code Snippets').closest('button'); expect(button).toBeVisible(); expect(button).toBeEnabled(); diff --git a/packages/manager/src/features/Linodes/LinodeCreate/Actions.tsx b/packages/manager/src/features/Linodes/LinodeCreate/Actions.tsx index d24c563fcf3..b1097ff730c 100644 --- a/packages/manager/src/features/Linodes/LinodeCreate/Actions.tsx +++ b/packages/manager/src/features/Linodes/LinodeCreate/Actions.tsx @@ -1,12 +1,8 @@ -import { useLDClient } from 'launchdarkly-react-client-sdk'; import React, { useState } from 'react'; import { useFormContext } from 'react-hook-form'; import { Box } from 'src/components/Box'; import { Button } from 'src/components/Button/Button'; -import { LD_DX_TOOLS_METRICS_KEYS } from 'src/constants'; -import { useFlags } from 'src/hooks/useFlags'; -import { useIsAkamaiAccount } from 'src/hooks/useIsAkamaiAccount'; import { useRestrictedGlobalGrantCheck } from 'src/hooks/useRestrictedGlobalGrantCheck'; import { sendApiAwarenessClickEvent } from 'src/utilities/analytics/customEventAnalytics'; import { sendLinodeCreateFormInputEvent } from 'src/utilities/analytics/formEventAnalytics'; @@ -21,15 +17,10 @@ import { import type { LinodeCreateFormValues } from './utilities'; export const Actions = () => { - const flags = useFlags(); - const ldClient = useLDClient(); const { params } = useLinodeCreateQueryParams(); - const { isAkamaiAccount: isInternalAccount } = useIsAkamaiAccount(); const [isAPIAwarenessModalOpen, setIsAPIAwarenessModalOpen] = useState(false); - const apicliButtonCopy = flags?.testdxtoolabexperiment; - const { formState, getValues, @@ -44,22 +35,15 @@ export const Actions = () => { isLinodeCreateRestricted || 'firewallOverride' in formState.errors; const onOpenAPIAwareness = async () => { - sendApiAwarenessClickEvent('Button', 'Create Using Command Line'); + sendApiAwarenessClickEvent('Button', 'View Code Snippets'); sendLinodeCreateFormInputEvent({ createType: params.type ?? 'OS', interaction: 'click', - label: apicliButtonCopy ?? 'Create Using Command Line', + label: 'View Code Snippets', }); if (await trigger()) { // If validation is successful, we open the dialog. setIsAPIAwarenessModalOpen(true); - if (!isInternalAccount) { - ldClient?.track(LD_DX_TOOLS_METRICS_KEYS.OPEN_MODAL, { - variation: apicliButtonCopy, - }); - } - - ldClient?.flush(); } else { scrollErrorIntoView(undefined, { behavior: 'smooth' }); } @@ -68,7 +52,7 @@ export const Actions = () => { return (