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 3 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 @@ -27,13 +27,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 to the specified field when the processor runs.',
lockewritesdocs marked this conversation as resolved.
Show resolved Hide resolved
}),
validations: [
{
validator: emptyField(
i18n.translate('xpack.ingestPipelines.pipelineEditor.appendForm.valueRequiredError', {
defaultMessage: 'A value to set is required.',
defaultMessage: 'A value to append is required.',
lockewritesdocs marked this conversation as resolved.
Show resolved Hide resolved
})
),
},
Expand All @@ -46,7 +46,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. Accepts a single value or an array of values.',
lockewritesdocs marked this conversation as resolved.
Show resolved Hide resolved
})}
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,22 @@ export const Bytes: FunctionComponent = () => {
<FieldNameField
helpText={i18n.translate(
'xpack.ingestPipelines.pipelineEditor.bytesForm.fieldNameHelpText',
{ defaultMessage: 'The field to convert.' }
{
defaultMessage:
'Field to convert from a human-readable format to its value in bytes. For example, 1KB becomes 1024 bytes.',
lockewritesdocs marked this conversation as resolved.
Show resolved Hide resolved
}
)}
/>

<TargetField />
<TargetField
helpText={i18n.translate(
'xpack.ingestPipelines.pipelineEditor.convertForm.targetFieldHelpText',
{
defaultMessage:
'Field to assign the converted value to. Defaults to the specified field name.',
Copy link
Contributor

Choose a reason for hiding this comment

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

We need a common pattern here. I used:

Field used to contain the converted value.

I like "Field to assign..." better, but I kinda hate ending the phrase in a preposition. The double to's also sound clunky.

Maybe something like "Output field. If empty, the field is updated in place."? Let me know what you think. I can update the help text for the fields I've reviewed to sync up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed. Let's use this phrase instead:

Output field. If empty, the input field is updated in place.

}
)}
/>

<IgnoreMissingField />
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const fieldsConfig: FieldsConfig = {
'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).',
'Difference between the side of the inscribed shape to the encompassing circle. Measured in meters for geo_shape, but uses no units for shape.',
}
),
validations: [
Expand Down Expand Up @@ -66,7 +66,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 circle.' }
lockewritesdocs marked this conversation as resolved.
Show resolved Hide resolved
),
validations: [
{
Expand All @@ -86,7 +86,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: 'Conditional statement to run with this processor.',
lockewritesdocs marked this conversation as resolved.
Show resolved Hide resolved
}),
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 this processor. Useful for debugging and metrics.',
lockewritesdocs marked this conversation as resolved.
Show resolved Hide resolved
}),
type: FIELD_TYPES.TEXT,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,15 @@ export const ProcessorTypeField: FunctionComponent<Props> = ({ initialType }) =>
<UseField<string> config={typeConfig} defaultValue={initialType} path="type">
{(typeField) => {
let selectedOptions: ProcessorTypeAndLabel[];
let helpText: string = '';
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like we still need to assign this value to the EuiFormRow below

Copy link
Contributor

Choose a reason for hiding this comment

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

You can also drop the : string annotation. If you init this value to a string TS will figure out that it is a string automatically.

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 }];
helpText = descriptor?.helpText || '';
Copy link
Contributor

Choose a reason for hiding this comment

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

We could probably restructure this code now to something like:

const procesorDescriptor = getProcessorDescriptor(type);
if (procesorDescriptor) {
  selectedOptions = [{ label: procesorDescriptor.label, value: type }];
  helpText = procesorDescriptor.description; // assuming we are using the key `description`
} else {
  // If there is no label for this processor type, just use the type as the label
  selectedOptions = [{ label: type, value: type }];
}

I think this would read a bit easier :)

} else {
selectedOptions = [];
}
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: 'Data type to convert the specified value to.',
lockewritesdocs marked this conversation as resolved.
Show resolved Hide resolved
}),
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 from one value to another.' }
lockewritesdocs marked this conversation as resolved.
Show resolved Hide resolved
)}
/>

Expand Down Expand Up @@ -119,7 +119,8 @@ export const Convert: FunctionComponent = () => {
helpText={i18n.translate(
'xpack.ingestPipelines.pipelineEditor.convertForm.targetFieldHelpText',
{
defaultMessage: 'The field to assign the converted value to.',
defaultMessage:
'Field to assign the converted value to. Defaults to the specified field name.',
lockewritesdocs marked this conversation as resolved.
Show resolved Hide resolved
}
)}
/>
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: 'A separator value must be a single character.',
lockewritesdocs marked this conversation as resolved.
Show resolved Hide resolved
}
),
}
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: 'Array of fields to assign extracted values to.',
Copy link
Contributor

Choose a reason for hiding this comment

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

These fields don't display as an array in the UI. I think calling them "array" can be a little confusing. I'd also try to align this with my earlier suggestions re: output 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="Single character string used to separate data. Defaults to {value}."
lockewritesdocs marked this conversation as resolved.
Show resolved Hide resolved
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="Single character string used to separate data. Defaults to {value}."
lockewritesdocs marked this conversation as resolved.
Show resolved Hide resolved
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: 'Trim whitespaces in unquoted fields.',
lockewritesdocs marked this conversation as resolved.
Show resolved Hide resolved
}),
},
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.',
'Value used to fill empty fields. Empty fields are skipped if this value is not provided.',
lockewritesdocs marked this conversation as resolved.
Show resolved Hide resolved
}
),
},
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 to extract CSV data from.',
lockewritesdocs marked this conversation as resolved.
Show resolved Hide resolved
})}
/>

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.',
'Array of the expected date formats. Accepts a Java time pattern, ISO8601, UNIX, UNIX_MS, or TAI64N formats.',
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
'Array of the expected date formats. Accepts a Java time pattern, ISO8601, UNIX, UNIX_MS, or TAI64N formats.',
'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 to use when parsing the date. Defaults to {timezone}."
lockewritesdocs marked this conversation as resolved.
Show resolved Hide resolved
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 to use when parsing the date. Useful when parsing month or day names. Defaults to {timezone}."
lockewritesdocs marked this conversation as resolved.
Show resolved Hide resolved
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 retrieve the date from.' }
lockewritesdocs marked this conversation as resolved.
Show resolved Hide resolved
)}
/>

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="Field that will hold the parsed date. Defaults to {defaultField}."
lockewritesdocs marked this conversation as resolved.
Show resolved Hide resolved
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 before the printed date for the index name.' }
),
},
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="Array of expected date formats for parsing dates and timestamps. Accepts a Java time pattern, ISO8601, UNIX, UNIX_MS, or TAI64N formats. Defaults to {value}."
lockewritesdocs marked this conversation as resolved.
Show resolved Hide resolved
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 to retrieve the date or timestamp from.' }
lockewritesdocs marked this conversation as resolved.
Show resolved Hide resolved
)}
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ const fieldsConfig: Record<string, FieldConfig> = {
helpText: i18n.translate(
'xpack.ingestPipelines.pipelineEditor.dissectForm.patternFieldHelpText',
{
defaultMessage: 'The pattern to apply to the field.',
defaultMessage:
'Pattern used to dissect the specified field. The pattern is defined by the parts of the string to discard.',
Copy link
Contributor

Choose a reason for hiding this comment

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

}
),
validations: [
Expand All @@ -58,7 +59,7 @@ const fieldsConfig: Record<string, FieldConfig> = {
helpText: (
<FormattedMessage
id="xpack.ingestPipelines.pipelineEditor.dissectForm.appendSeparatorHelpText"
defaultMessage="The character(s) that separate the appended fields. Default value is {value} (an empty string)."
defaultMessage="Characters used to separate fields when appending two or more results together. Defaults to {value}."
Copy link
Contributor

Choose a reason for hiding this comment

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

This description didn't make sense to me. Is it used to separate or append results?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I dug a little deeper on this field, and the append separator is only applicable when an append modifier is specified. I've updated the Pattern field to reference the key modifiers (including a link to that section of the doc page), and noted in the append separator description that it applies only if using a modifier in the pattern.

values={{ value: <EuiCode inline>{'""'}</EuiCode> }}
/>
),
Expand All @@ -71,7 +72,7 @@ export const Dissect: FunctionComponent = () => {
<FieldNameField
helpText={i18n.translate(
'xpack.ingestPipelines.pipelineEditor.dissectForm.fieldNameHelpText',
{ defaultMessage: 'The field to dissect.' }
{ defaultMessage: 'Field to dissect based on the defined pattern.' }
lockewritesdocs marked this conversation as resolved.
Show resolved Hide resolved
)}
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const fieldsConfig: Record<string, FieldConfig> = {
defaultMessage: 'Path',
}),
helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.dotExpanderForm.pathHelpText', {
defaultMessage: 'Only required if the field to expand is part another object field.',
defaultMessage:
'Field containing the object to expand. Only required if the field to expand is part another object field.',
lockewritesdocs marked this conversation as resolved.
Show resolved Hide resolved
}),
},
};
Expand All @@ -29,7 +30,7 @@ export const DotExpander: FunctionComponent = () => {
<FieldNameField
helpText={i18n.translate(
'xpack.ingestPipelines.pipelineEditor.dotExpanderForm.fieldNameHelpText',
{ defaultMessage: 'The field to expand into an object field.' }
{ defaultMessage: 'Field containing dot notation to expand into an object field.' }
lockewritesdocs marked this conversation as resolved.
Show resolved Hide resolved
)}
additionalValidations={[
{
Expand Down
Loading