[data view mgmt] fix privileges problem for field preview (#127523)

* fix privledges problem for field preview

* fix test
This commit is contained in:
Matthew Kime 2022-03-11 07:08:14 -06:00 committed by GitHub
parent 50941ebe35
commit fb11d2d8fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -302,7 +302,7 @@ describe('Field editor Preview panel', () => {
title: 'First doc - title',
},
documentId: '001',
index: 'testIndex',
index: 'testIndexPattern',
script: {
source: 'echo("hello")',
},

View file

@ -333,7 +333,7 @@ export const FieldPreviewProvider: FunctionComponent = ({ children }) => {
const currentApiCall = ++previewCount.current;
const response = await getFieldPreview({
index: currentDocIndex!,
index: dataView.title,
document: document!,
context: `${type!}_field` as PainlessExecuteContext,
script: script!,
@ -384,7 +384,6 @@ export const FieldPreviewProvider: FunctionComponent = ({ children }) => {
type,
script,
document,
currentDocIndex,
currentDocId,
getFieldPreview,
notifications.toasts,
@ -392,6 +391,7 @@ export const FieldPreviewProvider: FunctionComponent = ({ children }) => {
allParamsDefined,
scriptEditorValidation,
hasSomeParamsChanged,
dataView.title,
]);
const goToNextDoc = useCallback(() => {