Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,7 @@ class RuleEditorFlyoutUI extends Component {
};

render() {
const { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } = this.props.kibana.services.docLinks;
const docsUrl = `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-rules.html`;
const docsUrl = this.props.kibana.services.docLinks.links.ml.customRules;
const {
isFlyoutVisible,
job,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@ function prepareTest() {
kibana: {
services: {
docLinks: {
ELASTIC_WEBSITE_URL: 'https://www.elastic.co/',
DOC_LINK_VERSION: 'jest-metadata-mock-branch',
links: {
ml: {
customRules: 'jest-metadata-mock-url',
},
},
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,7 @@ export class ValidateJobUI extends Component {
};

render() {
const { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } = getDocLinks();
const jobTipsUrl = `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/create-jobs.html#job-tips`;
const jobTipsUrl = getDocLinks().links.ml.anomalyDetectionJobTips;
// 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;
// default to false if not explicitly set to true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ import { ValidateJob } from './validate_job_view';

jest.mock('../../util/dependency_cache', () => ({
getDocLinks: () => ({
ELASTIC_WEBSITE_URL: 'https://www.elastic.co/',
DOC_LINK_VERSION: 'jest-metadata-mock-branch',
links: {
ml: {
anomalyDetectionJobTips: 'jest-metadata-mock-url',
},
},
}),
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ export const DetailsStepForm: FC<CreateAnalyticsStepProps> = ({
const {
services: { docLinks, notifications },
} = useMlKibana();
const { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } = docLinks;

const createIndexLink = docLinks.links.apis.createIndex;
const { setFormState } = actions;
const { form, cloneJob, hasSwitchedToEditor, isJobCreated } = state;
const {
Expand Down Expand Up @@ -240,10 +239,7 @@ export const DetailsStepForm: FC<CreateAnalyticsStepProps> = ({
}
)}
<br />
<EuiLink
href={`${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/reference/${DOC_LINK_VERSION}/indices-create-index.html#indices-create-index`}
target="_blank"
>
<EuiLink href={createIndexLink} target="_blank">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering, where we use an EuiLink in this way, should the text end with a . ? Some places we end with a . and some we don't.

image

I prefer without the .

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an example of "Learn more" with an ending period in https://elastic.github.io/eui/#/guidelines/writing and a quick chat with @gchaps indicates it's preferred in general. I will open a separate PR to get consistency on that.

{i18n.translate(
'xpack.ml.dataframe.stepDetailsForm.destinationIndexInvalidErrorLink',
{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,7 @@ class OverridesUI extends Component {

const fieldOptions = getSortedFields(fields);
const timestampFormatErrorsList = [this.customTimestampFormatErrors, timestampFormatError];
const { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } = this.props.kibana.services.docLinks;
const docsUrl = `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/reference/${DOC_LINK_VERSION}/search-aggregations-bucket-daterange-aggregation.html#date-format-pattern`;
const docsUrl = this.props.kibana.services.docLinks.links.aggs.date_format_pattern;

const timestampFormatHelp = (
<EuiText size="xs">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ function getProps() {
kibana: {
services: {
docLinks: {
ELASTIC_WEBSITE_URL: 'https://www.elastic.co/',
DOC_LINK_VERSION: 'jest-metadata-mock-branch',
links: {
aggs: {
date_format_pattern: 'jest-metadata-mock-url',
},
},
},
},
},
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,6 @@ const props = {
addDanger: () => {},
},
},
docLinks: {
ELASTIC_WEBSITE_URL: 'https://www.elastic.co/',
DOC_LINK_VERSION: 'jest-metadata-mock-branch',
},
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ import {
import { withKibana } from '../../../../../../../../src/plugins/kibana_react/public';

function CalendarsListHeaderUI({ totalCount, refreshCalendars, kibana }) {
const { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } = kibana.services.docLinks;

const docsUrl = `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-calendars.html`;
const docsUrl = kibana.services.docLinks.links.ml.calendars;
return (
<React.Fragment>
<EuiFlexGroup justifyContent="spaceBetween" alignItems="baseline">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ describe('CalendarListsHeader', () => {
kibana: {
services: {
docLinks: {
ELASTIC_WEBSITE_URL: 'https://www.elastic.co/',
DOC_LINK_VERSION: 'jest-metadata-mock-branch',
links: {
ml: {
calendars: 'jest-metadata-mock-url',
},
},
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ import {
import { withKibana } from '../../../../../../../../src/plugins/kibana_react/public';

function FilterListsHeaderUI({ totalCount, refreshFilterLists, kibana }) {
const { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } = kibana.services.docLinks;
const docsUrl = `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-rules.html`;
const docsUrl = kibana.services.docLinks.links.ml.customRules;
return (
<React.Fragment>
<EuiFlexGroup justifyContent="spaceBetween" alignItems="baseline">
Expand Down