Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

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

Conversation

lockewritesdocs
Copy link
Contributor

@lockewritesdocs lockewritesdocs commented Aug 26, 2020

Summary

This PR updates UI field strings and adds a description for the following processors, extending the work completed in #72849:

  • Append Processor
  • Bytes Processor
  • Circle Processor
  • Convert Processor
  • CSV Processor
  • Date Processor
  • Date Index Name Processor
  • Dissect Processor
  • Dot Expander Processor
  • Drop Processor

Relates to Ingest Node Processors Editors Forms
Relates to #76113 and #72849

How to test

  1. Start Kibana with basic license
  2. Go to ingest pipelines plugin in management section
  3. Add a processor for each of the forms listed above (attempt to submit to see which fields are required)
  4. Create the pipeline

Notes

There's a strong chance that the coding in x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx is incorrect. @alisonelizabeth provided the proper syntax, but I might have broken something 😉

Checklist

For maintainers

@lockewritesdocs lockewritesdocs added v8.0.0 Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v7.10.0 Feature:Ingest Node Pipelines Ingest node pipelines management labels Aug 26, 2020
@lockewritesdocs lockewritesdocs requested a review from a team as a code owner August 26, 2020 13:24
@lockewritesdocs lockewritesdocs self-assigned this Aug 26, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui (Team:Elasticsearch UI)

@lockewritesdocs lockewritesdocs added the release_note:skip Skip the PR/issue when compiling release notes label Aug 26, 2020
Copy link
Contributor

@jloleysens jloleysens left a comment

Choose a reason for hiding this comment

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

Great work @lockewritesdocs ! This PR is looking in good shape, thanks for making those copy changes!

I left a few comments in the code that would be great if you could take a look at. It also looks like we are missing type annotations here for the new field (the thing I would like to block on):

I see you have named the new field helpText which aligns well with the name in the EuiFormRow which we are going to be using, but I think description would be a better name for this text.

@@ -68,13 +68,15 @@ export const ProcessorTypeField: FunctionComponent<Props> = ({ initialType }) =>
<UseField<string> config={typeConfig} defaultValue={initialType} path="type">
{(typeField) => {
let selectedOptions: ProcessorTypeAndLabel[];
let helpText: string = '';
Copy link
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Contributor

Choose a reason for hiding this comment

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

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

if (typeField.value?.length) {
const type = typeField.value;
const descriptor = getProcessorDescriptor(type);
selectedOptions = descriptor
? [{ label: descriptor.label, value: type }]
: // If there is no label for this processor type, just use the type as the label
[{ label: type, value: type }];
helpText = descriptor?.helpText || '';
Copy link
Contributor

Choose a reason for hiding this comment

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

We could probably restructure this code now to something like:

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

I think this would read a bit easier :)

@lockewritesdocs
Copy link
Contributor Author

@elasticmachine merge upstream

@jloleysens
Copy link
Contributor

@elasticmachine merge upstream

Copy link
Contributor

@jloleysens jloleysens left a comment

Choose a reason for hiding this comment

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

@alisonelizabeth @lockewritesdocs Thanks for addressing my feedback!

I did not re-test locally, but the proposed code changes look good to me.

Copy link
Contributor

@jrodewig jrodewig left a comment

Choose a reason for hiding this comment

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

Looks good overall. I left some suggestions, but most are non-blocking nits.

One bigger discussion point: Most of the processors have an output field. Some can also update the input field in place.

We should develop a common pattern. Here are the ones we have so far:

  • Field to assign the converted value to. Defaults to ...
  • Field used to contain the converted value. Defaults to ...

Those are okay, but I think we may be able to get away with something simpler like:

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

Regardless, we should pick one and use it consistently throughout. Let me know your thoughts. Once we make a decision, I can update the field help text in processors E-J.

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

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
@lockewritesdocs
Copy link
Contributor Author

@elasticmachine merge upstream

Comment on lines 120 to 128
description: {
defaultMessage: (
<FormattedMessage
id="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 {value}."
values={{ value: <EuiCode inline>{'my-index-yyyy-MM-dd'}</EuiCode> }}
/>
),
},
Copy link
Contributor

Choose a reason for hiding this comment

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

You will need to remove the { defaultMessage: ... } wrapping the <FormattedMessage ... /> component - you you will probably also get a TS error about this :)

@lockewritesdocs
Copy link
Contributor Author

@jloleysens, I incorporated feedback from @jrodewig, so I think that these changes can now be merged. The only other change I recommend is removing the two horizontal bars for the Drop processor, since there are no additional fields to display.

image

@jloleysens
Copy link
Contributor

@lockewritesdocs Thanks for the updated! I will create a fix for that.

@lockewritesdocs lockewritesdocs changed the title [DOCS] Updating UI strings for Ingest Pipeline processors A-D [Ingest Pipelines] Add descriptions for ingest processors A-D Sep 4, 2020
@lockewritesdocs
Copy link
Contributor Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

merge conflict between base and head

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

async chunks size

id value diff baseline
ingestPipelines 734.8KB +3.3KB 731.6KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@lockewritesdocs lockewritesdocs merged commit 6d4e772 into elastic:master Sep 4, 2020
@lockewritesdocs lockewritesdocs deleted the docs__update-ingest-pipeline-strings branch September 4, 2020 19:26
gmmorris added a commit to gmmorris/kibana that referenced this pull request Sep 7, 2020
* master:
  [APM] Use observer.hostname instead of observer.name (elastic#76074)
  Legacy logging: fix remoteAddress being duplicated in userAgent field (elastic#76751)
  Remove legacy deprecation adapter (elastic#76753)
  [Security Solution][Detections] Rule forms cleanup (elastic#76138)
  Adds back in custom images for reporting + tests (elastic#76810)
  [APM] Fix overlapping transaction names (elastic#76083)
  [Ingest Pipelines] Add descriptions for ingest processors A-D (elastic#75975)
jrodewig added a commit that referenced this pull request Sep 8, 2020
…76113) (#76948)

* [Ingest Pipelines] Add descriptions for ingest processors E-J (#76113)

Co-authored-by: Jean-Louis Leysens <jloleysens@gmail.com>
# Conflicts:
#	x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/shared/map_processor_type_to_form.tsx

* Add code from #76948

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

* Fixing formatting issues identified by Prettier, part 2.

* Fixing helpText labels.

* Adding {value} object for dissect processor.

* Incorporating reviewer feedback.

* fix dropdown not rendering

* Fixing typo.

* add support for FormattedMessage in help text

* fix TS

* Updating some strings and trying to add code formatting.

* fix formatted message

* Editing some field descriptions.

* Apply suggestions from code review

Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>

* Trying to add EuiLink, plus edits.

* fix help text for dissect processor

* Incorporating reviewer feedback.

* Trying to add another EUI element, plus edits.

* fix date_index_name description text

* Minor edit.

* Fixing linter error.

* Removing FunctionComponent, which was not read and caused build errors.

Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>

Co-authored-by: Adam Locke <adam.locke@elastic.co>
Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 75975 or prevent reminders by adding the backport:skip label.

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Sep 8, 2020
@lockewritesdocs lockewritesdocs added backport:skip This commit does not require backporting and removed backport missing Added to PRs automatically when the are determined to be missing a backport. labels Sep 9, 2020
@lockewritesdocs
Copy link
Contributor Author

I added the backport:skip label because #76113 by @jrodewig included the changes from this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Ingest Node Pipelines Ingest node pipelines management release_note:skip Skip the PR/issue when compiling release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants