mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
Add help text for runtime fields source. (#85204)
* Add help text for runtime fields source. * fix help text * Text changes and defining EuiCode element for _source. Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>
This commit is contained in:
parent
3f32b56192
commit
72ed936aa5
2 changed files with 22 additions and 16 deletions
|
@ -5,6 +5,8 @@
|
|||
*/
|
||||
import React, { useEffect, useState, useCallback } from 'react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { EuiCode } from '@elastic/eui';
|
||||
import { PainlessLang, PainlessContext } from '@kbn/monaco';
|
||||
import {
|
||||
EuiFlexGroup,
|
||||
|
@ -260,20 +262,25 @@ const RuntimeFieldFormComp = ({
|
|||
error={getErrorsMessages()}
|
||||
isInvalid={!isValid}
|
||||
helpText={
|
||||
<EuiFlexGroup justifyContent="flexEnd">
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiLink
|
||||
href={links.runtimePainless}
|
||||
target="_blank"
|
||||
external
|
||||
data-test-subj="painlessSyntaxLearnMoreLink"
|
||||
>
|
||||
{i18n.translate('xpack.runtimeFields.form.script.learnMoreLinkText', {
|
||||
defaultMessage: 'Learn more about syntax.',
|
||||
})}
|
||||
</EuiLink>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
<FormattedMessage
|
||||
id="xpack.runtimeFields.form.source.scriptFieldHelpText"
|
||||
defaultMessage="Runtime fields without a script retrieve values from a field with the same name in {source}. If a field with the same name doesn’t exist, no values return when a search request includes the runtime field. {learnMoreLink}"
|
||||
values={{
|
||||
learnMoreLink: (
|
||||
<EuiLink
|
||||
href={links.runtimePainless}
|
||||
target="_blank"
|
||||
external
|
||||
data-test-subj="painlessSyntaxLearnMoreLink"
|
||||
>
|
||||
{i18n.translate('xpack.runtimeFields.form.script.learnMoreLinkText', {
|
||||
defaultMessage: 'Learn about script syntax.',
|
||||
})}
|
||||
</EuiLink>
|
||||
),
|
||||
source: <EuiCode>{'_source'}</EuiCode>,
|
||||
}}
|
||||
/>
|
||||
}
|
||||
fullWidth
|
||||
>
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { FormSchema, fieldValidators } from '../../shared_imports';
|
||||
import { RUNTIME_FIELD_OPTIONS } from '../../constants';
|
||||
import { RuntimeField, RuntimeType, ComboBoxOption } from '../../types';
|
||||
|
@ -44,7 +43,7 @@ export const schema: FormSchema<RuntimeField> = {
|
|||
script: {
|
||||
source: {
|
||||
label: i18n.translate('xpack.runtimeFields.form.defineFieldLabel', {
|
||||
defaultMessage: 'Define field (optional)',
|
||||
defaultMessage: 'Define script (optional)',
|
||||
}),
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue