diff --git a/src/plugins/discover/public/application/helpers/get_sharing_data.ts b/src/plugins/discover/public/application/helpers/get_sharing_data.ts index f77480a421642..47be4b8037152 100644 --- a/src/plugins/discover/public/application/helpers/get_sharing_data.ts +++ b/src/plugins/discover/public/application/helpers/get_sharing_data.ts @@ -7,17 +7,12 @@ */ import type { Capabilities, IUiSettingsClient } from 'kibana/public'; -import { ISearchSource, SearchSourceFields } from '../../../../data/common'; +import { ISearchSource } from '../../../../data/common'; import { DOC_HIDE_TIME_COLUMN_SETTING, SORT_DEFAULT_ORDER_SETTING } from '../../../common'; import type { SavedSearch, SortOrder } from '../../saved_searches/types'; import { AppState } from '../angular/discover_state'; import { getSortForSearchSource } from '../angular/doc_table'; -export interface ISharingData { - columns: string[]; - searchSource: SearchSourceFields; -} - /** * Preparing data to share the current state as link or CSV/Report */ @@ -25,7 +20,7 @@ export async function getSharingData( currentSearchSource: ISearchSource, state: AppState | SavedSearch, config: IUiSettingsClient -): Promise { +) { const searchSource = currentSearchSource.createCopy(); const index = searchSource.getField('index')!; diff --git a/src/plugins/discover/public/index.ts b/src/plugins/discover/public/index.ts index 4ca9d2330adc4..fbe853ec6deb5 100644 --- a/src/plugins/discover/public/index.ts +++ b/src/plugins/discover/public/index.ts @@ -16,5 +16,5 @@ export function plugin(initializerContext: PluginInitializerContext) { export { SavedSearch, SavedSearchLoader, createSavedSearchesLoader } from './saved_searches'; export { ISearchEmbeddable, SEARCH_EMBEDDABLE_TYPE, SearchInput } from './application/embeddable'; -export { ISharingData, loadSharingDataHelpers } from './shared'; +export { loadSharingDataHelpers } from './shared'; export { DISCOVER_APP_URL_GENERATOR, DiscoverUrlGeneratorState } from './url_generator'; diff --git a/src/plugins/discover/public/shared/index.ts b/src/plugins/discover/public/shared/index.ts index 57fd62ce8dfc9..b1e4d9d87000e 100644 --- a/src/plugins/discover/public/shared/index.ts +++ b/src/plugins/discover/public/shared/index.ts @@ -12,5 +12,3 @@ export async function loadSharingDataHelpers() { return await import('../application/helpers/get_sharing_data'); } - -export { ISharingData } from '../application/helpers/get_sharing_data'; diff --git a/x-pack/plugins/reporting/public/panel_actions/get_csv_panel_action.tsx b/x-pack/plugins/reporting/public/panel_actions/get_csv_panel_action.tsx index 658ff5afaf7f8..95d193880975c 100644 --- a/x-pack/plugins/reporting/public/panel_actions/get_csv_panel_action.tsx +++ b/x-pack/plugins/reporting/public/panel_actions/get_csv_panel_action.tsx @@ -8,11 +8,7 @@ import { i18n } from '@kbn/i18n'; import moment from 'moment-timezone'; import type { CoreSetup } from 'src/core/public'; -import type { - ISearchEmbeddable, - ISharingData, - SavedSearch, -} from '../../../../../src/plugins/discover/public'; +import type { ISearchEmbeddable, SavedSearch } from '../../../../../src/plugins/discover/public'; import { loadSharingDataHelpers, SEARCH_EMBEDDABLE_TYPE, @@ -64,10 +60,7 @@ export class GetCsvReportPanelAction implements ActionDefinition }); } - public async getSearchSource( - savedSearch: SavedSearch, - embeddable: ISearchEmbeddable - ): Promise { + public async getSearchSource(savedSearch: SavedSearch, embeddable: ISearchEmbeddable) { const { getSharingData } = await loadSharingDataHelpers(); return await getSharingData( savedSearch.searchSource,