[Dataset quality] removing empty prompt (#192089)

The empty prompt as of now is just informative

After introducing other dataStream types within the page, the empty
prompt became a hindrance in the UX preventing users to properly select
a dataStream type when they have no data related to that type in the
environment.

This PR is about removing the empty prompt in favour of an empty state.
We want to keep the prompt only in case we have a place where to
redirect users to add relevant data
([ref](https://github.com/elastic/kibana/issues/191821)).

### Before


https://github.com/user-attachments/assets/f294e37e-3a4e-430a-acd4-73a7acd21178

### After


https://github.com/user-attachments/assets/c24cd62b-0fc0-4a94-8f45-d8f7ec4da6f1
This commit is contained in:
Yngrid Coello 2024-09-06 12:49:27 +02:00 committed by GitHub
parent ab1646f4e4
commit ad7d935de0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 3 additions and 46 deletions

View file

@ -16,7 +16,7 @@ import { useEmptyState } from '../../../hooks/use_empty_state';
// Allow for lazy loading
// eslint-disable-next-line import/no-default-export
export default function EmptyStateWrapper({ children }: { children: React.ReactNode }) {
const { canReadDataset, isDatasetEmpty } = useEmptyState();
const { canReadDataset } = useEmptyState();
if (!canReadDataset) {
return (
@ -46,32 +46,5 @@ export default function EmptyStateWrapper({ children }: { children: React.ReactN
);
}
if (isDatasetEmpty) {
return (
<EuiEmptyPrompt
iconType="logoLogging"
color="primary"
title={
<h2>
{i18n.translate('xpack.datasetQuality.emptyState.noData.title', {
defaultMessage: 'No datasets found',
})}
</h2>
}
body={
<p data-test-subj="datasetQualityNoDataEmptyState">
<FormattedMessage
id="xpack.datasetQuality.emptyState.noData.message"
defaultMessage="No logs datasets found. To get started, make sure you have logs data streams available matching {datasetPattern}."
values={{
datasetPattern: <EuiCode>{DEFAULT_LOGS_DATA_VIEW}</EuiCode>,
}}
/>
</p>
}
/>
);
}
return <>{children}</>;
}

View file

@ -14,15 +14,5 @@ export function useEmptyState() {
service,
(state) => state.context.datasetUserPrivileges.canRead
);
const isDatasetEmpty = useSelector(
service,
(state) =>
!state.matches('stats.datasets.fetching') &&
!state.matches('integrations.fetching') &&
!state.matches('stats.degradedDocs.fetching') &&
(state.context.datasets?.length ?? 0) === 0
);
return { canReadDataset, isDatasetEmpty };
return { canReadDataset };
}

View file

@ -14610,8 +14610,6 @@
"xpack.datasetQuality.degradedDocsColumnName": "Documents dégradés (%)",
"xpack.datasetQuality.degradedDocsColumnTooltip": "Le pourcentage de documents avec la propriété {ignoredProperty} dans votre ensemble de données.",
"xpack.datasetQuality.degradedDocsQualityDescription": "{quality} -{comparator} {minimimPercentage}%",
"xpack.datasetQuality.emptyState.noData.message": "Aucun log d'ensemble de données n'a été trouvé. Pour commencer, assurez-vous d'avoir des logs de flux de données disponibles correspondant à {datasetPattern}.",
"xpack.datasetQuality.emptyState.noData.title": "Aucun ensemble de données trouvé",
"xpack.datasetQuality.emptyState.noPrivileges.message": "Vous ne disposez pas des autorisations requises pour voir les données de logs. Assurez-vous d'avoir les autorisations requises pour voir {datasetPattern}.",
"xpack.datasetQuality.emptyState.noPrivileges.title": "Impossible de charger les ensembles de données",
"xpack.datasetQuality.fetchDatasetStatsFailed": "Nous n'avons pas pu obtenir vos ensembles de données.",

View file

@ -14599,8 +14599,6 @@
"xpack.datasetQuality.degradedDocsColumnName": "劣化したドキュメント(%",
"xpack.datasetQuality.degradedDocsColumnTooltip": "データセットにおける{ignoredProperty}プロパティのドキュメントの割合。",
"xpack.datasetQuality.degradedDocsQualityDescription": "{quality} -{comparator} {minimimPercentage}%",
"xpack.datasetQuality.emptyState.noData.message": "ログデータセットが見つかりません。開始するには、{datasetPattern}と一致するログデータストリームがあることを確認してください。",
"xpack.datasetQuality.emptyState.noData.title": "データセットが見つかりません",
"xpack.datasetQuality.emptyState.noPrivileges.message": "ログデータを表示するために必要な権限がありません。{datasetPattern}を表示するための十分な権限があることを確認してください。",
"xpack.datasetQuality.emptyState.noPrivileges.title": "データセットを読み込めませんでした",
"xpack.datasetQuality.fetchDatasetStatsFailed": "データセットを取得できませんでした。",

View file

@ -14622,8 +14622,6 @@
"xpack.datasetQuality.degradedDocsColumnName": "已降级文档 (%)",
"xpack.datasetQuality.degradedDocsColumnTooltip": "您的数据集中包含 {ignoredProperty} 属性的文档的百分比。",
"xpack.datasetQuality.degradedDocsQualityDescription": "{quality} -{comparator} {minimimPercentage}%",
"xpack.datasetQuality.emptyState.noData.message": "找不到日志数据集。要开始,请确保具有与 {datasetPattern} 匹配的可用日志数据流。",
"xpack.datasetQuality.emptyState.noData.title": "找不到数据集",
"xpack.datasetQuality.emptyState.noPrivileges.message": "您没有查看日志数据所需的权限。请确保您具有足够的权限,可以查看 {datasetPattern}。",
"xpack.datasetQuality.emptyState.noPrivileges.title": "无法加载数据集",
"xpack.datasetQuality.fetchDatasetStatsFailed": "无法获取数据集。",

View file

@ -120,7 +120,7 @@ export function DatasetQualityPageObject({ getPageObjects, getService }: FtrProv
datasetQualityDetailsIntegrationRowVersion: 'datasetQualityDetailsFieldsList-version',
datasetQualityDetailsLinkToDiscover: 'datasetQualityDetailsLinkToDiscover',
datasetQualityInsufficientPrivileges: 'datasetQualityInsufficientPrivileges',
datasetQualityNoDataEmptyState: 'datasetQualityNoDataEmptyState',
datasetQualityNoDataEmptyState: 'datasetQualityTableNoData',
datasetQualityNoPrivilegesEmptyState: 'datasetQualityNoPrivilegesEmptyState',
superDatePickerToggleQuickMenuButton: 'superDatePickerToggleQuickMenuButton',