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

[TSVB] Disable using top_hits in pipeline aggregations #82278

Merged
merged 8 commits into from
Nov 10, 2020
2 changes: 1 addition & 1 deletion src/plugins/vis_type_timeseries/common/vis_schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const metricsItems = schema.object({
type: stringRequired,
value: stringOptionalNullable,
values: schema.maybe(schema.nullable(schema.arrayOf(schema.nullable(schema.string())))),
size: stringOptionalNullable,
size: stringOrNumberOptionalNullable,
agg_with: stringOptionalNullable,
order: stringOptionalNullable,
order_by: stringOptionalNullable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { createChangeHandler } from '../lib/create_change_handler';
import { createSelectHandler } from '../lib/create_select_handler';
import { createTextHandler } from '../lib/create_text_handler';
import { CalculationVars, newVariable } from './vars';
import { METRIC_TYPES } from '../../../../common/metric_types';
import { FormattedMessage } from '@kbn/i18n/react';

import {
Expand Down Expand Up @@ -99,6 +100,7 @@ export function CalculationAgg(props) {
onChange={handleChange}
name="variables"
model={model}
exclude={[METRIC_TYPES.TOP_HIT]}
/>
</EuiFlexItem>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { AggSelect } from './agg_select';
import { MetricSelect } from './metric_select';
import { createChangeHandler } from '../lib/create_change_handler';
import { createSelectHandler } from '../lib/create_select_handler';
import { METRIC_TYPES } from '../../../../common/metric_types';
import { FormattedMessage } from '@kbn/i18n/react';
import {
htmlIdGenerator,
Expand Down Expand Up @@ -80,6 +81,7 @@ export function CumulativeSumAgg(props) {
metrics={siblings}
metric={model}
value={model.field}
exclude={[METRIC_TYPES.TOP_HIT]}
/>
</EuiFormRow>
</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { AggRow } from './agg_row';
import { createChangeHandler } from '../lib/create_change_handler';
import { createSelectHandler } from '../lib/create_select_handler';
import { createTextHandler } from '../lib/create_text_handler';
import { METRIC_TYPES } from '../../../../common/metric_types';
import {
htmlIdGenerator,
EuiFlexGroup,
Expand Down Expand Up @@ -91,6 +92,7 @@ export const DerivativeAgg = (props) => {
metrics={siblings}
metric={model}
value={model.field}
exclude={[METRIC_TYPES.TOP_HIT]}
fullWidth
/>
</EuiFormRow>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { MetricSelect } from './metric_select';
import { createChangeHandler } from '../lib/create_change_handler';
import { createSelectHandler } from '../lib/create_select_handler';
import { createNumberHandler } from '../lib/create_number_handler';
import { METRIC_TYPES } from '../../../../common/metric_types';
import {
htmlIdGenerator,
EuiFlexGroup,
Expand Down Expand Up @@ -153,6 +154,7 @@ export const MovingAverageAgg = (props) => {
metrics={siblings}
metric={model}
value={model.field}
exclude={[METRIC_TYPES.TOP_HIT]}
/>
</EuiFormRow>
</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { MetricSelect } from './metric_select';
import { AggRow } from './agg_row';
import { createChangeHandler } from '../lib/create_change_handler';
import { createSelectHandler } from '../lib/create_select_handler';
import { METRIC_TYPES } from '../../../../common/metric_types';
import {
htmlIdGenerator,
EuiFlexGroup,
Expand Down Expand Up @@ -85,6 +86,7 @@ export const PositiveOnlyAgg = (props) => {
metrics={siblings}
metric={model}
value={model.field}
exclude={[METRIC_TYPES.TOP_HIT]}
/>
</EuiFormRow>
</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { AggRow } from './agg_row';
import { createChangeHandler } from '../lib/create_change_handler';
import { createSelectHandler } from '../lib/create_select_handler';
import { createNumberHandler } from '../lib/create_number_handler';
import { METRIC_TYPES } from '../../../../common/metric_types';
import {
htmlIdGenerator,
EuiFlexGroup,
Expand Down Expand Up @@ -87,6 +88,7 @@ export const SerialDiffAgg = (props) => {
metrics={siblings}
metric={model}
value={model.field}
exclude={[METRIC_TYPES.TOP_HIT]}
/>
</EuiFormRow>
</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import { AggSelect } from './agg_select';
import { createChangeHandler } from '../lib/create_change_handler';
import { createSelectHandler } from '../lib/create_select_handler';
import { createTextHandler } from '../lib/create_text_handler';
import { METRIC_TYPES } from '../../../../common/metric_types';

import {
htmlIdGenerator,
EuiFlexGroup,
Expand Down Expand Up @@ -154,7 +156,7 @@ const StandardSiblingAggUi = (props) => {
>
<MetricSelect
onChange={handleSelectChange('field')}
exclude={['percentile']}
exclude={[METRIC_TYPES.PERCENTILE, METRIC_TYPES.TOP_HIT]}
metrics={siblings}
metric={model}
value={model.field}
Expand All @@ -179,6 +181,7 @@ StandardSiblingAggUi.propTypes = {
series: PropTypes.object,
siblings: PropTypes.array,
uiRestrictions: PropTypes.object,
exclude: PropTypes.array,
};

export const StandardSiblingAgg = injectI18n(StandardSiblingAggUi);
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export class CalculationVars extends Component {
metric={this.props.model}
value={row.field}
includeSiblings={this.props.includeSiblings}
exclude={this.props.exclude}
/>
</EuiFlexItem>
<EuiFlexItem>
Expand Down