From 49c311091e22f36ae753540087f4945a6f1fe42c Mon Sep 17 00:00:00 2001 From: Kawika Avilla Date: Sun, 18 Aug 2024 12:20:05 -0700 Subject: [PATCH] [discover] update interfaces and move dataset manager (#7745) * Move dataset location Signed-off-by: Kawika Avilla * update interfaces Signed-off-by: Kawika Avilla * Update src/plugins/data/common/datasets/types.ts Co-authored-by: Ashwin P Chandran Signed-off-by: Kawika Avilla --------- Signed-off-by: Kawika Avilla Co-authored-by: Ashwin P Chandran --- src/plugins/data/common/datasets/types.ts | 133 ++++++++++++++---- src/plugins/data/public/index.ts | 2 - src/plugins/data/public/query/index.tsx | 2 +- src/plugins/data/public/query/mocks.ts | 2 +- .../data/public/query/query_service.ts | 10 +- .../dataset_manager/dataset_manager.mock.ts | 16 +-- .../dataset_manager/dataset_manager.test.ts | 18 +-- .../dataset_manager/dataset_manager.ts | 34 ++--- .../dataset_manager/index.ts | 2 +- .../query_string/query_string_manager.ts | 38 +++++ .../create_global_query_observable.ts | 19 +-- .../data/public/query/state_sync/types.ts | 2 + 12 files changed, 198 insertions(+), 80 deletions(-) rename src/plugins/data/public/query/{ => query_string}/dataset_manager/dataset_manager.mock.ts (52%) rename src/plugins/data/public/query/{ => query_string}/dataset_manager/dataset_manager.test.ts (65%) rename src/plugins/data/public/query/{ => query_string}/dataset_manager/dataset_manager.ts (74%) rename src/plugins/data/public/query/{ => query_string}/dataset_manager/index.ts (58%) diff --git a/src/plugins/data/common/datasets/types.ts b/src/plugins/data/common/datasets/types.ts index cfcfe9044527..65f523d40fea 100644 --- a/src/plugins/data/common/datasets/types.ts +++ b/src/plugins/data/common/datasets/types.ts @@ -31,52 +31,74 @@ export interface DataSourceMeta { * Represents the hierarchical structure of data within a data source. * * @example - * Example of an OpenSearch cluster with indices * * const openSearchCluster: DataStructure = { * id: "b18e5f58-cf71-11ee-ad92-2468ce360004", - * title: "Production Cluster", - * type: "OPENSEARCH", + * title: "Data Cluster1", + * type: "DATA_SOURCE", * children: [ * { * id: "b18e5f58-cf71-11ee-ad92-2468ce360004::logs-2023.05", * title: "logs-2023.05", * type: "INDEX", - * parent: { id: "b18e5f58-cf71-11ee-ad92-2468ce360004", title: "Production Cluster", type: "OPENSEARCH" } + * parent: { id: "b18e5f58-cf71-11ee-ad92-2468ce360004", title: "Data Cluster1", type: "DATA_SOURCE" }, + * meta: { + * type: 'FEATURE', + * icon: 'indexIcon', + * tooltip: 'Logs from May 2023' + * } * }, * { * id: "b18e5f58-cf71-11ee-ad92-2468ce360004::logs-2023.06", * title: "logs-2023.06", * type: "INDEX", - * parent: { id: "b18e5f58-cf71-11ee-ad92-2468ce360004", title: "Production Cluster", type: "OPENSEARCH" } + * parent: { id: "b18e5f58-cf71-11ee-ad92-2468ce360004", title: "Data Cluster1", type: "DATA_SOURCE" }, + * meta: { + * type: 'FEATURE', + * icon: 'indexIcon', + * tooltip: 'Logs from June 2023' + * } * } - * ] + * ], + * meta: { + * type: 'FEATURE', + * icon: 'clusterIcon', + * tooltip: 'OpenSearch Cluster' + * } * }; * - * Example of an S3 data source with a database and tables: + * Example of an S3 data source with a connection, database, and tables: * * const s3DataSource: DataStructure = { * id: "7d5c3e1c-ae5f-11ee-9c91-1357bd240003", - * title: "mys3", - * type: "S3, + * title: "Flint MDS cluster name", + * type: "DATA_SOURCE", * children: [ * { - * id: "mys3.defaultDb", - * title: "defaultDb", - * type: "DATABASE", - * parent: { id: "myS3", title: "My S3 Bucket", type: "S3" }, + * id: "7d5c3e1c-ae5f-11ee-9c91-1357bd240003::mys3", + * title: "mys3", + * type: "CONNECTION", + * parent: { id: "7d5c3e1c-ae5f-11ee-9c91-1357bd240003", title: "Flint MDS cluster name", type: "DATA_SOURCE" }, * children: [ * { - * id: "mys3.defaultDb.table1", - * title: "table1", - * type: "TABLE", - * parent: { id: "sales-db", title: "Sales Database", type: "DATABASE" } - * }, - * { - * id: "mys3.defaultDb.table2", - * title: "table2", - * type: "TABLE", - * parent: { id: "sales-db", title: "Sales Database", type: "DATABASE" } + * id: "7d5c3e1c-ae5f-11ee-9c91-1357bd240003::mys3.defaultDb", + * title: "defaultDb", + * type: "DATABASE", + * parent: { id: "7d5c3e1c-ae5f-11ee-9c91-1357bd240003::mys3", title: "mys3", type: "CONNECTION" }, + * children: [ + * { + * id: "7d5c3e1c-ae5f-11ee-9c91-1357bd240003::mys3.defaultDb.table1", + * title: "table1", + * type: "TABLE", + * parent: { id: "7d5c3e1c-ae5f-11ee-9c91-1357bd240003::mys3.defaultDb", title: "defaultDb", type: "DATABASE" } + * }, + * { + * id: "7d5c3e1c-ae5f-11ee-9c91-1357bd240003::mys3.defaultDb.table2", + * title: "table2", + * type: "TABLE", + * parent: { id: "7d5c3e1c-ae5f-11ee-9c91-1357bd240003::mys3.defaultDb", title: "defaultDb", type: "DATABASE" } + * } + * ] * } * ] * } @@ -88,12 +110,69 @@ export interface DataStructure { id: string; /** Human-readable name of the data structure */ title: string; - /** The type of the data structure, registered by other classes */ + /** The type of the data structure */ type: string; /** Optional reference to the parent data structure */ parent?: DataStructure; /** Optional array of child data structures */ children?: DataStructure[]; + /** Optional metadata for the data structure */ + meta?: DataStructureMeta; +} + +/** + * Metadata for a data structure, used for additional properties like icons or tooltips. + */ +export interface DataStructureMeta { + type: DATA_STRUCTURE_META_TYPES; +} + +/** + * DataStructureMeta types + */ +export enum DATA_STRUCTURE_META_TYPES { + FEATURE = 'FEATURE', + CUSTOM = 'CUSTOM', +} + +/** + * Metadata for a data structure, used for additional properties like icons or tooltips. + */ +export interface DataStructureFeatureMeta extends DataStructureMeta { + type: DATA_STRUCTURE_META_TYPES.FEATURE; + icon: string; + tooltip: string; +} + +/** + * Metadata for a data structure with CUSTOM type, allowing any additional fields. + */ +export interface DataStructureCustomMeta extends DataStructureMeta { + type: DATA_STRUCTURE_META_TYPES.CUSTOM; + [key: string]: any; +} + +/** + * Represents a cached version of DataStructure with string references instead of object references. + * + * @example + * + * const cachedOpenSearchCluster: CachedDataStructure = { + * id: "b18e5f58-cf71-11ee-ad92-2468ce360004", + * title: "Data Cluster1", + * type: "DATA_SOURCE", + * parent: "", + * children: [ + * "b18e5f58-cf71-11ee-ad92-2468ce360004::logs-2023.05", + * "b18e5f58-cf71-11ee-ad92-2468ce360004::logs-2023.06" + * ] + * }; + */ +export interface CachedDataStructure extends Omit { + /** ID of the parent data structure */ + parent: string; + /** Array of child data structure IDs */ + children: string[]; } /** @@ -103,7 +182,7 @@ export interface DataStructure { * have similar titles and the data plugin assumes unique data set IDs. * * @example - * Example of a Dataset for an OpenSearch index + * Example of a Dataset for an OpenSearch index pattern * const logsIndexDataset: Dataset = { * id: "2e1b1b80-9c4d-11ee-8c90-0242ac120001", * title: "logs-*", @@ -112,7 +191,7 @@ export interface DataStructure { * dataSource: { * id: "main-cluster", * title: "Main OpenSearch Cluster", - * type: "DEFAULT" + * type: "OPENSEARCH" * }, * }; * @@ -126,7 +205,7 @@ export interface DataStructure { * dataSource: { * id: "7d5c3e1c-ae5f-11ee-9c91-1357bd240003", * title: "My S3 Connect", - * type: "EXAMPLE_DATASOURCE" + * type: "S3_GLUE" * }, * }; */ diff --git a/src/plugins/data/public/index.ts b/src/plugins/data/public/index.ts index 948bebed11ba..208359352e4b 100644 --- a/src/plugins/data/public/index.ts +++ b/src/plugins/data/public/index.ts @@ -462,8 +462,6 @@ export { QueryState, getDefaultQuery, FilterManager, - DataSetManager, - DataSetContract, SavedQuery, SavedQueryService, SavedQueryTimeFilter, diff --git a/src/plugins/data/public/query/index.tsx b/src/plugins/data/public/query/index.tsx index 42c6349bcc89..37cd52471db0 100644 --- a/src/plugins/data/public/query/index.tsx +++ b/src/plugins/data/public/query/index.tsx @@ -32,7 +32,7 @@ export * from './lib'; export * from './query_service'; export * from './filter_manager'; -export * from './dataset_manager'; +export * from './query_string/dataset_manager'; export * from './timefilter'; export * from './saved_query'; export * from './persisted_log'; diff --git a/src/plugins/data/public/query/mocks.ts b/src/plugins/data/public/query/mocks.ts index 87bd2edb49bc..f1377ad8ea0d 100644 --- a/src/plugins/data/public/query/mocks.ts +++ b/src/plugins/data/public/query/mocks.ts @@ -33,7 +33,7 @@ import { QueryService, QuerySetup, QueryStart } from '.'; import { timefilterServiceMock } from './timefilter/timefilter_service.mock'; import { createFilterManagerMock } from './filter_manager/filter_manager.mock'; import { queryStringManagerMock } from './query_string/query_string_manager.mock'; -import { dataSetManagerMock } from './dataset_manager/dataset_manager.mock'; +import { dataSetManagerMock } from './query_string/dataset_manager/dataset_manager.mock'; type QueryServiceClientContract = PublicMethodsOf; diff --git a/src/plugins/data/public/query/query_service.ts b/src/plugins/data/public/query/query_service.ts index 17a7773567f3..80f6bd542e5d 100644 --- a/src/plugins/data/public/query/query_service.ts +++ b/src/plugins/data/public/query/query_service.ts @@ -67,7 +67,6 @@ export class QueryService { filterManager!: FilterManager; timefilter!: TimefilterSetup; queryStringManager!: QueryStringContract; - dataSetManager!: DataSetContract; state$!: ReturnType; @@ -81,20 +80,19 @@ export class QueryService { }); this.queryStringManager = new QueryStringManager(storage, uiSettings); - this.dataSetManager = new DataSetManager(uiSettings); this.state$ = createQueryStateObservable({ filterManager: this.filterManager, timefilter: this.timefilter, queryString: this.queryStringManager, - dataSetManager: this.dataSetManager, + datasetManager: this.queryStringManager.getDatasetManager(), }).pipe(share()); return { filterManager: this.filterManager, timefilter: this.timefilter, queryString: this.queryStringManager, - dataSetManager: this.dataSetManager, + datasetManager: this.queryStringManager.getDatasetManager(), state$: this.state$, }; } @@ -105,7 +103,7 @@ export class QueryService { uiSettings, indexPatterns, }: QueryServiceStartDependencies) { - this.dataSetManager.init(indexPatterns); + this.queryStringManager.getDatasetManager().init(indexPatterns); return { addToQueryLog: createAddToQueryLog({ storage, @@ -113,7 +111,7 @@ export class QueryService { }), filterManager: this.filterManager, queryString: this.queryStringManager, - dataSetManager: this.dataSetManager, + dataSetManager: this.queryStringManager.getDatasetManager(), savedQueries: createSavedQueryService(savedObjectsClient), state$: this.state$, timefilter: this.timefilter, diff --git a/src/plugins/data/public/query/dataset_manager/dataset_manager.mock.ts b/src/plugins/data/public/query/query_string/dataset_manager/dataset_manager.mock.ts similarity index 52% rename from src/plugins/data/public/query/dataset_manager/dataset_manager.mock.ts rename to src/plugins/data/public/query/query_string/dataset_manager/dataset_manager.mock.ts index 93dcdfb22b82..fc3c52aa11ca 100644 --- a/src/plugins/data/public/query/dataset_manager/dataset_manager.mock.ts +++ b/src/plugins/data/public/query/query_string/dataset_manager/dataset_manager.mock.ts @@ -3,22 +3,22 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { DataSetContract } from '.'; +import { DatasetContract } from '.'; const createSetupContractMock = () => { - const dataSetManagerMock: jest.Mocked = { + const datasetManagerMock: jest.Mocked = { init: jest.fn(), - getDataSet: jest.fn(), - setDataSet: jest.fn(), + getDataset: jest.fn(), + setDataset: jest.fn(), getUpdates$: jest.fn(), - getDefaultDataSet: jest.fn(), - fetchDefaultDataSet: jest.fn(), + getDefaultDataset: jest.fn(), + fetchDefaultDataset: jest.fn(), initWithIndexPattern: jest.fn(), }; - return dataSetManagerMock; + return datasetManagerMock; }; -export const dataSetManagerMock = { +export const datasetManagerMock = { createSetupContract: createSetupContractMock, createStartContract: createSetupContractMock, }; diff --git a/src/plugins/data/public/query/dataset_manager/dataset_manager.test.ts b/src/plugins/data/public/query/query_string/dataset_manager/dataset_manager.test.ts similarity index 65% rename from src/plugins/data/public/query/dataset_manager/dataset_manager.test.ts rename to src/plugins/data/public/query/query_string/dataset_manager/dataset_manager.test.ts index 3ee499f31e33..597f7418af37 100644 --- a/src/plugins/data/public/query/dataset_manager/dataset_manager.test.ts +++ b/src/plugins/data/public/query/query_string/dataset_manager/dataset_manager.test.ts @@ -3,17 +3,17 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { DataSetManager } from './dataset_manager'; -import { coreMock } from '../../../../../core/public/mocks'; -import { Dataset } from '../../../common'; +import { DatasetManager } from './dataset_manager'; +import { coreMock } from '../../../../../../core/public/mocks'; +import { Dataset } from '../../../../common'; describe('DatasetManager', () => { - let service: DataSetManager; + let service: DatasetManager; beforeEach(() => { const uiSettingsMock = coreMock.createSetup().uiSettings; uiSettingsMock.get.mockReturnValue(true); - service = new DataSetManager(uiSettingsMock); + service = new DatasetManager(uiSettingsMock); }); test('getUpdates$ is a cold emits only after dataset changes', () => { @@ -25,16 +25,16 @@ describe('DatasetManager', () => { expect(emittedValues).toHaveLength(0); expect(emittedValues[0]).toEqual(undefined); - const newDataSet: Dataset = { + const newDataset: Dataset = { id: 'test_dataset', title: 'Test Dataset', type: 'INDEX_PATTERN', }; - service.setDataSet(newDataSet); + service.setDataset(newDataset); expect(emittedValues).toHaveLength(1); - expect(emittedValues[0]).toEqual(newDataSet); + expect(emittedValues[0]).toEqual(newDataset); - service.setDataSet({ ...newDataSet }); + service.setDataset({ ...newDataset }); expect(emittedValues).toHaveLength(2); }); }); diff --git a/src/plugins/data/public/query/dataset_manager/dataset_manager.ts b/src/plugins/data/public/query/query_string/dataset_manager/dataset_manager.ts similarity index 74% rename from src/plugins/data/public/query/dataset_manager/dataset_manager.ts rename to src/plugins/data/public/query/query_string/dataset_manager/dataset_manager.ts index deac33e516ef..af43fccacc50 100644 --- a/src/plugins/data/public/query/dataset_manager/dataset_manager.ts +++ b/src/plugins/data/public/query/query_string/dataset_manager/dataset_manager.ts @@ -6,22 +6,22 @@ import { BehaviorSubject } from 'rxjs'; import { CoreStart } from 'opensearch-dashboards/public'; import { skip } from 'rxjs/operators'; -import { DEFAULT_QUERY, Dataset, DataSource, IndexPattern, UI_SETTINGS } from '../../../common'; -import { IndexPatternsContract } from '../../index_patterns'; +import { DEFAULT_QUERY, Dataset, DataSource, IndexPattern, UI_SETTINGS } from '../../../../common'; +import { IndexPatternsContract } from '../../../index_patterns'; -export class DataSetManager { - private dataSet$: BehaviorSubject; +export class DatasetManager { + private dataset$: BehaviorSubject; private indexPatterns?: IndexPatternsContract; - private defaultDataSet?: Dataset; + private defaultDataset?: Dataset; constructor(private readonly uiSettings: CoreStart['uiSettings']) { - this.dataSet$ = new BehaviorSubject(undefined); + this.dataset$ = new BehaviorSubject(undefined); } public init = async (indexPatterns: IndexPatternsContract) => { if (!this.uiSettings.get(UI_SETTINGS.QUERY_ENHANCEMENTS_ENABLED)) return; this.indexPatterns = indexPatterns; - this.defaultDataSet = await this.fetchDefaultDataSet(); + this.defaultDataset = await this.fetchDefaultDataset(); }; public initWithIndexPattern = (indexPattern: IndexPattern | null) => { @@ -30,7 +30,7 @@ export class DataSetManager { return undefined; } - this.defaultDataSet = { + this.defaultDataset = { id: indexPattern.id, title: indexPattern.title, type: DEFAULT_QUERY.DATASET_TYPE, @@ -48,27 +48,27 @@ export class DataSetManager { }; public getUpdates$ = () => { - return this.dataSet$.asObservable().pipe(skip(1)); + return this.dataset$.asObservable().pipe(skip(1)); }; - public getDataSet = () => { - return this.dataSet$.getValue(); + public getDataset = () => { + return this.dataset$.getValue(); }; /** * Updates the query. * @param {Query} query */ - public setDataSet = (dataSet: Dataset | undefined) => { + public setDataset = (dataSet: Dataset | undefined) => { if (!this.uiSettings.get(UI_SETTINGS.QUERY_ENHANCEMENTS_ENABLED)) return; - this.dataSet$.next(dataSet); + this.dataset$.next(dataSet); }; - public getDefaultDataSet = () => { - return this.defaultDataSet; + public getDefaultDataset = () => { + return this.defaultDataset; }; - public fetchDefaultDataSet = async (): Promise => { + public fetchDefaultDataset = async (): Promise => { const defaultIndexPatternId = this.uiSettings.get('defaultIndex'); if (!defaultIndexPatternId) { return undefined; @@ -97,4 +97,4 @@ export class DataSetManager { }; } -export type DataSetContract = PublicMethodsOf; +export type DatasetContract = PublicMethodsOf; diff --git a/src/plugins/data/public/query/dataset_manager/index.ts b/src/plugins/data/public/query/query_string/dataset_manager/index.ts similarity index 58% rename from src/plugins/data/public/query/dataset_manager/index.ts rename to src/plugins/data/public/query/query_string/dataset_manager/index.ts index 8a9a39b81127..01291faa1fd1 100644 --- a/src/plugins/data/public/query/dataset_manager/index.ts +++ b/src/plugins/data/public/query/query_string/dataset_manager/index.ts @@ -3,4 +3,4 @@ * SPDX-License-Identifier: Apache-2.0 */ -export { DataSetContract, DataSetManager } from './dataset_manager'; +export { DatasetContract, DatasetManager } from './dataset_manager'; diff --git a/src/plugins/data/public/query/query_string/query_string_manager.ts b/src/plugins/data/public/query/query_string/query_string_manager.ts index 98a348b58254..fd0fe063b361 100644 --- a/src/plugins/data/public/query/query_string/query_string_manager.ts +++ b/src/plugins/data/public/query/query_string/query_string_manager.ts @@ -33,10 +33,12 @@ import { skip } from 'rxjs/operators'; import { CoreStart } from 'opensearch-dashboards/public'; import { DataStorage, Query, SimpleDataSet, TimeRange, UI_SETTINGS } from '../../../common'; import { createHistory, QueryHistory } from './query_history'; +import { DatasetContract, DatasetManager } from './dataset_manager'; export class QueryStringManager { private query$: BehaviorSubject; private queryHistory: QueryHistory; + private datasetManager!: DatasetContract; constructor( private readonly storage: DataStorage, @@ -44,6 +46,7 @@ export class QueryStringManager { ) { this.query$ = new BehaviorSubject(this.getDefaultQuery()); this.queryHistory = createHistory({ storage }); + this.datasetManager = new DatasetManager(uiSettings); } private getDefaultQueryString() { @@ -121,6 +124,41 @@ export class QueryStringManager { public changeQueryHistory(listener: (reqs: any[]) => void) { return this.queryHistory.change(listener); } + /** + * TODO: verify if we want to just access the dataset manager directly or access each function + */ + public getDatasetManager = () => { + return this.datasetManager; + }; + + // TODO: uncomment or use based on decision above + // public initDataset = async (indexPatterns: IndexPatternsContract) => { + // return this.datasetManager.init(indexPatterns); + // }; + + // public initDatasetWithIndexPattern = (indexPattern: IndexPattern | null) => { + // return this.datasetManager.initWithIndexPattern(indexPattern); + // }; + + // public getDatasetUpdates$ = () => { + // return this.datasetManager.getUpdates$(); + // }; + + // public getDataset = () => { + // return this.datasetManager.getDataset(); + // }; + + // public setDataset = (dataset: Dataset | undefined) => { + // return this.datasetManager.setDataset(dataset); + // }; + + // public getDefaultDataset = () => { + // return this.datasetManager.getDefaultDataset(); + // }; + + // public fetchDefaultDataset = async (): Promise => { + // return this.datasetManager.fetchDefaultDataset(); + // }; } export type QueryStringContract = PublicMethodsOf; diff --git a/src/plugins/data/public/query/state_sync/create_global_query_observable.ts b/src/plugins/data/public/query/state_sync/create_global_query_observable.ts index a77b3f159e25..2a7e18ae8416 100644 --- a/src/plugins/data/public/query/state_sync/create_global_query_observable.ts +++ b/src/plugins/data/public/query/state_sync/create_global_query_observable.ts @@ -36,18 +36,18 @@ import { QueryState, QueryStateChange } from './index'; import { createStateContainer } from '../../../../opensearch_dashboards_utils/public'; import { isFilterPinned, compareFilters, COMPARE_ALL_OPTIONS } from '../../../common'; import { QueryStringContract } from '../query_string'; -import { DataSetContract } from '../dataset_manager'; +import { DatasetContract } from '../query_string/dataset_manager'; export function createQueryStateObservable({ timefilter: { timefilter }, filterManager, queryString, - dataSetManager, + datasetManager, }: { timefilter: TimefilterSetup; filterManager: FilterManager; queryString: QueryStringContract; - dataSetManager: DataSetContract; + datasetManager: DatasetContract; }): Observable<{ changes: QueryStateChange; state: QueryState }> { return new Observable((subscriber) => { const state = createStateContainer({ @@ -55,7 +55,7 @@ export function createQueryStateObservable({ refreshInterval: timefilter.getRefreshInterval(), filters: filterManager.getFilters(), query: queryString.getQuery(), - dataSet: dataSetManager.getDataSet(), + dataset: queryString.getDatasetManager().getDataset(), }); let currentChange: QueryStateChange = {}; @@ -64,10 +64,13 @@ export function createQueryStateObservable({ currentChange.query = true; state.set({ ...state.get(), query: queryString.getQuery() }); }), - dataSetManager.getUpdates$().subscribe(() => { - currentChange.dataSet = true; - state.set({ ...state.get(), dataSet: dataSetManager.getDataSet() }); - }), + queryString + .getDatasetManager() + .getUpdates$() + .subscribe(() => { + currentChange.dataset = true; + state.set({ ...state.get(), dataset: queryString.getDatasetManager().getDataset() }); + }), timefilter.getTimeUpdate$().subscribe(() => { currentChange.time = true; state.set({ ...state.get(), time: timefilter.getTime() }); diff --git a/src/plugins/data/public/query/state_sync/types.ts b/src/plugins/data/public/query/state_sync/types.ts index ea00624895cc..4c7350e70172 100644 --- a/src/plugins/data/public/query/state_sync/types.ts +++ b/src/plugins/data/public/query/state_sync/types.ts @@ -38,6 +38,8 @@ export interface QueryState { refreshInterval?: RefreshInterval; filters?: Filter[]; query?: Query; + // TODO: remove once query object correctly has dataset + dataset?: Dataset; } type QueryStateChangePartial = {