From 5a74358c1881ce9e05ff7fccc944e575a271f854 Mon Sep 17 00:00:00 2001 From: Adam Locke Date: Wed, 26 Aug 2020 09:13:12 -0400 Subject: [PATCH 01/20] Fixing formatting issues identified by Prettier, part 2. --- .../processors/append.tsx | 7 ++-- .../processors/bytes.tsx | 15 ++++++- .../processors/circle.tsx | 6 +-- .../common_fields/common_processor_fields.tsx | 4 +- .../common_fields/processor_type_field.tsx | 2 + .../processors/convert.tsx | 7 ++-- .../manage_processor_form/processors/csv.tsx | 14 +++---- .../manage_processor_form/processors/date.tsx | 10 ++--- .../processors/date_index_name.tsx | 15 +++---- .../processors/dissect.tsx | 7 ++-- .../processors/dot_expander.tsx | 5 ++- .../shared/map_processor_type_to_form.tsx | 39 +++++++++++++++++++ 12 files changed, 94 insertions(+), 37 deletions(-) diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/append.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/append.tsx index 09d0981adf1c29..d02627591c0369 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/append.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/append.tsx @@ -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.', }), validations: [ { validator: emptyField( i18n.translate('xpack.ingestPipelines.pipelineEditor.appendForm.valueRequiredError', { - defaultMessage: 'A value to set is required.', + defaultMessage: 'A value to append is required.', }) ), }, @@ -46,7 +46,8 @@ export const Append: FunctionComponent = () => { <> diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/bytes.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/bytes.tsx index a76e1a6f3ce9a4..9a0fc2ec345b84 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/bytes.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/bytes.tsx @@ -17,11 +17,22 @@ export const Bytes: FunctionComponent = () => { - + diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/circle.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/circle.tsx index 599d2fdbfd413d..c966ce1959c283 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/circle.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/circle.tsx @@ -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: [ @@ -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.' } ), validations: [ { @@ -86,7 +86,7 @@ export const Circle: FunctionComponent = () => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/common_processor_fields.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/common_processor_fields.tsx index 8089b8e7dfad34..8f22a637b81edb 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/common_processor_fields.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/common_processor_fields.tsx @@ -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.', }), type: FIELD_TYPES.TEXT, }; @@ -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.', }), type: FIELD_TYPES.TEXT, }; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/processor_type_field.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/processor_type_field.tsx index e4ad90f61af0a1..dff7dfec35236f 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/processor_type_field.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/processor_type_field.tsx @@ -68,6 +68,7 @@ export const ProcessorTypeField: FunctionComponent = ({ initialType }) => config={typeConfig} defaultValue={initialType} path="type"> {(typeField) => { let selectedOptions: ProcessorTypeAndLabel[]; + let helpText: string = ''; if (typeField.value?.length) { const type = typeField.value; const descriptor = getProcessorDescriptor(type); @@ -75,6 +76,7 @@ export const ProcessorTypeField: FunctionComponent = ({ initialType }) => ? [{ 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 || ''; } else { selectedOptions = []; } diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/convert.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/convert.tsx index 2bf642dd9b5187..3c7423a45aa1c2 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/convert.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/convert.tsx @@ -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.', }), validations: [ { @@ -50,7 +50,7 @@ export const Convert: FunctionComponent = () => { @@ -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.', } )} /> diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/csv.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/csv.tsx index 835177dd861d56..a4c9a27142e592 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/csv.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/csv.tsx @@ -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.', } ), } @@ -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.', }), validations: [ { @@ -83,7 +83,7 @@ const fieldsConfig: FieldsConfig = { helpText: ( {','} }} /> ), @@ -102,7 +102,7 @@ const fieldsConfig: FieldsConfig = { helpText: ( {'"'} }} /> ), @@ -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.', }), }, empty_value: { @@ -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.', } ), }, @@ -138,7 +138,7 @@ export const CSV: FunctionComponent = () => { <> diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date.tsx index 7e3f8e0d7cd701..6bb9634b0d4ff1 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date.tsx @@ -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.', }), validations: [ { @@ -59,7 +59,7 @@ const fieldsConfig: FieldsConfig = { helpText: ( {'UTC'} }} /> ), @@ -73,7 +73,7 @@ const fieldsConfig: FieldsConfig = { helpText: ( {'ENGLISH'} }} /> ), @@ -89,7 +89,7 @@ export const DateProcessor: FunctionComponent = () => { @@ -99,7 +99,7 @@ export const DateProcessor: FunctionComponent = () => { helpText={ {'@timestamp'}, }} diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date_index_name.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date_index_name.tsx index 8cbc064c1c90ce..aa467cc6c62b9d 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date_index_name.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date_index_name.tsx @@ -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: [ @@ -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: { @@ -79,7 +80,7 @@ const fieldsConfig: FieldsConfig = { helpText: ( {'yyyy-MM-dd'} }} /> ), @@ -99,7 +100,7 @@ const fieldsConfig: FieldsConfig = { helpText: ( {"yyyy-MM-dd'T'HH:mm:ss.SSSXX"} }} /> ), @@ -116,7 +117,7 @@ const fieldsConfig: FieldsConfig = { helpText: ( {'UTC'} }} /> ), @@ -133,7 +134,7 @@ const fieldsConfig: FieldsConfig = { helpText: ( {'ENGLISH'} }} /> ), @@ -149,7 +150,7 @@ export const DateIndexName: FunctionComponent = () => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx index 5f9f55ced1a256..d9c0e8f0a92256 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx @@ -33,7 +33,8 @@ const fieldsConfig: Record = { 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.', } ), validations: [ @@ -58,7 +59,7 @@ const fieldsConfig: Record = { helpText: ( {'""'} }} /> ), @@ -71,7 +72,7 @@ export const Dissect: FunctionComponent = () => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dot_expander.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dot_expander.tsx index 4e50c61ac930c3..83fe5500045401 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dot_expander.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dot_expander.tsx @@ -18,7 +18,8 @@ const fieldsConfig: Record = { 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.', }), }, }; @@ -29,7 +30,7 @@ export const DotExpander: FunctionComponent = () => { Date: Wed, 26 Aug 2020 10:31:45 -0400 Subject: [PATCH 02/20] Fixing helpText labels. --- .../shared/map_processor_type_to_form.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx index c7cf6ed6fbb272..eb1e031a0acf25 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx @@ -62,7 +62,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { label: i18n.translate('xpack.ingestPipelines.processors.label.bytes', { defaultMessage: 'Bytes', }), - helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.append', { + helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.bytes', { defaultMessage: 'Converts a human-readable byte value to its value in bytes. If the field is an array of strings, the processor converts all members of the array.', }), @@ -73,7 +73,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { label: i18n.translate('xpack.ingestPipelines.processors.label.circle', { defaultMessage: 'Circle', }), - helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.append', { + helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.circle', { defaultMessage: 'Converts circle definitions of shapes to regular polygons that approximate them. The error distance determines the accuracy of the polygon that represents the circle.', }), @@ -84,7 +84,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { label: i18n.translate('xpack.ingestPipelines.processors.label.convert', { defaultMessage: 'Convert', }), - helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.append', { + helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.convert', { defaultMessage: 'Converts a field in the currently ingested document to a different type, such as converting a string to an integer.', }), @@ -95,7 +95,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { label: i18n.translate('xpack.ingestPipelines.processors.label.csv', { defaultMessage: 'CSV', }), - helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.append', { + helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.csv', { defaultMessage: 'Extracts fields from a CSV line in a single text field within a document.', }), }, @@ -105,7 +105,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { label: i18n.translate('xpack.ingestPipelines.processors.label.date', { defaultMessage: 'Date', }), - helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.append', { + helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.date', { defaultMessage: 'Parses dates from fields and uses the date or timestamp as the timestamp for the document.', }), @@ -116,7 +116,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { label: i18n.translate('xpack.ingestPipelines.processors.label.dateIndexName', { defaultMessage: 'Date index name', }), - helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.append', { + helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.dateIndexName', { defaultMessage: 'Points documents to the correct time-based index, based on a date or timestamp field in a document using the date math support in index names.', }), @@ -127,7 +127,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { label: i18n.translate('xpack.ingestPipelines.processors.label.dissect', { defaultMessage: 'Dissect', }), - helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.append', { + helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.dissect', { defaultMessage: 'Matches a single text field against a defined pattern to extract structured fields out of a single text field within a document.', }), @@ -138,7 +138,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { label: i18n.translate('xpack.ingestPipelines.processors.label.dotExpander', { defaultMessage: 'Dot expander', }), - helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.append', { + helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.dotExpander', { defaultMessage: 'Expands a field containing dot notation into an object field and makes these fields accessible by other processors in the pipeline.', }), @@ -149,7 +149,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { label: i18n.translate('xpack.ingestPipelines.processors.label.drop', { defaultMessage: 'Drop', }), - helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.append', { + helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.drop', { defaultMessage: 'Drops the document without raising any errors. Useful for preventing documents from getting indexed based other conditions.', }), From c233ecfcdfcacf20f34c7d6d61ab91ce33882d2a Mon Sep 17 00:00:00 2001 From: Adam Locke Date: Wed, 26 Aug 2020 11:52:47 -0400 Subject: [PATCH 03/20] Adding {value} object for dissect processor. --- .../components/manage_processor_form/processors/dissect.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx index d9c0e8f0a92256..9997a46c0f6363 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx @@ -59,7 +59,7 @@ const fieldsConfig: Record = { helpText: ( {'""'} }} /> ), From 446c108a026f7ae30938516f9d44b4ed5f6dbe16 Mon Sep 17 00:00:00 2001 From: Adam Locke Date: Thu, 27 Aug 2020 12:59:42 -0400 Subject: [PATCH 04/20] Incorporating reviewer feedback. --- .../common_fields/processor_type_field.tsx | 115 ++++++++++-------- .../shared/map_processor_type_to_form.tsx | 20 +-- 2 files changed, 71 insertions(+), 64 deletions(-) diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/processor_type_field.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/processor_type_field.tsx index dff7dfec35236f..327950c892f879 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/processor_type_field.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/processor_type_field.tsx @@ -68,7 +68,7 @@ export const ProcessorTypeField: FunctionComponent = ({ initialType }) => config={typeConfig} defaultValue={initialType} path="type"> {(typeField) => { let selectedOptions: ProcessorTypeAndLabel[]; - let helpText: string = ''; + let description = ''; if (typeField.value?.length) { const type = typeField.value; const descriptor = getProcessorDescriptor(type); @@ -76,65 +76,72 @@ export const ProcessorTypeField: FunctionComponent = ({ initialType }) => ? [{ 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 || ''; - } else { - selectedOptions = []; - } + const processorDescriptor = getProcessorDescriptor(type); + if (processorDescriptor) { + selectedOptions = [{ label: proccesorDescriptor.label, value: type }]; + description = proccesorDescriptor.description; + } else { + // If there is no label for this processor type, just use the type as the label + selectedOptions = [{ label: type, value: type }]; + } - const error = typeField.getErrorsMessages(); - const isInvalid = error ? Boolean(error.length) : false; + const error = typeField.getErrorsMessages(); + const isInvalid = error ? Boolean(error.length) : false; - const onCreateComboOption = (value: string) => { - // Note: for now, all validations for a comboBox array item have to be synchronous - // If there is a need to support asynchronous validation, we'll work on it (and will need to update the logic). - const { isValid } = typeField.validate({ - value, - validationType: VALIDATION_TYPES.ARRAY_ITEM, - }) as FieldValidateResponse; + const onCreateComboOption = (value: string) => { + // Note: for now, all validations for a comboBox array item have to be synchronous + // If there is a need to support asynchronous validation, we'll work on it (and will need to update the logic). + const { isValid } = typeField.validate({ + value, + validationType: VALIDATION_TYPES.ARRAY_ITEM, + }) as FieldValidateResponse; - if (!isValid) { - // Return false to explicitly reject the user's input. - return false; - } + if (!isValid) { + // Return false to explicitly reject the user's input. + return false; + } - typeField.setValue(value); - }; + typeField.setValue(value); + }; - return ( - - >) => { - const [selection] = options; - typeField.setValue(selection?.value! ?? ''); - }} - noSuggestions={false} - singleSelection={{ - asPlainText: true, - }} - data-test-subj="input" - /> - - ); + data-test-subj="processorTypeSelector" + > + >) => { + const [selection] = options; + typeField.setValue(selection?.value! ?? ''); + }} + noSuggestions={false} + singleSelection={{ + asPlainText: true, + }} + data-test-subj="input" + /> + + ); + } }} ); diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx index eb1e031a0acf25..fda5d0b9530dde 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx @@ -51,7 +51,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { label: i18n.translate('xpack.ingestPipelines.processors.label.append', { defaultMessage: 'Append', }), - helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.append', { + description: i18n.translate('xpack.ingestPipelines.processors.description.append', { defaultMessage: 'Appends one or more values to an existing array. Converts a scalar to an array and appends one or more values. Creates an array containing the provided values if the field does not exist.', }), @@ -62,7 +62,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { label: i18n.translate('xpack.ingestPipelines.processors.label.bytes', { defaultMessage: 'Bytes', }), - helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.bytes', { + description: i18n.translate('xpack.ingestPipelines.processors.description.bytes', { defaultMessage: 'Converts a human-readable byte value to its value in bytes. If the field is an array of strings, the processor converts all members of the array.', }), @@ -73,7 +73,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { label: i18n.translate('xpack.ingestPipelines.processors.label.circle', { defaultMessage: 'Circle', }), - helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.circle', { + description: i18n.translate('xpack.ingestPipelines.processors.description.circle', { defaultMessage: 'Converts circle definitions of shapes to regular polygons that approximate them. The error distance determines the accuracy of the polygon that represents the circle.', }), @@ -84,7 +84,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { label: i18n.translate('xpack.ingestPipelines.processors.label.convert', { defaultMessage: 'Convert', }), - helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.convert', { + description: i18n.translate('xpack.ingestPipelines.processors.description.convert', { defaultMessage: 'Converts a field in the currently ingested document to a different type, such as converting a string to an integer.', }), @@ -95,7 +95,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { label: i18n.translate('xpack.ingestPipelines.processors.label.csv', { defaultMessage: 'CSV', }), - helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.csv', { + description: i18n.translate('xpack.ingestPipelines.processors.description.csv', { defaultMessage: 'Extracts fields from a CSV line in a single text field within a document.', }), }, @@ -105,7 +105,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { label: i18n.translate('xpack.ingestPipelines.processors.label.date', { defaultMessage: 'Date', }), - helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.date', { + description: i18n.translate('xpack.ingestPipelines.processors.description.date', { defaultMessage: 'Parses dates from fields and uses the date or timestamp as the timestamp for the document.', }), @@ -116,7 +116,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { label: i18n.translate('xpack.ingestPipelines.processors.label.dateIndexName', { defaultMessage: 'Date index name', }), - helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.dateIndexName', { + description: i18n.translate('xpack.ingestPipelines.processors.description.dateIndexName', { defaultMessage: 'Points documents to the correct time-based index, based on a date or timestamp field in a document using the date math support in index names.', }), @@ -127,7 +127,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { label: i18n.translate('xpack.ingestPipelines.processors.label.dissect', { defaultMessage: 'Dissect', }), - helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.dissect', { + description: i18n.translate('xpack.ingestPipelines.processors.description.dissect', { defaultMessage: 'Matches a single text field against a defined pattern to extract structured fields out of a single text field within a document.', }), @@ -138,7 +138,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { label: i18n.translate('xpack.ingestPipelines.processors.label.dotExpander', { defaultMessage: 'Dot expander', }), - helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.dotExpander', { + description: i18n.translate('xpack.ingestPipelines.processors.description.dotExpander', { defaultMessage: 'Expands a field containing dot notation into an object field and makes these fields accessible by other processors in the pipeline.', }), @@ -149,7 +149,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { label: i18n.translate('xpack.ingestPipelines.processors.label.drop', { defaultMessage: 'Drop', }), - helpText: i18n.translate('xpack.ingestPipelines.processors.helpText.drop', { + description: i18n.translate('xpack.ingestPipelines.processors.description.drop', { defaultMessage: 'Drops the document without raising any errors. Useful for preventing documents from getting indexed based other conditions.', }), From a848afe0ce0560cfbb7057aef38c700a43476eae Mon Sep 17 00:00:00 2001 From: Alison Goryachev Date: Thu, 27 Aug 2020 13:25:01 -0400 Subject: [PATCH 05/20] fix dropdown not rendering --- .../common_fields/processor_type_field.tsx | 116 +++++++++--------- .../shared/map_processor_type_to_form.tsx | 1 + 2 files changed, 56 insertions(+), 61 deletions(-) diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/processor_type_field.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/processor_type_field.tsx index 327950c892f879..69f7ddfe5fdb11 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/processor_type_field.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/processor_type_field.tsx @@ -69,79 +69,73 @@ export const ProcessorTypeField: FunctionComponent = ({ initialType }) => {(typeField) => { let selectedOptions: ProcessorTypeAndLabel[]; let description = ''; + 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) { - selectedOptions = [{ label: proccesorDescriptor.label, value: type }]; - description = proccesorDescriptor.description; + const procesorDescriptor = getProcessorDescriptor(type); + if (procesorDescriptor) { + description = procesorDescriptor.description || ''; + selectedOptions = [{ label: procesorDescriptor.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 = []; + } - const error = typeField.getErrorsMessages(); - const isInvalid = error ? Boolean(error.length) : false; + const error = typeField.getErrorsMessages(); + const isInvalid = error ? Boolean(error.length) : false; - const onCreateComboOption = (value: string) => { - // Note: for now, all validations for a comboBox array item have to be synchronous - // If there is a need to support asynchronous validation, we'll work on it (and will need to update the logic). - const { isValid } = typeField.validate({ - value, - validationType: VALIDATION_TYPES.ARRAY_ITEM, - }) as FieldValidateResponse; + const onCreateComboOption = (value: string) => { + // Note: for now, all validations for a comboBox array item have to be synchronous + // If there is a need to support asynchronous validation, we'll work on it (and will need to update the logic). + const { isValid } = typeField.validate({ + value, + validationType: VALIDATION_TYPES.ARRAY_ITEM, + }) as FieldValidateResponse; - if (!isValid) { - // Return false to explicitly reject the user's input. - return false; - } + if (!isValid) { + // Return false to explicitly reject the user's input. + return false; + } - typeField.setValue(value); - }; + typeField.setValue(value); + }; - return ( - + - >) => { - const [selection] = options; - typeField.setValue(selection?.value! ?? ''); - }} - noSuggestions={false} - singleSelection={{ - asPlainText: true, - }} - data-test-subj="input" - /> - - ); - } + placeholder={i18n.translate( + 'xpack.ingestPipelines.pipelineEditor.typeField.typeFieldComboboxPlaceholder', + { + defaultMessage: 'Type and then hit "ENTER"', + } + )} + options={processorTypesAndLabels} + selectedOptions={selectedOptions} + onCreateOption={onCreateComboOption} + onChange={(options: Array>) => { + const [selection] = options; + typeField.setValue(selection?.value! ?? ''); + }} + noSuggestions={false} + singleSelection={{ + asPlainText: true, + }} + data-test-subj="input" + /> + + ); }} ); diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx index fda5d0b9530dde..192b11d755398b 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx @@ -40,6 +40,7 @@ interface FieldDescriptor { * A sentence case label that can be displayed to users */ label: string; + description?: string; } type MapProcessorTypeToDescriptor = Record; From 404ebb483b44662613fa33260a9de9eb3a13069c Mon Sep 17 00:00:00 2001 From: Adam Locke Date: Thu, 27 Aug 2020 14:40:42 -0400 Subject: [PATCH 06/20] Fixing typo. --- .../processors/common_fields/processor_type_field.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/processor_type_field.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/processor_type_field.tsx index 69f7ddfe5fdb11..7e03f123417a0b 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/processor_type_field.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/processor_type_field.tsx @@ -72,10 +72,10 @@ export const ProcessorTypeField: FunctionComponent = ({ initialType }) => if (typeField.value?.length) { const type = typeField.value; - const procesorDescriptor = getProcessorDescriptor(type); - if (procesorDescriptor) { - description = procesorDescriptor.description || ''; - selectedOptions = [{ label: procesorDescriptor.label, 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 }]; From 8e34f7a7c79472df6f4b2082ff065b89f2122455 Mon Sep 17 00:00:00 2001 From: Alison Goryachev Date: Thu, 27 Aug 2020 16:50:32 -0400 Subject: [PATCH 07/20] add support for FormattedMessage in help text --- .../processors/common_fields/processor_type_field.tsx | 2 +- .../components/shared/map_processor_type_to_form.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/processor_type_field.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/processor_type_field.tsx index 7e03f123417a0b..c47f1a80659fdc 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/processor_type_field.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/processor_type_field.tsx @@ -107,7 +107,7 @@ export const ProcessorTypeField: FunctionComponent = ({ initialType }) => ; From 439dfdbd30417b8ba0fed313b909db16cd5f75e2 Mon Sep 17 00:00:00 2001 From: Alison Goryachev Date: Fri, 28 Aug 2020 22:05:23 -0400 Subject: [PATCH 08/20] fix TS --- .../processors/common_fields/processor_type_field.tsx | 4 ++-- .../components/shared/map_processor_type_to_form.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/processor_type_field.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/processor_type_field.tsx index c47f1a80659fdc..32649234428866 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/processor_type_field.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/processor_type_field.tsx @@ -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'; @@ -68,7 +68,7 @@ export const ProcessorTypeField: FunctionComponent = ({ initialType }) => config={typeConfig} defaultValue={initialType} path="type"> {(typeField) => { let selectedOptions: ProcessorTypeAndLabel[]; - let description = ''; + let description: string | ReactNode = ''; if (typeField.value?.length) { const type = typeField.value; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx index c5de215e563909..c68c88167926bc 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx @@ -5,7 +5,7 @@ */ import { i18n } from '@kbn/i18n'; -import React, { FunctionComponent } from 'react'; +import { FunctionComponent, ReactNode } from 'react'; import { Append, From 2835d3de5098d7efb60b925c07cfa7c0964075a4 Mon Sep 17 00:00:00 2001 From: Adam Locke Date: Mon, 31 Aug 2020 16:09:44 -0400 Subject: [PATCH 09/20] Updating some strings and trying to add code formatting. --- .../manage_processor_form/processors/circle.tsx | 15 +++++++++------ .../shared/map_processor_type_to_form.tsx | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/circle.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/circle.tsx index c966ce1959c283..d8a6b765da3461 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/circle.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/circle.tsx @@ -5,6 +5,7 @@ */ import React, { FunctionComponent } from 'react'; +import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; import { @@ -34,12 +35,14 @@ const fieldsConfig: FieldsConfig = { defaultMessage: 'Error distance', } ), - helpText: i18n.translate( - 'xpack.ingestPipelines.pipelineEditor.circleForm.errorDistanceHelpText', - { - defaultMessage: - 'Difference between the side of the inscribed shape to the encompassing circle. Measured in meters for geo_shape, but uses no units for shape.', - } + helpText: () => ( + {JSON.stringify({ arbitrary_data: 'geo_shape' })}, + }} + /> ), validations: [ { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx index c68c88167926bc..b3149e0871b0de 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx @@ -54,7 +54,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { }), description: i18n.translate('xpack.ingestPipelines.processors.description.append', { defaultMessage: - 'Appends one or more values to an existing array. Converts a scalar to an array and appends one or more values. Creates an array containing the provided values if the field does not exist.', + "Appends values to an existing array, converts a scalar to an array and appends values, or creates an array containing the provided values if the field doesn't exist.", }), }, bytes: { @@ -130,7 +130,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { }), description: i18n.translate('xpack.ingestPipelines.processors.description.dissect', { defaultMessage: - 'Matches a single text field against a defined pattern to extract structured fields out of a single text field within a document.', + 'Matches a single text field against a defined pattern to extract structured fields within a document.', }), }, dot_expander: { From f4fdf280f1d46a9149e0d3f9a95037be74e5d7ff Mon Sep 17 00:00:00 2001 From: Alison Goryachev Date: Mon, 31 Aug 2020 16:27:15 -0400 Subject: [PATCH 10/20] fix formatted message --- .../components/manage_processor_form/processors/circle.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/circle.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/circle.tsx index d8a6b765da3461..c09c065a5e0974 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/circle.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/circle.tsx @@ -7,6 +7,7 @@ import React, { FunctionComponent } from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; +import { EuiCode } from '@elastic/eui'; import { FIELD_TYPES, @@ -40,7 +41,7 @@ const fieldsConfig: FieldsConfig = { id="xpack.ingestPipelines.pipelineEditor.circleForm.errorDistanceHelpText" defaultMessage="Difference between the side of the inscribed shape to the encompassing circle. Measured in meters for {geo_shape}, but uses no units for shape." values={{ - geo_shape: {JSON.stringify({ arbitrary_data: 'geo_shape' })}, + geo_shape: {'geo_shape'}, }} /> ), From a0be7d03378ea359a17ae915c5894620c75e22a6 Mon Sep 17 00:00:00 2001 From: Adam Locke Date: Mon, 31 Aug 2020 17:39:06 -0400 Subject: [PATCH 11/20] Editing some field descriptions. --- .../components/manage_processor_form/processors/circle.tsx | 3 ++- .../processors/common_fields/target_field.tsx | 2 +- .../manage_processor_form/processors/date_index_name.tsx | 4 ++-- .../components/shared/map_processor_type_to_form.tsx | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/circle.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/circle.tsx index c09c065a5e0974..89a273ab4c418f 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/circle.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/circle.tsx @@ -39,9 +39,10 @@ const fieldsConfig: FieldsConfig = { helpText: () => ( {'geo_shape'}, + shape: {'shape'}, }} /> ), diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/target_field.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/target_field.tsx index 9bf44425a7c5d1..72292a266e9113 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/target_field.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/target_field.tsx @@ -22,7 +22,7 @@ const fieldsConfig: FieldsConfig = { 'xpack.ingestPipelines.pipelineEditor.commonFields.targetFieldHelpText', { defaultMessage: - 'The field to assign the joined value to. If empty, the field is updated in-place.', + 'Field to assign the joined value to. If empty, the field is updated in place.', } ), }, diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date_index_name.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date_index_name.tsx index aa467cc6c62b9d..fb158abbeca9d2 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date_index_name.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date_index_name.tsx @@ -65,7 +65,7 @@ const fieldsConfig: FieldsConfig = { ), helpText: i18n.translate( 'xpack.ingestPipelines.pipelineEditor.dateIndexNameForm.indexNamePrefixFieldHelpText', - { defaultMessage: 'Prefix to add before the printed date for the index name.' } + { defaultMessage: 'Prefix to add to the index name before the printed date.' } ), }, index_name_format: { @@ -117,7 +117,7 @@ const fieldsConfig: FieldsConfig = { helpText: ( {'UTC'} }} /> ), diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx index b3149e0871b0de..92d108a8143209 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx @@ -141,7 +141,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { }), description: i18n.translate('xpack.ingestPipelines.processors.description.dotExpander', { defaultMessage: - 'Expands a field containing dot notation into an object field and makes these fields accessible by other processors in the pipeline.', + 'Expands a field containing dot notation into an object field, and makes these fields accessible by other processors in the pipeline.', }), }, drop: { From 929e016d4b2d841a6bd735587f54aa782b1ab16a Mon Sep 17 00:00:00 2001 From: Adam Locke Date: Tue, 1 Sep 2020 11:18:00 -0400 Subject: [PATCH 12/20] Apply suggestions from code review Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com> --- .../components/manage_processor_form/processors/append.tsx | 6 +++--- .../components/manage_processor_form/processors/bytes.tsx | 2 +- .../processors/common_fields/common_processor_fields.tsx | 2 +- .../components/manage_processor_form/processors/convert.tsx | 4 ++-- .../components/manage_processor_form/processors/csv.tsx | 4 ++-- .../components/manage_processor_form/processors/date.tsx | 6 +++--- .../manage_processor_form/processors/date_index_name.tsx | 4 ++-- .../components/manage_processor_form/processors/dissect.tsx | 2 +- .../manage_processor_form/processors/dot_expander.tsx | 2 +- .../components/shared/map_processor_type_to_form.tsx | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/append.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/append.tsx index 4e073c17001735..a9cb0f21015580 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/append.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/append.tsx @@ -28,13 +28,13 @@ const fieldsConfig: FieldsConfig = { defaultMessage: 'Value', }), helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.appendForm.valueFieldHelpText', { - defaultMessage: 'Values to append to the specified field when the processor runs.', + defaultMessage: 'Values to append.', }), validations: [ { validator: emptyField( i18n.translate('xpack.ingestPipelines.pipelineEditor.appendForm.valueRequiredError', { - defaultMessage: 'A value to append is required.', + defaultMessage: 'A value is required.', }) ), }, @@ -48,7 +48,7 @@ export const Append: FunctionComponent = () => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/bytes.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/bytes.tsx index 9a0fc2ec345b84..c1e4a8619eec88 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/bytes.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/bytes.tsx @@ -19,7 +19,7 @@ export const Bytes: FunctionComponent = () => { 'xpack.ingestPipelines.pipelineEditor.bytesForm.fieldNameHelpText', { defaultMessage: - 'Field to convert from a human-readable format to its value in bytes. For example, 1KB becomes 1024 bytes.', + 'Field to convert. If the field contains an array, each array value is converted., } )} /> diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/common_processor_fields.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/common_processor_fields.tsx index 8f22a637b81edb..51e9a59180383a 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/common_processor_fields.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/common_processor_fields.tsx @@ -50,7 +50,7 @@ const tagConfig: FieldConfig = { defaultMessage: 'Tag (optional)', }), helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.commonFields.tagFieldHelpText', { - defaultMessage: 'Identifier for this processor. Useful for debugging and metrics.', + defaultMessage: 'Identifier for the processor. Useful for debugging and metrics.', }), type: FIELD_TYPES.TEXT, }; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/convert.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/convert.tsx index 3c7423a45aa1c2..59aedd77c552e0 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/convert.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/convert.tsx @@ -30,7 +30,7 @@ const fieldsConfig: FieldsConfig = { defaultMessage: 'Type', }), helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.convertForm.typeFieldHelpText', { - defaultMessage: 'Data type to convert the specified value to.', + defaultMessage: 'Field data type for the output.', }), validations: [ { @@ -50,7 +50,7 @@ export const Convert: FunctionComponent = () => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/csv.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/csv.tsx index a4c9a27142e592..c24f5c522efd8c 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/csv.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/csv.tsx @@ -36,7 +36,7 @@ const isStringLengthOne: ValidationFunc = ({ value }) => { message: i18n.translate( 'xpack.ingestPipelines.pipelineEditor.convertForm.separatorLengthError', { - defaultMessage: 'A separator value must be a single character.', + defaultMessage: 'Must be a single character.', } ), } @@ -138,7 +138,7 @@ export const CSV: FunctionComponent = () => { <> diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date.tsx index 6bb9634b0d4ff1..847bffd756bd02 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date.tsx @@ -59,7 +59,7 @@ const fieldsConfig: FieldsConfig = { helpText: ( {'UTC'} }} /> ), @@ -73,7 +73,7 @@ const fieldsConfig: FieldsConfig = { helpText: ( {'ENGLISH'} }} /> ), @@ -89,7 +89,7 @@ export const DateProcessor: FunctionComponent = () => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date_index_name.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date_index_name.tsx index fb158abbeca9d2..8f1dcf1669e371 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date_index_name.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date_index_name.tsx @@ -100,7 +100,7 @@ const fieldsConfig: FieldsConfig = { helpText: ( {"yyyy-MM-dd'T'HH:mm:ss.SSSXX"} }} /> ), @@ -150,7 +150,7 @@ export const DateIndexName: FunctionComponent = () => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx index 9997a46c0f6363..c3bf92772f2254 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx @@ -72,7 +72,7 @@ export const Dissect: FunctionComponent = () => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dot_expander.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dot_expander.tsx index 83fe5500045401..0a6b0267a238d8 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dot_expander.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dot_expander.tsx @@ -30,7 +30,7 @@ export const DotExpander: FunctionComponent = () => { Date: Tue, 1 Sep 2020 14:45:19 -0400 Subject: [PATCH 13/20] Trying to add EuiLink, plus edits. --- .../processors/bytes.tsx | 2 +- .../processors/dissect.tsx | 31 ++++++++++++++----- .../shared/map_processor_type_to_form.tsx | 11 +++---- 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/bytes.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/bytes.tsx index c1e4a8619eec88..18c3659ba96a5f 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/bytes.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/bytes.tsx @@ -19,7 +19,7 @@ export const Bytes: FunctionComponent = () => { 'xpack.ingestPipelines.pipelineEditor.bytesForm.fieldNameHelpText', { defaultMessage: - 'Field to convert. If the field contains an array, each array value is converted., + 'Field to convert. If the field contains an array, each array value is converted.', } )} /> diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx index c3bf92772f2254..a03ee17bf84ea1 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx @@ -5,7 +5,7 @@ */ import React, { FunctionComponent } from 'react'; -import { EuiCode } from '@elastic/eui'; +import { EuiCode, EuiLink, EuiText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { TextEditor } from '../field_components'; @@ -30,12 +30,29 @@ const fieldsConfig: Record = { label: i18n.translate('xpack.ingestPipelines.pipelineEditor.dissectForm.patternFieldLabel', { defaultMessage: 'Pattern', }), - helpText: i18n.translate( - 'xpack.ingestPipelines.pipelineEditor.dissectForm.patternFieldHelpText', - { - defaultMessage: - 'Pattern used to dissect the specified field. The pattern is defined by the parts of the string to discard.', - } + helpText: () => ( + + + {i18n.translate( + 'xpack.ingestPipelines.pipelineEditor.dissectForm.patternFieldHelpText.dissectProcessorLink', + { + defaultMessage: 'key modifier', + } + )} + + ), + }} + /> + ), validations: [ { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx index 7c35aaa8d2e378..c2dad6c6df12c4 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx @@ -54,7 +54,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { }), description: i18n.translate('xpack.ingestPipelines.processors.description.append', { defaultMessage: - "Appends values to an existing array, converts a scalar to an array and appends values, or creates an array containing the provided values if the field doesn't exist.", + "Appends values to a field's array. If the field contains a single value, the processor first converts it to an array. If the field doesn't exist, the processor creates an array containing the appended values.", }), }, bytes: { @@ -65,7 +65,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { }), description: i18n.translate('xpack.ingestPipelines.processors.description.bytes', { defaultMessage: - 'Converts a human-readable byte value to its value in bytes. If the field is an array of strings, the processor converts all members of the array.', + 'Converts digital storage units to bytes. For example, 1KB becomes 1024 bytes.', }), }, circle: { @@ -107,8 +107,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { defaultMessage: 'Date', }), description: i18n.translate('xpack.ingestPipelines.processors.description.date', { - defaultMessage: - 'Converts a date to a document timestamp.', + defaultMessage: 'Converts a date to a document timestamp.', }), }, date_index_name: { @@ -141,7 +140,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { }), description: i18n.translate('xpack.ingestPipelines.processors.description.dotExpander', { defaultMessage: - 'Expands a field containing dot notation into an object field, and makes these fields accessible by other processors in the pipeline.', + 'Expands a field containing dot notation into an object field. The object field is then accessible by other processors in the pipeline.', }), }, drop: { @@ -152,7 +151,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { }), description: i18n.translate('xpack.ingestPipelines.processors.description.drop', { defaultMessage: - 'Drops the document without raising any errors. Useful for preventing documents from getting indexed based other conditions.', + 'Drops documents without returning an error. Used to only index documents that meet specified conditions.', }), }, enrich: { From 9145874fa6eb5f8482c7487ad5c031a5a7f01d11 Mon Sep 17 00:00:00 2001 From: Alison Goryachev Date: Tue, 1 Sep 2020 15:22:44 -0400 Subject: [PATCH 14/20] fix help text for dissect processor --- .../processors/dissect.tsx | 87 ++++++++++--------- 1 file changed, 47 insertions(+), 40 deletions(-) diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx index a03ee17bf84ea1..134163a407c479 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx @@ -16,6 +16,7 @@ import { fieldValidators, UseField, Field, + useKibana, } from '../../../../../../shared_imports'; import { FieldNameField } from './common_fields/field_name_field'; @@ -23,20 +24,20 @@ import { IgnoreMissingField } from './common_fields/ignore_missing_field'; const { emptyField } = fieldValidators; -const fieldsConfig: Record = { - /* Required field config */ - pattern: { - type: FIELD_TYPES.TEXT, - label: i18n.translate('xpack.ingestPipelines.pipelineEditor.dissectForm.patternFieldLabel', { - defaultMessage: 'Pattern', - }), - helpText: () => ( - +const getFieldsConfig = (esDocUrl: string): Record => { + return { + /* Required field config */ + pattern: { + type: FIELD_TYPES.TEXT, + label: i18n.translate('xpack.ingestPipelines.pipelineEditor.dissectForm.patternFieldLabel', { + defaultMessage: 'Pattern', + }), + helpText: ( = { ), }} /> - - ), - validations: [ - { - validator: emptyField( - i18n.translate('xpack.ingestPipelines.pipelineEditor.dissectForm.patternRequiredError', { - defaultMessage: 'A pattern value is required.', - }) - ), - }, - ], - }, - /* Optional field config */ - append_separator: { - type: FIELD_TYPES.TEXT, - label: i18n.translate( - 'xpack.ingestPipelines.pipelineEditor.dissectForm.appendSeparatorparaotrFieldLabel', - { - defaultMessage: 'Append separator (optional)', - } - ), - helpText: ( - {'""'} }} - /> - ), - }, + ), + validations: [ + { + validator: emptyField( + i18n.translate( + 'xpack.ingestPipelines.pipelineEditor.dissectForm.patternRequiredError', + { + defaultMessage: 'A pattern value is required.', + } + ) + ), + }, + ], + }, + /* Optional field config */ + append_separator: { + type: FIELD_TYPES.TEXT, + label: i18n.translate( + 'xpack.ingestPipelines.pipelineEditor.dissectForm.appendSeparatorparaotrFieldLabel', + { + defaultMessage: 'Append separator (optional)', + } + ), + helpText: ( + {'""'} }} + /> + ), + }, + }; }; export const Dissect: FunctionComponent = () => { + const { services } = useKibana(); + const fieldsConfig = getFieldsConfig(services.documentation.getEsDocsBasePath()); + return ( <> Date: Tue, 1 Sep 2020 17:06:12 -0400 Subject: [PATCH 15/20] Incorporating reviewer feedback. --- .../manage_processor_form/processors/bytes.tsx | 10 +--------- .../manage_processor_form/processors/circle.tsx | 4 ++-- .../common_fields/common_processor_fields.tsx | 2 +- .../processors/common_fields/target_field.tsx | 3 +-- .../manage_processor_form/processors/convert.tsx | 10 +--------- .../manage_processor_form/processors/csv.tsx | 10 +++++----- .../manage_processor_form/processors/date.tsx | 4 ++-- .../manage_processor_form/processors/dissect.tsx | 2 +- .../manage_processor_form/processors/dot_expander.tsx | 2 +- .../components/shared/map_processor_type_to_form.tsx | 10 ++++------ 10 files changed, 19 insertions(+), 38 deletions(-) diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/bytes.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/bytes.tsx index 18c3659ba96a5f..6633f9e5de94bc 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/bytes.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/bytes.tsx @@ -24,15 +24,7 @@ export const Bytes: FunctionComponent = () => { )} /> - + diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/circle.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/circle.tsx index 89a273ab4c418f..70df18acfd0a9f 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/circle.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/circle.tsx @@ -39,7 +39,7 @@ const fieldsConfig: FieldsConfig = { helpText: () => ( {'geo_shape'}, shape: {'shape'}, @@ -71,7 +71,7 @@ const fieldsConfig: FieldsConfig = { }), helpText: i18n.translate( 'xpack.ingestPipelines.pipelineEditor.circleForm.shapeTypeFieldHelpText', - { defaultMessage: 'Field mapping type to use when processing the circle.' } + { defaultMessage: 'Field mapping type to use when processing the output polygon.' } ), validations: [ { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/common_processor_fields.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/common_processor_fields.tsx index 51e9a59180383a..d297cf0a734bf0 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/common_processor_fields.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/common_processor_fields.tsx @@ -40,7 +40,7 @@ const ifConfig: FieldConfig = { defaultMessage: 'Condition (optional)', }), helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.commonFields.ifFieldHelpText', { - defaultMessage: 'Conditional statement to run with this processor.', + defaultMessage: 'Conditionally run this processor.', }), type: FIELD_TYPES.TEXT, }; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/target_field.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/target_field.tsx index 72292a266e9113..69ce01777b6165 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/target_field.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/target_field.tsx @@ -21,8 +21,7 @@ const fieldsConfig: FieldsConfig = { helpText: i18n.translate( 'xpack.ingestPipelines.pipelineEditor.commonFields.targetFieldHelpText', { - defaultMessage: - '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.', } ), }, diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/convert.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/convert.tsx index 59aedd77c552e0..7284bd6c627519 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/convert.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/convert.tsx @@ -115,15 +115,7 @@ export const Convert: FunctionComponent = () => { path="fields.type" /> - + diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/csv.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/csv.tsx index c24f5c522efd8c..471efaa56dea0f 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/csv.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/csv.tsx @@ -52,7 +52,7 @@ const fieldsConfig: FieldsConfig = { defaultMessage: 'Target fields', }), helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.csvForm.targetFieldsHelpText', { - defaultMessage: 'Array of fields to assign extracted values to.', + defaultMessage: 'Output fields. Extracted values are mapped to these fields.', }), validations: [ { @@ -83,7 +83,7 @@ const fieldsConfig: FieldsConfig = { helpText: ( {','} }} /> ), @@ -102,7 +102,7 @@ const fieldsConfig: FieldsConfig = { helpText: ( {'"'} }} /> ), @@ -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: { @@ -127,7 +127,7 @@ const fieldsConfig: FieldsConfig = { 'xpack.ingestPipelines.pipelineEditor.convertForm.emptyValueFieldHelpText', { defaultMessage: - 'Value used to fill empty fields. Empty fields are skipped if this value is not provided.', + 'Used to fill empty fields. If no value is provided, empty fields are skipped.', } ), }, diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date.tsx index 847bffd756bd02..8d6d88d2b06623 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date.tsx @@ -33,7 +33,7 @@ const fieldsConfig: FieldsConfig = { }), helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.dateForm.formatsFieldHelpText', { defaultMessage: - '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: [ { @@ -99,7 +99,7 @@ export const DateProcessor: FunctionComponent = () => { helpText={ {'@timestamp'}, }} diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx index 134163a407c479..a58cbd66b5fdd7 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx @@ -79,7 +79,7 @@ const getFieldsConfig = (esDocUrl: string): Record => { helpText: ( {'""'} }} /> ), diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dot_expander.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dot_expander.tsx index 0a6b0267a238d8..4f2aa2915fdeca 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dot_expander.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dot_expander.tsx @@ -19,7 +19,7 @@ const fieldsConfig: Record = { }), helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.dotExpanderForm.pathHelpText', { defaultMessage: - 'Field containing the object to expand. Only required if the field to expand is part another object field.', + 'Output field. Only required if the field to expand is part another object field.', }), }, }; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx index c2dad6c6df12c4..66238616b9ffa6 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx @@ -75,8 +75,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { defaultMessage: 'Circle', }), description: i18n.translate('xpack.ingestPipelines.processors.description.circle', { - defaultMessage: - 'Converts circle definitions of shapes to regular polygons that approximate them. The error distance determines the accuracy of the polygon that represents the circle.', + defaultMessage: 'Converts a circle definition into an approximate polygon.', }), }, convert: { @@ -97,7 +96,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { defaultMessage: 'CSV', }), description: i18n.translate('xpack.ingestPipelines.processors.description.csv', { - defaultMessage: 'Extracts fields from a CSV line in a single text field within a document.', + defaultMessage: 'Extracts fields values from CSV data.', }), }, date: { @@ -118,7 +117,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { }), description: i18n.translate('xpack.ingestPipelines.processors.description.dateIndexName', { defaultMessage: - 'Points documents to the correct time-based index, based on a date or timestamp field in a document using the date math support in index names.', + 'Uses a date or timestamp to add documents to the correct time-based index. Index names must use a date math pattern, such as my-index-yyyy-MM-dd.', }), }, dissect: { @@ -128,8 +127,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { defaultMessage: 'Dissect', }), description: i18n.translate('xpack.ingestPipelines.processors.description.dissect', { - defaultMessage: - 'Matches a single text field against a defined pattern to extract structured fields within a document.', + defaultMessage: 'Uses dissect patterns to extract matches from a field.', }), }, dot_expander: { From b588bd96ef39709015495d4883c85eb47e416da1 Mon Sep 17 00:00:00 2001 From: Adam Locke Date: Wed, 2 Sep 2020 11:59:06 -0400 Subject: [PATCH 16/20] Trying to add another EUI element, plus edits. --- .../processors/dissect.tsx | 2 +- .../shared/map_processor_type_to_form.tsx | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx index a58cbd66b5fdd7..de62a96738fb15 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx @@ -5,7 +5,7 @@ */ import React, { FunctionComponent } from 'react'; -import { EuiCode, EuiLink, EuiText } from '@elastic/eui'; +import { EuiCode, EuiLink } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { TextEditor } from '../field_components'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx index 66238616b9ffa6..c9d1be685dec8d 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx @@ -5,7 +5,9 @@ */ import { i18n } from '@kbn/i18n'; -import { FunctionComponent, ReactNode } from 'react'; +import { React, FunctionComponent, ReactNode } from 'react'; +import { FormattedMessage } from '@kbn/i18n/react'; +import { EuiCode } from '@elastic/eui'; import { Append, @@ -86,7 +88,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { }), description: i18n.translate('xpack.ingestPipelines.processors.description.convert', { defaultMessage: - 'Converts a field in the currently ingested document to a different type, such as converting a string to an integer.', + 'Converts a field to a different data type. For example, you can convert a string to an long.', }), }, csv: { @@ -115,10 +117,15 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { label: i18n.translate('xpack.ingestPipelines.processors.label.dateIndexName', { defaultMessage: 'Date index name', }), - description: i18n.translate('xpack.ingestPipelines.processors.description.dateIndexName', { - defaultMessage: - 'Uses a date or timestamp to add documents to the correct time-based index. Index names must use a date math pattern, such as my-index-yyyy-MM-dd.', - }), + description: { + defaultMessage: ( + {'my-index-yyyy-MM-dd'} }} + /> + ), + }, }, dissect: { FieldsComponent: Dissect, From 6b43188e7e0ab5d72796dd86a547912802e16fe5 Mon Sep 17 00:00:00 2001 From: Alison Goryachev Date: Wed, 2 Sep 2020 13:25:41 -0400 Subject: [PATCH 17/20] fix date_index_name description text --- .../shared/map_processor_type_to_form.tsx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx index c9d1be685dec8d..e51c807b7d085a 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx @@ -5,7 +5,7 @@ */ import { i18n } from '@kbn/i18n'; -import { React, FunctionComponent, ReactNode } from 'react'; +import React, { FunctionComponent, ReactNode } from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; import { EuiCode } from '@elastic/eui'; @@ -117,15 +117,13 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { label: i18n.translate('xpack.ingestPipelines.processors.label.dateIndexName', { defaultMessage: 'Date index name', }), - description: { - defaultMessage: ( - {'my-index-yyyy-MM-dd'} }} - /> - ), - }, + description: () => ( + {'my-index-yyyy-MM-dd'} }} + /> + ), }, dissect: { FieldsComponent: Dissect, From 0a1b71529f28f6b28e978da2c75ba3088170c0d5 Mon Sep 17 00:00:00 2001 From: Adam Locke Date: Wed, 2 Sep 2020 13:57:34 -0400 Subject: [PATCH 18/20] Minor edit. --- .../manage_processor_form/processors/date_index_name.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date_index_name.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date_index_name.tsx index 8f1dcf1669e371..73fa54429734f0 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date_index_name.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date_index_name.tsx @@ -65,7 +65,7 @@ const fieldsConfig: FieldsConfig = { ), helpText: i18n.translate( 'xpack.ingestPipelines.pipelineEditor.dateIndexNameForm.indexNamePrefixFieldHelpText', - { defaultMessage: 'Prefix to add to the index name before the printed date.' } + { defaultMessage: 'Prefix to add before the printed date in the index name.' } ), }, index_name_format: { From 9982b0133a905c3e4453287b711bbe33a5ecc973 Mon Sep 17 00:00:00 2001 From: Adam Locke Date: Wed, 2 Sep 2020 14:59:14 -0400 Subject: [PATCH 19/20] Fixing linter error. --- .../components/manage_processor_form/processors/append.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/append.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/append.tsx index a9cb0f21015580..52750529684b0c 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/append.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/append.tsx @@ -47,8 +47,7 @@ export const Append: FunctionComponent = () => { <> From 6872e49a5c3ea1dafd781abc47a5b7b86f0dc921 Mon Sep 17 00:00:00 2001 From: Adam Locke Date: Fri, 4 Sep 2020 12:49:07 -0400 Subject: [PATCH 20/20] Removing FunctionComponent, which was not read and caused build errors. --- .../components/shared/map_processor_type_to_form.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx index 0be6a51994b8a8..799551b296bab9 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx @@ -5,7 +5,7 @@ */ import { i18n } from '@kbn/i18n'; -import React, { FunctionComponent, ReactNode } from 'react'; +import React, { ReactNode } from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; import { EuiCode } from '@elastic/eui';