[Maps] do not show multi fields in tooltip and join field selection lists (#34379)
This commit is contained in:
parent
2e37f0d62f
commit
32bca45038
|
@ -91,7 +91,13 @@ export class Join extends Component {
|
|||
return;
|
||||
}
|
||||
|
||||
this.setState({ rightFields: indexPattern.fields });
|
||||
this.setState({
|
||||
rightFields: indexPattern.fields.filter(field => {
|
||||
// Do not show multi fields as right join options
|
||||
// since they do not have values in _source and exist for indexing only
|
||||
return field.subType !== 'multi';
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
async _loadLeftSourceName() {
|
||||
|
|
|
@ -53,7 +53,7 @@ export function MultiFieldSelect({
|
|||
|
||||
MultiFieldSelect.propTypes = {
|
||||
placeholder: PropTypes.string,
|
||||
fields: PropTypes.object, // IndexedArray object
|
||||
fields: PropTypes.array, // array of Field objects
|
||||
onChange: PropTypes.func.isRequired,
|
||||
value: PropTypes.arrayOf(PropTypes.string), // array of fieldNames
|
||||
filterField: PropTypes.func,
|
||||
|
|
|
@ -77,7 +77,10 @@ export function SingleFieldSelect({ fields,
|
|||
|
||||
SingleFieldSelect.propTypes = {
|
||||
placeholder: PropTypes.string,
|
||||
fields: PropTypes.object, // IndexedArray object
|
||||
fields: PropTypes.oneOfType([
|
||||
PropTypes.object, // IndexedArray object
|
||||
PropTypes.array // array of Field objects
|
||||
]),
|
||||
onChange: PropTypes.func.isRequired,
|
||||
value: PropTypes.string, // fieldName
|
||||
filterField: PropTypes.func,
|
||||
|
|
|
@ -201,7 +201,7 @@ export class ESSearchSource extends AbstractESSource {
|
|||
async getStringFields() {
|
||||
const indexPattern = await this._getIndexPattern();
|
||||
const stringFields = indexPattern.fields.filter(field => {
|
||||
return field.type === 'string';
|
||||
return field.type === 'string' && field.subType !== 'multi';
|
||||
});
|
||||
return stringFields.map(stringField => {
|
||||
return { name: stringField.name, label: stringField.name };
|
||||
|
|
|
@ -59,7 +59,13 @@ export class UpdateSourceEditor extends Component {
|
|||
return;
|
||||
}
|
||||
|
||||
this.setState({ fields: indexPattern.fields });
|
||||
this.setState({
|
||||
fields: indexPattern.fields.filter(field => {
|
||||
// Do not show multi fields as tooltip field options
|
||||
// since they do not have values in _source and exist for indexing only
|
||||
return field.subType !== 'multi';
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
onTooltipPropertiesSelect = (propertyNames) => {
|
||||
|
|
Loading…
Reference in a new issue