From e7fc24cee9407829d486347390e1fc5f3e6eb971 Mon Sep 17 00:00:00 2001 From: ducica Date: Sat, 17 Feb 2024 15:11:03 +0100 Subject: [PATCH 1/2] fixed less issues --- .../semantic-ui/js/oarepo_ui/search/ResultCount.jsx | 6 ++++-- .../oarepo_ui/search/SearchappSearchbarElement.jsx | 12 +++++++----- .../less/oarepo_ui/custom-components.less | 6 ++++++ .../themes/default/views/page_header.variables | 2 +- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/search/ResultCount.jsx b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/search/ResultCount.jsx index 7aadeaf1..5905af5d 100644 --- a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/search/ResultCount.jsx +++ b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/search/ResultCount.jsx @@ -14,7 +14,7 @@ export const CountElement = ({ totalResults }) => { }; export const ResultCount = ({ currentResultsState = {} }) => { - const { total } = currentResultsState.data; + const total = currentResultsState?.data?.total; const { loading } = currentResultsState; // determine if we are in searchApp context or pure searchkit const searchAppContext = useContext(SearchConfigurationContext); @@ -34,5 +34,7 @@ export const ResultCount = ({ currentResultsState = {} }) => { CountElement.propTypes = { totalResults: PropTypes.number.isRequired, }; - +ResultCount.propTypes = { + currentResultsState: PropTypes.object, +}; export const ResultCountWithState = withState(ResultCount); diff --git a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/search/SearchappSearchbarElement.jsx b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/search/SearchappSearchbarElement.jsx index 49dc4a06..873be073 100644 --- a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/search/SearchappSearchbarElement.jsx +++ b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/search/SearchappSearchbarElement.jsx @@ -14,8 +14,10 @@ export const SearchappSearchbarElement = withState( currentQueryState, iconName, iconColor, - placeholderText, + placeholder: passedPlaceholder, }) => { + const placeholder = passedPlaceholder || i18next.t("Search"); + const onSearch = () => { updateQueryState({ ...currentQueryState, queryString }); }; @@ -36,8 +38,8 @@ export const SearchappSearchbarElement = withState( "aria-label": i18next.t("Search"), }} fluid - placeholder={placeholderText} - aria-label={placeholderText} + placeholder={placeholder} + aria-label={placeholder} onChange={(event, { value }) => { onInputChange(value); }} @@ -49,7 +51,7 @@ export const SearchappSearchbarElement = withState( ); SearchappSearchbarElement.propTypes = { - placeholderText: PropTypes.string, + placeholder: PropTypes.string, queryString: PropTypes.string, onInputChange: PropTypes.func, updateQueryState: PropTypes.func, @@ -59,7 +61,7 @@ SearchappSearchbarElement.propTypes = { }; SearchappSearchbarElement.defaultProps = { - placeholderText: i18next.t("Search"), + placeholder: i18next.t("Search"), iconName: "search", iconColor: "green", }; diff --git a/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/custom-components.less b/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/custom-components.less index caaa517a..3ba73338 100644 --- a/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/custom-components.less +++ b/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/custom-components.less @@ -5,6 +5,12 @@ */ & { @import "./definitions/datepicker"; +} + +& { @import "./definitions/page_header"; +} + +& { @import "./definitions/page_footer"; } diff --git a/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/themes/default/views/page_header.variables b/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/themes/default/views/page_header.variables index cdaecac3..470b2c11 100644 --- a/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/themes/default/views/page_header.variables +++ b/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/themes/default/views/page_header.variables @@ -6,4 +6,4 @@ @pageHeaderMinHeight: 6rem; @pageHeaderLogoHeight:@pageHeaderMinHeight - 2rem; @borderRadius: 0.3rem; -@pageheaderbottomborder:1px solid black; +@pageHeaderBottomBorder:1px solid black; From 6ef162ebdd33cc4bc8444306f4f52e6bb3714dce Mon Sep 17 00:00:00 2001 From: Miroslav Bauer Date: Mon, 19 Feb 2024 10:07:47 +0100 Subject: [PATCH 2/2] chore(release): :bookmark: release version 5.0.105 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 7e82819e..509dcfc5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = oarepo-ui -version = 5.0.103 +version = 5.0.105 description = UI module for invenio 3.5+ long_description = file: README.md long_description_content_type = text/markdown