Skip to content

Commit

Permalink
[Vega] fix requesting not permitted or used data views (#130878) (#13…
Browse files Browse the repository at this point in the history
…1367)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 98041ca)

Co-authored-by: Marta Bondyra <4283304+mbondyra@users.noreply.github.com>
  • Loading branch information
kibanamachine and mbondyra authored May 3, 2022
1 parent f6a0363 commit f0b6ce3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/plugins/vis_types/vega/public/data_model/search_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const extendSearchParamsWithRuntimeFields = async (
let runtimeMappings = requestParams.body?.runtime_mappings;

if (!runtimeMappings) {
const indexPattern = (await indexPatterns.find(indexPatternString)).find(
const indexPattern = (await indexPatterns.find(indexPatternString, 1)).find(
(index) => index.title === indexPatternString
);
runtimeMappings = indexPattern?.getRuntimeMappings();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const extractIndexPatternsFromSpec = async (spec: VegaSpec) => {
await Promise.all(
data.reduce<Array<Promise<DataView[]>>>((accumulator, currentValue) => {
if (currentValue.url?.index) {
accumulator.push(dataViews.find(currentValue.url.index));
accumulator.push(dataViews.find(currentValue.url.index, 1));
}

return accumulator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export class VegaBaseView {
let idxObj;

if (index) {
[idxObj] = await dataViews.find(index);
[idxObj] = await dataViews.find(index, 1);
if (!idxObj) {
throw new Error(
i18n.translate('visTypeVega.vegaParser.baseView.indexNotFoundErrorMessage', {
Expand Down

0 comments on commit f0b6ce3

Please sign in to comment.