Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Rollups] Add attributes for tracking doc links clicks #186612

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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