@@ -293,48 +379,142 @@ export default class QueryEditorUI extends Component
{
- {this.props.prepend}
+
+ this.setState({ isCollapsed: !this.state.isCollapsed })}
+ isCollapsed={!this.state.isCollapsed}
+ />
+
{this.state.isDataSourcesVisible && (
-
+
)}
-
-
-
+
{this.state.isDataSetsVisible && (
-
+
)}
+
+
+ {(this.state.isCollapsed || !useQueryEditor) && (
+
+
+
+
+
+ )}
+ {!useQueryEditor && (
+
+
+
+
+
+ )}
+
+
+
+ {this.props.prepend}
+
+
-
+ {!this.state.isCollapsed && useQueryEditor && (
+
+ )}
+
+
+
+
+
+
+
+
+ {this.state.lineCount} {this.state.lineCount === 1 ? 'line' : 'lines'}
+
+
+ {typeof this.props.indexPatterns?.[0] !== 'string' &&
+ '@' + this.props.indexPatterns?.[0].timeFieldName}
+
+
+
+
+ {!this.state.isCollapsed && (
+ {this.props.filterBar}
+ )}
{this.renderQueryEditorExtensions()}
diff --git a/src/plugins/data/public/ui/query_editor/query_editor_btn_collapse.tsx b/src/plugins/data/public/ui/query_editor/query_editor_btn_collapse.tsx
new file mode 100644
index 000000000000..1bde59570fdd
--- /dev/null
+++ b/src/plugins/data/public/ui/query_editor/query_editor_btn_collapse.tsx
@@ -0,0 +1,31 @@
+/*
+ * Copyright OpenSearch Contributors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+import React from 'react';
+import { i18n } from '@osd/i18n';
+import { EuiToolTip, EuiButtonIcon } from '@elastic/eui';
+
+export interface Props {
+ onClick: () => void;
+ isCollapsed: boolean;
+}
+
+export function QueryEditorBtnCollapse({ onClick, isCollapsed }: Props) {
+ const label = i18n.translate('queryEditor.collapse', {
+ defaultMessage: 'Toggle query editor',
+ });
+ return (
+