diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/components/filter_label.test.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/components/filter_label.test.tsx index 097ea89826c38..dab2a82e7c7c9 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/components/filter_label.test.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/components/filter_label.test.tsx @@ -7,14 +7,14 @@ import React from 'react'; import { fireEvent, screen, waitFor } from '@testing-library/react'; -import { mockAppIndexPattern, mockIndexPattern, mockUxSeries, render } from '../rtl_helpers'; +import { mockAppDataView, mockDataView, mockUxSeries, render } from '../rtl_helpers'; import { FilterLabel } from './filter_label'; import * as useSeriesHook from '../hooks/use_series_filters'; import { buildFilterLabel } from '../../filter_value_label/filter_value_label'; // FLAKY: https://github.com/elastic/kibana/issues/115324 describe.skip('FilterLabel', function () { - mockAppIndexPattern(); + mockAppDataView(); const invertFilter = jest.fn(); jest.spyOn(useSeriesHook, 'useSeriesFilters').mockReturnValue({ @@ -30,7 +30,7 @@ describe.skip('FilterLabel', function () { negate={false} seriesId={0} removeFilter={jest.fn()} - indexPattern={mockIndexPattern} + dataView={mockDataView} series={mockUxSeries} /> ); @@ -55,7 +55,7 @@ describe.skip('FilterLabel', function () { negate={false} seriesId={0} removeFilter={removeFilter} - indexPattern={mockIndexPattern} + dataView={mockDataView} series={mockUxSeries} /> ); @@ -79,7 +79,7 @@ describe.skip('FilterLabel', function () { negate={false} seriesId={0} removeFilter={removeFilter} - indexPattern={mockIndexPattern} + dataView={mockDataView} series={mockUxSeries} /> ); @@ -106,7 +106,7 @@ describe.skip('FilterLabel', function () { negate={true} seriesId={0} removeFilter={jest.fn()} - indexPattern={mockIndexPattern} + dataView={mockDataView} series={mockUxSeries} /> ); @@ -126,7 +126,7 @@ describe.skip('FilterLabel', function () { buildFilterLabel({ field: 'user_agent.name', label: 'Browser family', - indexPattern: mockIndexPattern, + dataView: mockDataView, value: 'Firefox', negate: false, }) diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/components/filter_label.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/components/filter_label.tsx index c6254a85de9ac..077e9be4d634a 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/components/filter_label.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/components/filter_label.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { IndexPattern } from '../../../../../../../../src/plugins/data/public'; +import type { DataView } from '../../../../../../../../src/plugins/data_views/common'; import { useSeriesFilters } from '../hooks/use_series_filters'; import { FilterValueLabel } from '../../filter_value_label/filter_value_label'; import { SeriesUrl } from '../types'; @@ -19,7 +19,7 @@ interface Props { series: SeriesUrl; negate: boolean; definitionFilter?: boolean; - indexPattern: IndexPattern; + dataView: DataView; removeFilter: (field: string, value: string | string[], notVal: boolean) => void; } @@ -30,15 +30,15 @@ export function FilterLabel({ field, value, negate, - indexPattern, + dataView, removeFilter, definitionFilter, }: Props) { const { invertFilter } = useSeriesFilters({ seriesId, series }); - return indexPattern ? ( + return dataView ? ( { if (!definitionFilter) invertFilter(val); diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts index 93b3203ad6717..3c3a634af010e 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts @@ -6,12 +6,12 @@ */ import { AppDataType, ReportViewType, SeriesConfig } from '../types'; -import { IndexPattern } from '../../../../../../../../src/plugins/data/common'; +import type { DataView } from '../../../../../../../../src/plugins/data_views/common'; import { ReportConfigMap } from '../contexts/exploratory_view_config'; interface Props { reportType: ReportViewType; - indexPattern: IndexPattern; + dataView: DataView; dataType: AppDataType; reportConfigMap: ReportConfigMap; } @@ -19,13 +19,13 @@ interface Props { export const getDefaultConfigs = ({ reportType, dataType, - indexPattern, + dataView, reportConfigMap, }: Props): SeriesConfig => { let configResult: SeriesConfig | undefined; reportConfigMap[dataType]?.some((fn) => { - const config = fn({ indexPattern }); + const config = fn({ dataView }); if (config.reportType === reportType) { configResult = config; } diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/infra_metrics/kpi_over_time_config.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/infra_metrics/kpi_over_time_config.ts index 5111be8f9e39f..56538d252fe3c 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/infra_metrics/kpi_over_time_config.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/infra_metrics/kpi_over_time_config.ts @@ -20,7 +20,7 @@ import { SYSTEM_MEMORY_USAGE, } from '../constants/labels'; -export function getMetricsKPIConfig({ indexPattern }: ConfigProps): SeriesConfig { +export function getMetricsKPIConfig({ dataView }: ConfigProps): SeriesConfig { return { reportType: ReportTypes.KPI, defaultSeriesType: 'area', diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.test.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.test.ts index 430cf84c077ca..e2b85fdccc537 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.test.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.test.ts @@ -6,7 +6,7 @@ */ import { LayerConfig, LensAttributes } from './lens_attributes'; -import { mockAppIndexPattern, mockIndexPattern } from '../rtl_helpers'; +import { mockAppDataView, mockDataView } from '../rtl_helpers'; import { getDefaultConfigs } from './default_configs'; import { sampleAttribute } from './test_data/sample_attribute'; @@ -21,16 +21,16 @@ import { RECORDS_FIELD, REPORT_METRIC_FIELD, PERCENTILE_RANKS, ReportTypes } fro import { obsvReportConfigMap } from '../obsv_exploratory_view'; describe('Lens Attribute', () => { - mockAppIndexPattern(); + mockAppDataView(); const reportViewConfig = getDefaultConfigs({ reportType: 'data-distribution', dataType: 'ux', - indexPattern: mockIndexPattern, + dataView: mockDataView, reportConfigMap: obsvReportConfigMap, }); - reportViewConfig.baseFilters?.push(...buildExistsFilter('transaction.type', mockIndexPattern)); + reportViewConfig.baseFilters?.push(...buildExistsFilter('transaction.type', mockDataView)); let lnsAttr: LensAttributes; @@ -38,7 +38,7 @@ describe('Lens Attribute', () => { seriesConfig: reportViewConfig, seriesType: 'line', operationType: 'count', - indexPattern: mockIndexPattern, + indexPattern: mockDataView, reportDefinitions: {}, time: { from: 'now-15m', to: 'now' }, color: 'green', @@ -58,7 +58,7 @@ describe('Lens Attribute', () => { const seriesConfigKpi = getDefaultConfigs({ reportType: ReportTypes.KPI, dataType: 'ux', - indexPattern: mockIndexPattern, + dataView: mockDataView, reportConfigMap: obsvReportConfigMap, }); @@ -67,7 +67,7 @@ describe('Lens Attribute', () => { seriesConfig: seriesConfigKpi, seriesType: 'line', operationType: 'count', - indexPattern: mockIndexPattern, + indexPattern: mockDataView, reportDefinitions: { 'service.name': ['elastic-co'] }, time: { from: 'now-15m', to: 'now' }, color: 'green', @@ -83,7 +83,7 @@ describe('Lens Attribute', () => { const seriesConfigKpi = getDefaultConfigs({ reportType: ReportTypes.KPI, dataType: 'ux', - indexPattern: mockIndexPattern, + dataView: mockDataView, reportConfigMap: obsvReportConfigMap, }); @@ -95,7 +95,7 @@ describe('Lens Attribute', () => { from: 'now-1h', to: 'now', }, - indexPattern: mockIndexPattern, + indexPattern: mockDataView, name: 'ux-series-1', breakdown: 'percentile', reportDefinitions: {}, @@ -200,7 +200,7 @@ describe('Lens Attribute', () => { seriesConfig: reportViewConfig, seriesType: 'line', operationType: 'count', - indexPattern: mockIndexPattern, + indexPattern: mockDataView, reportDefinitions: { 'performance.metric': [LCP_FIELD] }, time: { from: 'now-15m', to: 'now' }, color: 'green', @@ -493,7 +493,7 @@ describe('Lens Attribute', () => { seriesConfig: reportViewConfig, seriesType: 'line', operationType: 'count', - indexPattern: mockIndexPattern, + indexPattern: mockDataView, reportDefinitions: { 'performance.metric': [LCP_FIELD] }, breakdown: USER_AGENT_NAME, time: { from: 'now-15m', to: 'now' }, @@ -507,7 +507,7 @@ describe('Lens Attribute', () => { lnsAttr.getBreakdownColumn({ sourceField: USER_AGENT_NAME, layerId: 'layer0', - indexPattern: mockIndexPattern, + indexPattern: mockDataView, labels: layerConfig.seriesConfig.labels, }); @@ -676,14 +676,14 @@ describe('Lens Attribute', () => { describe('Layer Filters', function () { it('should return expected filters', function () { reportViewConfig.baseFilters?.push( - ...buildPhrasesFilter('service.name', ['elastic', 'kibana'], mockIndexPattern) + ...buildPhrasesFilter('service.name', ['elastic', 'kibana'], mockDataView) ); const layerConfig1: LayerConfig = { seriesConfig: reportViewConfig, seriesType: 'line', operationType: 'count', - indexPattern: mockIndexPattern, + indexPattern: mockDataView, reportDefinitions: { 'performance.metric': [LCP_FIELD] }, time: { from: 'now-15m', to: 'now' }, color: 'green', diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts index 1058973a4432d..7f4e1543ce29e 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts @@ -30,7 +30,7 @@ import { CardinalityIndexPatternColumn, } from '../../../../../../lens/public'; import { urlFiltersToKueryString } from '../utils/stringify_kueries'; -import { IndexPattern } from '../../../../../../../../src/plugins/data/common'; +import type { DataView } from '../../../../../../../../src/plugins/data_views/common'; import { FILTER_RECORDS, USE_BREAK_DOWN_COLUMN, @@ -91,7 +91,7 @@ export interface LayerConfig { operationType?: OperationType; reportDefinitions: URLReportDefinition; time: { to: string; from: string }; - indexPattern: IndexPattern; + indexPattern: DataView; // TODO: Figure out if this can be renamed or if it's a Lens requirement selectedMetricField: string; color: string; name: string; @@ -150,7 +150,7 @@ export class LensAttributes { sourceField: string; layerId: string; labels: Record; - indexPattern: IndexPattern; + indexPattern: DataView; }): TermsIndexPatternColumn { const fieldMeta = indexPattern.getFieldByName(sourceField); diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/mobile/device_distribution_config.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/mobile/device_distribution_config.ts index b66709d0e2286..ae534704976e3 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/mobile/device_distribution_config.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/mobile/device_distribution_config.ts @@ -18,7 +18,7 @@ import { SERVICE_NAME } from '../constants/elasticsearch_fieldnames'; import { MOBILE_APP, NUMBER_OF_DEVICES } from '../constants/labels'; import { MobileFields } from './mobile_fields'; -export function getMobileDeviceDistributionConfig({ indexPattern }: ConfigProps): SeriesConfig { +export function getMobileDeviceDistributionConfig({ dataView }: ConfigProps): SeriesConfig { return { reportType: ReportTypes.DEVICE_DISTRIBUTION, defaultSeriesType: 'bar', @@ -36,8 +36,8 @@ export function getMobileDeviceDistributionConfig({ indexPattern }: ConfigProps) filterFields: [...Object.keys(MobileFields), LABEL_FIELDS_FILTER], breakdownFields: Object.keys(MobileFields), baseFilters: [ - ...buildPhraseFilter('agent.name', 'iOS/swift', indexPattern), - ...buildPhraseFilter('processor.event', 'transaction', indexPattern), + ...buildPhraseFilter('agent.name', 'iOS/swift', dataView), + ...buildPhraseFilter('processor.event', 'transaction', dataView), ], labels: { ...FieldLabels, diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/mobile/distribution_config.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/mobile/distribution_config.ts index f2f36f7a22abc..cf3fd0f3d2aab 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/mobile/distribution_config.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/mobile/distribution_config.ts @@ -26,7 +26,7 @@ import { import { CPU_USAGE, SYSTEM_MEMORY_USAGE, MOBILE_APP, RESPONSE_LATENCY } from '../constants/labels'; import { MobileFields } from './mobile_fields'; -export function getMobileKPIDistributionConfig({ indexPattern }: ConfigProps): SeriesConfig { +export function getMobileKPIDistributionConfig({ dataView }: ConfigProps): SeriesConfig { return { reportType: ReportTypes.DISTRIBUTION, defaultSeriesType: 'bar', @@ -43,7 +43,7 @@ export function getMobileKPIDistributionConfig({ indexPattern }: ConfigProps): S filterFields: [...Object.keys(MobileFields), LABEL_FIELDS_FILTER], breakdownFields: Object.keys(MobileFields), baseFilters: [ - ...buildPhrasesFilter('agent.name', ['iOS/swift', 'open-telemetry/swift'], indexPattern), + ...buildPhrasesFilter('agent.name', ['iOS/swift', 'open-telemetry/swift'], dataView), ], labels: { ...FieldLabels, diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/mobile/kpi_over_time_config.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/mobile/kpi_over_time_config.ts index 28dbe74c2b700..4d57ca45eae64 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/mobile/kpi_over_time_config.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/mobile/kpi_over_time_config.ts @@ -32,7 +32,7 @@ import { } from '../constants/labels'; import { MobileFields } from './mobile_fields'; -export function getMobileKPIConfig({ indexPattern }: ConfigProps): SeriesConfig { +export function getMobileKPIConfig({ dataView }: ConfigProps): SeriesConfig { return { reportType: ReportTypes.KPI, defaultSeriesType: 'line', @@ -50,7 +50,7 @@ export function getMobileKPIConfig({ indexPattern }: ConfigProps): SeriesConfig filterFields: [...Object.keys(MobileFields), LABEL_FIELDS_FILTER], breakdownFields: Object.keys(MobileFields), baseFilters: [ - ...buildPhrasesFilter('agent.name', ['iOS/swift', 'open-telemetry/swift'], indexPattern), + ...buildPhrasesFilter('agent.name', ['iOS/swift', 'open-telemetry/swift'], dataView), ], labels: { ...FieldLabels, diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/mobile/mobile_kpi_config.test.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/mobile/mobile_kpi_config.test.ts index b6f9a4f311342..2a7af16c1b9ea 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/mobile/mobile_kpi_config.test.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/mobile/mobile_kpi_config.test.ts @@ -5,16 +5,16 @@ * 2.0. */ -import { mockAppIndexPattern, mockIndexPattern } from '../../rtl_helpers'; +import { mockAppDataView, mockDataView } from '../../rtl_helpers'; import { LensAttributes } from '../lens_attributes'; import { METRIC_SYSTEM_MEMORY_USAGE, SERVICE_NAME } from '../constants/elasticsearch_fieldnames'; import { obsvReportConfigMap } from '../../obsv_exploratory_view'; import { testMobileKPIAttr } from '../test_data/mobile_test_attribute'; import { getLayerConfigs } from '../../hooks/use_lens_attributes'; -import { IndexPatternState } from '../../hooks/use_app_index_pattern'; +import { DataViewState } from '../../hooks/use_app_data_view'; describe('Mobile kpi config test', function () { - mockAppIndexPattern(); + mockAppDataView(); let lnsAttr: LensAttributes; @@ -31,7 +31,7 @@ describe('Mobile kpi config test', function () { ], 'kpi-over-time', {} as any, - { mobile: mockIndexPattern } as IndexPatternState, + { mobile: mockDataView } as DataViewState, obsvReportConfigMap ); diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/rum/core_web_vitals_config.test.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/rum/core_web_vitals_config.test.ts index 0602e37f61a20..a72bfeeb0d806 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/rum/core_web_vitals_config.test.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/rum/core_web_vitals_config.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { mockAppIndexPattern, mockIndexPattern } from '../../rtl_helpers'; +import { mockAppDataView, mockDataView } from '../../rtl_helpers'; import { getDefaultConfigs } from '../default_configs'; import { LayerConfig, LensAttributes } from '../lens_attributes'; import { sampleAttributeCoreWebVital } from '../test_data/sample_attribute_cwv'; @@ -13,12 +13,12 @@ import { LCP_FIELD, SERVICE_NAME, USER_AGENT_OS } from '../constants/elasticsear import { obsvReportConfigMap } from '../../obsv_exploratory_view'; describe('Core web vital config test', function () { - mockAppIndexPattern(); + mockAppDataView(); const seriesConfig = getDefaultConfigs({ reportType: 'core-web-vitals', dataType: 'ux', - indexPattern: mockIndexPattern, + dataView: mockDataView, reportConfigMap: obsvReportConfigMap, }); @@ -29,7 +29,7 @@ describe('Core web vital config test', function () { color: 'green', name: 'test-series', breakdown: USER_AGENT_OS, - indexPattern: mockIndexPattern, + indexPattern: mockDataView, time: { from: 'now-15m', to: 'now' }, reportDefinitions: { [SERVICE_NAME]: ['elastic-co'] }, selectedMetricField: LCP_FIELD, diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/rum/core_web_vitals_config.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/rum/core_web_vitals_config.ts index e5113211e0a62..0583ab390a0ef 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/rum/core_web_vitals_config.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/rum/core_web_vitals_config.ts @@ -35,7 +35,7 @@ import { } from '../constants/elasticsearch_fieldnames'; import { CLS_LABEL, FID_LABEL, LCP_LABEL } from '../constants/labels'; -export function getCoreWebVitalsConfig({ indexPattern }: ConfigProps): SeriesConfig { +export function getCoreWebVitalsConfig({ dataView }: ConfigProps): SeriesConfig { const statusPallete = euiPaletteForStatus(3); return { @@ -87,8 +87,8 @@ export function getCoreWebVitalsConfig({ indexPattern }: ConfigProps): SeriesCon URL_FULL, ], baseFilters: [ - ...buildPhraseFilter(TRANSACTION_TYPE, 'page-load', indexPattern), - ...buildPhraseFilter(PROCESSOR_EVENT, 'transaction', indexPattern), + ...buildPhraseFilter(TRANSACTION_TYPE, 'page-load', dataView), + ...buildPhraseFilter(PROCESSOR_EVENT, 'transaction', dataView), ], labels: { ...FieldLabels, [SERVICE_NAME]: 'Web Application' }, definitionFields: [SERVICE_NAME, SERVICE_ENVIRONMENT], diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/rum/data_distribution_config.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/rum/data_distribution_config.ts index 7796b381423bf..97b6d2ddf7199 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/rum/data_distribution_config.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/rum/data_distribution_config.ts @@ -45,7 +45,7 @@ import { WEB_APPLICATION_LABEL, } from '../constants/labels'; -export function getRumDistributionConfig({ indexPattern }: ConfigProps): SeriesConfig { +export function getRumDistributionConfig({ dataView }: ConfigProps): SeriesConfig { return { reportType: ReportTypes.DISTRIBUTION, defaultSeriesType: 'line', @@ -90,8 +90,8 @@ export function getRumDistributionConfig({ indexPattern }: ConfigProps): SeriesC { label: CLS_LABEL, id: CLS_FIELD, field: CLS_FIELD }, ], baseFilters: [ - ...buildPhraseFilter(TRANSACTION_TYPE, 'page-load', indexPattern), - ...buildPhraseFilter(PROCESSOR_EVENT, 'transaction', indexPattern), + ...buildPhraseFilter(TRANSACTION_TYPE, 'page-load', dataView), + ...buildPhraseFilter(PROCESSOR_EVENT, 'transaction', dataView), ], labels: { ...FieldLabels, diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/rum/kpi_over_time_config.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/rum/kpi_over_time_config.ts index e78a15ed66ea4..4981c5c531551 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/rum/kpi_over_time_config.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/rum/kpi_over_time_config.ts @@ -48,7 +48,7 @@ import { WEB_APPLICATION_LABEL, } from '../constants/labels'; -export function getKPITrendsLensConfig({ indexPattern }: ConfigProps): SeriesConfig { +export function getKPITrendsLensConfig({ dataView }: ConfigProps): SeriesConfig { return { defaultSeriesType: 'bar_stacked', seriesTypes: [], @@ -83,8 +83,8 @@ export function getKPITrendsLensConfig({ indexPattern }: ConfigProps): SeriesCon LABEL_FIELDS_BREAKDOWN, ], baseFilters: [ - ...buildPhraseFilter(TRANSACTION_TYPE, 'page-load', indexPattern), - ...buildPhraseFilter(PROCESSOR_EVENT, 'transaction', indexPattern), + ...buildPhraseFilter(TRANSACTION_TYPE, 'page-load', dataView), + ...buildPhraseFilter(PROCESSOR_EVENT, 'transaction', dataView), ], labels: { ...FieldLabels, [SERVICE_NAME]: WEB_APPLICATION_LABEL }, definitionFields: [SERVICE_NAME, SERVICE_ENVIRONMENT], diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/synthetics/data_distribution_config.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/synthetics/data_distribution_config.ts index fb44da8e4327f..ead75d79582cc 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/synthetics/data_distribution_config.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/synthetics/data_distribution_config.ts @@ -31,10 +31,7 @@ import { } from '../constants/field_names/synthetics'; import { buildExistsFilter } from '../utils'; -export function getSyntheticsDistributionConfig({ - series, - indexPattern, -}: ConfigProps): SeriesConfig { +export function getSyntheticsDistributionConfig({ series, dataView }: ConfigProps): SeriesConfig { return { reportType: ReportTypes.DISTRIBUTION, defaultSeriesType: series?.seriesType || 'line', @@ -61,7 +58,7 @@ export function getSyntheticsDistributionConfig({ baseFilters: [], definitionFields: [ { field: 'monitor.name', nested: 'synthetics.step.name.keyword', singleSelection: true }, - { field: 'url.full', filters: buildExistsFilter('summary.up', indexPattern) }, + { field: 'url.full', filters: buildExistsFilter('summary.up', dataView) }, ], metricOptions: [ { diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/synthetics/kpi_over_time_config.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/synthetics/kpi_over_time_config.ts index 63bd7e0cf3e81..217d34facbf0f 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/synthetics/kpi_over_time_config.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/synthetics/kpi_over_time_config.ts @@ -51,7 +51,7 @@ export const isStepLevelMetric = (metric?: string) => { SYNTHETICS_DOCUMENT_ONLOAD, ].includes(metric); }; -export function getSyntheticsKPIConfig({ indexPattern }: ConfigProps): SeriesConfig { +export function getSyntheticsKPIConfig({ dataView }: ConfigProps): SeriesConfig { return { reportType: ReportTypes.KPI, defaultSeriesType: 'bar_stacked', @@ -78,7 +78,7 @@ export function getSyntheticsKPIConfig({ indexPattern }: ConfigProps): SeriesCon palette: { type: 'palette', name: 'status' }, definitionFields: [ { field: 'monitor.name', nested: SYNTHETICS_STEP_NAME, singleSelection: true }, - { field: 'url.full', filters: buildExistsFilter('summary.up', indexPattern) }, + { field: 'url.full', filters: buildExistsFilter('summary.up', dataView) }, ], metricOptions: [ { diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/test_data/test_index_pattern.json b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/test_data/test_data_view.json similarity index 100% rename from x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/test_data/test_index_pattern.json rename to x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/test_data/test_data_view.json diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts index 29f751258e02d..e2cd05087188f 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts @@ -15,7 +15,7 @@ import { } from '@kbn/es-query'; import type { ReportViewType, SeriesUrl, UrlFilter } from '../types'; import type { AllSeries, AllShortSeries } from '../hooks/use_series_storage'; -import { IndexPattern } from '../../../../../../../../src/plugins/data/common'; +import type { DataView } from '../../../../../../../../src/plugins/data_views/common'; import { URL_KEYS } from './constants/url_constants'; import { PersistableFilter } from '../../../../../../lens/common'; @@ -78,17 +78,17 @@ export function createExploratoryViewUrl( ); } -export function buildPhraseFilter(field: string, value: string, indexPattern: IndexPattern) { - const fieldMeta = indexPattern?.fields.find((fieldT) => fieldT.name === field); +export function buildPhraseFilter(field: string, value: string, dataView: DataView) { + const fieldMeta = dataView?.fields.find((fieldT) => fieldT.name === field); if (fieldMeta) { - return [esBuildPhraseFilter(fieldMeta, value, indexPattern)]; + return [esBuildPhraseFilter(fieldMeta, value, dataView)]; } return []; } -export function getQueryFilter(field: string, value: string[], indexPattern: IndexPattern) { - const fieldMeta = indexPattern?.fields.find((fieldT) => fieldT.name === field); - if (fieldMeta && indexPattern.id) { +export function getQueryFilter(field: string, value: string[], dataView: DataView) { + const fieldMeta = dataView?.fields.find((fieldT) => fieldT.name === field); + if (fieldMeta && dataView.id) { return value.map((val) => buildQueryFilter( { @@ -97,7 +97,7 @@ export function getQueryFilter(field: string, value: string[], indexPattern: Ind query: `*${val}*`, }, }, - indexPattern.id!, + dataView.id!, '' ) ); @@ -106,21 +106,21 @@ export function getQueryFilter(field: string, value: string[], indexPattern: Ind return []; } -export function buildPhrasesFilter(field: string, value: string[], indexPattern: IndexPattern) { - const fieldMeta = indexPattern?.fields.find((fieldT) => fieldT.name === field); +export function buildPhrasesFilter(field: string, value: string[], dataView: DataView) { + const fieldMeta = dataView?.fields.find((fieldT) => fieldT.name === field); if (fieldMeta) { if (value.length === 1) { - return [esBuildPhraseFilter(fieldMeta, value[0], indexPattern)]; + return [esBuildPhraseFilter(fieldMeta, value[0], dataView)]; } - return [esBuildPhrasesFilter(fieldMeta, value, indexPattern)]; + return [esBuildPhrasesFilter(fieldMeta, value, dataView)]; } return []; } -export function buildExistsFilter(field: string, indexPattern: IndexPattern) { - const fieldMeta = indexPattern?.fields.find((fieldT) => fieldT.name === field); +export function buildExistsFilter(field: string, dataView: DataView) { + const fieldMeta = dataView?.fields.find((fieldT) => fieldT.name === field); if (fieldMeta) { - return [esBuildExistsFilter(fieldMeta, indexPattern)]; + return [esBuildExistsFilter(fieldMeta, dataView)]; } return []; } @@ -130,34 +130,34 @@ type FiltersType = Array; export function urlFilterToPersistedFilter({ urlFilters, initFilters, - indexPattern, + dataView, }: { urlFilters: UrlFilter[]; initFilters?: FiltersType; - indexPattern: IndexPattern; + dataView: DataView; }) { const parsedFilters: FiltersType = initFilters ? [...initFilters] : []; urlFilters.forEach( ({ field, values = [], notValues = [], wildcards = [], notWildcards = ([] = []) }) => { if (values.length > 0) { - const filter = buildPhrasesFilter(field, values, indexPattern); + const filter = buildPhrasesFilter(field, values, dataView); parsedFilters.push(...filter); } if (notValues.length > 0) { - const filter = buildPhrasesFilter(field, notValues, indexPattern)[0]; + const filter = buildPhrasesFilter(field, notValues, dataView)[0]; filter.meta.negate = true; parsedFilters.push(filter); } if (wildcards.length > 0) { - const filter = getQueryFilter(field, wildcards, indexPattern); + const filter = getQueryFilter(field, wildcards, dataView); parsedFilters.push(...filter); } if (notWildcards.length > 0) { - const filter = getQueryFilter(field, notWildcards, indexPattern)[0]; + const filter = getQueryFilter(field, notWildcards, dataView)[0]; filter.meta.negate = true; parsedFilters.push(filter); } diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/contexts/exploratory_view_config.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/contexts/exploratory_view_config.tsx index b7734e675f394..c464e4a536851 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/contexts/exploratory_view_config.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/contexts/exploratory_view_config.tsx @@ -18,21 +18,21 @@ interface ExploratoryViewContextValue { reportType: ReportViewType | typeof SELECT_REPORT_TYPE; label: string; }>; - indexPatterns: Record; + dataViews: Record; reportConfigMap: ReportConfigMap; setHeaderActionMenu: AppMountParameters['setHeaderActionMenu']; theme$: AppMountParameters['theme$']; } export const ExploratoryViewContext = createContext({ - indexPatterns: {}, + dataViews: {}, } as ExploratoryViewContextValue); export function ExploratoryViewContextProvider({ children, reportTypes, dataTypes, - indexPatterns, + dataViews, reportConfigMap, setHeaderActionMenu, theme$, @@ -40,7 +40,7 @@ export function ExploratoryViewContextProvider({ const value = { reportTypes, dataTypes, - indexPatterns, + dataViews, reportConfigMap, setHeaderActionMenu, theme$, diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.test.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.test.tsx index a21eeca9dcb45..fbaed83c30549 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.test.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import Embeddable from './embeddable'; import { LensPublicStart } from '../../../../../../lens/public'; -import { IndexPatternState } from '../hooks/use_app_index_pattern'; +import { DataViewState } from '../hooks/use_app_data_view'; import { render } from '../rtl_helpers'; import { AddToCaseAction } from '../header/add_to_case_action'; import { ActionTypes } from './use_actions'; @@ -77,7 +77,7 @@ const mockTimeRange = { }; const mockOwner = 'securitySolution'; const mockAppId = 'securitySolutionUI'; -const mockIndexPatterns = {} as IndexPatternState; +const mockDataViews = {} as DataViewState; const mockReportType = 'kpi-over-time'; const mockTitle = 'mockTitle'; const mockLens = { @@ -110,7 +110,7 @@ describe('Embeddable', () => { caseOwner={mockOwner} customLensAttrs={mockLensAttrs} customTimeRange={mockTimeRange} - indexPatterns={mockIndexPatterns} + indexPatterns={mockDataViews} lens={mockLens} reportType={mockReportType} title={mockTitle} @@ -128,7 +128,7 @@ describe('Embeddable', () => { caseOwner={mockOwner} customLensAttrs={mockLensAttrs} customTimeRange={mockTimeRange} - indexPatterns={mockIndexPatterns} + indexPatterns={mockDataViews} lens={mockLens} reportType={mockReportType} withActions={mockActions} @@ -146,7 +146,7 @@ describe('Embeddable', () => { caseOwner={mockOwner} customLensAttrs={mockLensAttrs} customTimeRange={mockTimeRange} - indexPatterns={mockIndexPatterns} + indexPatterns={mockDataViews} lens={mockLens} reportType={mockReportType} withActions={mockActions} @@ -181,7 +181,7 @@ describe('Embeddable', () => { caseOwner={mockOwner} customLensAttrs={mockLensAttrs} customTimeRange={mockTimeRange} - indexPatterns={mockIndexPatterns} + indexPatterns={mockDataViews} isSingleMetric={true} lens={mockLens} reportType={mockReportType} @@ -213,7 +213,7 @@ describe('Embeddable', () => { caseOwner={mockOwner} customLensAttrs={mockLensAttrs} customTimeRange={mockTimeRange} - indexPatterns={mockIndexPatterns} + indexPatterns={mockDataViews} isSingleMetric={true} lens={mockLens} reportType={mockReportType} diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx index 026f7ab04d68b..84ce40f0fe6c4 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx @@ -14,7 +14,7 @@ import { AppDataType, ReportViewType } from '../types'; import { getLayerConfigs } from '../hooks/use_lens_attributes'; import { LensEmbeddableInput, LensPublicStart, XYState } from '../../../../../../lens/public'; import { OperationTypeComponent } from '../series_editor/columns/operation_type_select'; -import { IndexPatternState } from '../hooks/use_app_index_pattern'; +import { DataViewState } from '../hooks/use_app_data_view'; import { ReportConfigMap } from '../contexts/exploratory_view_config'; import { obsvReportConfigMap } from '../obsv_exploratory_view'; import { ActionTypes, useActions } from './use_actions'; @@ -46,7 +46,7 @@ export interface ExploratoryEmbeddableProps { export interface ExploratoryEmbeddableComponentProps extends ExploratoryEmbeddableProps { lens: LensPublicStart; - indexPatterns: IndexPatternState; + indexPatterns: DataViewState; } // eslint-disable-next-line import/no-default-export diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/index.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/index.tsx index 521e7f746fdc9..6e9a2c26580de 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/index.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/index.tsx @@ -11,7 +11,7 @@ import { CoreStart } from 'kibana/public'; import type { ExploratoryEmbeddableProps, ExploratoryEmbeddableComponentProps } from './embeddable'; import { ObservabilityDataViews } from '../../../../utils/observability_data_views'; import { ObservabilityPublicPluginsStart } from '../../../../plugin'; -import type { IndexPatternState } from '../hooks/use_app_index_pattern'; +import type { DataViewState } from '../hooks/use_app_data_view'; import { EuiThemeProvider } from '../../../../../../../../src/plugins/kibana_react/common'; import type { AppDataType } from '../types'; @@ -30,7 +30,7 @@ export function getExploratoryViewEmbeddable( plugins: ObservabilityPublicPluginsStart ) { return (props: ExploratoryEmbeddableProps) => { - const [indexPatterns, setIndexPatterns] = useState({} as IndexPatternState); + const [indexPatterns, setIndexPatterns] = useState({} as DataViewState); const [loading, setLoading] = useState(false); const series = props.attributes && props.attributes[0]; diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/exploratory_view.test.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/exploratory_view.test.tsx index b1a1b55b7ed1e..5273cc3643cba 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/exploratory_view.test.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/exploratory_view.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { screen } from '@testing-library/dom'; -import { render, mockAppIndexPattern } from './rtl_helpers'; +import { render, mockAppDataView } from './rtl_helpers'; import { ExploratoryView } from './exploratory_view'; import * as obsvDataViews from '../../../utils/observability_data_views/observability_data_views'; import * as pluginHook from '../../../hooks/use_plugin_context'; @@ -19,7 +19,7 @@ jest.spyOn(pluginHook, 'usePluginContext').mockReturnValue({ }, } as any); describe('ExploratoryView', () => { - mockAppIndexPattern(); + mockAppDataView(); beforeEach(() => { const indexPattern = createStubIndexPattern({ diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/exploratory_view.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/exploratory_view.tsx index a383bc37880ae..4c48ab292b217 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/exploratory_view.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/exploratory_view.tsx @@ -22,7 +22,7 @@ import { ObservabilityPublicPluginsStart } from '../../../plugin'; import { useSeriesStorage } from './hooks/use_series_storage'; import { useLensAttributes } from './hooks/use_lens_attributes'; import { TypedLensByValueInput } from '../../../../../lens/public'; -import { useAppIndexPatternContext } from './hooks/use_app_index_pattern'; +import { useAppDataViewContext } from './hooks/use_app_data_view'; import { SeriesViews } from './views/series_views'; import { LensEmbeddable } from './lens_embeddable'; import { EmptyView } from './components/empty_view'; @@ -52,7 +52,7 @@ export function ExploratoryView({ null ); - const { loadIndexPattern, loading } = useAppIndexPatternContext(); + const { loadDataView, loading } = useAppDataViewContext(); const { firstSeries, allSeries, lastRefresh, reportType, setLastRefresh } = useSeriesStorage(); @@ -68,11 +68,11 @@ export function ExploratoryView({ useEffect(() => { allSeries.forEach((seriesT) => { - loadIndexPattern({ + loadDataView({ dataType: seriesT.dataType, }); }); - }, [allSeries, loadIndexPattern]); + }, [allSeries, loadDataView]); useEffect(() => { setLensAttributes(lensAttributesT); diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_app_index_pattern.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_app_data_view.tsx similarity index 60% rename from x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_app_index_pattern.tsx rename to x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_app_data_view.tsx index 7a370bc10d865..e92b0878ba3e9 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_app_index_pattern.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_app_data_view.tsx @@ -7,7 +7,7 @@ import React, { createContext, useContext, Context, useState, useCallback, useMemo } from 'react'; import { HttpFetchError } from 'kibana/public'; -import { IndexPattern } from '../../../../../../../../src/plugins/data/common'; +import type { DataView } from '../../../../../../../../src/plugins/data_views/common'; import { AppDataType } from '../types'; import { useKibana } from '../../../../../../../../src/plugins/kibana_react/public'; import { ObservabilityPublicPluginsStart } from '../../../../plugin'; @@ -17,40 +17,38 @@ import { useExploratoryView } from '../contexts/exploratory_view_config'; import { DataViewInsufficientAccessError } from '../../../../../../../../src/plugins/data_views/common'; import { getApmDataViewTitle } from '../utils/utils'; -export interface IndexPatternContext { +export interface DataViewContext { loading: boolean; - indexPatterns: IndexPatternState; - indexPatternErrors: IndexPatternErrors; + dataViews: DataViewState; + dataViewErrors: DataViewErrors; hasAppData: HasAppDataState; - loadIndexPattern: (params: { dataType: AppDataType }) => void; + loadDataView: (params: { dataType: AppDataType }) => void; } -export const IndexPatternContext = createContext>({}); +export const DataViewContext = createContext>({}); interface ProviderProps { children: JSX.Element; } type HasAppDataState = Record; -export type IndexPatternState = Record; -export type IndexPatternErrors = Record; +export type DataViewState = Record; +export type DataViewErrors = Record; type LoadingState = Record; -export function IndexPatternContextProvider({ children }: ProviderProps) { +export function DataViewContextProvider({ children }: ProviderProps) { const [loading, setLoading] = useState({} as LoadingState); - const [indexPatterns, setIndexPatterns] = useState({} as IndexPatternState); - const [indexPatternErrors, setIndexPatternErrors] = useState( - {} as IndexPatternErrors - ); + const [dataViews, setDataViews] = useState({} as DataViewState); + const [dataViewErrors, setDataViewErrors] = useState({} as DataViewErrors); const [hasAppData, setHasAppData] = useState({} as HasAppDataState); const { - services: { dataViews }, + services: { dataViews: dataViewsService }, } = useKibana(); - const { indexPatterns: indexPatternsList } = useExploratoryView(); + const { dataViews: dataViewsList } = useExploratoryView(); - const loadIndexPattern: IndexPatternContext['loadIndexPattern'] = useCallback( + const loadDataView: DataViewContext['loadDataView'] = useCallback( async ({ dataType }) => { if (typeof hasAppData[dataType] === 'undefined' && !loading[dataType]) { setLoading((prevState) => ({ ...prevState, [dataType]: true })); @@ -58,8 +56,8 @@ export function IndexPatternContextProvider({ children }: ProviderProps) { try { let hasDataT = false; let indices: string | undefined = ''; - if (indexPatternsList[dataType]) { - indices = indexPatternsList[dataType]; + if (dataViewsList[dataType]) { + indices = dataViewsList[dataType]; hasDataT = true; } switch (dataType) { @@ -84,10 +82,10 @@ export function IndexPatternContextProvider({ children }: ProviderProps) { setHasAppData((prevState) => ({ ...prevState, [dataType]: hasDataT })); if (hasDataT && indices) { - const obsvIndexP = new ObservabilityDataViews(dataViews); - const indPattern = await obsvIndexP.getDataView(dataType, indices); + const obsvDataV = new ObservabilityDataViews(dataViewsService); + const dataV = await obsvDataV.getDataView(dataType, indices); - setIndexPatterns((prevState) => ({ ...prevState, [dataType]: indPattern })); + setDataViews((prevState) => ({ ...prevState, [dataType]: dataV })); } setLoading((prevState) => ({ ...prevState, [dataType]: false })); } catch (e) { @@ -95,48 +93,48 @@ export function IndexPatternContextProvider({ children }: ProviderProps) { e instanceof DataViewInsufficientAccessError || (e as HttpFetchError).body === 'Forbidden' ) { - setIndexPatternErrors((prevState) => ({ ...prevState, [dataType]: e })); + setDataViewErrors((prevState) => ({ ...prevState, [dataType]: e })); } setLoading((prevState) => ({ ...prevState, [dataType]: false })); } } }, - [dataViews, hasAppData, indexPatternsList, loading] + [dataViewsService, hasAppData, dataViewsList, loading] ); return ( - loadingT), }} > {children} - + ); } -export const useAppIndexPatternContext = (dataType?: AppDataType) => { - const { loading, hasAppData, loadIndexPattern, indexPatterns, indexPatternErrors } = useContext( - IndexPatternContext as unknown as Context +export const useAppDataViewContext = (dataType?: AppDataType) => { + const { loading, hasAppData, loadDataView, dataViews, dataViewErrors } = useContext( + DataViewContext as unknown as Context ); - if (dataType && !indexPatterns?.[dataType] && !loading) { - loadIndexPattern({ dataType }); + if (dataType && !dataViews?.[dataType] && !loading) { + loadDataView({ dataType }); } return useMemo(() => { return { hasAppData, loading, - indexPatterns, - indexPatternErrors, - indexPattern: dataType ? indexPatterns?.[dataType] : undefined, + dataViews, + dataViewErrors, + dataView: dataType ? dataViews?.[dataType] : undefined, hasData: dataType ? hasAppData?.[dataType] : undefined, - loadIndexPattern, + loadDataView, }; - }, [dataType, hasAppData, indexPatternErrors, indexPatterns, loadIndexPattern, loading]); + }, [dataType, hasAppData, dataViewErrors, dataViews, loadDataView, loading]); }; diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_discover_link.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_discover_link.tsx index eac76cc238ad7..d3a9d16be8c0f 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_discover_link.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_discover_link.tsx @@ -9,7 +9,7 @@ import { useCallback, useEffect, useState } from 'react'; import { Filter } from '@kbn/es-query'; import { useKibana } from '../../../../utils/kibana_react'; import { SeriesConfig, SeriesUrl } from '../types'; -import { useAppIndexPatternContext } from './use_app_index_pattern'; +import { useAppDataViewContext } from './use_app_data_view'; import { buildExistsFilter, urlFilterToPersistedFilter } from '../configurations/utils'; import { getFiltersFromDefs } from './use_lens_attributes'; import { RECORDS_FIELD, RECORDS_PERCENTAGE_FIELD } from '../configurations/constants'; @@ -25,21 +25,21 @@ export const useDiscoverLink = ({ series, seriesConfig }: UseDiscoverLink) => { application: { navigateToUrl }, } = kServices; - const { indexPatterns } = useAppIndexPatternContext(); + const { dataViews } = useAppDataViewContext(); const locator = kServices.discover?.locator; const [discoverUrl, setDiscoverUrl] = useState(''); useEffect(() => { - const indexPattern = indexPatterns?.[series.dataType]; + const dataView = dataViews?.[series.dataType]; - if (indexPattern) { + if (dataView) { const definitions = series.reportDefinitions ?? {}; const urlFilters = (series.filters ?? []).concat(getFiltersFromDefs(definitions)); const filters = urlFilterToPersistedFilter({ - indexPattern, + dataView, urlFilters, initFilters: seriesConfig?.baseFilters, }) as Filter[]; @@ -51,7 +51,7 @@ export const useDiscoverLink = ({ series, seriesConfig }: UseDiscoverLink) => { selectedMetricField !== RECORDS_FIELD && selectedMetricField !== RECORDS_PERCENTAGE_FIELD ) { - filters.push(buildExistsFilter(selectedMetricField, indexPattern)[0]); + filters.push(buildExistsFilter(selectedMetricField, dataView)[0]); } const getDiscoverUrl = async () => { @@ -59,14 +59,14 @@ export const useDiscoverLink = ({ series, seriesConfig }: UseDiscoverLink) => { const newUrl = await locator.getUrl({ filters, - indexPatternId: indexPattern?.id, + indexPatternId: dataView?.id, }); setDiscoverUrl(newUrl); }; getDiscoverUrl(); } }, [ - indexPatterns, + dataViews, series.dataType, series.filters, series.reportDefinitions, diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_lens_attributes.test.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_lens_attributes.test.tsx index 05b86277470a9..d50e2134546c4 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_lens_attributes.test.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_lens_attributes.test.tsx @@ -11,11 +11,11 @@ import { allSeriesKey, reportTypeKey, UrlStorageContextProvider } from './use_se import { renderHook } from '@testing-library/react-hooks'; import { useLensAttributes } from './use_lens_attributes'; import { ReportTypes } from '../configurations/constants'; -import { mockIndexPattern } from '../rtl_helpers'; +import { mockDataView } from '../rtl_helpers'; import { createKbnUrlStateStorage } from '../../../../../../../../src/plugins/kibana_utils/public'; import { TRANSACTION_DURATION } from '../configurations/constants/elasticsearch_fieldnames'; import * as lensAttributes from '../configurations/lens_attributes'; -import * as indexPattern from './use_app_index_pattern'; +import * as useAppDataViewHook from './use_app_data_view'; import * as theme from '../../../../hooks/use_theme'; import { dataTypes, obsvReportConfigMap, reportTypesList } from '../obsv_exploratory_view'; import { ExploratoryViewContextProvider } from '../contexts/exploratory_view_config'; @@ -35,14 +35,14 @@ const mockSingleSeries = [ describe('useExpViewTimeRange', function () { const storage = createKbnUrlStateStorage({ useHash: false }); // @ts-ignore - jest.spyOn(indexPattern, 'useAppIndexPatternContext').mockReturnValue({ - indexPatterns: { - ux: mockIndexPattern, - apm: mockIndexPattern, - mobile: mockIndexPattern, - infra_logs: mockIndexPattern, - infra_metrics: mockIndexPattern, - synthetics: mockIndexPattern, + jest.spyOn(useAppDataViewHook, 'useAppDataViewContext').mockReturnValue({ + dataViews: { + ux: mockDataView, + apm: mockDataView, + mobile: mockDataView, + infra_logs: mockDataView, + infra_metrics: mockDataView, + synthetics: mockDataView, }, }); jest.spyOn(theme, 'useTheme').mockReturnValue({ @@ -58,7 +58,7 @@ describe('useExpViewTimeRange', function () { { - const indexPattern = indexPatterns?.[series?.dataType]; + const dataView = dataViews?.[series?.dataType]; if ( - indexPattern && + dataView && !isEmpty(series.reportDefinitions) && !series.hidden && series.selectedMetricField ) { const seriesConfig = getDefaultConfigs({ reportType, - indexPattern, + dataView, dataType: series.dataType, reportConfigMap, }); @@ -70,7 +70,7 @@ export function getLayerConfigs( layerConfigs.push({ filters, - indexPattern, + indexPattern: dataView, seriesConfig, time: series.time, name: series.name, @@ -90,7 +90,7 @@ export function getLayerConfigs( export const useLensAttributes = (): TypedLensByValueInput['attributes'] | null => { const { storage, allSeries, lastRefresh, reportType } = useSeriesStorage(); - const { indexPatterns } = useAppIndexPatternContext(); + const { dataViews } = useAppDataViewContext(); const { reportConfigMap } = useExploratoryView(); @@ -101,14 +101,14 @@ export const useLensAttributes = (): TypedLensByValueInput['attributes'] | null const allSeriesT: AllSeries = convertAllShortSeries(storage.get(allSeriesKey) ?? []); const reportTypeT: ReportViewType = storage.get(reportTypeKey) as ReportViewType; - if (isEmpty(indexPatterns) || isEmpty(allSeriesT) || !reportTypeT) { + if (isEmpty(dataViews) || isEmpty(allSeriesT) || !reportTypeT) { return null; } const layerConfigs = getLayerConfigs( allSeriesT, reportTypeT, theme, - indexPatterns, + dataViews, reportConfigMap ); @@ -121,5 +121,5 @@ export const useLensAttributes = (): TypedLensByValueInput['attributes'] | null return lensAttributes.getJSON(); // we also want to check the state on allSeries changes // eslint-disable-next-line react-hooks/exhaustive-deps - }, [indexPatterns, reportType, storage, theme, lastRefresh, allSeries]); + }, [dataViews, reportType, storage, theme, lastRefresh, allSeries]); }; diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/index.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/index.tsx index 4fc5293e03723..94954ff5522dc 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/index.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/index.tsx @@ -12,7 +12,7 @@ import { ExploratoryView } from './exploratory_view'; import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; import { ObservabilityPublicPluginsStart } from '../../../plugin'; import { useBreadcrumbs } from '../../../hooks/use_breadcrumbs'; -import { IndexPatternContextProvider } from './hooks/use_app_index_pattern'; +import { DataViewContextProvider } from './hooks/use_app_data_view'; import { createKbnUrlStateStorage, withNotifyOnErrors, @@ -73,11 +73,11 @@ export function ExploratoryViewPage({ return ( - + - + ); } diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/obsv_exploratory_view.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/obsv_exploratory_view.tsx index 79c37d5bb0b72..a8deb76432672 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/obsv_exploratory_view.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/obsv_exploratory_view.tsx @@ -101,7 +101,7 @@ export function ObservabilityExploratoryView() { >({ core, kibanaProps, }: MockKibanaProviderProps) { - const indexPattern = mockIndexPattern; + const dataView = mockDataView; setIndexPatterns({ - ...[indexPattern], - get: async () => indexPattern, - } as unknown as IndexPatternsContract); + ...[dataView], + get: async () => dataView, + } as unknown as DataViewsContract); return ( - {children} + {children} @@ -211,7 +214,7 @@ export function render( { return { spy, onRefreshTimeRange }; }; -export const mockAppIndexPattern = (props?: Partial) => { - const loadIndexPattern = jest.fn(); - const spy = jest.spyOn(useAppIndexPatternHook, 'useAppIndexPatternContext').mockReturnValue({ - indexPattern: mockIndexPattern, +export const mockAppDataView = (props?: Partial) => { + const loadDataView = jest.fn(); + const spy = jest.spyOn(useAppDataViewHook, 'useAppDataViewContext').mockReturnValue({ + dataView: mockDataView, hasData: true, loading: false, hasAppData: { ux: true } as any, - loadIndexPattern, - indexPatterns: { ux: mockIndexPattern } as unknown as Record, - indexPatternErrors: {} as any, + loadDataView, + dataViews: { ux: mockDataView } as unknown as Record, + dataViewErrors: {} as any, ...(props || {}), }); - return { spy, loadIndexPattern }; + return { spy, loadDataView }; }; export const mockUseValuesList = (values?: ListItem[]) => { @@ -369,12 +372,12 @@ export const mockHistory = { }, }; -export const mockIndexPattern = createStubIndexPattern({ +export const mockDataView = createStubDataView({ spec: { id: 'apm-*', title: 'apm-*', timeFieldName: '@timestamp', - fields: JSON.parse(indexPatternData.attributes.fields), + fields: JSON.parse(dataViewData.attributes.fields), }, }); diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/breakdown/breakdowns.test.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/breakdown/breakdowns.test.tsx index e213a41238123..37a554ba334d1 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/breakdown/breakdowns.test.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/breakdown/breakdowns.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { fireEvent, screen } from '@testing-library/react'; import { Breakdowns } from './breakdowns'; -import { mockIndexPattern, mockUxSeries, render } from '../../rtl_helpers'; +import { mockDataView, mockUxSeries, render } from '../../rtl_helpers'; import { getDefaultConfigs } from '../../configurations/default_configs'; import { RECORDS_FIELD } from '../../configurations/constants'; import { USER_AGENT_OS } from '../../configurations/constants/elasticsearch_fieldnames'; @@ -17,7 +17,7 @@ import { obsvReportConfigMap } from '../../obsv_exploratory_view'; describe('Breakdowns', function () { const dataViewSeries = getDefaultConfigs({ reportType: 'data-distribution', - indexPattern: mockIndexPattern, + dataView: mockDataView, dataType: 'ux', reportConfigMap: obsvReportConfigMap, }); @@ -62,7 +62,7 @@ describe('Breakdowns', function () { it('does not show percentile breakdown for records metrics', function () { const kpiConfig = getDefaultConfigs({ reportType: 'kpi-over-time', - indexPattern: mockIndexPattern, + dataView: mockDataView, dataType: 'ux', reportConfigMap: obsvReportConfigMap, }); diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/breakdown/label_breakdown.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/breakdown/label_breakdown.tsx index a5723ccb52648..d85c7fcaad721 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/breakdown/label_breakdown.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/breakdown/label_breakdown.tsx @@ -9,7 +9,7 @@ import { EuiComboBox, EuiFlexItem } from '@elastic/eui'; import React from 'react'; import { i18n } from '@kbn/i18n'; import { SeriesConfig, SeriesUrl } from '../../types'; -import { useAppIndexPatternContext } from '../../hooks/use_app_index_pattern'; +import { useAppDataViewContext } from '../../hooks/use_app_data_view'; import { useSeriesStorage } from '../../hooks/use_series_storage'; import { LABEL_FIELDS_BREAKDOWN } from '../../configurations/constants'; @@ -19,9 +19,9 @@ interface Props { seriesConfig?: SeriesConfig; } export function LabelsBreakdown({ series, seriesId }: Props) { - const { indexPattern } = useAppIndexPatternContext(series.dataType); + const { dataView } = useAppDataViewContext(series.dataType); - const labelFields = indexPattern?.fields.filter((field) => field.name.startsWith('labels.')); + const labelFields = dataView?.fields.filter((field) => field.name.startsWith('labels.')); const { setSeries } = useSeriesStorage(); diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/data_type_select.test.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/data_type_select.test.tsx index 1afe1f979b272..9856cdd527232 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/data_type_select.test.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/data_type_select.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { fireEvent, screen } from '@testing-library/react'; -import { mockAppIndexPattern, mockUxSeries, render } from '../../rtl_helpers'; +import { mockAppDataView, mockUxSeries, render } from '../../rtl_helpers'; import { DataTypesSelect } from './data_type_select'; import { DataTypes } from '../../configurations/constants'; import { DataTypesLabels } from '../../obsv_exploratory_view'; @@ -15,7 +15,7 @@ import { DataTypesLabels } from '../../obsv_exploratory_view'; describe('DataTypeSelect', function () { const seriesId = 0; - mockAppIndexPattern(); + mockAppDataView(); it('should render properly', function () { render(); diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/date_picker_col.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/date_picker_col.tsx index b01010e4b81f9..51728d628199f 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/date_picker_col.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/date_picker_col.tsx @@ -14,7 +14,7 @@ import { DateRangePicker } from '../../components/date_range_picker'; import { SeriesDatePicker } from '../../components/series_date_picker'; import { AppDataType, SeriesUrl } from '../../types'; import { ReportTypes } from '../../configurations/constants'; -import { useAppIndexPatternContext } from '../../hooks/use_app_index_pattern'; +import { useAppDataViewContext } from '../../hooks/use_app_data_view'; import { SyntheticsAddData } from '../../../add_data_buttons/synthetics_add_data'; import { MobileAddData } from '../../../add_data_buttons/mobile_add_data'; import { UXAddData } from '../../../add_data_buttons/ux_add_data'; @@ -36,7 +36,7 @@ const AddDataComponents: Record = { export function DatePickerCol({ seriesId, series }: Props) { const { reportType } = useSeriesStorage(); - const { hasAppData } = useAppIndexPatternContext(); + const { hasAppData } = useAppDataViewContext(); if (!series.dataType) { return null; diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/filter_expanded.test.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/filter_expanded.test.tsx index 0a5ac137a7870..d821e65afae04 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/filter_expanded.test.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/filter_expanded.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { fireEvent, screen, waitFor } from '@testing-library/react'; import { FilterExpanded } from './filter_expanded'; -import { mockUxSeries, mockAppIndexPattern, mockUseValuesList, render } from '../../rtl_helpers'; +import { mockUxSeries, mockAppDataView, mockUseValuesList, render } from '../../rtl_helpers'; import { USER_AGENT_NAME } from '../../configurations/constants/elasticsearch_fieldnames'; describe('FilterExpanded', function () { @@ -18,7 +18,7 @@ describe('FilterExpanded', function () { it('render', async () => { const initSeries = { filters }; - mockAppIndexPattern(); + mockAppDataView(); render( ) : ( button diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/incomplete_badge.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/incomplete_badge.tsx index 8e64f4bcea680..83319dc48d7df 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/incomplete_badge.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/incomplete_badge.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { isEmpty } from 'lodash'; import { i18n } from '@kbn/i18n'; import { EuiBadge } from '@elastic/eui'; -import { useAppIndexPatternContext } from '../../hooks/use_app_index_pattern'; +import { useAppDataViewContext } from '../../hooks/use_app_data_view'; import { SeriesConfig, SeriesUrl } from '../../types'; interface Props { @@ -18,7 +18,7 @@ interface Props { } export function IncompleteBadge({ seriesConfig, series }: Props) { - const { loading } = useAppIndexPatternContext(); + const { loading } = useAppDataViewContext(); if (!seriesConfig) { return null; diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/report_definition_col.test.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/report_definition_col.test.tsx index 3ec2af4a8c9d2..980c02a0ab153 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/report_definition_col.test.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/report_definition_col.test.tsx @@ -9,8 +9,8 @@ import { fireEvent, screen, waitFor } from '@testing-library/react'; import React from 'react'; import { getDefaultConfigs } from '../../configurations/default_configs'; import { - mockAppIndexPattern, - mockIndexPattern, + mockAppDataView, + mockDataView, mockUseValuesList, mockUxSeries, render, @@ -19,12 +19,12 @@ import { ReportDefinitionCol } from './report_definition_col'; import { obsvReportConfigMap } from '../../obsv_exploratory_view'; describe('Series Builder ReportDefinitionCol', function () { - mockAppIndexPattern(); + mockAppDataView(); const seriesId = 0; const seriesConfig = getDefaultConfigs({ reportType: 'data-distribution', - indexPattern: mockIndexPattern, + dataView: mockDataView, dataType: 'ux', reportConfigMap: obsvReportConfigMap, }); diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/report_definition_field.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/report_definition_field.tsx index 2808dfae83527..b518993a51940 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/report_definition_field.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/report_definition_field.tsx @@ -9,7 +9,7 @@ import React, { useMemo } from 'react'; import { isEmpty } from 'lodash'; import { ExistsFilter, PhraseFilter } from '@kbn/es-query'; import FieldValueSuggestions from '../../../field_value_suggestions'; -import { useAppIndexPatternContext } from '../../hooks/use_app_index_pattern'; +import { useAppDataViewContext } from '../../hooks/use_app_data_view'; import { ESFilter } from '../../../../../../../../../src/core/types/elasticsearch'; import { PersistableFilter } from '../../../../../../../lens/common'; import { buildPhrasesFilter } from '../../configurations/utils'; @@ -36,7 +36,7 @@ export function ReportDefinitionField({ onChange, filters, }: Props) { - const { indexPattern } = useAppIndexPatternContext(series.dataType); + const { dataView } = useAppDataViewContext(series.dataType); const field = typeof fieldProp === 'string' ? fieldProp : fieldProp.field; @@ -62,10 +62,10 @@ export function ReportDefinitionField({ definitionFields.forEach((fieldObj) => { const fieldT = typeof fieldObj === 'string' ? fieldObj : fieldObj.field; - if (indexPattern && selectedReportDefinitions?.[fieldT] && fieldT !== field) { + if (dataView && selectedReportDefinitions?.[fieldT] && fieldT !== field) { const values = selectedReportDefinitions?.[fieldT]; if (!values.includes(ALL_VALUES_SELECTED)) { - const valueFilter = buildPhrasesFilter(fieldT, values, indexPattern)[0]; + const valueFilter = buildPhrasesFilter(fieldT, values, dataView)[0]; if (valueFilter.query) { filtersN.push(valueFilter.query); } @@ -78,7 +78,7 @@ export function ReportDefinitionField({ // eslint-disable-next-line react-hooks/exhaustive-deps }, [JSON.stringify(selectedReportDefinitions), JSON.stringify(baseFilters)]); - if (!indexPattern) { + if (!dataView) { return null; } @@ -86,7 +86,7 @@ export function ReportDefinitionField({ onChange(field, val)} filters={queryFilters} diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/selected_filters.test.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/selected_filters.test.tsx index 9fcf4b14353b9..ef0f7c47d3f67 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/selected_filters.test.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/selected_filters.test.tsx @@ -7,18 +7,18 @@ import React from 'react'; import { screen, waitFor } from '@testing-library/react'; -import { mockAppIndexPattern, mockIndexPattern, mockUxSeries, render } from '../../rtl_helpers'; +import { mockAppDataView, mockDataView, mockUxSeries, render } from '../../rtl_helpers'; import { SelectedFilters } from './selected_filters'; import { getDefaultConfigs } from '../../configurations/default_configs'; import { USER_AGENT_NAME } from '../../configurations/constants/elasticsearch_fieldnames'; import { obsvReportConfigMap } from '../../obsv_exploratory_view'; describe('SelectedFilters', function () { - mockAppIndexPattern(); + mockAppDataView(); const dataViewSeries = getDefaultConfigs({ reportType: 'data-distribution', - indexPattern: mockIndexPattern, + dataView: mockDataView, dataType: 'ux', reportConfigMap: obsvReportConfigMap, }); diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/selected_filters.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/selected_filters.tsx index 5bba0b9dfb3cd..241a9ad13f98d 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/selected_filters.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/selected_filters.tsx @@ -10,7 +10,7 @@ import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/e import { i18n } from '@kbn/i18n'; import { FilterLabel } from '../../components/filter_label'; import { SeriesConfig, SeriesUrl, UrlFilter } from '../../types'; -import { useAppIndexPatternContext } from '../../hooks/use_app_index_pattern'; +import { useAppDataViewContext } from '../../hooks/use_app_data_view'; import { useSeriesFilters } from '../../hooks/use_series_filters'; import { useSeriesStorage } from '../../hooks/use_series_storage'; @@ -28,16 +28,16 @@ export function SelectedFilters({ seriesId, series, seriesConfig }: Props) { const { removeFilter, replaceFilter } = useSeriesFilters({ seriesId, series }); - const { indexPattern } = useAppIndexPatternContext(series.dataType); + const { dataView } = useAppDataViewContext(series.dataType); - if (filters.length === 0 || !indexPattern) { + if (filters.length === 0 || !dataView) { return null; } const btnProps = { seriesId, series, - indexPattern, + dataView, }; return ( diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/series_actions.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/series_actions.tsx index b3430da2d35e2..129fdf1cf25e3 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/series_actions.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/series_actions.tsx @@ -19,7 +19,7 @@ import { i18n } from '@kbn/i18n'; import { useSeriesStorage } from '../../hooks/use_series_storage'; import { SeriesConfig, SeriesUrl } from '../../types'; import { useDiscoverLink } from '../../hooks/use_discover_link'; -import { useAppIndexPatternContext } from '../../hooks/use_app_index_pattern'; +import { useAppDataViewContext } from '../../hooks/use_app_data_view'; interface Props { seriesId: number; @@ -34,9 +34,9 @@ export function SeriesActions({ seriesId, series, seriesConfig, onEditClick }: P const { href: discoverHref } = useDiscoverLink({ series, seriesConfig }); - const { indexPatterns } = useAppIndexPatternContext(); + const { dataViews } = useAppDataViewContext(); - const indexPattern = indexPatterns?.[series.dataType]; + const dataView = dataViews?.[series.dataType]; const deleteDisabled = seriesId === 0 && allSeries.length > 1; const copySeries = () => { @@ -109,7 +109,7 @@ export function SeriesActions({ seriesId, series, seriesConfig, onEditClick }: P icon="discoverApp" href={discoverHref} aria-label={VIEW_SAMPLE_DOCUMENTS_LABEL} - disabled={!series.dataType || !series.selectedMetricField || !indexPattern} + disabled={!series.dataType || !series.selectedMetricField || !dataView} target="_blank" > {VIEW_SAMPLE_DOCUMENTS_LABEL} diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/components/labels_filter.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/components/labels_filter.tsx index 6abe2e8f2a7d9..2284b06433e6e 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/components/labels_filter.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/components/labels_filter.tsx @@ -19,7 +19,7 @@ import { EuiSelectable } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FilterProps } from '../columns/filter_expanded'; -import { useAppIndexPatternContext } from '../../hooks/use_app_index_pattern'; +import { useAppDataViewContext } from '../../hooks/use_app_data_view'; import { FilterValuesList } from './filter_values_list'; import { useFilterValues } from '../use_filter_values'; @@ -28,9 +28,9 @@ export function LabelsFieldFilter(props: FilterProps) { const [query, setQuery] = useState(''); - const { indexPattern } = useAppIndexPatternContext(series.dataType); + const { dataView } = useAppDataViewContext(series.dataType); - const labelFields = indexPattern?.fields.filter((field) => field.name.startsWith('labels.')); + const labelFields = dataView?.fields.filter((field) => field.name.startsWith('labels.')); const [isPopoverOpen, setPopover] = useState(false); diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/expanded_series_row.test.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/expanded_series_row.test.tsx index afb1043e9caab..5d70e42808ea9 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/expanded_series_row.test.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/expanded_series_row.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { screen } from '@testing-library/react'; import { ExpandedSeriesRow } from './expanded_series_row'; -import { mockIndexPattern, mockUxSeries, render } from '../rtl_helpers'; +import { mockDataView, mockUxSeries, render } from '../rtl_helpers'; import { getDefaultConfigs } from '../configurations/default_configs'; import { PERCENTILE } from '../configurations/constants'; import { obsvReportConfigMap } from '../obsv_exploratory_view'; @@ -17,7 +17,7 @@ describe('ExpandedSeriesRow', function () { const dataViewSeries = getDefaultConfigs({ reportConfigMap: obsvReportConfigMap, reportType: 'kpi-over-time', - indexPattern: mockIndexPattern, + dataView: mockDataView, dataType: 'ux', }); diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/report_metric_options.test.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/report_metric_options.test.tsx index 9d83113f2b524..63725346ba18b 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/report_metric_options.test.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/report_metric_options.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import { mockAppIndexPattern, mockIndexPattern, mockUxSeries, render } from '../rtl_helpers'; +import { mockAppDataView, mockDataView, mockUxSeries, render } from '../rtl_helpers'; import { getDefaultConfigs } from '../configurations/default_configs'; import { PERCENTILE } from '../configurations/constants'; import { ReportMetricOptions } from './report_metric_options'; @@ -18,7 +18,7 @@ describe('ReportMetricOptions', function () { const dataViewSeries = getDefaultConfigs({ dataType: 'ux', reportType: 'kpi-over-time', - indexPattern: mockIndexPattern, + dataView: mockDataView, reportConfigMap: obsvReportConfigMap, }); @@ -31,7 +31,7 @@ describe('ReportMetricOptions', function () { }); it('should display loading if index pattern is not available and is loading', async function () { - mockAppIndexPattern({ loading: true, indexPatterns: undefined }); + mockAppDataView({ loading: true, dataViews: undefined }); const { container } = render( { setSeries(seriesId, { @@ -52,14 +52,14 @@ export function ReportMetricOptions({ seriesId, series, seriesConfig }: Props) { return null; } - const indexPattern = indexPatterns?.[series.dataType]; - const indexPatternError = indexPatternErrors?.[series.dataType]; + const dataView = dataViews?.[series.dataType]; + const dataViewError = dataViewErrors?.[series.dataType]; const options = (metricOptions ?? []).map(({ label, field, id }) => { let disabled = false; if (field !== RECORDS_FIELD && field !== RECORDS_PERCENTAGE_FIELD && field) { - disabled = !Boolean(indexPattern?.getFieldByName(field)); + disabled = !Boolean(dataView?.getFieldByName(field)); } return { disabled, @@ -85,19 +85,19 @@ export function ReportMetricOptions({ seriesId, series, seriesConfig }: Props) { }; }); - if (indexPatternError && !indexPattern && !loading) { + if (dataViewError && !dataView && !loading) { // TODO: Add a link to docs to explain how to add index patterns return ( - {indexPatternError.body?.error === 'Forbidden' || - indexPatternError.name === 'DataViewInsufficientAccessError' + {dataViewError.body?.error === 'Forbidden' || + dataViewError.name === 'DataViewInsufficientAccessError' ? NO_PERMISSIONS - : indexPatternError.body.message} + : dataViewError.body.message} ); } - if (!indexPattern && !loading) { + if (!dataView && !loading) { return {NO_DATA_AVAILABLE}; } @@ -111,7 +111,7 @@ export function ReportMetricOptions({ seriesId, series, seriesConfig }: Props) { onClick={() => setShowOptions((prevState) => !prevState)} fill size="s" - isLoading={!indexPattern && loading} + isLoading={!dataView && loading} buttonRef={focusButton} > {SELECT_REPORT_METRIC_LABEL} @@ -133,7 +133,7 @@ export function ReportMetricOptions({ seriesId, series, seriesConfig }: Props) { )} {series.selectedMetricField && - (indexPattern ? ( + (dataView ? ( ; export const getSeriesToEdit = ({ - indexPatterns, + dataViews, allSeries, reportType, reportConfigMap, }: { allSeries: SeriesContextValue['allSeries']; - indexPatterns: IndexPatternState; + dataViews: DataViewState; reportType: ReportViewType; reportConfigMap: ReportConfigMap; }): BuilderItem[] => { const getDataViewSeries = (dataType: AppDataType) => { - if (indexPatterns?.[dataType]) { + if (dataViews?.[dataType]) { return getDefaultConfigs({ dataType, reportType, reportConfigMap, - indexPattern: indexPatterns[dataType], + dataView: dataViews[dataType], }); } }; @@ -61,7 +61,7 @@ export const SeriesEditor = React.memo(function () { const { getSeries, allSeries, reportType } = useSeriesStorage(); - const { loading, indexPatterns } = useAppIndexPatternContext(); + const { loading, dataViews } = useAppDataViewContext(); const { reportConfigMap } = useExploratoryView(); @@ -88,7 +88,7 @@ export const SeriesEditor = React.memo(function () { const newEditorItems = getSeriesToEdit({ reportType, allSeries, - indexPatterns, + dataViews, reportConfigMap, }); @@ -108,7 +108,7 @@ export const SeriesEditor = React.memo(function () { setItemIdToExpandedRowMap((prevState) => { return { ...prevState, ...newExpandRows }; }); - }, [allSeries, getSeries, indexPatterns, loading, reportConfigMap, reportType]); + }, [allSeries, getSeries, dataViews, loading, reportConfigMap, reportType]); const toggleDetails = (item: BuilderItem) => { const itemIdToExpandedRowMapValues = { ...itemIdToExpandedRowMap }; diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/use_filter_values.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/use_filter_values.ts index 3a273cc6adc96..848bd6b44ea16 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/use_filter_values.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/use_filter_values.ts @@ -8,7 +8,7 @@ import { ExistsFilter, isExistsFilter } from '@kbn/es-query'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { useValuesList } from '../../../../hooks/use_values_list'; import { FilterProps } from './columns/filter_expanded'; -import { useAppIndexPatternContext } from '../hooks/use_app_index_pattern'; +import { useAppDataViewContext } from '../hooks/use_app_data_view'; import { ESFilter } from '../../../../../../../../src/core/types/elasticsearch'; import { PersistableFilter } from '../../../../../../lens/common'; @@ -16,7 +16,7 @@ export function useFilterValues( { field, series, baseFilters, label }: FilterProps, query?: string ) { - const { indexPatterns } = useAppIndexPatternContext(series.dataType); + const { dataViews } = useAppDataViewContext(series.dataType); const queryFilters: ESFilter[] = []; @@ -36,6 +36,6 @@ export function useFilterValues( time: series.time, keepHistory: true, filters: queryFilters, - indexPatternTitle: indexPatterns[series.dataType]?.title, + dataViewTitle: dataViews[series.dataType]?.title, }); } diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts index acd49fc25588e..9fa565e4eae34 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts @@ -17,7 +17,7 @@ import { } from '../../../../../lens/public'; import { PersistableFilter } from '../../../../../lens/common'; -import { IndexPattern } from '../../../../../../../src/plugins/data/public'; +import type { DataView } from '../../../../../../../src/plugins/data_views/common'; export const ReportViewTypes = { dist: 'data-distribution', @@ -102,7 +102,7 @@ export interface UrlFilter { } export interface ConfigProps { - indexPattern: IndexPattern; + dataView: DataView; series?: SeriesUrl; } diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/views/add_series_button.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/views/add_series_button.tsx index 4c1bc1d7fe3bb..7199a2c47adee 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/views/add_series_button.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/views/add_series_button.tsx @@ -12,7 +12,7 @@ import { i18n } from '@kbn/i18n'; import { SeriesUrl, BuilderItem } from '../types'; import { getSeriesToEdit } from '../series_editor/series_editor'; import { NEW_SERIES_KEY, useSeriesStorage } from '../hooks/use_series_storage'; -import { useAppIndexPatternContext } from '../hooks/use_app_index_pattern'; +import { useAppDataViewContext } from '../hooks/use_app_data_view'; import { DEFAULT_TIME, ReportTypes } from '../configurations/constants'; import { useExploratoryView } from '../contexts/exploratory_view_config'; @@ -21,13 +21,13 @@ export function AddSeriesButton() { const addSeriesButtonRef = useRef(null); const { getSeries, allSeries, setSeries, reportType } = useSeriesStorage(); - const { loading, indexPatterns } = useAppIndexPatternContext(); + const { loading, dataViews } = useAppDataViewContext(); const { reportConfigMap } = useExploratoryView(); useEffect(() => { - setEditorItems(getSeriesToEdit({ allSeries, indexPatterns, reportType, reportConfigMap })); - }, [allSeries, getSeries, indexPatterns, loading, reportConfigMap, reportType]); + setEditorItems(getSeriesToEdit({ allSeries, dataViews, reportType, reportConfigMap })); + }, [allSeries, getSeries, dataViews, loading, reportConfigMap, reportType]); const addSeries = () => { const prevSeries = allSeries?.[0]; diff --git a/x-pack/plugins/observability/public/components/shared/field_value_suggestions/index.tsx b/x-pack/plugins/observability/public/components/shared/field_value_suggestions/index.tsx index f2a30f8bee351..2cd8487c57048 100644 --- a/x-pack/plugins/observability/public/components/shared/field_value_suggestions/index.tsx +++ b/x-pack/plugins/observability/public/components/shared/field_value_suggestions/index.tsx @@ -15,7 +15,7 @@ export function FieldValueSuggestions({ fullWidth, sourceField, label, - indexPatternTitle, + dataViewTitle, selectedValue, excludedValue, filters, @@ -41,7 +41,7 @@ export function FieldValueSuggestions({ const [query, setQuery] = useState(''); const { values, loading } = useValuesList({ - indexPatternTitle, + dataViewTitle, query, sourceField, filters, diff --git a/x-pack/plugins/observability/public/components/shared/field_value_suggestions/types.ts b/x-pack/plugins/observability/public/components/shared/field_value_suggestions/types.ts index 95b24aa69b1e7..1ee477e05fbc0 100644 --- a/x-pack/plugins/observability/public/components/shared/field_value_suggestions/types.ts +++ b/x-pack/plugins/observability/public/components/shared/field_value_suggestions/types.ts @@ -33,7 +33,7 @@ interface CommonProps { } export type FieldValueSuggestionsProps = CommonProps & { - indexPatternTitle?: string; + dataViewTitle?: string; sourceField: string; asCombobox?: boolean; onChange: (val?: string[], excludedValue?: string[]) => void; diff --git a/x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx b/x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx index bd3e1d6c8f50d..f7cfe7b848fc9 100644 --- a/x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx +++ b/x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx @@ -8,28 +8,29 @@ import React from 'react'; import { injectI18n } from '@kbn/i18n-react'; import { Filter, buildPhrasesFilter, buildPhraseFilter } from '@kbn/es-query'; -import { FilterItem, IndexPattern } from '../../../../../../../src/plugins/data/public'; +import { FilterItem } from '../../../../../../../src/plugins/data/public'; +import type { DataView } from '../../../../../../../src/plugins/data_views/common'; import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; export function buildFilterLabel({ field, value, label, - indexPattern, + dataView, negate, }: { label: string; value: string | string[]; negate: boolean; field: string; - indexPattern: IndexPattern; + dataView: DataView; }) { - const indexField = indexPattern.getFieldByName(field)!; + const indexField = dataView.getFieldByName(field)!; const filter = value instanceof Array && value.length > 1 - ? buildPhrasesFilter(indexField, value, indexPattern) - : buildPhraseFilter(indexField, value as string, indexPattern); + ? buildPhrasesFilter(indexField, value, dataView) + : buildPhraseFilter(indexField, value as string, dataView); filter.meta.type = value instanceof Array && value.length > 1 ? 'phrases' : 'phrase'; @@ -49,7 +50,7 @@ export interface FilterValueLabelProps { negate: boolean; removeFilter: (field: string, value: string | string[], notVal: boolean) => void; invertFilter: (val: { field: string; value: string | string[]; negate: boolean }) => void; - indexPattern: IndexPattern; + dataView: DataView; allowExclusion?: boolean; } export function FilterValueLabel({ @@ -57,22 +58,22 @@ export function FilterValueLabel({ field, value, negate, - indexPattern, + dataView, invertFilter, removeFilter, allowExclusion = true, }: FilterValueLabelProps) { const FilterItemI18n = injectI18n(FilterItem); - const filter = buildFilterLabel({ field, value, label, indexPattern, negate }); + const filter = buildFilterLabel({ field, value, label, dataView, negate }); const { services: { uiSettings }, } = useKibana(); - return indexPattern ? ( + return dataView ? ( { diff --git a/x-pack/plugins/observability/public/hooks/use_values_list.ts b/x-pack/plugins/observability/public/hooks/use_values_list.ts index e2268f7b85244..5ab9b41ca6f9a 100644 --- a/x-pack/plugins/observability/public/hooks/use_values_list.ts +++ b/x-pack/plugins/observability/public/hooks/use_values_list.ts @@ -17,7 +17,7 @@ export interface Props { sourceField: string; label: string; query?: string; - indexPatternTitle?: string; + dataViewTitle?: string; filters?: ESFilter[]; time?: { from: string; to: string }; keepHistory?: boolean; @@ -59,7 +59,7 @@ const getIncludeClause = (sourceField: string, query?: string) => { export const useValuesList = ({ sourceField, - indexPatternTitle, + dataViewTitle, query = '', filters, time, @@ -91,7 +91,7 @@ export const useValuesList = ({ const { data, loading } = useEsSearch( createEsParams({ - index: indexPatternTitle!, + index: dataViewTitle!, body: { query: { bool: { @@ -135,7 +135,7 @@ export const useValuesList = ({ }, }, }), - [debouncedQuery, from, to, JSON.stringify(filters), indexPatternTitle, sourceField], + [debouncedQuery, from, to, JSON.stringify(filters), dataViewTitle, sourceField], { name: `get${label.replace(/\s/g, '')}ValuesList` } ); diff --git a/x-pack/plugins/observability/public/utils/observability_data_views/observability_data_views.test.ts b/x-pack/plugins/observability/public/utils/observability_data_views/observability_data_views.test.ts index 0a24f35a498cc..eb7df98da599b 100644 --- a/x-pack/plugins/observability/public/utils/observability_data_views/observability_data_views.test.ts +++ b/x-pack/plugins/observability/public/utils/observability_data_views/observability_data_views.test.ts @@ -6,7 +6,7 @@ */ import { dataViewList, ObservabilityDataViews } from './observability_data_views'; -import { mockCore, mockIndexPattern } from '../../components/shared/exploratory_view/rtl_helpers'; +import { mockCore, mockDataView } from '../../components/shared/exploratory_view/rtl_helpers'; import { SavedObjectNotFound } from '../../../../../../src/plugins/kibana_utils/public'; const fieldFormats = { @@ -116,11 +116,11 @@ describe('ObservabilityIndexPatterns', function () { }); it('should validate field formats', async function () { - mockIndexPattern.getFormatterForField = jest.fn().mockReturnValue({ params: () => {} }); + mockDataView.getFormatterForField = jest.fn().mockReturnValue({ params: () => {} }); const obsv = new ObservabilityDataViews(dataViews!); - await obsv.validateFieldFormats('ux', mockIndexPattern); + await obsv.validateFieldFormats('ux', mockDataView); expect(dataViews?.updateSavedObject).toHaveBeenCalledTimes(1); expect(dataViews?.updateSavedObject).toHaveBeenCalledWith( diff --git a/x-pack/plugins/uptime/public/components/overview/alerts/monitor_expressions/filters_expression_select.tsx b/x-pack/plugins/uptime/public/components/overview/alerts/monitor_expressions/filters_expression_select.tsx index e10e9267df184..0e083d1fcd679 100644 --- a/x-pack/plugins/uptime/public/components/overview/alerts/monitor_expressions/filters_expression_select.tsx +++ b/x-pack/plugins/uptime/public/components/overview/alerts/monitor_expressions/filters_expression_select.tsx @@ -134,7 +134,7 @@ export const FiltersExpressionsSelect: React.FC = { diff --git a/x-pack/plugins/uptime/public/components/overview/filter_group/filter_group.tsx b/x-pack/plugins/uptime/public/components/overview/filter_group/filter_group.tsx index 06c080cc659fc..e25e764390f6b 100644 --- a/x-pack/plugins/uptime/public/components/overview/filter_group/filter_group.tsx +++ b/x-pack/plugins/uptime/public/components/overview/filter_group/filter_group.tsx @@ -57,7 +57,7 @@ export const FilterGroup = () => { { ...selectedItems.map((value) => ( { onChange( field, @@ -51,7 +51,7 @@ export const SelectedFilters = ({ onChange }: Props) => { ...excludedItems.map((value) => ( { onChange( field, diff --git a/x-pack/plugins/ux/public/components/app/rum_dashboard/local_uifilters/index.tsx b/x-pack/plugins/ux/public/components/app/rum_dashboard/local_uifilters/index.tsx index b472258704e5d..766e4d6f5baa5 100644 --- a/x-pack/plugins/ux/public/components/app/rum_dashboard/local_uifilters/index.tsx +++ b/x-pack/plugins/ux/public/components/app/rum_dashboard/local_uifilters/index.tsx @@ -110,7 +110,7 @@ function LocalUIFilters() { ( { onChange( name, diff --git a/x-pack/plugins/ux/public/components/app/rum_dashboard/local_uifilters/selected_wildcards.tsx b/x-pack/plugins/ux/public/components/app/rum_dashboard/local_uifilters/selected_wildcards.tsx index 8a104b1ae9bd0..46257605a22ce 100644 --- a/x-pack/plugins/ux/public/components/app/rum_dashboard/local_uifilters/selected_wildcards.tsx +++ b/x-pack/plugins/ux/public/components/app/rum_dashboard/local_uifilters/selected_wildcards.tsx @@ -47,7 +47,7 @@ export function SelectedWildcards({ indexPattern }: Props) { return searchTerm ? ( { updateSearchTerm(''); }}