Skip to content
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 @@ -634,6 +634,7 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D
elasticManagedLlm: `${ELASTIC_DOCS}reference/kibana/connectors-kibana/elastic-managed-llm`,
elasticManagedLlmUsageCost: `${ELASTIC_WEBSITE_URL}pricing`,
elasticServerlessSearchManagedLlmUsageCost: `${ELASTIC_WEBSITE_URL}pricing/serverless-search`,
downsamplingConcepts: `${ELASTIC_DOCS}manage-data/data-store/data-streams/downsampling-concepts`,
},
alerting: {
guide: `${ELASTIC_DOCS}explore-analyze/alerts-cases/alerts/create-manage-rules`,
Expand Down
1 change: 1 addition & 0 deletions src/platform/packages/shared/kbn-doc-links/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ export interface DocLinks {
elasticManagedLlm: string;
elasticManagedLlmUsageCost: string;
elasticServerlessSearchManagedLlmUsageCost: string;
downsamplingConcepts: string;
}>;
readonly alerting: Readonly<{
authorization: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import React from 'react';
import { act, fireEvent, render, screen, waitFor, within } from '@testing-library/react';
import { I18nProvider } from '@kbn/i18n-react';
import type { IlmPolicyPhases, PhaseName } from '@kbn/streams-schema';
import { EditIlmPhasesFlyout } from './edit_ilm_phases_flyout';

Expand Down Expand Up @@ -94,7 +95,11 @@ const renderFlyout = (
);
};

const { unmount } = render(<Wrapper />);
const { unmount } = render(
<I18nProvider>
<Wrapper />
</I18nProvider>
);

return {
onClose,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import React, { useCallback, useEffect } from 'react';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import type { IlmPolicyPhases } from '@kbn/streams-schema';
import type { FormHook } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib';
import { useFormData } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib';
Expand All @@ -18,12 +19,14 @@ import {
EuiTitle,
EuiCallOut,
useGeneratedHtmlId,
EuiLink,
} from '@elastic/eui';
import type { DownsamplePhase, IlmPhasesFlyoutFormInternal } from '../form';
import { DOWNSAMPLE_PHASES } from '../form';
import { DownsampleIntervalField } from '../form';
import { getDoubledDurationFromPrevious, type PreservedTimeUnit } from '../../shared';
import { TIME_UNIT_OPTIONS } from '../constants';
import { useKibana } from '../../../../../../hooks/use_kibana';

export interface DownsampleFieldSectionProps {
form: FormHook<IlmPolicyPhases, IlmPhasesFlyoutFormInternal>;
Expand Down Expand Up @@ -67,6 +70,10 @@ export const DownsampleFieldSection = ({
}
}, [isEnabled, isReadonlyEnabled, resetReadonly]);

const {
core: { docLinks },
} = useKibana();

if (!enabledField) return null;

return (
Expand Down Expand Up @@ -179,10 +186,22 @@ export const DownsampleFieldSection = ({
defaultMessage: 'Downsampling is unavailable for this stream',
})}
>
{i18n.translate('xpack.streams.editIlmPhasesFlyout.downsamplingNotSupportedBody', {
defaultMessage:
"Downsampling only works for time series streams. Configuring these settings won't effect how this stream's data is stored.",
})}
<FormattedMessage
id="xpack.streams.editIlmPhasesFlyout.downsamplingNotSupportedBody"
defaultMessage="Downsampling only works for time series streams. Configuring these settings won't effect how this stream's data is stored. {learnMoreLink}"
values={{
learnMoreLink: (
<EuiLink
href={docLinks?.links?.observability?.downsamplingConcepts}
target="_blank"
>
{i18n.translate('xpack.streams.editIlmPhasesFlyout.downsamplingLearnMoreLink', {
defaultMessage: 'Learn more',
})}
</EuiLink>
),
}}
/>
</EuiCallOut>
)}

Expand Down
Loading