From 311888988598c1ddba3fffb876e67f7b12a0d791 Mon Sep 17 00:00:00 2001 From: Henry Liu <645599166@qq.com> Date: Thu, 24 Oct 2024 11:09:51 +0800 Subject: [PATCH] [DataView] show empty matching sources when no matched index pattern (#195537) ## Summary Closes #194736 Show empty matching sources when no matched index pattern in create data view panel ### Before ![image](https://github.com/user-attachments/assets/84bbc6b7-5ec7-4755-92fb-c2f52b38d7c1) ### After ![image](https://github.com/user-attachments/assets/af5ac7c2-4346-4f97-82aa-e4c54659d9a9) --------- Co-authored-by: Matthias Wilhelm Co-authored-by: Elastic Machine Co-authored-by: Davis McPhee (cherry picked from commit 23848ddea6185cadbf0fdd6fe59cd6b6b0c60ec0) --- .../preview_panel/preview_panel.tsx | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/plugins/data_view_editor/public/components/preview_panel/preview_panel.tsx b/src/plugins/data_view_editor/public/components/preview_panel/preview_panel.tsx index 62de466889990..44322d92a42b3 100644 --- a/src/plugins/data_view_editor/public/components/preview_panel/preview_panel.tsx +++ b/src/plugins/data_view_editor/public/components/preview_panel/preview_panel.tsx @@ -86,17 +86,18 @@ export const PreviewPanel = ({ type, allowHidden, title = '', matchedIndices$ }: query={title} /> - {Boolean(title) && currentlyVisibleIndices.length > 0 && ( - setViewMode(id as ViewMode)} - /> - )} + {Boolean(title) && + (matched.exactMatchedIndices.length > 0 || matched.partialMatchedIndices.length > 0) && ( + setViewMode(id as ViewMode)} + /> + )} {indicesListContent} );