Skip to content

Commit

Permalink
forms for processors T-U
Browse files Browse the repository at this point in the history
  • Loading branch information
alisonelizabeth committed Sep 3, 2020
1 parent 60986d4 commit b45b1f4
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ export { HtmlStrip } from './html_strip';
export { Inference } from './inference';
export { Join } from './join';
export { Json } from './json';
export { Trim } from './trim';
export { Uppercase } from './uppercase';
export { UrlDecode } from './url_decode';
export { UserAgent } from './user_agent';
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React, { FunctionComponent } from 'react';
import { i18n } from '@kbn/i18n';

import { IgnoreMissingField } from './common_fields/ignore_missing_field';
import { FieldNameField } from './common_fields/field_name_field';
import { TargetField } from './common_fields/target_field';

export const Trim: FunctionComponent = () => {
return (
<>
<FieldNameField
helpText={i18n.translate(
'xpack.ingestPipelines.pipelineEditor.trimForm.fieldNameHelpText',
{ defaultMessage: 'The field to trim whitespace from.' }
)}
/>

<TargetField />

<IgnoreMissingField />
</>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React, { FunctionComponent } from 'react';
import { i18n } from '@kbn/i18n';

import { IgnoreMissingField } from './common_fields/ignore_missing_field';
import { FieldNameField } from './common_fields/field_name_field';
import { TargetField } from './common_fields/target_field';

export const Uppercase: FunctionComponent = () => {
return (
<>
<FieldNameField
helpText={i18n.translate(
'xpack.ingestPipelines.pipelineEditor.uppercaseForm.fieldNameHelpText',
{ defaultMessage: 'The field to make uppercase.' }
)}
/>

<TargetField />

<IgnoreMissingField />
</>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React, { FunctionComponent } from 'react';
import { i18n } from '@kbn/i18n';

import { IgnoreMissingField } from './common_fields/ignore_missing_field';
import { FieldNameField } from './common_fields/field_name_field';
import { TargetField } from './common_fields/target_field';

export const UrlDecode: FunctionComponent = () => {
return (
<>
<FieldNameField
helpText={i18n.translate(
'xpack.ingestPipelines.pipelineEditor.urlDecodeForm.fieldNameHelpText',
{ defaultMessage: 'The field to decode.' }
)}
/>

<TargetField />

<IgnoreMissingField />
</>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React, { FunctionComponent } from 'react';
import { i18n } from '@kbn/i18n';

import { IgnoreMissingField } from './common_fields/ignore_missing_field';
import { FieldNameField } from './common_fields/field_name_field';
import { TargetField } from './common_fields/target_field';

// TODO: Add support for `regex_file` and `properties`
export const UserAgent: FunctionComponent = () => {
return (
<>
<FieldNameField
helpText={i18n.translate(
'xpack.ingestPipelines.pipelineEditor.urlDecodeForm.fieldNameHelpText',
{ defaultMessage: 'The field containing the user agent string.' }
)}
/>

<TargetField />

<IgnoreMissingField />
</>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ import {
Inference,
Join,
Json,
Trim,
Uppercase,
UrlDecode,
UserAgent,
} from '../manage_processor_form/processors';

// import { SetProcessor } from './processors/set';
Expand Down Expand Up @@ -249,28 +253,28 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = {
}),
},
trim: {
FieldsComponent: undefined, // TODO: Implement
FieldsComponent: Trim,
docLinkPath: '/trim-processor.html',
label: i18n.translate('xpack.ingestPipelines.processors.label.trim', {
defaultMessage: 'Trim',
}),
},
uppercase: {
FieldsComponent: undefined, // TODO: Implement
FieldsComponent: Uppercase,
docLinkPath: '/uppercase-processor.html',
label: i18n.translate('xpack.ingestPipelines.processors.label.uppercase', {
defaultMessage: 'Uppercase',
}),
},
urldecode: {
FieldsComponent: undefined, // TODO: Implement
FieldsComponent: UrlDecode,
docLinkPath: '/urldecode-processor.html',
label: i18n.translate('xpack.ingestPipelines.processors.label.urldecode', {
defaultMessage: 'URL decode',
}),
},
user_agent: {
FieldsComponent: undefined, // TODO: Implement
FieldsComponent: UserAgent,
docLinkPath: '/user-agent-processor.html',
label: i18n.translate('xpack.ingestPipelines.processors.label.userAgent', {
defaultMessage: 'User agent',
Expand Down

0 comments on commit b45b1f4

Please sign in to comment.