mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -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() {
|
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 (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<TooltipSelector
|
<TooltipSelector
|
||||||
|
@ -212,17 +229,7 @@ export class UpdateSourceEditor extends Component {
|
||||||
/>
|
/>
|
||||||
</EuiFormRow>
|
</EuiFormRow>
|
||||||
|
|
||||||
<EuiFormRow>
|
{topHitsCheckbox}
|
||||||
<EuiSwitch
|
|
||||||
label={
|
|
||||||
i18n.translate('xpack.maps.source.esSearch.useTopHitsLabel', {
|
|
||||||
defaultMessage: `Show most recent documents by entity`
|
|
||||||
})
|
|
||||||
}
|
|
||||||
checked={this.props.useTopHits}
|
|
||||||
onChange={this.onUseTopHitsChange}
|
|
||||||
/>
|
|
||||||
</EuiFormRow>
|
|
||||||
|
|
||||||
{this.renderTopHitsForm()}
|
{this.renderTopHitsForm()}
|
||||||
</Fragment>
|
</Fragment>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue