Skip to content

Commit

Permalink
[Vega] fix requesting not permitted or used data views
Browse files Browse the repository at this point in the history
  • Loading branch information
mbondyra committed Apr 25, 2022
1 parent 780333b commit 30b142e
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 30b142e

Please sign in to comment.