From 3ac63a6a861d3d01756203fa4722e041e41e3d5d Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Tue, 22 Sep 2020 09:03:46 -0700 Subject: [PATCH] Require script when first adding a field. Shorten painless script editor. Remove error callout. --- .../painless_script_parameter.tsx | 51 ++++++++----------- .../runtime_type.tsx | 9 +++- 2 files changed, 28 insertions(+), 32 deletions(-) diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/painless_script_parameter.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/painless_script_parameter.tsx index 4520848dea25e..63b3b3aac9c3f 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/painless_script_parameter.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/painless_script_parameter.tsx @@ -5,7 +5,7 @@ */ import React from 'react'; -import { EuiFormRow, EuiCallOut, EuiSpacer } from '@elastic/eui'; +import { EuiFormRow } from '@elastic/eui'; import { CodeEditor, UseField } from '../../../shared_imports'; import { getFieldConfig } from '../../../lib'; @@ -18,35 +18,26 @@ export const PainlessScriptParameter = () => { const isInvalid = error ? Boolean(error.length) : false; return ( - <> - {isInvalid && ( - <> - - - - )} - - - - - + + + ); }} diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/create_field/required_parameters_forms/runtime_type.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/create_field/required_parameters_forms/runtime_type.tsx index 63a6fc0ffe62a..54907295f8a15 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/create_field/required_parameters_forms/runtime_type.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/create_field/required_parameters_forms/runtime_type.tsx @@ -6,8 +6,13 @@ import React from 'react'; -import { RuntimeTypeParameter } from '../../../field_parameters'; +import { RuntimeTypeParameter, PainlessScriptParameter } from '../../../field_parameters'; export const RuntimeTypeRequiredParameters = () => { - return ; + return ( + <> + + + + ); };