mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
* [Maps] only show top hits checkbox if index has date fields * rename useTopHitsCheckbox to topHitsCheckbox
This commit is contained in:
parent
50f9e2b7f1
commit
d322b609d9
1 changed files with 18 additions and 11 deletions
|
@ -191,6 +191,23 @@ export class UpdateSourceEditor extends Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
let topHitsCheckbox;
|
||||
if (this.state.dateFields && this.state.dateFields.length) {
|
||||
topHitsCheckbox = (
|
||||
<EuiFormRow>
|
||||
<EuiSwitch
|
||||
label={
|
||||
i18n.translate('xpack.maps.source.esSearch.useTopHitsLabel', {
|
||||
defaultMessage: `Show most recent documents by entity`
|
||||
})
|
||||
}
|
||||
checked={this.props.useTopHits}
|
||||
onChange={this.onUseTopHitsChange}
|
||||
/>
|
||||
</EuiFormRow>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<TooltipSelector
|
||||
|
@ -212,17 +229,7 @@ export class UpdateSourceEditor extends Component {
|
|||
/>
|
||||
</EuiFormRow>
|
||||
|
||||
<EuiFormRow>
|
||||
<EuiSwitch
|
||||
label={
|
||||
i18n.translate('xpack.maps.source.esSearch.useTopHitsLabel', {
|
||||
defaultMessage: `Show most recent documents by entity`
|
||||
})
|
||||
}
|
||||
checked={this.props.useTopHits}
|
||||
onChange={this.onUseTopHitsChange}
|
||||
/>
|
||||
</EuiFormRow>
|
||||
{topHitsCheckbox}
|
||||
|
||||
{this.renderTopHitsForm()}
|
||||
</Fragment>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue