Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ingest Pipelines] Add descriptions for ingest processors A-D #75975

Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
5a74358
Fixing formatting issues identified by Prettier, part 2.
Aug 26, 2020
377a778
Fixing helpText labels.
Aug 26, 2020
c233ecf
Adding {value} object for dissect processor.
Aug 26, 2020
446c108
Incorporating reviewer feedback.
Aug 27, 2020
a848afe
fix dropdown not rendering
alisonelizabeth Aug 27, 2020
404ebb4
Fixing typo.
Aug 27, 2020
adf6e80
Merge branch 'master' into docs__update-ingest-pipeline-strings
elasticmachine Aug 27, 2020
8e34f7a
add support for FormattedMessage in help text
alisonelizabeth Aug 27, 2020
439dfdb
fix TS
alisonelizabeth Aug 29, 2020
6de3d1e
Merge branch 'master' into docs__update-ingest-pipeline-strings
elasticmachine Aug 31, 2020
2835d3d
Updating some strings and trying to add code formatting.
Aug 31, 2020
f4fdf28
fix formatted message
alisonelizabeth Aug 31, 2020
a0be7d0
Editing some field descriptions.
Aug 31, 2020
929e016
Apply suggestions from code review
Sep 1, 2020
67e3f5f
Trying to add EuiLink, plus edits.
Sep 1, 2020
9145874
fix help text for dissect processor
alisonelizabeth Sep 1, 2020
dfc4b4f
Incorporating reviewer feedback.
Sep 1, 2020
e129444
Merge branch 'master' into docs__update-ingest-pipeline-strings
elasticmachine Sep 2, 2020
b588bd9
Trying to add another EUI element, plus edits.
Sep 2, 2020
6b43188
fix date_index_name description text
alisonelizabeth Sep 2, 2020
0a1b715
Minor edit.
Sep 2, 2020
9982b01
Fixing linter error.
Sep 2, 2020
500403b
Merge branch 'master' into docs__update-ingest-pipeline-strings
Sep 4, 2020
6872e49
Removing FunctionComponent, which was not read and caused build errors.
Sep 4, 2020
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 @@ -28,13 +28,13 @@ const fieldsConfig: FieldsConfig = {
defaultMessage: 'Value',
}),
helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.appendForm.valueFieldHelpText', {
defaultMessage: 'The value to be appended by this processor.',
defaultMessage: 'Values to append.',
}),
validations: [
{
validator: emptyField(
i18n.translate('xpack.ingestPipelines.pipelineEditor.appendForm.valueRequiredError', {
defaultMessage: 'A value to set is required.',
defaultMessage: 'A value is required.',
})
),
},
Expand All @@ -47,7 +47,8 @@ export const Append: FunctionComponent = () => {
<>
<FieldNameField
helpText={i18n.translate('xpack.ingestPipelines.pipelineEditor.appendForm.fieldHelpText', {
defaultMessage: 'The field to be appended to.',
defaultMessage:
'Field to append values to.',
})}
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ export const Bytes: FunctionComponent = () => {
<FieldNameField
helpText={i18n.translate(
'xpack.ingestPipelines.pipelineEditor.bytesForm.fieldNameHelpText',
{ defaultMessage: 'The field to convert.' }
{
defaultMessage:
'Field to convert. If the field contains an array, each array value is converted.',
}
)}
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
*/

import React, { FunctionComponent } from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';
import { EuiCode } from '@elastic/eui';

import {
FIELD_TYPES,
Expand Down Expand Up @@ -34,12 +36,15 @@ const fieldsConfig: FieldsConfig = {
defaultMessage: 'Error distance',
}
),
helpText: i18n.translate(
'xpack.ingestPipelines.pipelineEditor.circleForm.errorDistanceHelpText',
{
defaultMessage:
'The difference between the resulting inscribed distance from center to side and the circle’s radius (measured in meters for geo_shape, unit-less for shape).',
}
helpText: () => (
<FormattedMessage
id="xpack.ingestPipelines.pipelineEditor.circleForm.errorDistanceHelpText"
defaultMessage="Difference between the side of the inscribed shape to the encompassing circle. Determines the accuracy of the output polygon. Measured in meters for {geo_shape}, but uses no units for {shape}."
values={{
geo_shape: <EuiCode>{'geo_shape'}</EuiCode>,
shape: <EuiCode>{'shape'}</EuiCode>,
}}
/>
),
validations: [
{
Expand All @@ -66,7 +71,7 @@ const fieldsConfig: FieldsConfig = {
}),
helpText: i18n.translate(
'xpack.ingestPipelines.pipelineEditor.circleForm.shapeTypeFieldHelpText',
{ defaultMessage: 'Which field mapping type is to be used.' }
{ defaultMessage: 'Field mapping type to use when processing the output polygon.' }
),
validations: [
{
Expand All @@ -86,7 +91,7 @@ export const Circle: FunctionComponent = () => {
<FieldNameField
helpText={i18n.translate(
'xpack.ingestPipelines.pipelineEditor.circleForm.fieldNameHelpText',
{ defaultMessage: 'The string-valued field to trim whitespace from.' }
{ defaultMessage: 'Field to convert.' }
)}
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const ifConfig: FieldConfig = {
defaultMessage: 'Condition (optional)',
}),
helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.commonFields.ifFieldHelpText', {
defaultMessage: 'Conditionally execute this processor.',
defaultMessage: 'Conditionally run this processor.',
}),
type: FIELD_TYPES.TEXT,
};
Expand All @@ -50,7 +50,7 @@ const tagConfig: FieldConfig = {
defaultMessage: 'Tag (optional)',
}),
helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.commonFields.tagFieldHelpText', {
defaultMessage: 'An identifier for this processor. Useful for debugging and metrics.',
defaultMessage: 'Identifier for the processor. Useful for debugging and metrics.',
}),
type: FIELD_TYPES.TEXT,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
import { EuiComboBox, EuiComboBoxOptionOption, EuiFormRow } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React, { FunctionComponent } from 'react';
import React, { FunctionComponent, ReactNode } from 'react';
import { flow } from 'fp-ts/lib/function';
import { map } from 'fp-ts/lib/Array';

Expand Down Expand Up @@ -68,13 +68,18 @@ export const ProcessorTypeField: FunctionComponent<Props> = ({ initialType }) =>
<UseField<string> config={typeConfig} defaultValue={initialType} path="type">
{(typeField) => {
let selectedOptions: ProcessorTypeAndLabel[];
let description: string | ReactNode = '';

if (typeField.value?.length) {
const type = typeField.value;
const descriptor = getProcessorDescriptor(type);
selectedOptions = descriptor
? [{ label: descriptor.label, value: type }]
: // If there is no label for this processor type, just use the type as the label
[{ label: type, value: type }];
const processorDescriptor = getProcessorDescriptor(type);
if (processorDescriptor) {
description = processorDescriptor.description || '';
selectedOptions = [{ label: processorDescriptor.label, value: type }];
} else {
// If there is no label for this processor type, just use the type as the label
selectedOptions = [{ label: type, value: type }];
}
} else {
selectedOptions = [];
}
Expand Down Expand Up @@ -102,9 +107,7 @@ export const ProcessorTypeField: FunctionComponent<Props> = ({ initialType }) =>
<EuiFormRow
label={typeField.label}
labelAppend={typeField.labelAppend}
helpText={
typeof typeField.helpText === 'function' ? typeField.helpText() : typeField.helpText
}
helpText={typeof description === 'function' ? description() : description}
error={error}
isInvalid={isInvalid}
fullWidth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ const fieldsConfig: FieldsConfig = {
helpText: i18n.translate(
'xpack.ingestPipelines.pipelineEditor.commonFields.targetFieldHelpText',
{
defaultMessage:
'The field to assign the joined value to. If empty, the field is updated in-place.',
defaultMessage: 'Output field. If empty, the input field is updated in place.',
}
),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const fieldsConfig: FieldsConfig = {
defaultMessage: 'Type',
}),
helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.convertForm.typeFieldHelpText', {
defaultMessage: 'The type to convert the existing value to.',
defaultMessage: 'Field data type for the output.',
}),
validations: [
{
Expand All @@ -50,7 +50,7 @@ export const Convert: FunctionComponent = () => {
<FieldNameField
helpText={i18n.translate(
'xpack.ingestPipelines.pipelineEditor.convertForm.fieldNameHelpText',
{ defaultMessage: 'The field whose value is to be converted.' }
{ defaultMessage: 'Field to convert.' }
)}
/>

Expand Down Expand Up @@ -115,14 +115,7 @@ export const Convert: FunctionComponent = () => {
path="fields.type"
/>

<TargetField
helpText={i18n.translate(
'xpack.ingestPipelines.pipelineEditor.convertForm.targetFieldHelpText',
{
defaultMessage: 'The field to assign the converted value to.',
}
)}
/>
<TargetField />

<IgnoreMissingField />
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const isStringLengthOne: ValidationFunc = ({ value }) => {
message: i18n.translate(
'xpack.ingestPipelines.pipelineEditor.convertForm.separatorLengthError',
{
defaultMessage: 'A separator value must be 1 character.',
defaultMessage: 'Must be a single character.',
}
),
}
Expand All @@ -52,7 +52,7 @@ const fieldsConfig: FieldsConfig = {
defaultMessage: 'Target fields',
}),
helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.csvForm.targetFieldsHelpText', {
defaultMessage: 'The array of fields to assign extracted values to.',
defaultMessage: 'Output fields. Extracted values are mapped to these fields.',
}),
validations: [
{
Expand Down Expand Up @@ -83,7 +83,7 @@ const fieldsConfig: FieldsConfig = {
helpText: (
<FormattedMessage
id="xpack.ingestPipelines.pipelineEditor.convertForm.separatorHelpText"
defaultMessage="Separator used in CSV, has to be single character string. Default value is {value}."
defaultMessage="Delimiter used in the CSV data. Defaults to {value}."
values={{ value: <EuiCode inline>{','}</EuiCode> }}
/>
),
Expand All @@ -102,7 +102,7 @@ const fieldsConfig: FieldsConfig = {
helpText: (
<FormattedMessage
id="xpack.ingestPipelines.pipelineEditor.convertForm.quoteHelpText"
defaultMessage="Quote used in CSV, has to be single character string. Default value is {value}."
defaultMessage="Escape character used in the CSV data. Defaults to {value}."
values={{ value: <EuiCode inline>{'"'}</EuiCode> }}
/>
),
Expand All @@ -115,7 +115,7 @@ const fieldsConfig: FieldsConfig = {
defaultMessage: 'Trim',
}),
helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.csvForm.trimFieldHelpText', {
defaultMessage: 'Trim whitespaces in unquoted fields',
defaultMessage: 'Remove whitespaces in unquoted CSV data.',
}),
},
empty_value: {
Expand All @@ -127,7 +127,7 @@ const fieldsConfig: FieldsConfig = {
'xpack.ingestPipelines.pipelineEditor.convertForm.emptyValueFieldHelpText',
{
defaultMessage:
'Value used to fill empty fields, empty fields will be skipped if this is not provided.',
'Used to fill empty fields. If no value is provided, empty fields are skipped.',
}
),
},
Expand All @@ -138,7 +138,7 @@ export const CSV: FunctionComponent = () => {
<>
<FieldNameField
helpText={i18n.translate('xpack.ingestPipelines.pipelineEditor.csvForm.fieldNameHelpText', {
defaultMessage: 'The field to extract data from.',
defaultMessage: 'Field containing CSV data.',
})}
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const fieldsConfig: FieldsConfig = {
}),
helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.dateForm.formatsFieldHelpText', {
defaultMessage:
'An array of the expected date formats. Can be a java time pattern or one of the following formats: ISO8601, UNIX, UNIX_MS, or TAI64N.',
'Expected date formats. Provided formats are applied sequentially. Accepts a Java time pattern, ISO8601, UNIX, UNIX_MS, or TAI64N formats.',
}),
validations: [
{
Expand All @@ -59,7 +59,7 @@ const fieldsConfig: FieldsConfig = {
helpText: (
<FormattedMessage
id="xpack.ingestPipelines.pipelineEditor.dateForm.timezoneHelpText"
defaultMessage="The timezone to use when parsing the date. Default value is {timezone}."
defaultMessage="Timezone for the date. Defaults to {timezone}."
values={{ timezone: <EuiCode inline>{'UTC'}</EuiCode> }}
/>
),
Expand All @@ -73,7 +73,7 @@ const fieldsConfig: FieldsConfig = {
helpText: (
<FormattedMessage
id="xpack.ingestPipelines.pipelineEditor.dateForm.localeHelpText"
defaultMessage="The locale to use when parsing the date, relevant when parsing month names or week days. Default value is {timezone}."
defaultMessage="Locale for the date. Useful when parsing month or day names. Defaults to {timezone}."
values={{ timezone: <EuiCode inline>{'ENGLISH'}</EuiCode> }}
/>
),
Expand All @@ -89,7 +89,7 @@ export const DateProcessor: FunctionComponent = () => {
<FieldNameField
helpText={i18n.translate(
'xpack.ingestPipelines.pipelineEditor.dateForm.fieldNameHelpText',
{ defaultMessage: 'The field to get the date from.' }
{ defaultMessage: 'Field to convert.' }
)}
/>

Expand All @@ -99,7 +99,7 @@ export const DateProcessor: FunctionComponent = () => {
helpText={
<FormattedMessage
id="xpack.ingestPipelines.pipelineEditor.dateForm.targetFieldHelpText"
defaultMessage="The field that will hold the parsed date. Default field is {defaultField}."
defaultMessage="Output field. If empty, the input field is updated in place. Defaults to {defaultField}."
values={{
defaultField: <EuiCode inline>{'@timestamp'}</EuiCode>,
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ const fieldsConfig: FieldsConfig = {
helpText: i18n.translate(
'xpack.ingestPipelines.pipelineEditor.dateIndexNameForm.dateRoundingFieldHelpText',
{
defaultMessage: 'How to round the date when formatting the date into the index name.',
defaultMessage:
'Time period used to round the date when formatting the date into the index name.',
}
),
validations: [
Expand Down Expand Up @@ -64,7 +65,7 @@ const fieldsConfig: FieldsConfig = {
),
helpText: i18n.translate(
'xpack.ingestPipelines.pipelineEditor.dateIndexNameForm.indexNamePrefixFieldHelpText',
{ defaultMessage: 'A prefix of the index name to be prepended before the printed date.' }
{ defaultMessage: 'Prefix to add to the index name before the printed date.' }
),
},
index_name_format: {
Expand All @@ -79,7 +80,7 @@ const fieldsConfig: FieldsConfig = {
helpText: (
<FormattedMessage
id="xpack.ingestPipelines.pipelineEditor.dateIndexNameForm.indexNameFormatFieldHelpText"
defaultMessage="The format to be used when printing the parsed date into the index name. Default value is {value}."
defaultMessage="Date format used to print the parsed date into the index name. Defaults to {value}."
values={{ value: <EuiCode inline>{'yyyy-MM-dd'}</EuiCode> }}
/>
),
Expand All @@ -99,7 +100,7 @@ const fieldsConfig: FieldsConfig = {
helpText: (
<FormattedMessage
id="xpack.ingestPipelines.pipelineEditor.dateIndexNameForm.dateFormatsHelpText"
defaultMessage="An array of the expected date formats for parsing dates / timestamps in the document being preprocessed. Can be a java time pattern or one of the following formats: ISO8601, UNIX, UNIX_MS, or TAI64N. Default value is {value}."
defaultMessage="Expected date formats. Provided formats are applied sequentially. Accepts a Java time pattern, ISO8601, UNIX, UNIX_MS, or TAI64N formats. Defaults to {value}."
values={{ value: <EuiCode inline>{"yyyy-MM-dd'T'HH:mm:ss.SSSXX"}</EuiCode> }}
/>
),
Expand All @@ -116,7 +117,7 @@ const fieldsConfig: FieldsConfig = {
helpText: (
<FormattedMessage
id="xpack.ingestPipelines.pipelineEditor.dateIndexNameForm.timezoneHelpText"
defaultMessage="The timezone to use when parsing the date and when date math index supports resolves expressions into concrete index names. Default value is {timezone}."
defaultMessage="Timezone used when parsing the date and constructing the index name expression. Defaults to {timezone}."
values={{ timezone: <EuiCode inline>{'UTC'}</EuiCode> }}
/>
),
Expand All @@ -133,7 +134,7 @@ const fieldsConfig: FieldsConfig = {
helpText: (
<FormattedMessage
id="xpack.ingestPipelines.pipelineEditor.dateIndexForm.localeHelpText"
defaultMessage="The locale to use when parsing the date from the document being preprocessed, relevant when parsing month names or week days. Default value is {locale}."
defaultMessage="Locale to use when parsing the date. Useful when parsing month or day names. Defaults to {locale}."
values={{ locale: <EuiCode inline>{'ENGLISH'}</EuiCode> }}
/>
),
Expand All @@ -149,7 +150,7 @@ export const DateIndexName: FunctionComponent = () => {
<FieldNameField
helpText={i18n.translate(
'xpack.ingestPipelines.pipelineEditor.dateIndexNameForm.fieldNameHelpText',
{ defaultMessage: 'The field to get the date or timestamp from.' }
{ defaultMessage: 'Field containing the date or timestamp.' }
)}
/>

Expand Down
Loading