Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] Using data views service for loading data views #113961

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixing index pattern loading
  • Loading branch information
jgowdyelastic committed Oct 7, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 4b1b963668b41d123e437bc39b14b0c4af505d74
7 changes: 4 additions & 3 deletions x-pack/plugins/ml/public/application/util/index_utils.ts
Original file line number Diff line number Diff line change
@@ -11,14 +11,15 @@ import type { DataView, DataViewsContract } from '../../../../../../src/plugins/
import type { SavedSearchSavedObject } from '../../../common/types/kibana';
import { getToastNotifications, getSavedObjectsClient, getDataViews } from './dependency_cache';

const indexPatternCache: DataView[] = [];
let indexPatternCache: DataView[] = [];
let savedSearchesCache: SavedSearchSavedObject[] = [];
let indexPatternsContract: DataViewsContract | null = null;

export function loadIndexPatterns(indexPatterns: DataViewsContract) {
export async function loadIndexPatterns(indexPatterns: DataViewsContract) {
indexPatternsContract = indexPatterns;
const dataViewsContract = getDataViews();
return dataViewsContract.find('*');
indexPatternCache = await dataViewsContract.find('*');
return indexPatternCache;
}

export function loadSavedSearches() {