Skip to content

Commit cf59af3

Browse files
address review feedback
1 parent 7d6f017 commit cf59af3

File tree

2 files changed

+20
-1
lines changed
  • x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors

2 files changed

+20
-1
lines changed

x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/properties_field.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import React, { FunctionComponent } from 'react';
88
import { i18n } from '@kbn/i18n';
99

10+
import { EuiComboBoxOptionOption } from '@elastic/eui';
1011
import { ComboBoxField, FIELD_TYPES, UseField } from '../../../../../../../shared_imports';
1112

1213
import { FieldsConfig, to } from '../shared';
@@ -27,9 +28,10 @@ const fieldsConfig: FieldsConfig = {
2728

2829
interface Props {
2930
helpText?: React.ReactNode;
31+
propertyOptions?: EuiComboBoxOptionOption[];
3032
}
3133

32-
export const PropertiesField: FunctionComponent<Props> = ({ helpText }) => {
34+
export const PropertiesField: FunctionComponent<Props> = ({ helpText, propertyOptions }) => {
3335
return (
3436
<UseField
3537
config={{
@@ -38,6 +40,12 @@ export const PropertiesField: FunctionComponent<Props> = ({ helpText }) => {
3840
}}
3941
component={ComboBoxField}
4042
path="fields.properties"
43+
componentProps={{
44+
euiFieldProps: {
45+
options: propertyOptions || [],
46+
noSuggestions: !propertyOptions,
47+
},
48+
}}
4149
/>
4250
);
4351
};

x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/user_agent.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import React, { FunctionComponent } from 'react';
88
import { i18n } from '@kbn/i18n';
99

10+
import { EuiComboBoxOptionOption } from '@elastic/eui';
1011
import { FIELD_TYPES, UseField, Field } from '../../../../../../shared_imports';
1112

1213
import { FieldsConfig } from './shared';
@@ -15,7 +16,16 @@ import { FieldNameField } from './common_fields/field_name_field';
1516
import { TargetField } from './common_fields/target_field';
1617
import { PropertiesField } from './common_fields/properties_field';
1718

19+
const propertyOptions: EuiComboBoxOptionOption[] = [
20+
{ label: 'name' },
21+
{ label: 'os' },
22+
{ label: 'device' },
23+
{ label: 'original' },
24+
{ label: 'version' },
25+
];
26+
1827
const fieldsConfig: FieldsConfig = {
28+
/* Optional fields config */
1929
regex_file: {
2030
type: FIELD_TYPES.TEXT,
2131
deserializer: String,
@@ -54,6 +64,7 @@ export const UserAgent: FunctionComponent = () => {
5464
'xpack.ingestPipelines.pipelineEditor.userAgentForm.propertiesFieldHelpText',
5565
{ defaultMessage: 'Properties added to the target field.' }
5666
)}
67+
propertyOptions={propertyOptions}
5768
/>
5869

5970
<IgnoreMissingField />

0 commit comments

Comments
 (0)