From d5beda692759a95dff30f6c664420053585f3db4 Mon Sep 17 00:00:00 2001 From: Carlin MacKenzie Date: Thu, 31 Oct 2024 15:46:12 +0100 Subject: [PATCH] admin: improve files and stats display --- .../records/search/SearchResultItemLayout.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/records/search/SearchResultItemLayout.js b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/records/search/SearchResultItemLayout.js index 109191c93..b237ba213 100644 --- a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/records/search/SearchResultItemLayout.js +++ b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/records/search/SearchResultItemLayout.js @@ -14,7 +14,7 @@ import { RecordActions } from "../RecordActions"; import _truncate from "lodash/truncate"; import PropTypes from "prop-types"; import React, { Component } from "react"; -import { Table, Button } from "semantic-ui-react"; +import { Popup, Table, Button } from "semantic-ui-react"; import { withState } from "react-searchkit"; import { AdminUIRoutes } from "@js/invenio_administration/src/routes"; import { humanReadableBytes, toRelativeTime } from "react-invenio-forms"; @@ -96,7 +96,8 @@ class SearchResultItemComponent extends Component { data-label={i18next.t("Files")} className="word-break-all" > - {humanReadableBytes(result.files.total_bytes)} | #{result.files.count} + {result.files.count} file{result.files.count !== 1 ? "s" : ""}:{" "} + {humanReadableBytes(result.files.total_bytes, true)} - {result?.stats?.all_versions?.unique_views} |{" "} - {result?.stats?.all_versions?.unique_downloads} |{" "} + + {result?.stats?.all_versions?.unique_views ?? 0} |{" "} + {result?.stats?.all_versions?.unique_downloads ?? 0} + + } + />