Skip to content

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Oct 7, 2019
1 parent dda9c4c commit 60284c5
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 37 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down Expand Up @@ -214,25 +212,26 @@ export class UpdateSourceEditor extends Component {

<EuiFormRow>
<EuiSwitch
label={i18n.translate('xpack.maps.source.esSearch.extentFilterLabel', {
defaultMessage: `Dynamically filter for data in the visible map area`,
label={i18n.translate('xpack.maps.source.esSearch.useTopHitsLabel', {
defaultMessage: `Show top documents based on sort order`,
})}
checked={this.props.filterByMapBounds}
onChange={this._onFilterByMapBoundsChange}
checked={this.props.useTopHits}
onChange={this.onUseTopHitsChange}
/>
</EuiFormRow>

{this.renderTopHitsForm()}

<EuiFormRow>
<EuiSwitch
label={i18n.translate('xpack.maps.source.esSearch.useTopHitsLabel', {
defaultMessage: `Show most recent documents by entity`,
label={i18n.translate('xpack.maps.source.esSearch.extentFilterLabel', {
defaultMessage: `Dynamically filter for data in the visible map area`,
})}
checked={this.props.useTopHits}
onChange={this.onUseTopHitsChange}
checked={this.props.filterByMapBounds}
onChange={this._onFilterByMapBoundsChange}
/>
</EuiFormRow>

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

0 comments on commit 60284c5

Please sign in to comment.