File tree Expand file tree Collapse file tree
src/plugins/visualizations/public Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ } ;
Original file line number Diff line number Diff line change 88
99import type { DataView } from '@kbn/data-views-plugin/common' ;
1010import { METRIC_TYPES } from '@kbn/data-plugin/public' ;
11- import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public' ;
1211import { AggBasedColumn , SchemaConfig , SupportedAggregation } from '../../common' ;
1312import { convertBucketToColumns } from '../../common/convert_to_lens/lib/buckets' ;
1413import { isSiblingPipeline } from '../../common/convert_to_lens/lib/utils' ;
@@ -122,14 +121,3 @@ export const sortColumns = (
122121} ;
123122
124123export 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- } ;
Original file line number Diff line number Diff line change @@ -74,4 +74,4 @@ export {
7474} from './triggers' ;
7575
7676export const convertToLensModule = import ( './convert_to_lens' ) ;
77- export { getDataViewByIndexPatternId } from './convert_to_lens/utils ' ;
77+ export { getDataViewByIndexPatternId } from './convert_to_lens/datasource ' ;
You can’t perform that action at this time.
0 commit comments