mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
[ML] File Data Visualiser - Link for timestamp notation docs/guide (#39037)
* add helpText with doc link to timestamp format * add internationalization * update snapshot
This commit is contained in:
parent
d4e3e3d779
commit
76777c5c92
2 changed files with 34 additions and 4 deletions
|
@ -74,6 +74,20 @@ exports[`Overrides render overrides 1`] = `
|
||||||
describedByIds={Array []}
|
describedByIds={Array []}
|
||||||
fullWidth={false}
|
fullWidth={false}
|
||||||
hasEmptyLabelSpace={false}
|
hasEmptyLabelSpace={false}
|
||||||
|
helpText={
|
||||||
|
<EuiText
|
||||||
|
size="xs"
|
||||||
|
>
|
||||||
|
<EuiLink
|
||||||
|
color="primary"
|
||||||
|
href="https://www.elastic.co/guide/en/elasticsearch/reference/jest-metadata-mock-branch/search-aggregations-bucket-daterange-aggregation.html#date-format-pattern"
|
||||||
|
target="_blank"
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
See more on accepted formats
|
||||||
|
</EuiLink>
|
||||||
|
</EuiText>
|
||||||
|
}
|
||||||
label={
|
label={
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
defaultMessage="Timestamp format"
|
defaultMessage="Timestamp format"
|
||||||
|
|
|
@ -10,17 +10,20 @@ import { i18n } from '@kbn/i18n';
|
||||||
import React, {
|
import React, {
|
||||||
Component,
|
Component,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
|
import { metadata } from 'ui/metadata';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
EuiForm,
|
|
||||||
EuiFormRow,
|
|
||||||
EuiFieldText,
|
|
||||||
EuiComboBox,
|
EuiComboBox,
|
||||||
EuiCheckbox,
|
EuiCheckbox,
|
||||||
|
EuiFieldNumber,
|
||||||
|
EuiFieldText,
|
||||||
|
EuiForm,
|
||||||
|
EuiFormRow,
|
||||||
|
EuiLink,
|
||||||
EuiSpacer,
|
EuiSpacer,
|
||||||
|
EuiText,
|
||||||
EuiTitle,
|
EuiTitle,
|
||||||
EuiTextArea,
|
EuiTextArea,
|
||||||
EuiFieldNumber,
|
|
||||||
} from '@elastic/eui';
|
} from '@elastic/eui';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
@ -260,6 +263,18 @@ export class Overrides extends Component {
|
||||||
|
|
||||||
const fieldOptions = getSortedFields(fields);
|
const fieldOptions = getSortedFields(fields);
|
||||||
const timestampFormatErrorsList = [this.customTimestampFormatErrors, timestampFormatError];
|
const timestampFormatErrorsList = [this.customTimestampFormatErrors, timestampFormatError];
|
||||||
|
// metadata.branch corresponds to the version used in documentation links.
|
||||||
|
const docsUrl = `https://www.elastic.co/guide/en/elasticsearch/reference/${metadata.branch}/search-aggregations-bucket-daterange-aggregation.html#date-format-pattern`;
|
||||||
|
|
||||||
|
const timestampFormatHelp = (
|
||||||
|
<EuiText size="xs">
|
||||||
|
<EuiLink href={docsUrl} target="_blank">
|
||||||
|
{i18n.translate('xpack.ml.fileDatavisualizer.editFlyout.overrides.timestampFormatHelpText', {
|
||||||
|
defaultMessage: 'See more on accepted formats'
|
||||||
|
})}
|
||||||
|
</EuiLink>
|
||||||
|
</EuiText>
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
||||||
|
@ -401,6 +416,7 @@ export class Overrides extends Component {
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
}
|
}
|
||||||
<EuiFormRow
|
<EuiFormRow
|
||||||
|
helpText={timestampFormatHelp}
|
||||||
label={
|
label={
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id="xpack.ml.fileDatavisualizer.editFlyout.overrides.timestampFormatFormRowLabel"
|
id="xpack.ml.fileDatavisualizer.editFlyout.overrides.timestampFormatFormRowLabel"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue