Skip to content

Commit a920eac

Browse files
committed
Fixed bundle size.
1 parent 45a165c commit a920eac

3 files changed

Lines changed: 21 additions & 13 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
5+
* in compliance with, at your election, the Elastic License 2.0 or the Server
6+
* Side Public License, v 1.
7+
*/
8+
9+
import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public';
10+
11+
export const getDataViewByIndexPatternId = async (
12+
indexPatternId: string | undefined,
13+
dataViews: DataViewsPublicPluginStart
14+
) => {
15+
try {
16+
return indexPatternId ? await dataViews.get(indexPatternId) : await dataViews.getDefault();
17+
} catch (err) {
18+
return null;
19+
}
20+
};

src/plugins/visualizations/public/convert_to_lens/utils.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import type { DataView } from '@kbn/data-views-plugin/common';
1010
import { METRIC_TYPES } from '@kbn/data-plugin/public';
11-
import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public';
1211
import { AggBasedColumn, SchemaConfig, SupportedAggregation } from '../../common';
1312
import { convertBucketToColumns } from '../../common/convert_to_lens/lib/buckets';
1413
import { isSiblingPipeline } from '../../common/convert_to_lens/lib/utils';
@@ -122,14 +121,3 @@ export const sortColumns = (
122121
};
123122

124123
export const getColumnIds = (columns: AggBasedColumn[]) => columns.map(({ columnId }) => columnId);
125-
126-
export const getDataViewByIndexPatternId = async (
127-
indexPatternId: string | undefined,
128-
dataViews: DataViewsPublicPluginStart
129-
) => {
130-
try {
131-
return indexPatternId ? await dataViews.get(indexPatternId) : await dataViews.getDefault();
132-
} catch (err) {
133-
return null;
134-
}
135-
};

src/plugins/visualizations/public/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,4 @@ export {
7474
} from './triggers';
7575

7676
export const convertToLensModule = import('./convert_to_lens');
77-
export { getDataViewByIndexPatternId } from './convert_to_lens/utils';
77+
export { getDataViewByIndexPatternId } from './convert_to_lens/datasource';

0 commit comments

Comments
 (0)