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

[Metrics UI] Remove remaining field filtering #63398

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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 @@ -10,7 +10,6 @@ import { i18n } from '@kbn/i18n';
import React, { useCallback } from 'react';
import { IFieldType } from 'src/plugins/data/public';
import { MetricsExplorerOptions } from '../../containers/metrics_explorer/use_metrics_explorer_options';
import { isDisplayable } from '../../utils/is_displayable';

interface Props {
options: MetricsExplorerOptions;
Expand All @@ -27,18 +26,6 @@ export const MetricsExplorerGroupBy = ({ options, onChange, fields }: Props) =>
[onChange]
);

const metricPrefixes = options.metrics
.map(
metric =>
(metric.field &&
metric.field
.split(/\./)
.slice(0, 2)
.join('.')) ||
null
)
.filter(metric => metric) as string[];

return (
<EuiComboBox
placeholder={i18n.translate('xpack.infra.metricsExplorer.groupByLabel', {
Expand All @@ -51,7 +38,7 @@ export const MetricsExplorerGroupBy = ({ options, onChange, fields }: Props) =>
singleSelection={true}
selectedOptions={(options.groupBy && [{ label: options.groupBy }]) || []}
options={fields
.filter(f => isDisplayable(f, metricPrefixes) && f.aggregatable && f.type === 'string')
.filter(f => f.aggregatable && f.type === 'string')
.map(f => ({ label: f.name }))}
onChange={handleChange}
isClearable={true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { i18n } from '@kbn/i18n';
import React, { useEffect, useState } from 'react';
import { WithKueryAutocompletion } from '../../containers/with_kuery_autocompletion';
import { AutocompleteField } from '../autocomplete_field';
import { isDisplayable } from '../../utils/is_displayable';
import { esKuery, IIndexPattern } from '../../../../../../src/plugins/data/public';

interface Props {
Expand Down Expand Up @@ -51,7 +50,7 @@ export const MetricsExplorerKueryBar = ({

const filteredDerivedIndexPattern = {
...derivedIndexPattern,
fields: derivedIndexPattern.fields.filter(field => isDisplayable(field)),
fields: derivedIndexPattern.fields,
};

const defaultPlaceholder = i18n.translate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { IFieldType } from 'src/plugins/data/public';
import { colorTransformer, MetricsExplorerColor } from '../../../common/color_palette';
import { MetricsExplorerMetric } from '../../../common/http_api/metrics_explorer';
import { MetricsExplorerOptions } from '../../containers/metrics_explorer/use_metrics_explorer_options';
import { isDisplayable } from '../../utils/is_displayable';

interface Props {
autoFocus?: boolean;
Expand Down Expand Up @@ -54,9 +53,7 @@ export const MetricsExplorerMetrics = ({ options, onChange, fields, autoFocus =
[onChange, options.aggregation, colors]
);

const comboOptions = fields
.filter(field => isDisplayable(field))
.map(field => ({ label: field.name, value: field.name }));
const comboOptions = fields.map(field => ({ label: field.name, value: field.name }));
const selectedOptions = options.metrics
.filter(m => m.aggregation !== 'count')
.map(metric => ({
Expand Down