Skip to content

Commit 102bd2b

Browse files
[Mappings editor] include/exclude fields only support custom options (#54949)
1 parent 9e07a42 commit 102bd2b

File tree

1 file changed

+3
-8
lines changed
  • x-pack/legacy/plugins/index_management/public/app/components/mappings_editor/components/configuration_form/source_field_section

1 file changed

+3
-8
lines changed

x-pack/legacy/plugins/index_management/public/app/components/mappings_editor/components/configuration_form/source_field_section/source_field_section.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* or more contributor license agreements. Licensed under the Elastic License;
44
* you may not use this file except in compliance with the Elastic License.
55
*/
6-
import React, { useState } from 'react';
6+
import React from 'react';
77

88
import { i18n } from '@kbn/i18n';
99
import { FormattedMessage } from '@kbn/i18n/react';
@@ -14,9 +14,6 @@ import { UseField, FormDataProvider, FormRow, ToggleField } from '../../../share
1414
import { ComboBoxOption } from '../../../types';
1515

1616
export const SourceFieldSection = () => {
17-
const [includeComboBoxOptions, setIncludeComboBoxOptions] = useState<ComboBoxOption[]>([]);
18-
const [excludeComboBoxOptions, setExcludeComboBoxOptions] = useState<ComboBoxOption[]>([]);
19-
2017
const renderWarning = () => (
2118
<EuiCallOut
2219
title={i18n.translate('xpack.idxMgmt.mappingsEditor.disabledSourceFieldCallOutTitle', {
@@ -73,13 +70,13 @@ export const SourceFieldSection = () => {
7370
{({ label, helpText, value, setValue }) => (
7471
<EuiFormRow label={label} helpText={helpText} fullWidth>
7572
<EuiComboBox
73+
noSuggestions
7674
placeholder={i18n.translate(
7775
'xpack.idxMgmt.mappingsEditor.sourceIncludeField.placeholderLabel',
7876
{
7977
defaultMessage: 'path.to.field.*',
8078
}
8179
)}
82-
options={includeComboBoxOptions}
8380
selectedOptions={value as ComboBoxOption[]}
8481
onChange={newValue => {
8582
setValue(newValue);
@@ -90,7 +87,6 @@ export const SourceFieldSection = () => {
9087
};
9188

9289
setValue([...(value as ComboBoxOption[]), newOption]);
93-
setIncludeComboBoxOptions([...includeComboBoxOptions, newOption]);
9490
}}
9591
fullWidth
9692
/>
@@ -104,13 +100,13 @@ export const SourceFieldSection = () => {
104100
{({ label, helpText, value, setValue }) => (
105101
<EuiFormRow label={label} helpText={helpText} fullWidth>
106102
<EuiComboBox
103+
noSuggestions
107104
placeholder={i18n.translate(
108105
'xpack.idxMgmt.mappingsEditor.sourceExcludeField.placeholderLabel',
109106
{
110107
defaultMessage: 'path.to.field.*',
111108
}
112109
)}
113-
options={excludeComboBoxOptions}
114110
selectedOptions={value as ComboBoxOption[]}
115111
onChange={newValue => {
116112
setValue(newValue);
@@ -121,7 +117,6 @@ export const SourceFieldSection = () => {
121117
};
122118

123119
setValue([...(value as ComboBoxOption[]), newOption]);
124-
setExcludeComboBoxOptions([...excludeComboBoxOptions, newOption]);
125120
}}
126121
fullWidth
127122
/>

0 commit comments

Comments
 (0)