diff --git a/src/platform/packages/private/kbn-esql-editor/src/esql_editor.test.tsx b/src/platform/packages/private/kbn-esql-editor/src/esql_editor.test.tsx index c572ff5355585..8d1139f9758aa 100644 --- a/src/platform/packages/private/kbn-esql-editor/src/esql_editor.test.tsx +++ b/src/platform/packages/private/kbn-esql-editor/src/esql_editor.test.tsx @@ -163,4 +163,14 @@ describe('ESQLEditor', () => { findTestSubject(component, 'ESQLEditor-run-query-button').simulate('click'); expect(onTextLangQuerySubmit).toHaveBeenCalled(); }); + + it('should not render the run query button if the hideRunQueryButton prop is set to true and editorIsInline prop is set to true', async () => { + const newProps = { + ...props, + hideRunQueryButton: true, + editorIsInline: true, + }; + const component = mount(renderESQLEditorComponent({ ...newProps })); + expect(component.find('[data-test-subj="ESQLEditor-run-query-button"]').length).toBe(0); + }); }); diff --git a/src/platform/packages/private/kbn-esql-editor/src/esql_editor.tsx b/src/platform/packages/private/kbn-esql-editor/src/esql_editor.tsx index 8fb01997c4413..2203a11f38036 100644 --- a/src/platform/packages/private/kbn-esql-editor/src/esql_editor.tsx +++ b/src/platform/packages/private/kbn-esql-editor/src/esql_editor.tsx @@ -89,6 +89,7 @@ export const ESQLEditor = memo(function ESQLEditor({ isLoading, isDisabled, hideRunQueryText, + hideRunQueryButton, editorIsInline, disableSubmitAction, dataTestSubj, @@ -679,7 +680,7 @@ export const ESQLEditor = memo(function ESQLEditor({ const editorPanel = ( <> - {Boolean(editorIsInline) && ( + {Boolean(editorIsInline) && !hideRunQueryButton && (