Skip to content

Commit

Permalink
[Infra] Fix deprecated usage of dataview title (elastic#200751)
Browse files Browse the repository at this point in the history
Closes elastic#200698 

## Summary

This PR replaces the usage of the deprecated dataview `title` with
`getIndexPattern`
  • Loading branch information
jennypavlova authored Nov 19, 2024
1 parent ddf324a commit eb504e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const validateIndexPatternIsTimeBased = (indexPattern: DataView): FormVal
: [
{
type: 'missing_timestamp_field' as const,
indexPatternTitle: indexPattern.title,
indexPatternTitle: indexPattern.getIndexPattern(),
},
];

Expand All @@ -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 {
Expand All @@ -124,7 +124,7 @@ export const validateIndexPatternIsntRollup = (indexPattern: DataView): FormVali
? [
{
type: 'rollup_index_pattern' as const,
indexPatternTitle: indexPattern.title,
indexPatternTitle: indexPattern.getIndexPattern(),
},
]
: [];
Original file line number Diff line number Diff line change
Expand Up @@ -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<DataView>;

jest.mock('../../../../containers/metrics_source', () => ({
Expand Down

0 comments on commit eb504e6

Please sign in to comment.