From d16d402d81060161ff997cd027f4cfd7ef6c1d22 Mon Sep 17 00:00:00 2001 From: Elena Stoeva <59341489+ElenaStoeva@users.noreply.github.com> Date: Fri, 21 Jun 2024 16:05:44 +0100 Subject: [PATCH] [Rollups] Add attributes for tracking doc links clicks (#186612) Closes https://github.com/elastic/kibana/issues/186610 ## Summary This PR adds `data-test-subj` attributes to the doc links in the Rollup deprecation warning callout and the deprecation empty callout so that clicks on these links can be tracked on Fullstory. The links on the deprecation callout have test subjects with a prefix depending on whether they are on the list view page or the create form page so that we can differentiate the clicks from the different pages. --- .../deprecation_callout/deprecation_callout.tsx | 15 +++++++++++++-- .../crud_app/sections/job_create/job_create.js | 2 +- .../sections/job_list/deprecated_prompt.tsx | 1 + .../public/crud_app/sections/job_list/job_list.js | 2 +- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/rollup/public/crud_app/sections/components/deprecation_callout/deprecation_callout.tsx b/x-pack/plugins/rollup/public/crud_app/sections/components/deprecation_callout/deprecation_callout.tsx index 4b36b9a086b69c..877fd87cdf10c9 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/components/deprecation_callout/deprecation_callout.tsx +++ b/x-pack/plugins/rollup/public/crud_app/sections/components/deprecation_callout/deprecation_callout.tsx @@ -11,10 +11,16 @@ import { i18n } from '@kbn/i18n'; import React from 'react'; import { documentationLinks } from '../../../services/documentation_links'; +interface DeprecationCalloutProps { + /** The prefix to be applied at the test subjects for the doc links. + * Used for clicks tracking in Fullstory. */ + linksTestSubjPrefix: string; +} + /* A component for displaying a deprecation warning. */ -export const DeprecationCallout = () => { +export const DeprecationCallout = ({ linksTestSubjPrefix }: DeprecationCalloutProps) => { return ( { {i18n.translate('xpack.rollupJobs.deprecationCallout.migrationGuideLink', { defaultMessage: 'migration guide', @@ -37,7 +44,11 @@ export const DeprecationCallout = () => { ), downsamplingLink: ( - + {i18n.translate('xpack.rollupJobs.deprecationCallout.downsamplingLink', { defaultMessage: 'downsampling', })} diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_create/job_create.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/job_create.js index 4983fbb10ae8f2..28ebe01d7de0c5 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_create/job_create.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/job_create.js @@ -557,7 +557,7 @@ export class JobCreateUi extends Component { - + diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_list/deprecated_prompt.tsx b/x-pack/plugins/rollup/public/crud_app/sections/job_list/deprecated_prompt.tsx index ecdae95e908138..138495d834a890 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_list/deprecated_prompt.tsx +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_list/deprecated_prompt.tsx @@ -41,6 +41,7 @@ export const DeprecatedPrompt = () => { target="_blank" fill iconType="help" + data-test-subj="rollupDeprecatedPromptDocsLink" > - +