diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/__snapshots__/update_source_editor.test.js.snap b/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/__snapshots__/update_source_editor.test.js.snap index 6f50b9eaea2bc..c0736a54e55d2 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/__snapshots__/update_source_editor.test.js.snap +++ b/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/__snapshots__/update_source_editor.test.js.snap @@ -64,8 +64,8 @@ exports[`should enable sort order select when sort field provided 1`] = ` labelType="label" > @@ -77,8 +77,8 @@ exports[`should enable sort order select when sort field provided 1`] = ` labelType="label" > @@ -149,20 +149,7 @@ exports[`should render top hits form when useTopHits is true 1`] = ` > - - - @@ -204,6 +191,19 @@ exports[`should render top hits form when useTopHits is true 1`] = ` value={1} /> + + + `; @@ -270,8 +270,8 @@ exports[`should render update source editor 1`] = ` labelType="label" > @@ -283,8 +283,8 @@ exports[`should render update source editor 1`] = ` labelType="label" > diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/es_search_source.js b/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/es_search_source.js index 4f8831d8d25da..8fd2f49a8059d 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/es_search_source.js +++ b/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/es_search_source.js @@ -245,16 +245,14 @@ export class ESSearchSource extends AbstractESSource { }; } - // Returns true when top hits is enabled and properly configured _isTopHits() { const { useTopHits, topHitsSplitField } = this._descriptor; return !!(useTopHits && topHitsSplitField); } - // Returns true when sort is properly configured _hasSort() { const { sortField, sortOrder } = this._descriptor; - return !!(sortField && sortOrder); + return !!sortField && !!sortOrder; } async getGeoJsonWithMeta(layerName, searchFilters, registerCancelCallback) { diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/update_source_editor.js b/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/update_source_editor.js index ea7594423e351..37c955c982168 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/update_source_editor.js +++ b/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/update_source_editor.js @@ -75,9 +75,7 @@ export class UpdateSourceEditor extends Component { this.setState({ tooltipFields: getSourceFields(indexPattern.fields), termFields: getTermsFields(indexPattern.fields), - sortFields: indexPattern.fields.filter(field => { - return field.sortable; - }), + sortFields: indexPattern.fields.filter(field => field.sortable), }); } _onTooltipPropertiesChange = propertyNames => { @@ -214,25 +212,26 @@ export class UpdateSourceEditor extends Component { + {this.renderTopHitsForm()} + - {this.renderTopHitsForm()} ); }