From 24989c8915fefe1eb5ff1f991333d89c575a04a1 Mon Sep 17 00:00:00 2001 From: Jenny Date: Tue, 19 Nov 2024 15:33:41 +0100 Subject: [PATCH] [Infra] Fix deprecated usage of dataview title --- .../infra/public/pages/logs/settings/validation_errors.ts | 8 ++++---- .../inventory_view/hooks/use_waffle_filters.test.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/observability_solution/infra/public/pages/logs/settings/validation_errors.ts b/x-pack/plugins/observability_solution/infra/public/pages/logs/settings/validation_errors.ts index e6b375efdaab7..b769bb68f8d2a 100644 --- a/x-pack/plugins/observability_solution/infra/public/pages/logs/settings/validation_errors.ts +++ b/x-pack/plugins/observability_solution/infra/public/pages/logs/settings/validation_errors.ts @@ -91,7 +91,7 @@ export const validateIndexPatternIsTimeBased = (indexPattern: DataView): FormVal : [ { type: 'missing_timestamp_field' as const, - indexPatternTitle: indexPattern.title, + indexPatternTitle: indexPattern.getIndexPattern(), }, ]; @@ -104,14 +104,14 @@ export const validateIndexPatternHasStringMessageField = ( return [ { type: 'missing_message_field' as const, - indexPatternTitle: indexPattern.title, + indexPatternTitle: indexPattern.getIndexPattern(), }, ]; } else if (messageField.type !== KBN_FIELD_TYPES.STRING) { return [ { type: 'invalid_message_field_type' as const, - indexPatternTitle: indexPattern.title, + indexPatternTitle: indexPattern.getIndexPattern(), }, ]; } else { @@ -124,7 +124,7 @@ export const validateIndexPatternIsntRollup = (indexPattern: DataView): FormVali ? [ { type: 'rollup_index_pattern' as const, - indexPatternTitle: indexPattern.title, + indexPatternTitle: indexPattern.getIndexPattern(), }, ] : []; diff --git a/x-pack/plugins/observability_solution/infra/public/pages/metrics/inventory_view/hooks/use_waffle_filters.test.ts b/x-pack/plugins/observability_solution/infra/public/pages/metrics/inventory_view/hooks/use_waffle_filters.test.ts index 87aaad06abc96..7fe7b8b3fe18c 100644 --- a/x-pack/plugins/observability_solution/infra/public/pages/metrics/inventory_view/hooks/use_waffle_filters.test.ts +++ b/x-pack/plugins/observability_solution/infra/public/pages/metrics/inventory_view/hooks/use_waffle_filters.test.ts @@ -21,11 +21,11 @@ jest.mock('react-router-dom', () => ({ const mockDataView = { id: 'mock-id', - title: 'mock-title', timeFieldName: TIMESTAMP_FIELD, isPersisted: () => false, getName: () => 'mock-data-view', toSpec: () => ({}), + getIndexPattern: () => 'mock-title', } as jest.Mocked; jest.mock('../../../../containers/metrics_source', () => ({