From 9d66fd6e74f8805e2533bf8fadc8db8a4186b91e Mon Sep 17 00:00:00 2001 From: alejandromumo Date: Thu, 24 Oct 2024 16:35:44 +0100 Subject: [PATCH] refactor: moved RequestResults to invenio-search-ui --- .../search/RequestsResults.js | 79 ------------------- .../js/invenio_requests/search/index.js | 1 - 2 files changed, 80 deletions(-) delete mode 100644 invenio_requests/assets/semantic-ui/js/invenio_requests/search/RequestsResults.js diff --git a/invenio_requests/assets/semantic-ui/js/invenio_requests/search/RequestsResults.js b/invenio_requests/assets/semantic-ui/js/invenio_requests/search/RequestsResults.js deleted file mode 100644 index f35170f3..00000000 --- a/invenio_requests/assets/semantic-ui/js/invenio_requests/search/RequestsResults.js +++ /dev/null @@ -1,79 +0,0 @@ -// This file is part of Invenio -// Copyright (C) 2023 CERN. -// -// Invenio is free software; you can redistribute it and/or modify it -// under the terms of the MIT License; see LICENSE file for more details. - -import { InvenioSearchPagination } from "@js/invenio_search_ui/components"; -import { i18next } from "@translations/invenio_requests/i18next"; -import PropTypes from "prop-types"; -import React from "react"; -import { Count, ResultsList, Sort } from "react-searchkit"; -import { Grid, Segment } from "semantic-ui-react"; - -export const RequestsResults = ({ - sortOptions, - paginationOptions, - currentResultsState, -}) => { - const { total } = currentResultsState.data; - - const handleResultsRendered = () => { - window.invenio?.onSearchResultsRendered(); - }; - return ( - total && ( - - - - - - - - ( - <> - {i18next.t("{{count}} results found", { - count: total, - })} - - )} - /> - - - {sortOptions && ( - ( - <> - - {cmp} - - )} - /> - )} - - - - - - - - - - - - - - ) - ); -}; - -RequestsResults.propTypes = { - sortOptions: PropTypes.object.isRequired, - paginationOptions: PropTypes.object.isRequired, - currentResultsState: PropTypes.object.isRequired, -}; diff --git a/invenio_requests/assets/semantic-ui/js/invenio_requests/search/index.js b/invenio_requests/assets/semantic-ui/js/invenio_requests/search/index.js index 023e4108..9432573b 100644 --- a/invenio_requests/assets/semantic-ui/js/invenio_requests/search/index.js +++ b/invenio_requests/assets/semantic-ui/js/invenio_requests/search/index.js @@ -11,5 +11,4 @@ export { RequestsEmptyResults, RequestsEmptyResultsWithState, } from "./RequestsEmptyResults"; -export { RequestsResults } from "./RequestsResults"; export { RequestStatusFilter } from "./RequestStatusFilterComponent";