Skip to content

Commit

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

* [Vega] fix requesting not permitted or used data views (#130878)

Co-authored-by: Kibana Machine <[email protected]>
(cherry picked from commit 98041ca)

# Conflicts:
#	src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts
#	src/plugins/vis_types/vega/public/vega_view/vega_base_view.js

* Update src/plugins/vis_types/vega/public/vega_view/vega_base_view.js

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
mbondyra and kibanamachine authored May 3, 2022
1 parent 838f632 commit 2577520
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 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 @@ -29,7 +29,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?.getComputedFields().runtimeFields;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ export const extractIndexPatternsFromSpec = async (spec: VegaSpec) => {
await Promise.all(
data.reduce<Array<Promise<IndexPattern[]>>>((accumulator, currentValue) => {
if (currentValue.url?.index) {
accumulator.push(indexPatterns.find(currentValue.url.index));
accumulator.push(indexPatterns.find(currentValue.url.index, 1));
}

return accumulator;
}, [])
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export class VegaBaseView {
let idxObj;

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

0 comments on commit 2577520

Please sign in to comment.