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 K-S #76981

Merged
merged 4 commits into from
Sep 9, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,15 @@ const fieldsConfig: FieldsConfig = {
label: i18n.translate('xpack.ingestPipelines.pipelineEditor.kvForm.fieldSplitFieldLabel', {
defaultMessage: 'Field split',
}),
helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.kvForm.fieldSplitHelpText', {
defaultMessage: 'Regex pattern for splitting key-value pairs.',
}),
helpText: () => (
Copy link
Contributor

Choose a reason for hiding this comment

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

nit; I'm sure this anonymous function is needed for these helpText entries. Should be able to just have:

helpText: <FormattedMessage>...</FormattedMessage>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right. Thanks for catching this.

<FormattedMessage
id="xpack.ingestPipelines.pipelineEditor.kvForm.fieldSplitHelpText"
defaultMessage="Regex pattern used to delimit the key-value pairs. Typically a space character ({space})."
values={{
space: <EuiCode>{'" "'}</EuiCode>,
}}
/>
),
validations: [
{
validator: emptyField(
Expand All @@ -52,9 +58,15 @@ const fieldsConfig: FieldsConfig = {
label: i18n.translate('xpack.ingestPipelines.pipelineEditor.kvForm.valueSplitFieldLabel', {
defaultMessage: 'Value split',
}),
helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.kvForm.valueSplitHelpText', {
defaultMessage: 'Regex pattern for splitting the key from the value within a key-value pair.',
}),
helpText: () => (
<FormattedMessage
id="xpack.ingestPipelines.pipelineEditor.kvForm.valueSplitHelpText"
defaultMessage="Regex pattern used to split keys and values. Typically an assignment operator ({equal})."
values={{
equal: <EuiCode>{'"="'}</EuiCode>,
}}
/>
),
validations: [
{
validator: emptyField(
Expand All @@ -75,8 +87,7 @@ const fieldsConfig: FieldsConfig = {
defaultMessage: 'Include keys',
}),
helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.kvForm.includeKeysHelpText', {
defaultMessage:
'List of keys to filter and insert into document. Defaults to including all keys.',
defaultMessage: 'List of extracted keys to include in the output. Defaults to all keys.',
}),
},

Expand All @@ -88,7 +99,7 @@ const fieldsConfig: FieldsConfig = {
defaultMessage: 'Exclude keys',
}),
helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.kvForm.excludeKeysHelpText', {
defaultMessage: 'List of keys to exclude from document.',
defaultMessage: 'List of extracted keys to exclude from the output.',
}),
},

Expand All @@ -99,7 +110,7 @@ const fieldsConfig: FieldsConfig = {
defaultMessage: 'Prefix',
}),
helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.kvForm.prefixHelpText', {
defaultMessage: 'Prefix to be added to extracted keys.',
defaultMessage: 'Prefix to add to extracted keys.',
}),
},

