diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 5f5cb38bc..dc1bae75e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -11,11 +11,11 @@ on: - "staging" tags: - release* - pull_request: - branches: - - main - - production - - staging + # pull_request: + # branches: + # - main + # - production + # - staging env: DOCKER_BUILDKIT: 1 diff --git a/README.md b/README.md index 2eb6c8977..0ff1bb972 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Knowledge Commons Works is a collaborative tool for storing and sharing academic research. It is part of Knowledge Commons and is built on an instance of the InvenioRDM repository system. -Version 0.3.4-beta7 +Version 0.3.5-beta8 ## Copyright diff --git a/assets/js/invenio_app_rdm/overridableRegistry/mapping.js b/assets/js/invenio_app_rdm/overridableRegistry/mapping.js index 95fd76b42..9d19d8f04 100644 --- a/assets/js/invenio_app_rdm/overridableRegistry/mapping.js +++ b/assets/js/invenio_app_rdm/overridableRegistry/mapping.js @@ -34,6 +34,7 @@ import { PublisherField } from "./fields/PublisherField"; import { RDMRecordMultipleSearchBarElement } from "./search/RDMRecordMultipleSearchBarElement"; import RecordsResultsListItem from "./search/RecordsResultsListItem"; import { RecordResultsListItemDashboard } from "./search/RecordsResultsListItemDashboard"; +import { RecordSearchBarElement } from "./search/RecordSearchBarElement"; import { RequestMetadata } from "./requests/RequestMetadata"; import { RequestsResultsItemTemplateDashboard } from "./user_dashboard/RequestsResultsItemTemplateDashboard"; import { RequestsResultsItemTemplateWithCommunity } from "./collections/members/requests/RequestsResultsItemTemplate"; @@ -54,6 +55,10 @@ const MobileActionMenu = () => { ); }; +const DashboardSearchBarElementWithConfig = parametrize(RecordSearchBarElement, { + placeholder: "Search my works...", +}); + const SearchAppLayoutWithConfig = parametrize(SearchAppLayout, { appName: "InvenioAppRdm.Search", }); @@ -89,6 +94,7 @@ export const overriddenComponents = { "InvenioAppRdm.DashboardRequests.SearchApp.layout": DashboardRequestsSearchLayoutWithApp, "InvenioAppRdm.DashboardRequests.ResultsList.item": RequestsResultsItemTemplateDashboard, "InvenioAppRdm.DashboardUploads.SearchApp.layout": DashboardUploadsSearchLayout, + "InvenioAppRdm.DashboardUploads.SearchBar.element": DashboardSearchBarElementWithConfig, "InvenioAppRdm.DashboardUploads.ResultsList.item": RecordResultsListItemDashboard, "InvenioAppRdm.Deposit.AccessRightField.container": AccessRightField, "InvenioAppRdm.Deposit.CreatorsField.container": CreatibutorsField, diff --git a/assets/js/invenio_app_rdm/overridableRegistry/search/RDMRecordMultipleSearchBarElement.jsx b/assets/js/invenio_app_rdm/overridableRegistry/search/RDMRecordMultipleSearchBarElement.jsx index d9addef56..a60191763 100644 --- a/assets/js/invenio_app_rdm/overridableRegistry/search/RDMRecordMultipleSearchBarElement.jsx +++ b/assets/js/invenio_app_rdm/overridableRegistry/search/RDMRecordMultipleSearchBarElement.jsx @@ -6,6 +6,8 @@ import {i18next} from "@translations/invenio_app_rdm/i18next"; import { RecordSearchBarElement } from "./RecordSearchBarElement"; import _isEmpty from "lodash/isEmpty"; +// Note: This search bar element is necessary for the unique +// needs of the main works search page. export const RDMRecordMultipleSearchBarElement = ({ queryString, onInputChange }) => { const headerSearchbar = document.getElementById("header-search-bar"); const searchbarOptions = JSON.parse(headerSearchbar.dataset.options); diff --git a/assets/js/invenio_app_rdm/overridableRegistry/search/RecordSearchBarElement.jsx b/assets/js/invenio_app_rdm/overridableRegistry/search/RecordSearchBarElement.jsx index accfe313a..bc0e97d61 100644 --- a/assets/js/invenio_app_rdm/overridableRegistry/search/RecordSearchBarElement.jsx +++ b/assets/js/invenio_app_rdm/overridableRegistry/search/RecordSearchBarElement.jsx @@ -1,23 +1,28 @@ import { i18next } from "@translations/invenio_communities/i18next"; import PropTypes from "prop-types"; -import React from "react"; +import React, { useState } from "react"; import { withState } from "react-searchkit"; import { Input } from "semantic-ui-react"; - export const RecordSearchBarElement = withState( ({ placeholder: passedPlaceholder, queryString, - onInputChange, + // onInputChange, updateQueryState, currentQueryState, + uiProps }) => { const placeholder = passedPlaceholder || i18next.t("Search"); + const [currentValue, setCurrentValue] = useState(queryString || currentQueryState.queryString || ""); + + const onInputChange = (value) => { + setCurrentValue(value); + }; const onSearch = () => { - updateQueryState({ ...currentQueryState, queryString }); + updateQueryState({ ...currentQueryState, queryString: currentValue }); }; const onBtnSearchClick = () => { @@ -28,6 +33,7 @@ export const RecordSearchBarElement = withState( onSearch(); } }; + return ( { onInputChange(value); }} - value={queryString} + value={currentValue} onKeyPress={onKeyPress} + {...uiProps} /> ); } ); + +RecordSearchBarElement.propTypes = { + placeholder: PropTypes.string, + queryString: PropTypes.string, + onInputChange: PropTypes.func, + updateQueryState: PropTypes.func, + currentQueryState: PropTypes.object, +}; diff --git a/assets/js/invenio_app_rdm/overridableRegistry/search/SearchAppLayout.jsx b/assets/js/invenio_app_rdm/overridableRegistry/search/SearchAppLayout.jsx index 9351891f4..47663577a 100644 --- a/assets/js/invenio_app_rdm/overridableRegistry/search/SearchAppLayout.jsx +++ b/assets/js/invenio_app_rdm/overridableRegistry/search/SearchAppLayout.jsx @@ -25,6 +25,7 @@ import { ContribSearchAppFacets } from "@js/invenio_search_ui/components"; import { ResultOptionsWithState, } from "./ResultOptions"; +import { SearchBar } from "@js/invenio_search_ui/components"; import { RecordSearchBarElement } from "./RecordSearchBarElement"; const ContribSearchHelpLinks = (props) => { @@ -71,29 +72,39 @@ const SearchAppLayout = ({ config, appName, help=true, toggle=true }) => { return ( - - - - - - + + + - - - + + {/* invenio_search_ui SearchBar Overridable id: ".SearchApp.searchbar" + and wraps searchkit Searchbar with Overridable id: ".SearchBar.element" */} + + + + + + + + =2.1.0,<3.0.0"]