From 2bfd80eb98a2d9784ead8ca581df2e34945dd901 Mon Sep 17 00:00:00 2001 From: Yulong Ruan Date: Fri, 6 Sep 2024 12:10:30 +0800 Subject: [PATCH 1/3] fix: order it query editor extensions not working Signed-off-by: Yulong Ruan --- .../public/ui/query_editor/_query_editor.scss | 9 +++++++ .../query_editor_extensions.tsx | 24 ++++++++++++------- .../public/query_assist/_index.scss | 8 ++++--- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/src/plugins/data/public/ui/query_editor/_query_editor.scss b/src/plugins/data/public/ui/query_editor/_query_editor.scss index 770160de8c1d..a7f4db7f0ea9 100644 --- a/src/plugins/data/public/ui/query_editor/_query_editor.scss +++ b/src/plugins/data/public/ui/query_editor/_query_editor.scss @@ -150,6 +150,15 @@ } } +.osdQueryEditor__header { + display: flex; + align-items: center; + + .osdQueryEditorExtensionComponent { + padding: 0 $euiSizeXS $euiSizeXS; + } +} + .osdQueryEditor__topBar { display: flex; align-items: center; diff --git a/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extensions.tsx b/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extensions.tsx index 45b0d076877e..89e9f5e3c94f 100644 --- a/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extensions.tsx +++ b/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extensions.tsx @@ -26,15 +26,21 @@ const QueryEditorExtensions: React.FC = React.memo(( return ( <> - {sortedConfigs.map((config) => ( - - ))} + {sortedConfigs.map((config) => { + const extensionComponentContainer = document.createElement('div'); + extensionComponentContainer.className = `osdQueryEditorExtensionComponent osdQueryEditorExtensionComponent__${config.id}`; + componentContainer.appendChild(extensionComponentContainer); + + return ( + + ); + })} ); }); diff --git a/src/plugins/query_enhancements/public/query_assist/_index.scss b/src/plugins/query_enhancements/public/query_assist/_index.scss index f80ad45850c9..6b62c4c2e697 100644 --- a/src/plugins/query_enhancements/public/query_assist/_index.scss +++ b/src/plugins/query_enhancements/public/query_assist/_index.scss @@ -4,11 +4,13 @@ */ .queryAssist { - &.queryAssist__form { - padding: 0 $euiSizeXS $euiSizeXS; - } + &.queryAssist__form {} &.queryAssist__callout { margin-top: $euiSizeXS; } } + +.osdQueryEditorExtensionComponent__query-assist { + flex-grow: 1; +} From 0991268b81d239a0d78934514e13ea661def279d Mon Sep 17 00:00:00 2001 From: Yulong Ruan Date: Fri, 6 Sep 2024 12:59:29 +0800 Subject: [PATCH 2/3] tweaks query assist extension styles Signed-off-by: Yulong Ruan --- src/plugins/query_enhancements/public/query_assist/_index.scss | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/plugins/query_enhancements/public/query_assist/_index.scss b/src/plugins/query_enhancements/public/query_assist/_index.scss index 6b62c4c2e697..65ed6aa60884 100644 --- a/src/plugins/query_enhancements/public/query_assist/_index.scss +++ b/src/plugins/query_enhancements/public/query_assist/_index.scss @@ -4,8 +4,6 @@ */ .queryAssist { - &.queryAssist__form {} - &.queryAssist__callout { margin-top: $euiSizeXS; } From 1e961cfa01af86ff724e8841d45a3317830a0df7 Mon Sep 17 00:00:00 2001 From: "opensearch-changeset-bot[bot]" <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Date: Fri, 6 Sep 2024 05:01:49 +0000 Subject: [PATCH 3/3] Changeset file for PR #8045 created/updated --- changelogs/fragments/8045.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelogs/fragments/8045.yml diff --git a/changelogs/fragments/8045.yml b/changelogs/fragments/8045.yml new file mode 100644 index 000000000000..da2a823b6367 --- /dev/null +++ b/changelogs/fragments/8045.yml @@ -0,0 +1,2 @@ +fix: +- Order of query editor extensions not working ([#8045](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8045)) \ No newline at end of file