[Maps] do not show multi fields in tooltip and join field selection lists (#34379)

This commit is contained in:
Nathan Reese 2019-04-02 18:57:01 -06:00 committed by GitHub
parent 2e37f0d62f
commit 32bca45038
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 5 deletions

View file

@ -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() {

View file

@ -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,

View file

@ -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,

View file

@ -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 };

View file

@ -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) => {