mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[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.
This commit is contained in:
parent
7129eea6d5
commit
d16d402d81
4 changed files with 16 additions and 4 deletions
|
@ -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 (
|
||||
<EuiCallOut
|
||||
title="Deprecated in 8.11.0"
|
||||
|
@ -30,6 +36,7 @@ export const DeprecationCallout = () => {
|
|||
<EuiLink
|
||||
href={documentationLinks.elasticsearch.rollupMigratingToDownsampling}
|
||||
target="_blank"
|
||||
data-test-subj={`${linksTestSubjPrefix}-rollupDeprecationCalloutMigrationGuideLink`}
|
||||
>
|
||||
{i18n.translate('xpack.rollupJobs.deprecationCallout.migrationGuideLink', {
|
||||
defaultMessage: 'migration guide',
|
||||
|
@ -37,7 +44,11 @@ export const DeprecationCallout = () => {
|
|||
</EuiLink>
|
||||
),
|
||||
downsamplingLink: (
|
||||
<EuiLink href={documentationLinks.fleet.datastreamsDownsampling} target="_blank">
|
||||
<EuiLink
|
||||
href={documentationLinks.fleet.datastreamsDownsampling}
|
||||
target="_blank"
|
||||
data-test-subj={`${linksTestSubjPrefix}-rollupDeprecationCalloutDownsamplingDocLink`}
|
||||
>
|
||||
{i18n.translate('xpack.rollupJobs.deprecationCallout.downsamplingLink', {
|
||||
defaultMessage: 'downsampling',
|
||||
})}
|
||||
|
|
|
@ -557,7 +557,7 @@ export class JobCreateUi extends Component {
|
|||
|
||||
<EuiSpacer size="l" />
|
||||
|
||||
<DeprecationCallout />
|
||||
<DeprecationCallout linksTestSubjPrefix="createForm" />
|
||||
|
||||
<EuiSpacer size="l" />
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@ export const DeprecatedPrompt = () => {
|
|||
target="_blank"
|
||||
fill
|
||||
iconType="help"
|
||||
data-test-subj="rollupDeprecatedPromptDocsLink"
|
||||
>
|
||||
<FormattedMessage
|
||||
id="xpack.rollupJobs.deprecatedPrompt.downsamplingDocsButtonLabel"
|
||||
|
|
|
@ -173,7 +173,7 @@ export class JobListUi extends Component {
|
|||
|
||||
<EuiSpacer size="l" />
|
||||
|
||||
<DeprecationCallout />
|
||||
<DeprecationCallout linksTestSubjPrefix="listView" />
|
||||
|
||||
<EuiSpacer size="l" />
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue