mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
[Streams 🌊] Handle no data screen for simulation (#225322)
## 📓 Summary Fixes an issue where the no-data warning for the stream simulation was hiding the simulation filters. https://github.com/user-attachments/assets/965f22f6-3faf-4378-883e-26b002a9cdcd
This commit is contained in:
parent
69971435e4
commit
e78d4faaa5
1 changed files with 31 additions and 4 deletions
|
@ -35,14 +35,14 @@ import { selectPreviewDocuments } from './state_management/simulation_state_mach
|
|||
import { isGrokProcessor } from './utils';
|
||||
import { selectDraftProcessor } from './state_management/stream_enrichment_state_machine/selectors';
|
||||
import { WithUIAttributes } from './types';
|
||||
import { AssetImage } from '../../asset_image';
|
||||
|
||||
export const ProcessorOutcomePreview = () => {
|
||||
const isLoading = useSimulatorSelector(
|
||||
(snapshot) => snapshot.matches('debouncingChanges') || snapshot.matches('runningSimulation')
|
||||
);
|
||||
const previewDocuments = useSimulatorSelector((snapshot) =>
|
||||
selectPreviewDocuments(snapshot.context)
|
||||
);
|
||||
|
||||
const samples = useSimulatorSelector((snapshot) => snapshot.context.samples);
|
||||
|
||||
const areDataSourcesLoading = useStreamEnrichmentSelector((state) =>
|
||||
state.context.dataSourcesRefs.some((ref) => {
|
||||
|
@ -53,7 +53,7 @@ export const ProcessorOutcomePreview = () => {
|
|||
})
|
||||
);
|
||||
|
||||
if (isEmpty(previewDocuments)) {
|
||||
if (isEmpty(samples)) {
|
||||
if (areDataSourcesLoading) {
|
||||
return (
|
||||
<EuiFlexGroup justifyContent="center" alignItems="center" style={{ minHeight: 200 }}>
|
||||
|
@ -301,6 +301,33 @@ const OutcomePreviewTable = () => {
|
|||
setPreviewColumnsOrder(visibleColumns);
|
||||
};
|
||||
|
||||
if (isEmpty(previewDocuments)) {
|
||||
return (
|
||||
<EuiEmptyPrompt
|
||||
icon={<AssetImage type="noResults" />}
|
||||
titleSize="s"
|
||||
title={
|
||||
<h2>
|
||||
{i18n.translate(
|
||||
'xpack.streams.streamDetailView.managementTab.enrichment.processor.outcomePreviewTable.noFilteredDocumentsTitle',
|
||||
{ defaultMessage: 'No documents available' }
|
||||
)}
|
||||
</h2>
|
||||
}
|
||||
body={
|
||||
<p>
|
||||
{i18n.translate(
|
||||
'xpack.streams.streamDetailView.managementTab.enrichment.processor.outcomePreviewTable.noFilteredDocumentsBody',
|
||||
{
|
||||
defaultMessage: 'The current filter settings do not match any documents.',
|
||||
}
|
||||
)}
|
||||
</p>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<PreviewTable
|
||||
documents={previewDocuments}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue