Skip to content

Commit

Permalink
[Dataset quality] removing empty prompt (elastic#192089)
Browse files Browse the repository at this point in the history
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](elastic#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
  • Loading branch information
yngrdyn authored Sep 6, 2024
1 parent ab1646f commit ad7d935
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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}</>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
}
2 changes: 0 additions & 2 deletions x-pack/plugins/translations/translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "データセットを取得できませんでした。",
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "无法获取数据集。",
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/functional/page_objects/dataset_quality.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit ad7d935

Please sign in to comment.