Skip to content

Commit

Permalink
take away the export interface to test CI build stats
Browse files Browse the repository at this point in the history
  • Loading branch information
tsullivan committed Apr 12, 2021
1 parent a879667 commit fc16f85
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,20 @@
*/

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
*/
export async function getSharingData(
currentSearchSource: ISearchSource,
state: AppState | SavedSearch,
config: IUiSettingsClient
): Promise<ISharingData> {
) {
const searchSource = currentSearchSource.createCopy();
const index = searchSource.getField('index')!;

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/discover/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
2 changes: 0 additions & 2 deletions src/plugins/discover/public/shared/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@
export async function loadSharingDataHelpers() {
return await import('../application/helpers/get_sharing_data');
}

export { ISharingData } from '../application/helpers/get_sharing_data';
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -64,10 +60,7 @@ export class GetCsvReportPanelAction implements ActionDefinition<ActionContext>
});
}

public async getSearchSource(
savedSearch: SavedSearch,
embeddable: ISearchEmbeddable
): Promise<ISharingData> {
public async getSearchSource(savedSearch: SavedSearch, embeddable: ISearchEmbeddable) {
const { getSharingData } = await loadSharingDataHelpers();
return await getSharingData(
savedSearch.searchSource,
Expand Down

0 comments on commit fc16f85

Please sign in to comment.