From 5de52e84d59c59842dd59f8965671a57a877174b Mon Sep 17 00:00:00 2001 From: Chenhui Wang <54903978+wangch079@users.noreply.github.com> Date: Thu, 20 Apr 2023 21:14:42 +0800 Subject: [PATCH] [Enterprise Search] Render indexed_document_volume in MiB (#155250) ## Part of https://github.com/elastic/connectors-python/issues/735 ## Summary The field type for `indexed_document_volume` is `integer`, which can only represent about 2GB worth of "bytes". To be able to support syncing with larger datasets, `indexed_document_volume` is updated to store the size in `MebiBytes`. This PR makes sure the size is rendered correctly in UI. ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --- .../search_index/sync_jobs/documents_panel.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/sync_jobs/documents_panel.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/sync_jobs/documents_panel.tsx index 5323620776026..27b18d48b1743 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/sync_jobs/documents_panel.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/sync_jobs/documents_panel.tsx @@ -45,7 +45,23 @@ export const SyncJobDocumentsPanel: React.FC = (sync name: i18n.translate('xpack.enterpriseSearch.content.index.syncJobs.documents.volume', { defaultMessage: 'Volume', }), - render: (volume: number) => new ByteSizeValue(volume).toString(), + render: (volume: number) => + volume < 1 + ? i18n.translate( + 'xpack.enterpriseSearch.content.index.syncJobs.documents.volume.lessThanOneMBLabel', + { + defaultMessage: 'Less than 1mb', + } + ) + : i18n.translate( + 'xpack.enterpriseSearch.content.index.syncJobs.documents.volume.aboutLabel', + { + defaultMessage: 'About {volume}', + values: { + volume: new ByteSizeValue(volume * 1024 * 1024).toString(), + }, + } + ), }, ]; return (