Skip to content

Commit

Permalink
[8.x] [DataView] show empty matching sources when no matched index pa…
Browse files Browse the repository at this point in the history
…ttern (#195537) (#197560)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[DataView] show empty matching sources when no matched index pattern
(#195537)](#195537)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Henry
Liu","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-24T03:09:51Z","message":"[DataView]
show empty matching sources when no matched index pattern
(#195537)\n\n## Summary\r\n\r\nCloses #194736\r\n\r\nShow empty matching
sources when no matched index pattern in create data\r\nview
panel\r\n\r\n###
Before\r\n\r\n![image](https://github.com/user-attachments/assets/84bbc6b7-5ec7-4755-92fb-c2f52b38d7c1)\r\n\r\n###
After\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/af5ac7c2-4346-4f97-82aa-e4c54659d9a9)\r\n\r\n---------\r\n\r\nCo-authored-by:
Matthias Wilhelm <[email protected]>\r\nCo-authored-by:
Elastic Machine
<[email protected]>\r\nCo-authored-by: Davis
McPhee
<[email protected]>","sha":"23848ddea6185cadbf0fdd6fe59cd6b6b0c60ec0","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["usability","release_note:skip","💝community","v9.0.0","Team:DataDiscovery","backport:prev-minor"],"title":"[DataView]
show empty matching sources when no matched index
pattern","number":195537,"url":"https://github.com/elastic/kibana/pull/195537","mergeCommit":{"message":"[DataView]
show empty matching sources when no matched index pattern
(#195537)\n\n## Summary\r\n\r\nCloses #194736\r\n\r\nShow empty matching
sources when no matched index pattern in create data\r\nview
panel\r\n\r\n###
Before\r\n\r\n![image](https://github.com/user-attachments/assets/84bbc6b7-5ec7-4755-92fb-c2f52b38d7c1)\r\n\r\n###
After\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/af5ac7c2-4346-4f97-82aa-e4c54659d9a9)\r\n\r\n---------\r\n\r\nCo-authored-by:
Matthias Wilhelm <[email protected]>\r\nCo-authored-by:
Elastic Machine
<[email protected]>\r\nCo-authored-by: Davis
McPhee
<[email protected]>","sha":"23848ddea6185cadbf0fdd6fe59cd6b6b0c60ec0"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195537","number":195537,"mergeCommit":{"message":"[DataView]
show empty matching sources when no matched index pattern
(#195537)\n\n## Summary\r\n\r\nCloses #194736\r\n\r\nShow empty matching
sources when no matched index pattern in create data\r\nview
panel\r\n\r\n###
Before\r\n\r\n![image](https://github.com/user-attachments/assets/84bbc6b7-5ec7-4755-92fb-c2f52b38d7c1)\r\n\r\n###
After\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/af5ac7c2-4346-4f97-82aa-e4c54659d9a9)\r\n\r\n---------\r\n\r\nCo-authored-by:
Matthias Wilhelm <[email protected]>\r\nCo-authored-by:
Elastic Machine
<[email protected]>\r\nCo-authored-by: Davis
McPhee
<[email protected]>","sha":"23848ddea6185cadbf0fdd6fe59cd6b6b0c60ec0"}}]}]
BACKPORT-->

Co-authored-by: Henry Liu <[email protected]>
  • Loading branch information
kibanamachine and lsq645599166 authored Oct 24, 2024
1 parent 820e34e commit 502a211
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 502a211

Please sign in to comment.