[ML] Use documentation link service in more ML pages (#87389)
This commit is contained in:
parent
ff8d30bc6c
commit
a9797999a1
|
@ -96,7 +96,7 @@ exports[`RuleEditorFlyout renders the flyout after adding a condition to a rule
|
||||||
values={
|
values={
|
||||||
Object {
|
Object {
|
||||||
"learnMoreLink": <EuiLink
|
"learnMoreLink": <EuiLink
|
||||||
href="https://www.elastic.co/guide/en/machine-learning/jest-metadata-mock-branch/ml-rules.html"
|
href="jest-metadata-mock-url"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
|
@ -355,7 +355,7 @@ exports[`RuleEditorFlyout renders the flyout after setting the rule to edit 1`]
|
||||||
values={
|
values={
|
||||||
Object {
|
Object {
|
||||||
"learnMoreLink": <EuiLink
|
"learnMoreLink": <EuiLink
|
||||||
href="https://www.elastic.co/guide/en/machine-learning/jest-metadata-mock-branch/ml-rules.html"
|
href="jest-metadata-mock-url"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
|
@ -600,7 +600,7 @@ exports[`RuleEditorFlyout renders the flyout for creating a rule with conditions
|
||||||
values={
|
values={
|
||||||
Object {
|
Object {
|
||||||
"learnMoreLink": <EuiLink
|
"learnMoreLink": <EuiLink
|
||||||
href="https://www.elastic.co/guide/en/machine-learning/jest-metadata-mock-branch/ml-rules.html"
|
href="jest-metadata-mock-url"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
|
|
|
@ -479,8 +479,7 @@ class RuleEditorFlyoutUI extends Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } = this.props.kibana.services.docLinks;
|
const docsUrl = this.props.kibana.services.docLinks.links.ml.customRules;
|
||||||
const docsUrl = `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-rules.html`;
|
|
||||||
const {
|
const {
|
||||||
isFlyoutVisible,
|
isFlyoutVisible,
|
||||||
job,
|
job,
|
||||||
|
|
|
@ -86,8 +86,11 @@ function prepareTest() {
|
||||||
kibana: {
|
kibana: {
|
||||||
services: {
|
services: {
|
||||||
docLinks: {
|
docLinks: {
|
||||||
ELASTIC_WEBSITE_URL: 'https://www.elastic.co/',
|
links: {
|
||||||
DOC_LINK_VERSION: 'jest-metadata-mock-branch',
|
ml: {
|
||||||
|
customRules: 'jest-metadata-mock-url',
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -309,8 +309,7 @@ export class ValidateJobUI extends Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } = getDocLinks();
|
const jobTipsUrl = getDocLinks().links.ml.anomalyDetectionJobTips;
|
||||||
const jobTipsUrl = `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/create-jobs.html#job-tips`;
|
|
||||||
// only set to false if really false and not another falsy value, so it defaults to true.
|
// only set to false if really false and not another falsy value, so it defaults to true.
|
||||||
const fill = this.props.fill === false ? false : true;
|
const fill = this.props.fill === false ? false : true;
|
||||||
// default to false if not explicitly set to true
|
// default to false if not explicitly set to true
|
||||||
|
|
|
@ -11,8 +11,11 @@ import { ValidateJob } from './validate_job_view';
|
||||||
|
|
||||||
jest.mock('../../util/dependency_cache', () => ({
|
jest.mock('../../util/dependency_cache', () => ({
|
||||||
getDocLinks: () => ({
|
getDocLinks: () => ({
|
||||||
ELASTIC_WEBSITE_URL: 'https://www.elastic.co/',
|
links: {
|
||||||
DOC_LINK_VERSION: 'jest-metadata-mock-branch',
|
ml: {
|
||||||
|
anomalyDetectionJobTips: 'jest-metadata-mock-url',
|
||||||
|
},
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
@ -43,8 +43,7 @@ export const DetailsStepForm: FC<CreateAnalyticsStepProps> = ({
|
||||||
const {
|
const {
|
||||||
services: { docLinks, notifications },
|
services: { docLinks, notifications },
|
||||||
} = useMlKibana();
|
} = useMlKibana();
|
||||||
const { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } = docLinks;
|
const createIndexLink = docLinks.links.apis.createIndex;
|
||||||
|
|
||||||
const { setFormState } = actions;
|
const { setFormState } = actions;
|
||||||
const { form, cloneJob, hasSwitchedToEditor, isJobCreated } = state;
|
const { form, cloneJob, hasSwitchedToEditor, isJobCreated } = state;
|
||||||
const {
|
const {
|
||||||
|
@ -240,10 +239,7 @@ export const DetailsStepForm: FC<CreateAnalyticsStepProps> = ({
|
||||||
}
|
}
|
||||||
)}
|
)}
|
||||||
<br />
|
<br />
|
||||||
<EuiLink
|
<EuiLink href={createIndexLink} target="_blank">
|
||||||
href={`${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/reference/${DOC_LINK_VERSION}/indices-create-index.html#indices-create-index`}
|
|
||||||
target="_blank"
|
|
||||||
>
|
|
||||||
{i18n.translate(
|
{i18n.translate(
|
||||||
'xpack.ml.dataframe.stepDetailsForm.destinationIndexInvalidErrorLink',
|
'xpack.ml.dataframe.stepDetailsForm.destinationIndexInvalidErrorLink',
|
||||||
{
|
{
|
||||||
|
|
|
@ -84,7 +84,7 @@ exports[`Overrides render overrides 1`] = `
|
||||||
size="xs"
|
size="xs"
|
||||||
>
|
>
|
||||||
<EuiLink
|
<EuiLink
|
||||||
href="https://www.elastic.co/guide/en/elasticsearch/reference/jest-metadata-mock-branch/search-aggregations-bucket-daterange-aggregation.html#date-format-pattern"
|
href="jest-metadata-mock-url"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
See more on accepted formats
|
See more on accepted formats
|
||||||
|
|
|
@ -268,8 +268,7 @@ class OverridesUI extends Component {
|
||||||
|
|
||||||
const fieldOptions = getSortedFields(fields);
|
const fieldOptions = getSortedFields(fields);
|
||||||
const timestampFormatErrorsList = [this.customTimestampFormatErrors, timestampFormatError];
|
const timestampFormatErrorsList = [this.customTimestampFormatErrors, timestampFormatError];
|
||||||
const { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } = this.props.kibana.services.docLinks;
|
const docsUrl = this.props.kibana.services.docLinks.links.aggs.date_format_pattern;
|
||||||
const docsUrl = `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/reference/${DOC_LINK_VERSION}/search-aggregations-bucket-daterange-aggregation.html#date-format-pattern`;
|
|
||||||
|
|
||||||
const timestampFormatHelp = (
|
const timestampFormatHelp = (
|
||||||
<EuiText size="xs">
|
<EuiText size="xs">
|
||||||
|
|
|
@ -26,8 +26,11 @@ function getProps() {
|
||||||
kibana: {
|
kibana: {
|
||||||
services: {
|
services: {
|
||||||
docLinks: {
|
docLinks: {
|
||||||
ELASTIC_WEBSITE_URL: 'https://www.elastic.co/',
|
links: {
|
||||||
DOC_LINK_VERSION: 'jest-metadata-mock-branch',
|
aggs: {
|
||||||
|
date_format_pattern: 'jest-metadata-mock-url',
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -90,7 +90,7 @@ exports[`CalendarListsHeader renders header 1`] = `
|
||||||
Object {
|
Object {
|
||||||
"br": <br />,
|
"br": <br />,
|
||||||
"learnMoreLink": <EuiLink
|
"learnMoreLink": <EuiLink
|
||||||
href="https://www.elastic.co/guide/en/machine-learning/jest-metadata-mock-branch/ml-calendars.html"
|
href="jest-metadata-mock-url"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
|
|
|
@ -117,10 +117,6 @@ const props = {
|
||||||
addDanger: () => {},
|
addDanger: () => {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
docLinks: {
|
|
||||||
ELASTIC_WEBSITE_URL: 'https://www.elastic.co/',
|
|
||||||
DOC_LINK_VERSION: 'jest-metadata-mock-branch',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -26,9 +26,7 @@ import {
|
||||||
import { withKibana } from '../../../../../../../../src/plugins/kibana_react/public';
|
import { withKibana } from '../../../../../../../../src/plugins/kibana_react/public';
|
||||||
|
|
||||||
function CalendarsListHeaderUI({ totalCount, refreshCalendars, kibana }) {
|
function CalendarsListHeaderUI({ totalCount, refreshCalendars, kibana }) {
|
||||||
const { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } = kibana.services.docLinks;
|
const docsUrl = kibana.services.docLinks.links.ml.calendars;
|
||||||
|
|
||||||
const docsUrl = `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-calendars.html`;
|
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<EuiFlexGroup justifyContent="spaceBetween" alignItems="baseline">
|
<EuiFlexGroup justifyContent="spaceBetween" alignItems="baseline">
|
||||||
|
|
|
@ -24,8 +24,11 @@ describe('CalendarListsHeader', () => {
|
||||||
kibana: {
|
kibana: {
|
||||||
services: {
|
services: {
|
||||||
docLinks: {
|
docLinks: {
|
||||||
ELASTIC_WEBSITE_URL: 'https://www.elastic.co/',
|
links: {
|
||||||
DOC_LINK_VERSION: 'jest-metadata-mock-branch',
|
ml: {
|
||||||
|
calendars: 'jest-metadata-mock-url',
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -26,8 +26,7 @@ import {
|
||||||
import { withKibana } from '../../../../../../../../src/plugins/kibana_react/public';
|
import { withKibana } from '../../../../../../../../src/plugins/kibana_react/public';
|
||||||
|
|
||||||
function FilterListsHeaderUI({ totalCount, refreshFilterLists, kibana }) {
|
function FilterListsHeaderUI({ totalCount, refreshFilterLists, kibana }) {
|
||||||
const { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } = kibana.services.docLinks;
|
const docsUrl = kibana.services.docLinks.links.ml.customRules;
|
||||||
const docsUrl = `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-rules.html`;
|
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<EuiFlexGroup justifyContent="spaceBetween" alignItems="baseline">
|
<EuiFlexGroup justifyContent="spaceBetween" alignItems="baseline">
|
||||||
|
|
Loading…
Reference in a new issue