diff --git a/public/components/common/search/sql_search.tsx b/public/components/common/search/sql_search.tsx index 69e1f26109..59768dae73 100644 --- a/public/components/common/search/sql_search.tsx +++ b/public/components/common/search/sql_search.tsx @@ -190,8 +190,8 @@ export const DirectSearch = (props: any) => { dispatch( changeQuery({ tabId, query: { [RAW_QUERY]: tempQuery.replaceAll(PPL_NEWLINE_REGEX, '') } }) ); - dispatch(updateSearchMetaData({ tabId, data: { isPolling: true, lang } })); }); + dispatch(updateSearchMetaData({ tabId, data: { isPolling: true, lang } })); const sessionId = getAsyncSessionId(); const requestPayload = { lang: lang.toLowerCase(), diff --git a/public/services/saved_objects/saved_object_loaders/explorer_saved_object_loader.ts b/public/services/saved_objects/saved_object_loaders/explorer_saved_object_loader.ts index 1e65d045be..395aacbd14 100644 --- a/public/services/saved_objects/saved_object_loaders/explorer_saved_object_loader.ts +++ b/public/services/saved_objects/saved_object_loaders/explorer_saved_object_loader.ts @@ -46,11 +46,7 @@ import { coreRefs } from '../../../framework/core_refs'; import { UsePolling } from '../../../components/hooks/use_polling'; import { getAsyncSessionId, setAsyncSessionId } from '../../../../common/utils/query_session_utils'; import { get as getObjValue } from '../../../../common/utils/shared'; -import { - ASYNC_POLLING_INTERVAL, - DEFAULT_DATA_SOURCE_NAME, - DEFAULT_DATA_SOURCE_TYPE, -} from '../../../../common/constants/data_sources'; +import { ASYNC_POLLING_INTERVAL } from '../../../../common/constants/data_sources'; enum DIRECT_DATA_SOURCE_TYPES { DEFAULT_INDEX_PATTERNS = 'DEFAULT_INDEX_PATTERNS', @@ -322,31 +318,6 @@ export class ExplorerSavedObjectLoader extends SavedObjectLoaderBase implements return true; }; - loadWODataSource = ({ tabId }: { tabId: string }) => { - const { dispatch, batch } = this.dispatchers; - const { fetchData } = this.loadContext; - - // default datasource - batch(() => { - dispatch( - updateSearchMetaData({ - tabId, - data: { - datasources: [ - { - name: DEFAULT_DATA_SOURCE_NAME, - type: DEFAULT_DATA_SOURCE_TYPE, - label: DEFAULT_DATA_SOURCE_NAME, - value: DEFAULT_DATA_SOURCE_NAME, - }, - ], - }, - }) - ); - fetchData(); - }); - }; - loadDefaultIndexPattern = () => { const { fetchData } = this.loadContext; fetchData(); @@ -409,15 +380,7 @@ export class ExplorerSavedObjectLoader extends SavedObjectLoaderBase implements async loadDataFromSavedObject(objectData, tabId: string) { const dataSources = parseStringDataSource(objectData.data_sources, this.notifications); - - // backward compatibility for saved object that doesn't contain datasource - if (dataSources.length === 0) { - this.loadWODataSource({ tabId }); - return; - } - - // saved object contains data source information - if (dataSources[0].type) { + if (dataSources.length > 0 && dataSources[0].type) { switch (dataSources[0].type) { case DIRECT_DATA_SOURCE_TYPES.DEFAULT_INDEX_PATTERNS: this.loadDefaultIndexPattern();