Skip to content

Commit

Permalink
[DataView] show empty matching sources when no matched index pattern (#…
Browse files Browse the repository at this point in the history
…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 <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: Davis McPhee <[email protected]>
  • Loading branch information
4 people authored Oct 24, 2024
1 parent de876fb commit 23848dd
Showing 1 changed file with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,18 @@ export const PreviewPanel = ({ type, allowHidden, title = '', matchedIndices$ }:
query={title}
/>
<EuiSpacer size="m" />
{Boolean(title) && currentlyVisibleIndices.length > 0 && (
<EuiButtonGroup
isFullWidth
legend={i18n.translate('indexPatternEditor.previewPanel.viewModeGroup.legend', {
defaultMessage: 'Visible sources',
})}
options={viewModeButtons}
idSelected={currentViewMode}
onChange={(id: string) => setViewMode(id as ViewMode)}
/>
)}
{Boolean(title) &&
(matched.exactMatchedIndices.length > 0 || matched.partialMatchedIndices.length > 0) && (
<EuiButtonGroup
isFullWidth
legend={i18n.translate('indexPatternEditor.previewPanel.viewModeGroup.legend', {
defaultMessage: 'Visible sources',
})}
options={viewModeButtons}
idSelected={currentViewMode}
onChange={(id: string) => setViewMode(id as ViewMode)}
/>
)}
{indicesListContent}
</>
);
Expand Down

0 comments on commit 23848dd

Please sign in to comment.