mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
* fix privledges problem for field preview
* fix test
(cherry picked from commit fb11d2d8fe
)
# Conflicts:
# src/plugins/data_view_field_editor/__jest__/client_integration/field_editor_flyout_preview.test.ts
# src/plugins/data_view_field_editor/public/components/preview/field_preview_context.tsx
This commit is contained in:
parent
0135f75aaf
commit
485e9689b7
2 changed files with 3 additions and 4 deletions
|
@ -367,7 +367,7 @@ describe('Field editor Preview panel', () => {
|
|||
title: 'First doc - title',
|
||||
},
|
||||
documentId: '001',
|
||||
index: 'testIndex',
|
||||
index: 'testIndexPattern',
|
||||
script: {
|
||||
source: 'echo("hello")',
|
||||
},
|
||||
|
|
|
@ -167,7 +167,6 @@ export const FieldPreviewProvider: FunctionComponent = ({ children }) => {
|
|||
[documents, currentIdx]
|
||||
);
|
||||
|
||||
const currentDocIndex = currentDocument?._index;
|
||||
const currentDocId: string = currentDocument?._id ?? '';
|
||||
const totalDocs = documents.length;
|
||||
const { name, document, script, format, type } = params;
|
||||
|
@ -334,7 +333,7 @@ export const FieldPreviewProvider: FunctionComponent = ({ children }) => {
|
|||
const currentApiCall = ++previewCount.current;
|
||||
|
||||
const response = await getFieldPreview({
|
||||
index: currentDocIndex,
|
||||
index: indexPattern.title,
|
||||
document: params.document!,
|
||||
context: `${params.type!}_field` as FieldPreviewContext,
|
||||
script: params.script!,
|
||||
|
@ -386,11 +385,11 @@ export const FieldPreviewProvider: FunctionComponent = ({ children }) => {
|
|||
}, [
|
||||
needToUpdatePreview,
|
||||
params,
|
||||
currentDocIndex,
|
||||
currentDocId,
|
||||
getFieldPreview,
|
||||
notifications.toasts,
|
||||
valueFormatter,
|
||||
indexPattern.title,
|
||||
]);
|
||||
|
||||
const goToNextDoc = useCallback(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue