forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TSVB] Enable
dual mode
, support index patterns and strings (elasti…
…c#92395) Part of elastic#91367 Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
adf9374
commit 69aed37
Showing
9 changed files
with
59 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/get_index_pattern.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { IndexPatternsService, IndexPattern } from '../../../../../data/server'; | ||
|
||
interface IndexPatternObjectDependencies { | ||
indexPatternsService: IndexPatternsService; | ||
} | ||
export async function getIndexPatternObject( | ||
indexPatternString: string, | ||
{ indexPatternsService }: IndexPatternObjectDependencies | ||
) { | ||
let indexPatternObject: IndexPattern | undefined | null; | ||
|
||
if (!indexPatternString) { | ||
indexPatternObject = await indexPatternsService.getDefault(); | ||
} else { | ||
indexPatternObject = (await indexPatternsService.find(indexPatternString)).find( | ||
(index) => index.title === indexPatternString | ||
); | ||
} | ||
|
||
return { | ||
indexPatternObject, | ||
indexPatternString: indexPatternObject?.title || indexPatternString || '', | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 0 additions & 48 deletions
48
src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_index_pattern.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters