Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Maps] only show top hits checkbox if index has date fields #43056

Merged
merged 2 commits into from
Aug 9, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,23 @@ export class UpdateSourceEditor extends Component {
}

render() {
let useTopHitsCheckbox;
nreese marked this conversation as resolved.
Show resolved Hide resolved
if (this.state.dateFields && this.state.dateFields.length) {
useTopHitsCheckbox = (
<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
Expand All @@ -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>
{useTopHitsCheckbox}

{this.renderTopHitsForm()}
</Fragment>
Expand Down