mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
* [Vega] fix requesting not permitted or used data views (#130878)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 98041caf3c
)
# 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 <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
838f632946
commit
25775200a8
3 changed files with 3 additions and 4 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}, [])
|
||||
)
|
||||
|
|
|
@ -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', {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue