Skip to content

Commit

Permalink
[Rollups] Add attributes for tracking doc links clicks
Browse files Browse the repository at this point in the history
  • Loading branch information
ElenaStoeva committed Jun 21, 2024
1 parent 73ef3cf commit ef7e511
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -30,14 +36,19 @@ export const DeprecationCallout = () => {
<EuiLink
href={documentationLinks.elasticsearch.rollupMigratingToDownsampling}
target="_blank"
data-test-subj={`${linksTestSubjPrefix}-rollupDeprecationCalloutMigrationGuideLink`}
>
{i18n.translate('xpack.rollupJobs.deprecationCallout.migrationGuideLink', {
defaultMessage: 'migration guide',
})}
</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',
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ export class JobCreateUi extends Component {

<EuiSpacer size="l" />

<DeprecationCallout />
<DeprecationCallout linksTestSubjPrefix="createForm" />

<EuiSpacer size="l" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const DeprecatedPrompt = () => {
target="_blank"
fill
iconType="help"
data-test-subj="rollupDeprecatedPromptDocsLink"
>
<FormattedMessage
id="xpack.rollupJobs.deprecatedPrompt.downsamplingDocsButtonLabel"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export class JobListUi extends Component {

<EuiSpacer size="l" />

<DeprecationCallout />
<DeprecationCallout linksTestSubjPrefix="listView" />

<EuiSpacer size="l" />

Expand Down

0 comments on commit ef7e511

Please sign in to comment.