mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
fix multi index pattern load bug (#130428)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
d55c7b34e3
commit
884b47731f
2 changed files with 5 additions and 2 deletions
|
@ -24,7 +24,10 @@ describe('metricsVisDefinition', () => {
|
|||
async getDefault() {
|
||||
return indexPattern1;
|
||||
},
|
||||
async find(title: string) {
|
||||
async find(title: string, size: number) {
|
||||
if (size !== 1) {
|
||||
throw new Error('trying to fetch too many data views');
|
||||
}
|
||||
if (title === 'pattern1') return [indexPattern1];
|
||||
if (title === 'pattern2') return [indexPattern2];
|
||||
return [];
|
||||
|
|
|
@ -71,7 +71,7 @@ async function resolveIndexPattern(
|
|||
) {
|
||||
if (!indexPatternValue) return;
|
||||
if (isStringTypeIndexPattern(indexPatternValue)) {
|
||||
return await indexPatterns.find(indexPatternValue);
|
||||
return await indexPatterns.find(indexPatternValue, 1);
|
||||
}
|
||||
|
||||
if (indexPatternValue.id) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue