From 98f01f0ff9fdd0d9b2566a47f1bcb5d52f8dc14b Mon Sep 17 00:00:00 2001 From: Matthias Wilhelm Date: Thu, 30 Jan 2020 14:28:34 +0100 Subject: [PATCH] Improve issues found while preparing the demo --- .../plugins/painless_playground/public/components/editor.tsx | 2 +- .../public/components/painless_playground.tsx | 2 +- .../plugins/painless_playground/public/components/settings.tsx | 2 +- x-pack/legacy/plugins/painless_playground/public/lib/helpers.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/legacy/plugins/painless_playground/public/components/editor.tsx b/x-pack/legacy/plugins/painless_playground/public/components/editor.tsx index bc5fabf4f309b..1a9ba18fa7dc0 100644 --- a/x-pack/legacy/plugins/painless_playground/public/components/editor.tsx +++ b/x-pack/legacy/plugins/painless_playground/public/components/editor.tsx @@ -21,7 +21,7 @@ export function Editor({ code, setCode, renderMainControls }: Props) { - {response.error || response.result ? ( + {response.error || typeof response.result !== 'undefined' ? ( diff --git a/x-pack/legacy/plugins/painless_playground/public/components/settings.tsx b/x-pack/legacy/plugins/painless_playground/public/components/settings.tsx index 654831fe138e4..8ea2c9929da29 100644 --- a/x-pack/legacy/plugins/painless_playground/public/components/settings.tsx +++ b/x-pack/legacy/plugins/painless_playground/public/components/settings.tsx @@ -79,7 +79,7 @@ export function Settings({
setContextSetup({ params: value })} options={{ diff --git a/x-pack/legacy/plugins/painless_playground/public/lib/helpers.ts b/x-pack/legacy/plugins/painless_playground/public/lib/helpers.ts index af288ea53b275..43edd08fd043e 100644 --- a/x-pack/legacy/plugins/painless_playground/public/lib/helpers.ts +++ b/x-pack/legacy/plugins/painless_playground/public/lib/helpers.ts @@ -30,7 +30,7 @@ export function buildRequestPayload( request.context = context; request.context_setup = { index: contextSetup.index, - document: parseJSON(contextSetup.doc), + document: parseJSON(contextSetup.document), }; return request; }