diff --git a/package.json b/package.json index 480b762c0..ba758c373 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "react-redux": "^7.2.0", "react-router-dom": "^5.1.2", "react-scroll": "^1.7.16", - "react-searchkit": "^1.0.0-alpha.2", + "react-searchkit": "^1.0.0-alpha.3", "react-show-more": "^2.0.0", "react-tagcloud": "^2.0.0", "redux": "^4.0.5", @@ -93,7 +93,7 @@ "react-overridable": "^0.0.2", "react-redux": "^7.2.0", "react-router-dom": "^5.1.2", - "react-searchkit": "^1.0.0-alpha.2", + "react-searchkit": "^1.0.0-alpha.3", "react-scripts": "^3.4.1", "react-scroll": "^1.7.16", "react-show-more": "^2.0.0", diff --git a/src/lib/components/SearchBar/SearchBar.js b/src/lib/components/SearchBar/SearchBar.js index d501dfa1e..ead7f784d 100644 --- a/src/lib/components/SearchBar/SearchBar.js +++ b/src/lib/components/SearchBar/SearchBar.js @@ -42,7 +42,6 @@ class SearchBar extends Component { render() { const { - buttonColor, currentQueryString, executeSearch: parentSearch, onKeyPressHandler, @@ -54,13 +53,13 @@ class SearchBar extends Component { ...otherProps } = this.props; const { currentValue } = this.state; + const searchAction = parentSearch || this.executeSearch; return ( <> - + {text} ); @@ -30,7 +30,7 @@ ClearButton.propTypes = { }; ClearButton.defaultProps = { - text: 'Clear query', + text: 'Clear search', fluid: false, disabled: false, }; diff --git a/src/lib/modules/SearchControls/SearchControlsOverrides.js b/src/lib/modules/SearchControls/SearchControlsOverrides.js index 13d7f6c42..ae1ade8c4 100644 --- a/src/lib/modules/SearchControls/SearchControlsOverrides.js +++ b/src/lib/modules/SearchControls/SearchControlsOverrides.js @@ -1,4 +1,4 @@ -import SearchBar from '@components/SearchBar/SearchBar'; +import { SearchBar } from '@components/SearchBar'; import { MenuBucketAggregationValueElementOverrides } from '@modules/SearchControls/overridden/MenuBucketAggregationElement'; import { AvailableLoanBucketAggregationValues } from './overridden/AvailableLoanBucketAggregationValues'; import { AvailableLoanBucketAggregationElement } from './overridden/AvailableLoanBucketAggregationElement'; diff --git a/src/lib/modules/SearchControls/SearchEmptyResults.js b/src/lib/modules/SearchControls/SearchEmptyResults.js index 9b0d1e403..b3594e5e8 100644 --- a/src/lib/modules/SearchControls/SearchEmptyResults.js +++ b/src/lib/modules/SearchControls/SearchEmptyResults.js @@ -1,22 +1,20 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; -import { Segment } from 'semantic-ui-react'; +import { Header, Segment } from 'semantic-ui-react'; import ClearButton from '@modules/SearchControls/ClearButton'; import { SearchMessage } from '@modules/SearchControls/SearchMessage'; export default class SearchEmptyResults extends Component { render() { const { queryString, resetQuery, extraContent } = this.props; - const currentSearch = `Current search "${queryString}"`; return ( - + {queryString && ( - <> -
{currentSearch}
- - {extraContent} - - + +
{queryString}
+ + {extraContent} +
)}
); diff --git a/src/lib/modules/SearchControls/SearchError.js b/src/lib/modules/SearchControls/SearchError.js index 59be8c99f..251e05c62 100644 --- a/src/lib/modules/SearchControls/SearchError.js +++ b/src/lib/modules/SearchControls/SearchError.js @@ -1,6 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import _get from 'lodash/get'; +import { Header } from 'semantic-ui-react'; import { EmailLink } from '@components/EmailLink'; import { invenioConfig } from '@config'; import { SearchMessage } from '@modules/SearchControls/SearchMessage'; @@ -18,11 +19,13 @@ export const SearchError = ({ error }) => { title="Something went wrong while fetching results." icon="warning" > - Please try again later. If the problem persists,{' '} - - contact the technical support - - . + + Please try again later. If the problem persists,{' '} + + contact the technical support + + . +
); } diff --git a/src/lib/modules/SearchControls/SearchMessage.js b/src/lib/modules/SearchControls/SearchMessage.js index f9869024b..4e750f6b1 100644 --- a/src/lib/modules/SearchControls/SearchMessage.js +++ b/src/lib/modules/SearchControls/SearchMessage.js @@ -8,17 +8,17 @@ export const SearchMessage = ({ title, icon, children }) => ( {icon && } {title} - {children && {children}} + {children} ); SearchMessage.propTypes = { - title: PropTypes.string.isRequired, children: PropTypes.node, icon: PropTypes.string, + title: PropTypes.string.isRequired, }; SearchMessage.defaultProps = { - icon: null, children: null, + icon: null, };