Skip to content

Commit

Permalink
[TSVB] [Rollup] Table tab not working with rollup indexes (#83635)
Browse files Browse the repository at this point in the history
* Added restrictions and type to filtering filed for group by

* Use context instead of consumer

* Added bucket types

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
VladLasitsa and kibanamachine committed Nov 23, 2020
1 parent cacd199 commit 53d3003
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,26 @@
* under the License.
*/

export const METRIC_TYPES = {
PERCENTILE: 'percentile',
PERCENTILE_RANK: 'percentile_rank',
TOP_HIT: 'top_hit',
COUNT: 'count',
DERIVATIVE: 'derivative',
STD_DEVIATION: 'std_deviation',
VARIANCE: 'variance',
SUM_OF_SQUARES: 'sum_of_squares',
CARDINALITY: 'cardinality',
VALUE_COUNT: 'value_count',
AVERAGE: 'avg',
SUM: 'sum',
};
// We should probably use METRIC_TYPES from data plugin in future.
export enum METRIC_TYPES {
PERCENTILE = 'percentile',
PERCENTILE_RANK = 'percentile_rank',
TOP_HIT = 'top_hit',
COUNT = 'count',
DERIVATIVE = 'derivative',
STD_DEVIATION = 'std_deviation',
VARIANCE = 'variance',
SUM_OF_SQUARES = 'sum_of_squares',
CARDINALITY = 'cardinality',
VALUE_COUNT = 'value_count',
AVERAGE = 'avg',
SUM = 'sum',
}

// We should probably use BUCKET_TYPES from data plugin in future.
export enum BUCKET_TYPES {
TERMS = 'terms',
}

export const EXTENDED_STATS_TYPES = [
METRIC_TYPES.STD_DEVIATION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ import {
import { FormattedMessage } from '@kbn/i18n/react';
import { QueryBarWrapper } from '../query_bar_wrapper';
import { getDefaultQueryLanguage } from '../lib/get_default_query_language';
import { VisDataContext } from './../../contexts/vis_data_context';
import { BUCKET_TYPES } from '../../../../common/metric_types';
export class TablePanelConfig extends Component {
static contextType = VisDataContext;
constructor(props) {
super(props);
this.state = { selectedTab: 'data' };
Expand Down Expand Up @@ -120,6 +123,8 @@ export class TablePanelConfig extends Component {
value={model.pivot_id}
indexPattern={model.index_pattern}
onChange={this.handlePivotChange}
uiRestrictions={this.context.uiRestrictions}
type={BUCKET_TYPES.TERMS}
fullWidth
/>
</EuiFormRow>
Expand Down

0 comments on commit 53d3003

Please sign in to comment.