Expand Down Expand Up @@ -136,7 +147,7 @@ const fieldsConfig: FieldsConfig = {
helpText: (
<FormattedMessage
id="xpack.ingestPipelines.pipelineEditor.kvForm.stripBracketsHelpText"
defaultMessage="If true, strip brackets {paren}, {angle}, {square} as well as quotes {singleQuote} and {doubleQuote} from extracted values."
defaultMessage="Remove brackets ( {paren}, {angle}, {square}) and quotes ({singleQuote}, {doubleQuote}) from extracted values."
values={{
paren: <EuiCode>{'()'}</EuiCode>,
angle: <EuiCode>&lt;&gt;</EuiCode>,
Expand All @@ -154,7 +165,7 @@ export const Kv: FunctionComponent = () => {
<>
<FieldNameField
helpText={i18n.translate('xpack.ingestPipelines.pipelineEditor.kvForm.fieldNameHelpText', {
defaultMessage: 'Field to be parsed.',
defaultMessage: 'Field containing a string of key-value pairs.',
})}
/>

Expand All @@ -166,8 +177,7 @@ export const Kv: FunctionComponent = () => {
helpText={i18n.translate(
'xpack.ingestPipelines.pipelineEditor.kvForm.targetFieldHelpText',
{
defaultMessage:
'Field to insert the extracted keys into. Defaults to the root of the document.',
defaultMessage: 'Output field for the extracted fields. Defaults to the document root.',
}
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

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

import { FieldNameField } from './common_fields/field_name_field';
import { TargetField } from './common_fields/target_field';
Expand All @@ -23,17 +21,7 @@ export const Lowercase: FunctionComponent = () => {
)}
/>

<TargetField
helpText={
<FormattedMessage
id="xpack.ingestPipelines.pipelineEditor.lowerCaseForm.targetFieldHelpText"
defaultMessage="Field to assign the converted value to. Defaults to {field}."
values={{
field: <EuiCode>{'field'}</EuiCode>,
}}
/>
}
/>
<TargetField />

<IgnoreMissingField />
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const fieldsConfig: FieldsConfig = {
helpText: i18n.translate(
'xpack.ingestPipelines.pipelineEditor.pipelineForm.pipelineNameFieldHelpText',
{
defaultMessage: 'Name of the pipeline to execute.',
defaultMessage: 'Name of the ingest pipeline to run.',
}
),
validations: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const fieldsConfig: FieldsConfig = {
defaultMessage: 'Fields',
}),
helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.removeForm.fieldNameHelpText', {
defaultMessage: 'Fields to be removed.',
defaultMessage: 'Fields to remove.',
}),
validations: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const Rename: FunctionComponent = () => {
<FieldNameField
helpText={i18n.translate(
'xpack.ingestPipelines.pipelineEditor.renameForm.fieldNameHelpText',
{ defaultMessage: 'Field to be renamed.' }
{ defaultMessage: 'Field to rename.' }
)}
/>

Expand All @@ -31,7 +31,7 @@ export const Rename: FunctionComponent = () => {
})}
helpText={i18n.translate(
'xpack.ingestPipelines.pipelineEditor.renameForm.targetFieldHelpText',
{ defaultMessage: 'Name of the new field.' }
{ defaultMessage: 'New field name. This field cannot already exist.' }
)}
validations={[
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const fieldsConfig: FieldsConfig = {
helpText: i18n.translate(
'xpack.ingestPipelines.pipelineEditor.scriptForm.storedScriptIDFieldHelpText',
{
defaultMessage: 'Stored script reference.',
defaultMessage: 'ID of the stored script to run.',
}
),
validations: [
Expand All @@ -55,7 +55,7 @@ const fieldsConfig: FieldsConfig = {
helpText: i18n.translate(
'xpack.ingestPipelines.pipelineEditor.scriptForm.sourceFieldHelpText',
{
defaultMessage: 'Script to be executed.',
defaultMessage: 'Inline script to run.',
}
),
validations: [
Expand Down Expand Up @@ -98,7 +98,7 @@ const fieldsConfig: FieldsConfig = {
helpText: i18n.translate(
'xpack.ingestPipelines.pipelineEditor.scriptForm.paramsFieldHelpText',
{
defaultMessage: 'Script parameters.',
defaultMessage: 'Named parameters passed to the script as variables.',
}
),
validations: [
Expand Down Expand Up @@ -128,7 +128,7 @@ export const Script: FormFieldsComponent = ({ initialFieldValues }) => {
<EuiSwitch
label={i18n.translate(
'xpack.ingestPipelines.pipelineEditor.scriptForm.useScriptIdToggleLabel',
{ defaultMessage: 'Use stored script' }
{ defaultMessage: 'Run a stored script' }
)}
checked={showId}
onChange={() => setShowId((v) => !v)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ const fieldsConfig: FieldsConfig = {
defaultMessage: 'Value',
}),
helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.setForm.valueFieldHelpText', {
defaultMessage: 'Value to be set for the field',
defaultMessage: 'Value for the field.',
}),
validations: [
{
validator: emptyField(
i18n.translate('xpack.ingestPipelines.pipelineEditor.setForm.valueRequiredError', {
defaultMessage: 'A value is required',
defaultMessage: 'A value is required.',
})
),
},
Expand All @@ -53,9 +53,15 @@ const fieldsConfig: FieldsConfig = {
label: i18n.translate('xpack.ingestPipelines.pipelineEditor.setForm.overrideFieldLabel', {
defaultMessage: 'Override',
}),
helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.setForm.overrideFieldHelpText', {
defaultMessage: 'If disabled, fields containing non-null values will not be updated.',
}),
helpText: (
<FormattedMessage
id="xpack.ingestPipelines.pipelineEditor.setForm.overrideFieldHelpText"
defaultMessage="If enabled, overwrite existing field values. If disabled, only update {nullValue} fields."
values={{
nullValue: <EuiCode>{'null'}</EuiCode>,
}}
/>
),
},
ignore_empty_value: {
type: FIELD_TYPES.TOGGLE,
Expand All @@ -71,7 +77,8 @@ const fieldsConfig: FieldsConfig = {
helpText: (
<FormattedMessage
id="xpack.ingestPipelines.pipelineEditor.setForm.ignoreEmptyValueFieldHelpText"
defaultMessage="If enabled and {valueField} is a template snippet that evaluates to {nullValue} or an empty string, quietly exit without modifying the document."
defaultMessage="If {valueField} is {nullValue} or an empty string, do not
update the field."
values={{
valueField: <EuiCode>{'value'}</EuiCode>,
nullValue: <EuiCode>{'null'}</EuiCode>,
Expand All @@ -89,7 +96,7 @@ export const SetProcessor: FunctionComponent = () => {
<>
<FieldNameField
helpText={i18n.translate('xpack.ingestPipelines.pipelineEditor.setForm.fieldNameField', {
defaultMessage: 'Field to insert or update',
defaultMessage: 'Field to insert or update.',
})}
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const fieldsConfig: FieldsConfig = {
helpText: (
<FormattedMessage
id="xpack.ingestPipelines.pipelineEditor.setForm.propertiesFieldHelpText"
defaultMessage="User properties to add. Defaults to {value}."
defaultMessage="User details to add. Defaults to: {value}"
values={{
value: <EuiCode>[{helpTextValues}]</EuiCode>,
}}
Expand All @@ -60,7 +60,7 @@ export const SetSecurityUser: FunctionComponent = () => {
helpText={i18n.translate(
'xpack.ingestPipelines.pipelineEditor.setSecurityUserForm.fieldNameField',
{
defaultMessage: 'Field to store the user information',
defaultMessage: 'Output field.',
}
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ const fieldsConfig: FieldsConfig = {
defaultMessage: 'Order',
}),
helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.sortForm.orderFieldHelpText', {
defaultMessage: 'Sort order to use',
defaultMessage:
'Sort order. Arrays containing a mix of strings and numbers are sorted lexicographically.',
}),
},
};
Expand All @@ -35,7 +36,7 @@ export const Sort: FunctionComponent = () => {
<FieldNameField
helpText={i18n.translate(
'xpack.ingestPipelines.pipelineEditor.sortForm.fieldNameHelpText',
{ defaultMessage: 'Field to sort' }
{ defaultMessage: 'Field containing array values to sort.' }
)}
/>

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.splitForm.separatorFieldHelpText',
{
defaultMessage: 'Regex to match a separator',
defaultMessage: 'Regex pattern used to delimit the field value.',
}
),
validations: [
Expand All @@ -60,7 +60,7 @@ const fieldsConfig: FieldsConfig = {
),
helpText: i18n.translate(
'xpack.ingestPipelines.pipelineEditor.splitForm.preserveTrailingFieldHelpText',
{ defaultMessage: 'If enabled, preserve any trailing space.' }
{ defaultMessage: 'Preserve any trailing whitespace in the split field values.' }
),
},
};
Expand All @@ -71,7 +71,7 @@ export const Split: FunctionComponent = () => {
<FieldNameField
helpText={i18n.translate(
'xpack.ingestPipelines.pipelineEditor.splitForm.fieldNameHelpText',
{ defaultMessage: 'Field to split' }
{ defaultMessage: 'Field to split.' }
)}
/>

Expand Down
Loading