From 27d02bb2f5610d05bd28975f9208cbcaceb5592f Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 9 Aug 2019 14:51:16 -0600 Subject: [PATCH] [Maps] only show top hits checkbox if index has date fields (#43056) * [Maps] only show top hits checkbox if index has date fields * rename useTopHitsCheckbox to topHitsCheckbox --- .../es_search_source/update_source_editor.js | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) 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 332b0027796b4..7b9ae98d31e8e 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 @@ -191,6 +191,23 @@ export class UpdateSourceEditor extends Component { } render() { + let topHitsCheckbox; + if (this.state.dateFields && this.state.dateFields.length) { + topHitsCheckbox = ( + + + + ); + } + return ( - - - + {topHitsCheckbox} {this.renderTopHitsForm()}