From 4d07b9a76af0e43340e100db10ad1051c61f3a89 Mon Sep 17 00:00:00 2001 From: laszlocseh Date: Wed, 6 Mar 2024 09:07:44 +0200 Subject: [PATCH 01/21] feat: set isPrint redux state when window.print() is triggered --- src/actions/index.js | 1 + src/components/theme/Banner/View.jsx | 95 ++++++++++++++++++++++++---- src/index.js | 8 ++- 3 files changed, 92 insertions(+), 12 deletions(-) diff --git a/src/actions/index.js b/src/actions/index.js index e27a6e2f..6675505d 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -1 +1,2 @@ export * from './schema'; +export * from './print'; diff --git a/src/components/theme/Banner/View.jsx b/src/components/theme/Banner/View.jsx index 86c40317..4cfc0249 100644 --- a/src/components/theme/Banner/View.jsx +++ b/src/components/theme/Banner/View.jsx @@ -1,11 +1,11 @@ import React, { useCallback, useMemo, useRef } from 'react'; import { Helmet } from '@plone/volto/helpers'; import { compose } from 'redux'; -import { connect } from 'react-redux'; +import { connect, useDispatch } from 'react-redux'; import { withRouter } from 'react-router'; import { defineMessages, injectIntl } from 'react-intl'; import startCase from 'lodash/startCase'; -import { Icon } from 'semantic-ui-react'; +import { Icon, Loader } from 'semantic-ui-react'; import Popup from '@eeacms/volto-eea-design-system/ui/Popup/Popup'; import config from '@plone/volto/registry'; import Banner from '@eeacms/volto-eea-design-system/ui/Banner/Banner'; @@ -14,7 +14,8 @@ import { sharePage, } from '@eeacms/volto-eea-design-system/ui/Banner/Banner'; import Copyright from '@eeacms/volto-eea-design-system/ui/Copyright/Copyright'; - +import { setIsPrint } from '@eeacms/volto-eea-website-theme/actions/print'; +import cx from 'classnames'; import './styles.less'; const messages = defineMessages({ @@ -65,6 +66,7 @@ const Title = ({ config = {}, properties }) => { }; const View = (props) => { + const dispatch = useDispatch(); const { banner = {}, intl } = props; const metadata = props.metadata || props.properties; const popupRef = useRef(null); @@ -164,14 +166,84 @@ const View = (props) => { )} {!hideDownloadButton && ( - { - window.print(); - }} - /> + <> + { + // set tabs to be visible + const tabs = document.getElementsByClassName('ui tab'); + Array.from(tabs).forEach((tab) => { + tab.style.display = 'block'; + }); + + dispatch(setIsPrint(true)); + // display loader + const printLoader = document.getElementById( + 'download-print-loader', + ); + printLoader.style.display = 'flex'; + + // scroll to iframes to make them be in the viewport + // use timeout to wait for load + let timeoutValue = 3000; + setTimeout(() => { + const iframes = document.getElementsByTagName('iframe'); + if (iframes) { + Array.from(iframes).forEach((element, index) => { + setTimeout(() => { + element.scrollIntoView({ + behavior: 'instant', + block: 'nearest', + inline: 'center', + }); + }, timeoutValue); + timeoutValue = timeoutValue + 3000; + }); + } + + timeoutValue = timeoutValue + 1000; + setTimeout(() => { + window.scrollTo({ + top: 0, + }); + Array.from(tabs).forEach((tab) => { + tab.style.display = ''; + }); + printLoader.style.display = 'none'; + dispatch(setIsPrint(false)); + window.print(); + }, timeoutValue); + }, timeoutValue); + }} + /> +
+ +
Preparing download
+
+ )} {rssLinks?.map((rssLink, index) => ( <> @@ -253,6 +325,7 @@ export default compose( connect((state) => { return { types: state.types.types, + isPrint: state.isPrint, }; }), )(View); diff --git a/src/index.js b/src/index.js index 70f82432..dab7f3ac 100644 --- a/src/index.js +++ b/src/index.js @@ -27,7 +27,7 @@ import contentBoxSVG from './icons/content-box.svg'; import okMiddleware from './middleware/ok'; import voltoCustomMiddleware from './middleware/voltoCustom'; import installSlate from './slate'; - +import { print } from './reducers'; import { nanoid } from '@plone/volto-slate/utils'; import { v4 as uuid } from 'uuid'; @@ -534,6 +534,12 @@ const applyConfig = (config) => { }; } + // addonReducers + config.addonReducers = { + ...(config.addonReducers || {}), + print, + }; + // Breadcrumbs config.settings.apiExpanders.push({ match: '', From d995789f337a00455d45b5ec26de9c4c0c898ce6 Mon Sep 17 00:00:00 2001 From: laszlocseh Date: Wed, 6 Mar 2024 09:16:39 +0200 Subject: [PATCH 02/21] add isPrint missing files --- src/actions/print.js | 13 +++++++++++++ src/constants/ActionTypes.js | 6 ++++++ src/reducers/index.js | 1 + src/reducers/print.js | 21 +++++++++++++++++++++ 4 files changed, 41 insertions(+) create mode 100644 src/actions/print.js create mode 100644 src/constants/ActionTypes.js create mode 100644 src/reducers/index.js create mode 100644 src/reducers/print.js diff --git a/src/actions/print.js b/src/actions/print.js new file mode 100644 index 00000000..f293ec5a --- /dev/null +++ b/src/actions/print.js @@ -0,0 +1,13 @@ +/** + * Print action. + * @module actions/print + */ + +import { SET_ISPRINT } from '@eeacms/volto-eea-website-theme/constants/ActionTypes'; + +export const setIsPrint = (data) => { + return { + type: SET_ISPRINT, + payload: data, + }; +}; diff --git a/src/constants/ActionTypes.js b/src/constants/ActionTypes.js new file mode 100644 index 00000000..9d45401a --- /dev/null +++ b/src/constants/ActionTypes.js @@ -0,0 +1,6 @@ +/** + * Action types. + * @module constants/ActionTypes + */ + +export const SET_ISPRINT = 'SET_ISPRINT'; diff --git a/src/reducers/index.js b/src/reducers/index.js new file mode 100644 index 00000000..04527318 --- /dev/null +++ b/src/reducers/index.js @@ -0,0 +1 @@ +export print from './print'; diff --git a/src/reducers/print.js b/src/reducers/print.js new file mode 100644 index 00000000..c4a2a7d0 --- /dev/null +++ b/src/reducers/print.js @@ -0,0 +1,21 @@ +/** + * Print reducer. + * @module reducers/print + */ + +import { SET_ISPRINT } from '@eeacms/volto-eea-website-theme/constants/ActionTypes'; + +const initialState = { + isPrint: false, +}; + +export default function print(state = initialState, action) { + if (action.type === SET_ISPRINT) { + return { + ...state, + isPrint: action.payload, + }; + } else { + return state; + } +} From 752c5629840d906382858f088b97d33147684ca8 Mon Sep 17 00:00:00 2001 From: laszlocseh Date: Wed, 6 Mar 2024 14:47:44 +0200 Subject: [PATCH 03/21] test: add Logo.test.jsx --- src/components/theme/Logo.test.jsx | 32 ++++++++++++++++++++++++++++++ src/index.test.js | 5 +++++ 2 files changed, 37 insertions(+) create mode 100644 src/components/theme/Logo.test.jsx diff --git a/src/components/theme/Logo.test.jsx b/src/components/theme/Logo.test.jsx new file mode 100644 index 00000000..365ec8d2 --- /dev/null +++ b/src/components/theme/Logo.test.jsx @@ -0,0 +1,32 @@ +import React from 'react'; +import { render } from '@testing-library/react'; +import { Provider } from 'react-intl-redux'; +import configureStore from 'redux-mock-store'; +import { Router } from 'react-router-dom'; +import { createMemoryHistory } from 'history'; +import EEALogo from './Logo'; + +const mockStore = configureStore(); +let history = createMemoryHistory(); + +describe('EEALogo Component', () => { + it('renders without crashing', () => { + const store = mockStore({ + intl: { + locale: 'en', + messages: {}, + }, + }); + + const { container } = render( + + + + + , + ); + + expect(container).toBeTruthy(); + expect(container).toHaveProperty(); + }); +}); diff --git a/src/index.test.js b/src/index.test.js index 92ac856c..1758381b 100644 --- a/src/index.test.js +++ b/src/index.test.js @@ -215,6 +215,11 @@ describe('applyConfig', () => { title: 'Horizontal', isDefault: false, }, + { + id: 'accordion', + title: 'Accordion responsive', + isDefault: false, + }, ], }, columnsBlock: {}, From 6d552f89d5aff6e47ef3032d4862a1bcbe364c01 Mon Sep 17 00:00:00 2001 From: laszlocseh Date: Wed, 6 Mar 2024 15:02:32 +0200 Subject: [PATCH 04/21] test: fix in Logo.test.jsx --- src/components/theme/Logo.test.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/theme/Logo.test.jsx b/src/components/theme/Logo.test.jsx index 365ec8d2..c6ac8ee9 100644 --- a/src/components/theme/Logo.test.jsx +++ b/src/components/theme/Logo.test.jsx @@ -27,6 +27,5 @@ describe('EEALogo Component', () => { ); expect(container).toBeTruthy(); - expect(container).toHaveProperty(); }); }); From 2076651820693825b5e20b0a7774307cd78eeb57 Mon Sep 17 00:00:00 2001 From: laszlocseh Date: Wed, 6 Mar 2024 16:27:10 +0200 Subject: [PATCH 05/21] test: added HomePageView.test.jsx and HomePageInverseView.test.jsx --- .../theme/Homepage/HomePageInverseView.test.jsx | 16 ++++++++++++++++ .../theme/Homepage/HomePageView.test.jsx | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 src/components/theme/Homepage/HomePageInverseView.test.jsx create mode 100644 src/components/theme/Homepage/HomePageView.test.jsx diff --git a/src/components/theme/Homepage/HomePageInverseView.test.jsx b/src/components/theme/Homepage/HomePageInverseView.test.jsx new file mode 100644 index 00000000..4200fba8 --- /dev/null +++ b/src/components/theme/Homepage/HomePageInverseView.test.jsx @@ -0,0 +1,16 @@ +import React from 'react'; +import { render } from '@testing-library/react'; +import HomePageInverseView from './HomePageInverseView'; +import '@testing-library/jest-dom/extend-expect'; + +describe('HomePageInverseView Component', () => { + it('renders without crashing', () => { + const mockContent = ( + +
Mock content
+ + ); + const { container } = render(); + expect(container).toBeTruthy(); + }); +}); diff --git a/src/components/theme/Homepage/HomePageView.test.jsx b/src/components/theme/Homepage/HomePageView.test.jsx new file mode 100644 index 00000000..e089081e --- /dev/null +++ b/src/components/theme/Homepage/HomePageView.test.jsx @@ -0,0 +1,16 @@ +import React from 'react'; +import { render } from '@testing-library/react'; +import HomePageView from './HomePageView'; +import '@testing-library/jest-dom/extend-expect'; + +describe('HomePageView Component', () => { + it('renders without crashing', () => { + const mockContent = ( + +
Mock content
+ + ); + const { container } = render(); + expect(container).toBeTruthy(); + }); +}); From c1f2650f0f7ffb27c168399fabcbf69d0299235b Mon Sep 17 00:00:00 2001 From: laszlocseh Date: Thu, 7 Mar 2024 10:27:19 +0200 Subject: [PATCH 06/21] chore: cleanup unused RemoveSchema code --- src/actions/schema.js | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 src/actions/schema.js diff --git a/src/actions/schema.js b/src/actions/schema.js deleted file mode 100644 index 72b0313e..00000000 --- a/src/actions/schema.js +++ /dev/null @@ -1,5 +0,0 @@ -export function removeSchema() { - return { - type: 'REMOVE_SCHEMA', - }; -} From 6d8de0a27dd6bfd5645bb730d2c66f2d4784c158 Mon Sep 17 00:00:00 2001 From: laszlocseh Date: Thu, 7 Mar 2024 10:37:50 +0200 Subject: [PATCH 07/21] chore: cleanup unused RemoveSchema code --- src/actions/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/actions/index.js b/src/actions/index.js index 6675505d..47560feb 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -1,2 +1 @@ -export * from './schema'; export * from './print'; From f7292bb426591f758dcc7bc159b5dbd75b7afb36 Mon Sep 17 00:00:00 2001 From: laszlocseh Date: Thu, 7 Mar 2024 12:45:31 +0200 Subject: [PATCH 08/21] test: added TokenWidget.test.jsx and TopicsWidget.test.jsx --- .../theme/Widgets/TokenWidget.test.jsx | 35 +++++++++++++++++++ .../theme/Widgets/TopicsWidget.test.jsx | 35 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 src/components/theme/Widgets/TokenWidget.test.jsx create mode 100644 src/components/theme/Widgets/TopicsWidget.test.jsx diff --git a/src/components/theme/Widgets/TokenWidget.test.jsx b/src/components/theme/Widgets/TokenWidget.test.jsx new file mode 100644 index 00000000..02b3e76c --- /dev/null +++ b/src/components/theme/Widgets/TokenWidget.test.jsx @@ -0,0 +1,35 @@ +import React from 'react'; +import { render } from '@testing-library/react'; +import { Provider } from 'react-intl-redux'; +import configureStore from 'redux-mock-store'; +import { Router } from 'react-router-dom'; +import { createMemoryHistory } from 'history'; +import { TokenWidget } from './TokenWidget'; + +const mockStore = configureStore(); +let history = createMemoryHistory(); + +describe('TokenWidget Component', () => { + it('renders without crashing', () => { + const store = mockStore({ + intl: { + locale: 'en', + messages: {}, + }, + }); + + const { container } = render( + + + + + , + ); + + expect(container).toBeTruthy(); + }); +}); diff --git a/src/components/theme/Widgets/TopicsWidget.test.jsx b/src/components/theme/Widgets/TopicsWidget.test.jsx new file mode 100644 index 00000000..d4dc2238 --- /dev/null +++ b/src/components/theme/Widgets/TopicsWidget.test.jsx @@ -0,0 +1,35 @@ +import React from 'react'; +import { render } from '@testing-library/react'; +import { Provider } from 'react-intl-redux'; +import configureStore from 'redux-mock-store'; +import { Router } from 'react-router-dom'; +import { createMemoryHistory } from 'history'; +import { TopicsWidget } from './TopicsWidget'; + +const mockStore = configureStore(); +let history = createMemoryHistory(); + +describe('TopicsWidget Component', () => { + it('renders without crashing', () => { + const store = mockStore({ + intl: { + locale: 'en', + messages: {}, + }, + }); + + const { container } = render( + + + + + , + ); + + expect(container).toBeTruthy(); + }); +}); From 1fcc50f1201c6b8a428dc9a2620c2bc4f306a8ab Mon Sep 17 00:00:00 2001 From: EEA Jenkins <@users.noreply.github.com> Date: Thu, 7 Mar 2024 11:01:23 +0000 Subject: [PATCH 09/21] Automated release 1.28.4 --- CHANGELOG.md | 36 ++++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b38b1c41..a5d2ad94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,24 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +### [1.28.4](https://github.com/eea/volto-eea-website-theme/compare/1.28.3...1.28.4) - 7 March 2024 + +#### :rocket: New Features + +- feat: set isPrint redux state when window.print() is triggered [laszlocseh - [`4d07b9a`](https://github.com/eea/volto-eea-website-theme/commit/4d07b9a76af0e43340e100db10ad1051c61f3a89)] + +#### :house: Internal changes + +- chore: cleanup unused RemoveSchema code [laszlocseh - [`6d8de0a`](https://github.com/eea/volto-eea-website-theme/commit/6d8de0a27dd6bfd5645bb730d2c66f2d4784c158)] +- chore: cleanup unused RemoveSchema code [laszlocseh - [`c1f2650`](https://github.com/eea/volto-eea-website-theme/commit/c1f2650f0f7ffb27c168399fabcbf69d0299235b)] + +#### :hammer_and_wrench: Others + +- test: added TokenWidget.test.jsx and TopicsWidget.test.jsx [laszlocseh - [`f7292bb`](https://github.com/eea/volto-eea-website-theme/commit/f7292bb426591f758dcc7bc159b5dbd75b7afb36)] +- test: added HomePageView.test.jsx and HomePageInverseView.test.jsx [laszlocseh - [`2076651`](https://github.com/eea/volto-eea-website-theme/commit/2076651820693825b5e20b0a7774307cd78eeb57)] +- test: fix in Logo.test.jsx [laszlocseh - [`6d552f8`](https://github.com/eea/volto-eea-website-theme/commit/6d552f89d5aff6e47ef3032d4862a1bcbe364c01)] +- test: add Logo.test.jsx [laszlocseh - [`752c562`](https://github.com/eea/volto-eea-website-theme/commit/752c5629840d906382858f088b97d33147684ca8)] +- add isPrint missing files [laszlocseh - [`d995789`](https://github.com/eea/volto-eea-website-theme/commit/d995789f337a00455d45b5ec26de9c4c0c898ce6)] ### [1.28.3](https://github.com/eea/volto-eea-website-theme/compare/1.28.2...1.28.3) - 5 March 2024 #### :bug: Bug Fixes @@ -45,6 +63,8 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - bump version [Razvan - [`721e939`](https://github.com/eea/volto-eea-website-theme/commit/721e939d12e324b459ebfa78a2e656ee7142a3d6)] - merge master into this branch [Razvan - [`586c8f9`](https://github.com/eea/volto-eea-website-theme/commit/586c8f910bac55a043bd8dda60e9444bd2ae1663)] +- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`fd90044`](https://github.com/eea/volto-eea-website-theme/commit/fd9004442a9d1d465f7601ecdefe3e23c61e6a9c)] +- Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`4bc3dd3`](https://github.com/eea/volto-eea-website-theme/commit/4bc3dd3ae412a66befd04b5b80fab3716c929240)] - test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`c4dbd28`](https://github.com/eea/volto-eea-website-theme/commit/c4dbd289358205bc2d849aab7edb11ccf3b89cee)] - fix tests [Razvan - [`042330b`](https://github.com/eea/volto-eea-website-theme/commit/042330bc97d32ffe7ba769b4f2453f71cffed706)] - remove RemoveSchema logic [Razvan - [`08d10f8`](https://github.com/eea/volto-eea-website-theme/commit/08d10f8bf6f75478260e4e4c66d7316ba87b907a)] @@ -139,6 +159,11 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - test: Add real image to cypress test [Alin Voinea - [`4ff591a`](https://github.com/eea/volto-eea-website-theme/commit/4ff591ae3318c9588b4e2114582c0fa6cfdf31ae)] - test: Add cypress tests for Image block styling position and align [Alin Voinea - [`7341ef7`](https://github.com/eea/volto-eea-website-theme/commit/7341ef7b92714fc0cc3ab0c31c39033e7b3e19e7)] - Revert "change(tests): commented out rss test since title block config is missing" [Alin Voinea - [`fb61191`](https://github.com/eea/volto-eea-website-theme/commit/fb611918d6ca380b89b594f283dcf9f685a4b294)] +- test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`6a3be30`](https://github.com/eea/volto-eea-website-theme/commit/6a3be3092589411af7808a235f76de5222fd3868)] +- test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`c3978f2`](https://github.com/eea/volto-eea-website-theme/commit/c3978f23375ef066e9fd6f6c2e34ba6c1c058f69)] +- test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`f672779`](https://github.com/eea/volto-eea-website-theme/commit/f672779e845bec9240ccc901e9f53ec80c5a1819)] +- test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`ae5d8e3`](https://github.com/eea/volto-eea-website-theme/commit/ae5d8e3f4e04dc2808d47ce2ee886e1b23b528da)] +- test: [JENKINS] Improve cypress time [valentinab25 - [`170ff0c`](https://github.com/eea/volto-eea-website-theme/commit/170ff0c8e3b30e69479bdf1117e811fea94f1027)] ### [1.23.0](https://github.com/eea/volto-eea-website-theme/compare/1.22.1...1.23.0) - 2 November 2023 #### :rocket: New Features @@ -151,6 +176,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :house: Internal changes +- chore: [JENKINS] Refactor automated testing [valentinab25 - [`f28fce3`](https://github.com/eea/volto-eea-website-theme/commit/f28fce3d1eb815f95fb9aa40de42b10b7e8e30c5)] - chore: husky, lint-staged use fixed versions [valentinab25 - [`6d15088`](https://github.com/eea/volto-eea-website-theme/commit/6d150886c5aeb2ca0b569270486e60f7cc274e2c)] - chore:volto 16 in tests, update docs, fix stylelint overrides [valentinab25 - [`20c0323`](https://github.com/eea/volto-eea-website-theme/commit/20c032380b33c0077c869a05136f93e2fb68e5d4)] @@ -336,6 +362,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :house: Internal changes +- chore: [JENKINS] Deprecate circularity website [valentinab25 - [`370dcbf`](https://github.com/eea/volto-eea-website-theme/commit/370dcbfbf1a8135ce7b1b3b271b004552a631837)] #### :hammer_and_wrench: Others @@ -491,6 +518,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others +- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`6c5e2f8`](https://github.com/eea/volto-eea-website-theme/commit/6c5e2f80456e2061d9e9c15fd0a0b91b9ac70568)] ### [1.9.1](https://github.com/eea/volto-eea-website-theme/compare/1.9.0...1.9.1) - 28 February 2023 #### :bug: Bug Fixes @@ -637,6 +665,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - For some reasons types is a string [Alin Voinea - [`3769a09`](https://github.com/eea/volto-eea-website-theme/commit/3769a0981181d5b633f3498daebbe96be8b4b833)] - Fix(redirect): o.filter - refs #157627 [Alin Voinea - [`deb23da`](https://github.com/eea/volto-eea-website-theme/commit/deb23da846444cc96539697fd798429ae0abe89e)] +- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`f1fffc5`](https://github.com/eea/volto-eea-website-theme/commit/f1fffc5db96725440863d545580b4e76cce4b796)] ### [1.5.0](https://github.com/eea/volto-eea-website-theme/compare/1.4.2...1.5.0) - 9 January 2023 #### :hammer_and_wrench: Others @@ -670,6 +699,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Release 1.4.0 [Alin Voinea - [`bd42a0d`](https://github.com/eea/volto-eea-website-theme/commit/bd42a0d26e928cac5d99933194755da3db06b341)] - bump version to use as volto-eea-design-system [David Ichim - [`f4be047`](https://github.com/eea/volto-eea-website-theme/commit/f4be047328b46399b03b612d378b18aaf82e7dc1)] +- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`9b7cfef`](https://github.com/eea/volto-eea-website-theme/commit/9b7cfefb4d34fc1c948015e491feb370f9795bd8)] - test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`df252a9`](https://github.com/eea/volto-eea-website-theme/commit/df252a9bfed0bb86cadf53c59dd1603b1e2cd822)] ### [1.3.2](https://github.com/eea/volto-eea-website-theme/compare/1.3.1...1.3.2) - 16 December 2022 @@ -679,6 +709,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others +- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`a43c658`](https://github.com/eea/volto-eea-website-theme/commit/a43c658a7920c8df95e763b9a637f38ce77eba2c)] - Better razzle.config [Tiberiu Ichim - [`81dbf48`](https://github.com/eea/volto-eea-website-theme/commit/81dbf48815fb27facb4f82c9b764540fdf188b2e)] - Better razzle.config [Tiberiu Ichim - [`7bc9da2`](https://github.com/eea/volto-eea-website-theme/commit/7bc9da2cd837ab62a95cd29979cdd9b0055b7d67)] ### [1.3.1](https://github.com/eea/volto-eea-website-theme/compare/1.3.0...1.3.1) - 28 November 2022 @@ -689,6 +720,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others +- yarn 3 [Alin Voinea - [`ea7a709`](https://github.com/eea/volto-eea-website-theme/commit/ea7a7094945312776e9b6f44e371178603e92139)] ### [1.3.0](https://github.com/eea/volto-eea-website-theme/compare/1.2.0...1.3.0) - 22 November 2022 #### :rocket: New Features @@ -729,6 +761,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Add subsite class to body [Tiberiu Ichim - [`74d700f`](https://github.com/eea/volto-eea-website-theme/commit/74d700fbfd6249a8604762a7e4e49cce857db0f3)] - Add subsite info to header [Tiberiu Ichim - [`47daf8b`](https://github.com/eea/volto-eea-website-theme/commit/47daf8bb6374a1222040626b19d4154df7ba1b83)] - fix eslint [Miu Razvan - [`eb8d0a7`](https://github.com/eea/volto-eea-website-theme/commit/eb8d0a790bc70c0aae256c6ff35f63c4885f338e)] +- Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`cc578a4`](https://github.com/eea/volto-eea-website-theme/commit/cc578a413b205a8e61e091fab3a88f94cedefc89)] ### [1.1.0](https://github.com/eea/volto-eea-website-theme/compare/1.0.0...1.1.0) - 28 October 2022 #### :nail_care: Enhancements @@ -776,6 +809,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others +- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`33b56ac`](https://github.com/eea/volto-eea-website-theme/commit/33b56acb13fbaf0c5b79e8fc6e13c4b699c79c90)] ### [0.7.3](https://github.com/eea/volto-eea-website-theme/compare/0.7.2...0.7.3) - 22 September 2022 #### :hammer_and_wrench: Others @@ -1043,6 +1077,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Header refactor, add custom logo #5 [ichim-david - [`4950235`](https://github.com/eea/volto-eea-website-theme/commit/49502358105437cfeac3b144e6d301cb59aa2346)] - Update footer.config with new publication card component [ichim-david - [`2e38e9a`](https://github.com/eea/volto-eea-website-theme/commit/2e38e9a417f835009d60c80d4eb4b30229f55e45)] - feature(breadcrumbs): implement eea-design-system breadcrumb as Volto component #32 #7 [ichim-david - [`181af41`](https://github.com/eea/volto-eea-website-theme/commit/181af4125ce2b9ddac56dab4723cb11c26633221)] +- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`da8ceb6`](https://github.com/eea/volto-eea-website-theme/commit/da8ceb68ea68bfbc9504e48ccd4d68277f11ab9a)] - use breadcrumbs from eea-design-system [nileshgulia1 - [`db2f9e9`](https://github.com/eea/volto-eea-website-theme/commit/db2f9e9a4327420a3cce9a9903cd88549b129eab)] - Update theme.config [ichim-david - [`8eca4f4`](https://github.com/eea/volto-eea-website-theme/commit/8eca4f40397a4aeca6d39029c92db78968d37064)] - Added keyContent component to theme.config [ichim-david - [`d86f202`](https://github.com/eea/volto-eea-website-theme/commit/d86f202d0274d839487a88b51cae9a0e899beb23)] @@ -1084,4 +1119,5 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others +- yarn bootstrap [Alin Voinea - [`6995e9e`](https://github.com/eea/volto-eea-website-theme/commit/6995e9e091f21fdbbdffa8a44fc0e2c626f6d46a)] - Initial commit [Alin Voinea - [`6a9c03a`](https://github.com/eea/volto-eea-website-theme/commit/6a9c03a7cebe71ca87e82cf58c42904063e9d8d3)] diff --git a/package.json b/package.json index cb93e2e9..5ba8c1be 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eeacms/volto-eea-website-theme", - "version": "1.28.3", + "version": "1.28.4", "description": "@eeacms/volto-eea-website-theme: Volto add-on", "main": "src/index.js", "author": "European Environment Agency: IDM2 A-Team", From 7bc8eabd4b0462fc5afc07ed131d074af642cc89 Mon Sep 17 00:00:00 2001 From: Claudia Ifrim Date: Thu, 7 Mar 2024 14:22:42 +0200 Subject: [PATCH 10/21] Bump version to 1.29.0 from 1.28.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5ba8c1be..0da207b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eeacms/volto-eea-website-theme", - "version": "1.28.4", + "version": "1.29.0", "description": "@eeacms/volto-eea-website-theme: Volto add-on", "main": "src/index.js", "author": "European Environment Agency: IDM2 A-Team", From 7b2d986e4aaefd35f0a03ea7721a24f7b24a7358 Mon Sep 17 00:00:00 2001 From: EEA Jenkins <@users.noreply.github.com> Date: Thu, 7 Mar 2024 12:33:22 +0000 Subject: [PATCH 11/21] Automated release 1.29.0 --- CHANGELOG.md | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5d2ad94..f473c354 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). -### [1.28.4](https://github.com/eea/volto-eea-website-theme/compare/1.28.3...1.28.4) - 7 March 2024 +### [1.29.0](https://github.com/eea/volto-eea-website-theme/compare/1.28.3...1.29.0) - 7 March 2024 #### :rocket: New Features @@ -17,6 +17,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others +- Bump version to 1.29.0 from 1.28.4 [Claudia Ifrim - [`7bc8eab`](https://github.com/eea/volto-eea-website-theme/commit/7bc8eabd4b0462fc5afc07ed131d074af642cc89)] - test: added TokenWidget.test.jsx and TopicsWidget.test.jsx [laszlocseh - [`f7292bb`](https://github.com/eea/volto-eea-website-theme/commit/f7292bb426591f758dcc7bc159b5dbd75b7afb36)] - test: added HomePageView.test.jsx and HomePageInverseView.test.jsx [laszlocseh - [`2076651`](https://github.com/eea/volto-eea-website-theme/commit/2076651820693825b5e20b0a7774307cd78eeb57)] - test: fix in Logo.test.jsx [laszlocseh - [`6d552f8`](https://github.com/eea/volto-eea-website-theme/commit/6d552f89d5aff6e47ef3032d4862a1bcbe364c01)] @@ -63,8 +64,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - bump version [Razvan - [`721e939`](https://github.com/eea/volto-eea-website-theme/commit/721e939d12e324b459ebfa78a2e656ee7142a3d6)] - merge master into this branch [Razvan - [`586c8f9`](https://github.com/eea/volto-eea-website-theme/commit/586c8f910bac55a043bd8dda60e9444bd2ae1663)] -- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`fd90044`](https://github.com/eea/volto-eea-website-theme/commit/fd9004442a9d1d465f7601ecdefe3e23c61e6a9c)] -- Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`4bc3dd3`](https://github.com/eea/volto-eea-website-theme/commit/4bc3dd3ae412a66befd04b5b80fab3716c929240)] - test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`c4dbd28`](https://github.com/eea/volto-eea-website-theme/commit/c4dbd289358205bc2d849aab7edb11ccf3b89cee)] - fix tests [Razvan - [`042330b`](https://github.com/eea/volto-eea-website-theme/commit/042330bc97d32ffe7ba769b4f2453f71cffed706)] - remove RemoveSchema logic [Razvan - [`08d10f8`](https://github.com/eea/volto-eea-website-theme/commit/08d10f8bf6f75478260e4e4c66d7316ba87b907a)] @@ -159,11 +158,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - test: Add real image to cypress test [Alin Voinea - [`4ff591a`](https://github.com/eea/volto-eea-website-theme/commit/4ff591ae3318c9588b4e2114582c0fa6cfdf31ae)] - test: Add cypress tests for Image block styling position and align [Alin Voinea - [`7341ef7`](https://github.com/eea/volto-eea-website-theme/commit/7341ef7b92714fc0cc3ab0c31c39033e7b3e19e7)] - Revert "change(tests): commented out rss test since title block config is missing" [Alin Voinea - [`fb61191`](https://github.com/eea/volto-eea-website-theme/commit/fb611918d6ca380b89b594f283dcf9f685a4b294)] -- test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`6a3be30`](https://github.com/eea/volto-eea-website-theme/commit/6a3be3092589411af7808a235f76de5222fd3868)] -- test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`c3978f2`](https://github.com/eea/volto-eea-website-theme/commit/c3978f23375ef066e9fd6f6c2e34ba6c1c058f69)] -- test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`f672779`](https://github.com/eea/volto-eea-website-theme/commit/f672779e845bec9240ccc901e9f53ec80c5a1819)] -- test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`ae5d8e3`](https://github.com/eea/volto-eea-website-theme/commit/ae5d8e3f4e04dc2808d47ce2ee886e1b23b528da)] -- test: [JENKINS] Improve cypress time [valentinab25 - [`170ff0c`](https://github.com/eea/volto-eea-website-theme/commit/170ff0c8e3b30e69479bdf1117e811fea94f1027)] ### [1.23.0](https://github.com/eea/volto-eea-website-theme/compare/1.22.1...1.23.0) - 2 November 2023 #### :rocket: New Features @@ -176,7 +170,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :house: Internal changes -- chore: [JENKINS] Refactor automated testing [valentinab25 - [`f28fce3`](https://github.com/eea/volto-eea-website-theme/commit/f28fce3d1eb815f95fb9aa40de42b10b7e8e30c5)] - chore: husky, lint-staged use fixed versions [valentinab25 - [`6d15088`](https://github.com/eea/volto-eea-website-theme/commit/6d150886c5aeb2ca0b569270486e60f7cc274e2c)] - chore:volto 16 in tests, update docs, fix stylelint overrides [valentinab25 - [`20c0323`](https://github.com/eea/volto-eea-website-theme/commit/20c032380b33c0077c869a05136f93e2fb68e5d4)] @@ -362,7 +355,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :house: Internal changes -- chore: [JENKINS] Deprecate circularity website [valentinab25 - [`370dcbf`](https://github.com/eea/volto-eea-website-theme/commit/370dcbfbf1a8135ce7b1b3b271b004552a631837)] #### :hammer_and_wrench: Others @@ -518,7 +510,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others -- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`6c5e2f8`](https://github.com/eea/volto-eea-website-theme/commit/6c5e2f80456e2061d9e9c15fd0a0b91b9ac70568)] ### [1.9.1](https://github.com/eea/volto-eea-website-theme/compare/1.9.0...1.9.1) - 28 February 2023 #### :bug: Bug Fixes @@ -665,7 +656,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - For some reasons types is a string [Alin Voinea - [`3769a09`](https://github.com/eea/volto-eea-website-theme/commit/3769a0981181d5b633f3498daebbe96be8b4b833)] - Fix(redirect): o.filter - refs #157627 [Alin Voinea - [`deb23da`](https://github.com/eea/volto-eea-website-theme/commit/deb23da846444cc96539697fd798429ae0abe89e)] -- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`f1fffc5`](https://github.com/eea/volto-eea-website-theme/commit/f1fffc5db96725440863d545580b4e76cce4b796)] ### [1.5.0](https://github.com/eea/volto-eea-website-theme/compare/1.4.2...1.5.0) - 9 January 2023 #### :hammer_and_wrench: Others @@ -699,7 +689,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Release 1.4.0 [Alin Voinea - [`bd42a0d`](https://github.com/eea/volto-eea-website-theme/commit/bd42a0d26e928cac5d99933194755da3db06b341)] - bump version to use as volto-eea-design-system [David Ichim - [`f4be047`](https://github.com/eea/volto-eea-website-theme/commit/f4be047328b46399b03b612d378b18aaf82e7dc1)] -- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`9b7cfef`](https://github.com/eea/volto-eea-website-theme/commit/9b7cfefb4d34fc1c948015e491feb370f9795bd8)] - test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`df252a9`](https://github.com/eea/volto-eea-website-theme/commit/df252a9bfed0bb86cadf53c59dd1603b1e2cd822)] ### [1.3.2](https://github.com/eea/volto-eea-website-theme/compare/1.3.1...1.3.2) - 16 December 2022 @@ -709,7 +698,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others -- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`a43c658`](https://github.com/eea/volto-eea-website-theme/commit/a43c658a7920c8df95e763b9a637f38ce77eba2c)] - Better razzle.config [Tiberiu Ichim - [`81dbf48`](https://github.com/eea/volto-eea-website-theme/commit/81dbf48815fb27facb4f82c9b764540fdf188b2e)] - Better razzle.config [Tiberiu Ichim - [`7bc9da2`](https://github.com/eea/volto-eea-website-theme/commit/7bc9da2cd837ab62a95cd29979cdd9b0055b7d67)] ### [1.3.1](https://github.com/eea/volto-eea-website-theme/compare/1.3.0...1.3.1) - 28 November 2022 @@ -720,7 +708,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others -- yarn 3 [Alin Voinea - [`ea7a709`](https://github.com/eea/volto-eea-website-theme/commit/ea7a7094945312776e9b6f44e371178603e92139)] ### [1.3.0](https://github.com/eea/volto-eea-website-theme/compare/1.2.0...1.3.0) - 22 November 2022 #### :rocket: New Features @@ -761,7 +748,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Add subsite class to body [Tiberiu Ichim - [`74d700f`](https://github.com/eea/volto-eea-website-theme/commit/74d700fbfd6249a8604762a7e4e49cce857db0f3)] - Add subsite info to header [Tiberiu Ichim - [`47daf8b`](https://github.com/eea/volto-eea-website-theme/commit/47daf8bb6374a1222040626b19d4154df7ba1b83)] - fix eslint [Miu Razvan - [`eb8d0a7`](https://github.com/eea/volto-eea-website-theme/commit/eb8d0a790bc70c0aae256c6ff35f63c4885f338e)] -- Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`cc578a4`](https://github.com/eea/volto-eea-website-theme/commit/cc578a413b205a8e61e091fab3a88f94cedefc89)] ### [1.1.0](https://github.com/eea/volto-eea-website-theme/compare/1.0.0...1.1.0) - 28 October 2022 #### :nail_care: Enhancements @@ -809,7 +795,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others -- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`33b56ac`](https://github.com/eea/volto-eea-website-theme/commit/33b56acb13fbaf0c5b79e8fc6e13c4b699c79c90)] ### [0.7.3](https://github.com/eea/volto-eea-website-theme/compare/0.7.2...0.7.3) - 22 September 2022 #### :hammer_and_wrench: Others @@ -1077,7 +1062,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Header refactor, add custom logo #5 [ichim-david - [`4950235`](https://github.com/eea/volto-eea-website-theme/commit/49502358105437cfeac3b144e6d301cb59aa2346)] - Update footer.config with new publication card component [ichim-david - [`2e38e9a`](https://github.com/eea/volto-eea-website-theme/commit/2e38e9a417f835009d60c80d4eb4b30229f55e45)] - feature(breadcrumbs): implement eea-design-system breadcrumb as Volto component #32 #7 [ichim-david - [`181af41`](https://github.com/eea/volto-eea-website-theme/commit/181af4125ce2b9ddac56dab4723cb11c26633221)] -- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`da8ceb6`](https://github.com/eea/volto-eea-website-theme/commit/da8ceb68ea68bfbc9504e48ccd4d68277f11ab9a)] - use breadcrumbs from eea-design-system [nileshgulia1 - [`db2f9e9`](https://github.com/eea/volto-eea-website-theme/commit/db2f9e9a4327420a3cce9a9903cd88549b129eab)] - Update theme.config [ichim-david - [`8eca4f4`](https://github.com/eea/volto-eea-website-theme/commit/8eca4f40397a4aeca6d39029c92db78968d37064)] - Added keyContent component to theme.config [ichim-david - [`d86f202`](https://github.com/eea/volto-eea-website-theme/commit/d86f202d0274d839487a88b51cae9a0e899beb23)] @@ -1119,5 +1103,4 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others -- yarn bootstrap [Alin Voinea - [`6995e9e`](https://github.com/eea/volto-eea-website-theme/commit/6995e9e091f21fdbbdffa8a44fc0e2c626f6d46a)] - Initial commit [Alin Voinea - [`6a9c03a`](https://github.com/eea/volto-eea-website-theme/commit/6a9c03a7cebe71ca87e82cf58c42904063e9d8d3)] From 808d7e9ef406f38e008a718fd4883fe735c296de Mon Sep 17 00:00:00 2001 From: laszlocseh Date: Thu, 7 Mar 2024 15:57:04 +0200 Subject: [PATCH 12/21] fix: smaller timeout in window.print --- src/components/theme/Banner/View.jsx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/components/theme/Banner/View.jsx b/src/components/theme/Banner/View.jsx index 4cfc0249..63d0153d 100644 --- a/src/components/theme/Banner/View.jsx +++ b/src/components/theme/Banner/View.jsx @@ -185,12 +185,23 @@ const View = (props) => { ); printLoader.style.display = 'flex'; + let timeoutValue = 1000; + // if we have plotlycharts increase timeout + setTimeout(() => { + const plotlyCharts = document.getElementsByClassName( + 'visualization-wrapper', + ); + if (plotlyCharts.length > 0) { + timeoutValue = timeoutValue + 1000; + } + }, timeoutValue); + // scroll to iframes to make them be in the viewport // use timeout to wait for load - let timeoutValue = 3000; setTimeout(() => { const iframes = document.getElementsByTagName('iframe'); - if (iframes) { + if (iframes.length > 0) { + timeoutValue = timeoutValue + 2000; Array.from(iframes).forEach((element, index) => { setTimeout(() => { element.scrollIntoView({ @@ -201,9 +212,9 @@ const View = (props) => { }, timeoutValue); timeoutValue = timeoutValue + 3000; }); + timeoutValue = timeoutValue + 1000; } - timeoutValue = timeoutValue + 1000; setTimeout(() => { window.scrollTo({ top: 0, From dd154bb520237f458be563280cac1545eb381bdf Mon Sep 17 00:00:00 2001 From: laszlocseh Date: Thu, 7 Mar 2024 16:18:18 +0200 Subject: [PATCH 13/21] test: TokenWidget.test.jsx and TopicsWidget.test.jsx cover more conditions --- .../theme/Widgets/TokenWidget.test.jsx | 19 +++++++++++++++++ .../theme/Widgets/TopicsWidget.test.jsx | 21 ++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/src/components/theme/Widgets/TokenWidget.test.jsx b/src/components/theme/Widgets/TokenWidget.test.jsx index 02b3e76c..d7e6ee54 100644 --- a/src/components/theme/Widgets/TokenWidget.test.jsx +++ b/src/components/theme/Widgets/TokenWidget.test.jsx @@ -32,4 +32,23 @@ describe('TokenWidget Component', () => { expect(container).toBeTruthy(); }); + + it('renders without crashing, without value', () => { + const store = mockStore({ + intl: { + locale: 'en', + messages: {}, + }, + }); + + const { container } = render( + + + + + , + ); + + expect(container).toBeTruthy(); + }); }); diff --git a/src/components/theme/Widgets/TopicsWidget.test.jsx b/src/components/theme/Widgets/TopicsWidget.test.jsx index d4dc2238..478de267 100644 --- a/src/components/theme/Widgets/TopicsWidget.test.jsx +++ b/src/components/theme/Widgets/TopicsWidget.test.jsx @@ -10,7 +10,7 @@ const mockStore = configureStore(); let history = createMemoryHistory(); describe('TopicsWidget Component', () => { - it('renders without crashing', () => { + it('renders without crashing, with value', () => { const store = mockStore({ intl: { locale: 'en', @@ -32,4 +32,23 @@ describe('TopicsWidget Component', () => { expect(container).toBeTruthy(); }); + + it('renders without crashing, without value', () => { + const store = mockStore({ + intl: { + locale: 'en', + messages: {}, + }, + }); + + const { container } = render( + + + + + , + ); + + expect(container).toBeTruthy(); + }); }); From 4fd6e676e31eb03bbab9960ffaed7832134ebbe0 Mon Sep 17 00:00:00 2001 From: EEA Jenkins <@users.noreply.github.com> Date: Thu, 7 Mar 2024 14:29:33 +0000 Subject: [PATCH 14/21] Automated release 1.29.0 --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f473c354..8aea8f5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat: set isPrint redux state when window.print() is triggered [laszlocseh - [`4d07b9a`](https://github.com/eea/volto-eea-website-theme/commit/4d07b9a76af0e43340e100db10ad1051c61f3a89)] +#### :bug: Bug Fixes + +- fix: smaller timeout in window.print [laszlocseh - [`808d7e9`](https://github.com/eea/volto-eea-website-theme/commit/808d7e9ef406f38e008a718fd4883fe735c296de)] + #### :house: Internal changes - chore: cleanup unused RemoveSchema code [laszlocseh - [`6d8de0a`](https://github.com/eea/volto-eea-website-theme/commit/6d8de0a27dd6bfd5645bb730d2c66f2d4784c158)] @@ -17,6 +21,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others +- test: TokenWidget.test.jsx and TopicsWidget.test.jsx cover more conditions [laszlocseh - [`dd154bb`](https://github.com/eea/volto-eea-website-theme/commit/dd154bb520237f458be563280cac1545eb381bdf)] - Bump version to 1.29.0 from 1.28.4 [Claudia Ifrim - [`7bc8eab`](https://github.com/eea/volto-eea-website-theme/commit/7bc8eabd4b0462fc5afc07ed131d074af642cc89)] - test: added TokenWidget.test.jsx and TopicsWidget.test.jsx [laszlocseh - [`f7292bb`](https://github.com/eea/volto-eea-website-theme/commit/f7292bb426591f758dcc7bc159b5dbd75b7afb36)] - test: added HomePageView.test.jsx and HomePageInverseView.test.jsx [laszlocseh - [`2076651`](https://github.com/eea/volto-eea-website-theme/commit/2076651820693825b5e20b0a7774307cd78eeb57)] From 43b09cc875516c221cdfe13f84cd52d1aa0559b2 Mon Sep 17 00:00:00 2001 From: Teodor Voicu <104510089+tedw87@users.noreply.github.com> Date: Thu, 7 Mar 2024 19:59:36 +0200 Subject: [PATCH 15/21] fix: remove noreferrer for seo purposes (#203) * fix: remove noreferrer for seo purposes * remove noreferrer * change ESlint rule * Delete src/customizations/volto/components/theme/Navigation directory We don't use this logic as such there is no point in having a customization of something we don't use --------- Co-authored-by: ichim-david --- .eslintrc.js | 7 +- .../theme/EventDetails/EventDetails.jsx | 154 ++++++++++++++++++ 2 files changed, 155 insertions(+), 6 deletions(-) create mode 100644 src/customizations/volto/components/theme/EventDetails/EventDetails.jsx diff --git a/.eslintrc.js b/.eslintrc.js index 52469170..dfca4d93 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -48,12 +48,7 @@ const defaultConfig = { }, }, rules: { - 'react/jsx-no-target-blank': [ - 'error', - { - allowReferrer: true, - }, - ], + 'react/jsx-no-target-blank': 'off', }, }; diff --git a/src/customizations/volto/components/theme/EventDetails/EventDetails.jsx b/src/customizations/volto/components/theme/EventDetails/EventDetails.jsx new file mode 100644 index 00000000..4cff18e1 --- /dev/null +++ b/src/customizations/volto/components/theme/EventDetails/EventDetails.jsx @@ -0,0 +1,154 @@ +import React from 'react'; +import { defineMessages, useIntl } from 'react-intl'; +import { Segment, Header, List } from 'semantic-ui-react'; +import { + When, + Recurrence, +} from '@plone/volto/components/theme/View/EventDatesInfo'; +import { Icon } from '@plone/volto/components'; +import { expandToBackendURL } from '@plone/volto/helpers'; + +import calendarSVG from '@plone/volto/icons/calendar.svg'; + +const messages = defineMessages({ + what: { + id: 'event_what', + defaultMessage: 'What', + }, + when: { + id: 'event_when', + defaultMessage: 'When', + }, + allDates: { + id: 'event_alldates', + defaultMessage: 'All dates', + }, + downloadEvent: { + id: 'Download Event', + defaultMessage: 'Download Event', + }, + where: { + id: 'event_where', + defaultMessage: 'Where', + }, + contactName: { + id: 'event_contactname', + defaultMessage: 'Contact Name', + }, + contactPhone: { + id: 'event_contactphone', + defaultMessage: 'Contact Phone', + }, + attendees: { + id: 'event_attendees', + defaultMessage: 'Attendees', + }, + website: { + id: 'event_website', + defaultMessage: 'Website', + }, + visitWebsite: { + id: 'visit_external_website', + defaultMessage: 'Visit external website', + }, +}); + +const EventDetails = ({ content, display_as = 'aside' }) => { + const intl = useIntl(); + return ( + + {content.subjects?.length > 0 && ( + <> +
+ {intl.formatMessage(messages.what)} +
+ + + )} +
+ {intl.formatMessage(messages.when)} +
+ + {content.recurrence && ( + <> +
+ {intl.formatMessage(messages.allDates)} +
+ + + )} + {content.location && ( + <> +
+ {intl.formatMessage(messages.where)} +
+

{content.location}

+ + )} + {content.contact_name && ( + <> +
+ {intl.formatMessage(messages.contactName)} +
+

+ {content.contact_email ? ( + + {content.contact_name} + + ) : ( + content.contact_name + )} +

+ + )} + {content.contact_phone && ( + <> +
+ {intl.formatMessage(messages.contactPhone)} +
+

{content.contact_phone}

+ + )} + {content.attendees?.length > 0 && ( + <> +
+ {intl.formatMessage(messages.attendees)} +
+ + + )} + {content.event_url && ( + <> +
+ {intl.formatMessage(messages.website)} +
+

+ + {intl.formatMessage(messages.visitWebsite)} + +

+ + )} + +
+ ); +}; + +export default EventDetails; From 2a670db0a9bcb741ea24ea3ac98ba7267b6a83e1 Mon Sep 17 00:00:00 2001 From: David Ichim Date: Thu, 7 Mar 2024 20:05:49 +0200 Subject: [PATCH 16/21] Lint fix, export of print should be made after import --- src/reducers/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/reducers/index.js b/src/reducers/index.js index 04527318..7523fa7f 100644 --- a/src/reducers/index.js +++ b/src/reducers/index.js @@ -1 +1,3 @@ -export print from './print'; +import print from './print'; + +export default print; From bbaf5be2e7cd24b6a8c5d694ee4030b6fafbd120 Mon Sep 17 00:00:00 2001 From: David Ichim Date: Thu, 7 Mar 2024 20:26:01 +0200 Subject: [PATCH 17/21] Fix export statement in reducers/index.js --- src/reducers/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reducers/index.js b/src/reducers/index.js index 7523fa7f..67391cb9 100644 --- a/src/reducers/index.js +++ b/src/reducers/index.js @@ -1,3 +1,3 @@ import print from './print'; -export default print; +export { print }; From f9dd860ba46b34f09e263550044e9350eff70873 Mon Sep 17 00:00:00 2001 From: Tiberiu Ichim Date: Tue, 12 Mar 2024 14:00:29 +0200 Subject: [PATCH 18/21] fix(blocks): Allow image block urls to be external (#214) --- .../volto/components/manage/Blocks/Image/View.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/customizations/volto/components/manage/Blocks/Image/View.jsx b/src/customizations/volto/components/manage/Blocks/Image/View.jsx index 3814856d..b1c86aae 100644 --- a/src/customizations/volto/components/manage/Blocks/Image/View.jsx +++ b/src/customizations/volto/components/manage/Blocks/Image/View.jsx @@ -20,7 +20,7 @@ import { Copyright } from '@eeacms/volto-eea-design-system/ui'; */ export const View = (props) => { const { data, detached } = props; - const href = data?.href?.[0]?.['@id'] || ''; + const href = data?.href?.[0]?.['@id'] ?? (data?.href || ''); const { copyright, copyrightIcon, copyrightPosition } = data; // const [hovering, setHovering] = React.useState(false); const [viewLoaded, setViewLoaded] = React.useState(false); From e6a6c2d71eae7a934729a53ceac5be9a183e48d5 Mon Sep 17 00:00:00 2001 From: dobri1408 <50819975+dobri1408@users.noreply.github.com> Date: Tue, 12 Mar 2024 17:09:38 +0200 Subject: [PATCH 19/21] (fix): In search block on edit, the sort on and sort order are not working (#205) * fix-search-block-on-edit * fix no selection not working --- .../manage/Blocks/Search/SearchBlockEdit.jsx | 106 ++++ .../manage/Blocks/Search/hocs/withSearch.jsx | 479 ++++++++++++++++++ 2 files changed, 585 insertions(+) create mode 100644 src/customizations/volto/components/manage/Blocks/Search/SearchBlockEdit.jsx create mode 100644 src/customizations/volto/components/manage/Blocks/Search/hocs/withSearch.jsx diff --git a/src/customizations/volto/components/manage/Blocks/Search/SearchBlockEdit.jsx b/src/customizations/volto/components/manage/Blocks/Search/SearchBlockEdit.jsx new file mode 100644 index 00000000..4ce1f10a --- /dev/null +++ b/src/customizations/volto/components/manage/Blocks/Search/SearchBlockEdit.jsx @@ -0,0 +1,106 @@ +//this customization is used for fixing: in the search block, on edit sort on and reversed order doesn't work. +//See here volto pr: https://github.com/plone/volto/pull/5262 +import React, { useEffect } from 'react'; +import { defineMessages } from 'react-intl'; +import { compose } from 'redux'; + +import { SidebarPortal, BlockDataForm } from '@plone/volto/components'; +import { addExtensionFieldToSchema } from '@plone/volto/helpers/Extensions/withBlockSchemaEnhancer'; +import { getBaseUrl } from '@plone/volto/helpers'; +import config from '@plone/volto/registry'; + +import { SearchBlockViewComponent } from '@plone/volto/components/manage/Blocks/Search/SearchBlockView'; +import Schema from '@plone/volto/components/manage/Blocks/Search/schema'; +import { + withSearch, + withQueryString, +} from '@plone/volto/components/manage/Blocks/Search/hocs'; +import { cloneDeep } from 'lodash'; + +const messages = defineMessages({ + template: { + id: 'Results template', + defaultMessage: 'Results template', + }, +}); + +const SearchBlockEdit = (props) => { + const { + block, + onChangeBlock, + data, + selected, + intl, + navRoot, + contentType, + onTriggerSearch, + querystring = {}, + } = props; + const { sortable_indexes = {} } = querystring; + + let schema = Schema({ data, intl }); + + schema = addExtensionFieldToSchema({ + schema, + name: 'listingBodyTemplate', + items: config.blocks.blocksConfig.listing.variations, + intl, + title: { id: intl.formatMessage(messages.template) }, + }); + const listingVariations = config.blocks.blocksConfig?.listing?.variations; + let activeItem = listingVariations.find( + (item) => item.id === data.listingBodyTemplate, + ); + const listingSchemaEnhancer = activeItem?.schemaEnhancer; + if (listingSchemaEnhancer) + schema = listingSchemaEnhancer({ + schema: cloneDeep(schema), + data, + intl, + }); + schema.properties.sortOnOptions.items = { + choices: Object.keys(sortable_indexes).map((k) => [ + k, + sortable_indexes[k].title, + ]), + }; + + const { query = {} } = data || {}; + // We don't need deep compare here, as this is just json serializable data. + const deepQuery = JSON.stringify(query); + useEffect(() => { + onTriggerSearch( + '', + data?.facets, + data?.query?.sort_on, + data?.query?.sort_order, + ); + }, [deepQuery, onTriggerSearch, data]); + + return ( + <> + + + { + onChangeBlock(block, { + ...data, + [id]: value, + }); + }} + onChangeBlock={onChangeBlock} + formData={data} + navRoot={navRoot} + contentType={contentType} + /> + + + ); +}; + +export default compose(withQueryString, withSearch())(SearchBlockEdit); diff --git a/src/customizations/volto/components/manage/Blocks/Search/hocs/withSearch.jsx b/src/customizations/volto/components/manage/Blocks/Search/hocs/withSearch.jsx new file mode 100644 index 00000000..6bf2b191 --- /dev/null +++ b/src/customizations/volto/components/manage/Blocks/Search/hocs/withSearch.jsx @@ -0,0 +1,479 @@ +//this customization is used for fixing: in the search block, on edit sort on and reversed order doesn't work. +//See here volto pr: https://github.com/plone/volto/pull/5262 +import React from 'react'; +import { useSelector } from 'react-redux'; +import qs from 'query-string'; +import { useLocation, useHistory } from 'react-router-dom'; + +import { resolveExtension } from '@plone/volto/helpers/Extensions/withBlockExtensions'; +import config from '@plone/volto/registry'; +import { usePrevious } from '@plone/volto/helpers'; +import { isEqual } from 'lodash'; + +function getDisplayName(WrappedComponent) { + return WrappedComponent.displayName || WrappedComponent.name || 'Component'; +} + +const SEARCH_ENDPOINT_FIELDS = [ + 'SearchableText', + 'b_size', + 'limit', + 'sort_on', + 'sort_order', +]; + +const PAQO = 'plone.app.querystring.operation'; + +/** + * Based on URL state, gets an initial internal state for the search + * + * @function getInitialState + * + */ +function getInitialState( + data, + facets, + urlSearchText, + id, + sortOnParam, + sortOrderParam, +) { + const { + types: facetWidgetTypes, + } = config.blocks.blocksConfig.search.extensions.facetWidgets; + const facetSettings = data?.facets || []; + + return { + query: [ + ...(data.query?.query || []), + ...(facetSettings || []) + .map((facet) => { + if (!facet?.field) return null; + + const { valueToQuery } = resolveExtension( + 'type', + facetWidgetTypes, + facet, + ); + + const name = facet.field.value; + const value = facets[name]; + + return valueToQuery({ value, facet }); + }) + .filter((f) => !!f), + ...(urlSearchText + ? [ + { + i: 'SearchableText', + o: 'plone.app.querystring.operation.string.contains', + v: urlSearchText, + }, + ] + : []), + ], + sort_on: sortOnParam || data.query?.sort_on, + sort_order: sortOrderParam || data.query?.sort_order, + b_size: data.query?.b_size, + limit: data.query?.limit, + block: id, + }; +} + +/** + * "Normalizes" the search state to something that's serializable + * (for querying) and used to compute data for the ListingBody + * + * @function normalizeState + * + */ +function normalizeState({ + query, // base query + facets, // facet values + id, // block id + searchText, // SearchableText + sortOn, + sortOrder, + facetSettings, // data.facets extracted from block data +}) { + const { + types: facetWidgetTypes, + } = config.blocks.blocksConfig.search.extensions.facetWidgets; + + // Here, we are removing the QueryString of the Listing ones, which is present in the Facet + // because we already initialize the facet with those values. + const configuredFacets = facetSettings + ? facetSettings.map((facet) => facet?.field?.value) + : []; + + let copyOfQuery = query.query ? [...query.query] : []; + + const queryWithoutFacet = copyOfQuery.filter((query) => { + return !configuredFacets.includes(query.i); + }); + + const params = { + query: [ + ...(queryWithoutFacet || []), + ...(facetSettings || []).map((facet) => { + if (!facet?.field) return null; + + const { valueToQuery } = resolveExtension( + 'type', + facetWidgetTypes, + facet, + ); + + const name = facet.field.value; + const value = facets[name]; + + return valueToQuery({ value, facet }); + }), + ].filter((o) => !!o), + sort_on: sortOn || query.sort_on, + sort_order: sortOrder || query.sort_order, + b_size: query.b_size, + limit: query.limit, + block: id, + }; + + // Note Ideally the searchtext functionality should be restructured as being just + // another facet. But right now it's the same. This means that if a searchText + // is provided, it will override the SearchableText facet. + // If there is no searchText, the SearchableText in the query remains in effect. + // TODO eventually the searchText should be a distinct facet from SearchableText, and + // the two conditions could be combined, in comparison to the current state, when + // one overrides the other. + if (searchText) { + params.query = params.query.reduce( + // Remove SearchableText from query + (acc, kvp) => (kvp.i === 'SearchableText' ? acc : [...acc, kvp]), + [], + ); + params.query.push({ + i: 'SearchableText', + o: 'plone.app.querystring.operation.string.contains', + v: searchText, + }); + } + + return params; +} + +const getSearchFields = (searchData) => { + return Object.assign( + {}, + ...SEARCH_ENDPOINT_FIELDS.map((k) => { + return searchData[k] ? { [k]: searchData[k] } : {}; + }), + searchData.query ? { query: serializeQuery(searchData['query']) } : {}, + ); +}; + +/** + * A hook that will mirror the search block state to a hash location + */ +const useHashState = () => { + const location = useLocation(); + const history = useHistory(); + + /** + * Required to maintain parameter compatibility. + With this we will maintain support for receiving hash (#) and search (?) type parameters. + */ + const oldState = React.useMemo(() => { + return { + ...qs.parse(location.search), + ...qs.parse(location.hash), + }; + }, [location.hash, location.search]); + + // This creates a shallow copy. Why is this needed? + const current = Object.assign( + {}, + ...Array.from(Object.keys(oldState)).map((k) => ({ [k]: oldState[k] })), + ); + + const setSearchData = React.useCallback( + (searchData) => { + const newParams = qs.parse(location.search); + + let changed = false; + + Object.keys(searchData) + .sort() + .forEach((k) => { + if (searchData[k]) { + newParams[k] = searchData[k]; + if (oldState[k] !== searchData[k]) { + changed = true; + } + } + }); + + if (changed) { + history.push({ + search: qs.stringify(newParams), + }); + } + }, + [history, oldState, location.search], + ); + + return [current, setSearchData]; +}; + +/** + * A hook to make it possible to switch disable mirroring the search block + * state to the window location. When using the internal state we "start from + * scratch", as it's intended to be used in the edit page. + */ +const useSearchBlockState = (uniqueId, isEditMode) => { + const [hashState, setHashState] = useHashState(); + const [internalState, setInternalState] = React.useState({}); + + return isEditMode + ? [internalState, setInternalState] + : [hashState, setHashState]; +}; + +// Simple compress/decompress the state in URL by replacing the lengthy string +const deserializeQuery = (q) => { + return JSON.parse(q)?.map((kvp) => ({ + ...kvp, + o: kvp.o.replace(/^paqo/, PAQO), + })); +}; +const serializeQuery = (q) => { + return JSON.stringify( + q?.map((kvp) => ({ ...kvp, o: kvp.o.replace(PAQO, 'paqo') })), + ); +}; + +const withSearch = (options) => (WrappedComponent) => { + const { inputDelay = 1000 } = options || {}; + + function WithSearch(props) { + const { data, id, editable = false } = props; + + const [locationSearchData, setLocationSearchData] = useSearchBlockState( + id, + editable, + ); + + // TODO: Improve the hook dependencies out of the scope of https://github.com/plone/volto/pull/4662 + // eslint-disable-next-line react-hooks/exhaustive-deps + const urlQuery = locationSearchData.query + ? deserializeQuery(locationSearchData.query) + : []; + const urlSearchText = + locationSearchData.SearchableText || + urlQuery.find(({ i }) => i === 'SearchableText')?.v || + ''; + + // TODO: refactor, should use only useLocationStateManager()!!! + const [searchText, setSearchText] = React.useState(urlSearchText); + // TODO: Improve the hook dependencies out of the scope of https://github.com/plone/volto/pull/4662 + // eslint-disable-next-line react-hooks/exhaustive-deps + const configuredFacets = + data.facets?.map((facet) => facet?.field?.value) || []; + + // Here we are getting the initial value of the facet if Listing Query contains the same criteria as + // facet. + const queryData = data?.query?.query + ? deserializeQuery(JSON.stringify(data?.query?.query)) + : []; + + let intializeFacetWithQueryValue = []; + + for (let value of configuredFacets) { + const queryString = queryData.find((item) => item.i === value); + if (queryString) { + intializeFacetWithQueryValue = [ + ...intializeFacetWithQueryValue, + { [queryString.i]: queryString.v }, + ]; + } + } + + const multiFacets = data.facets + ?.filter((facet) => facet?.multiple) + .map((facet) => facet?.field?.value); + const [facets, setFacets] = React.useState( + Object.assign( + {}, + ...urlQuery.map(({ i, v }) => ({ [i]: v })), + // TODO: the 'o' should be kept. This would be a major refactoring of the facets + ...intializeFacetWithQueryValue, + // support for simple filters like ?Subject=something + // TODO: since the move to hash params this is no longer working. + // We'd have to treat the location.search and manage it just like the + // hash, to support it. We can read it, but we'd have to reset it as + // well, so at that point what's the difference to the hash? + ...configuredFacets.map((f) => + locationSearchData[f] + ? { + [f]: + multiFacets.indexOf(f) > -1 + ? [locationSearchData[f]] + : locationSearchData[f], + } + : {}, + ), + ), + ); + const previousUrlQuery = usePrevious(urlQuery); + + // During first render the previousUrlQuery is undefined and urlQuery + // is empty so it ressetting the facet when you are navigating but during reload we have urlQuery and we need + // to set the facet at first render. + const preventOverrideOfFacetState = + previousUrlQuery === undefined && urlQuery.length === 0; + + React.useEffect(() => { + if ( + !isEqual(urlQuery, previousUrlQuery) && + !preventOverrideOfFacetState + ) { + setFacets( + Object.assign( + {}, + ...urlQuery.map(({ i, v }) => ({ [i]: v })), // TODO: the 'o' should be kept. This would be a major refactoring of the facets + + // support for simple filters like ?Subject=something + // TODO: since the move to hash params this is no longer working. + // We'd have to treat the location.search and manage it just like the + // hash, to support it. We can read it, but we'd have to reset it as + // well, so at that point what's the difference to the hash? + ...configuredFacets.map((f) => + locationSearchData[f] + ? { + [f]: + multiFacets.indexOf(f) > -1 + ? [locationSearchData[f]] + : locationSearchData[f], + } + : {}, + ), + ), + ); + } + }, [ + urlQuery, + configuredFacets, + locationSearchData, + multiFacets, + previousUrlQuery, + preventOverrideOfFacetState, + ]); + + const [sortOn, setSortOn] = React.useState(data?.query?.sort_on); + const [sortOrder, setSortOrder] = React.useState(data?.query?.sort_order); + + const [searchData, setSearchData] = React.useState( + getInitialState(data, facets, urlSearchText, id), + ); + + const deepFacets = JSON.stringify(facets); + const deepData = JSON.stringify(data); + React.useEffect(() => { + setSearchData( + getInitialState( + JSON.parse(deepData), + JSON.parse(deepFacets), + urlSearchText, + id, + sortOn, + sortOrder, + ), + ); + }, [deepData, deepFacets, urlSearchText, id, sortOn, sortOrder]); + + const timeoutRef = React.useRef(); + const facetSettings = data?.facets; + + const deepQuery = JSON.stringify(data.query); + const onTriggerSearch = React.useCallback( + ( + toSearchText = undefined, + toSearchFacets = undefined, + toSortOn = undefined, + toSortOrder = undefined, + ) => { + if (timeoutRef.current) clearTimeout(timeoutRef.current); + timeoutRef.current = setTimeout( + () => { + const newSearchData = normalizeState({ + id, + query: data.query || {}, + facets: toSearchFacets || facets, + searchText: toSearchText ? toSearchText.trim() : '', + sortOn: toSortOn || undefined, + sortOrder: toSortOrder || sortOrder, + facetSettings, + }); + if (toSearchFacets) setFacets(toSearchFacets); + if (toSortOn) setSortOn(toSortOn || undefined); + if (toSortOrder) setSortOrder(toSortOrder); + setSearchData(newSearchData); + setLocationSearchData(getSearchFields(newSearchData)); + }, + toSearchFacets ? inputDelay / 3 : inputDelay, + ); + }, + // eslint-disable-next-line react-hooks/exhaustive-deps + [ + // Use deep comparison of data.query + deepQuery, + facets, + id, + setLocationSearchData, + searchText, + sortOn, + sortOrder, + facetSettings, + ], + ); + + const removeSearchQuery = () => { + let newSearchData = { ...searchData }; + newSearchData.query = searchData.query.reduce( + // Remove SearchableText from query + (acc, kvp) => (kvp.i === 'SearchableText' ? acc : [...acc, kvp]), + [], + ); + setSearchData(newSearchData); + setLocationSearchData(getSearchFields(newSearchData)); + }; + + const querystringResults = useSelector( + (state) => state.querystringsearch.subrequests, + ); + const totalItems = + querystringResults[id]?.total || querystringResults[id]?.items?.length; + + return ( + + ); + } + WithSearch.displayName = `WithSearch(${getDisplayName(WrappedComponent)})`; + + return WithSearch; +}; + +export default withSearch; From 4c2f794256098dff98aa4b78ba99be65709b1b9b Mon Sep 17 00:00:00 2001 From: ichim-david Date: Tue, 12 Mar 2024 18:49:34 +0200 Subject: [PATCH 20/21] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0da207b9..7f4b1999 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eeacms/volto-eea-website-theme", - "version": "1.29.0", + "version": "1.30.0", "description": "@eeacms/volto-eea-website-theme: Volto add-on", "main": "src/index.js", "author": "European Environment Agency: IDM2 A-Team", From e53e930bc582d85fc365725c3b69524c69fe200d Mon Sep 17 00:00:00 2001 From: EEA Jenkins <@users.noreply.github.com> Date: Wed, 13 Mar 2024 09:40:44 +0000 Subject: [PATCH 21/21] Automated release 1.30.0 --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8aea8f5b..8465e81b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). -### [1.29.0](https://github.com/eea/volto-eea-website-theme/compare/1.28.3...1.29.0) - 7 March 2024 +### [1.30.0](https://github.com/eea/volto-eea-website-theme/compare/1.29.0...1.30.0) - 13 March 2024 #### :rocket: New Features @@ -21,6 +21,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others +- Update package.json [ichim-david - [`4c2f794`](https://github.com/eea/volto-eea-website-theme/commit/4c2f794256098dff98aa4b78ba99be65709b1b9b)] +- Fix export statement in reducers/index.js [David Ichim - [`bbaf5be`](https://github.com/eea/volto-eea-website-theme/commit/bbaf5be2e7cd24b6a8c5d694ee4030b6fafbd120)] +- Lint fix, export of print should be made after import [David Ichim - [`2a670db`](https://github.com/eea/volto-eea-website-theme/commit/2a670db0a9bcb741ea24ea3ac98ba7267b6a83e1)] - test: TokenWidget.test.jsx and TopicsWidget.test.jsx cover more conditions [laszlocseh - [`dd154bb`](https://github.com/eea/volto-eea-website-theme/commit/dd154bb520237f458be563280cac1545eb381bdf)] - Bump version to 1.29.0 from 1.28.4 [Claudia Ifrim - [`7bc8eab`](https://github.com/eea/volto-eea-website-theme/commit/7bc8eabd4b0462fc5afc07ed131d074af642cc89)] - test: added TokenWidget.test.jsx and TopicsWidget.test.jsx [laszlocseh - [`f7292bb`](https://github.com/eea/volto-eea-website-theme/commit/f7292bb426591f758dcc7bc159b5dbd75b7afb36)] @@ -28,6 +31,8 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - test: fix in Logo.test.jsx [laszlocseh - [`6d552f8`](https://github.com/eea/volto-eea-website-theme/commit/6d552f89d5aff6e47ef3032d4862a1bcbe364c01)] - test: add Logo.test.jsx [laszlocseh - [`752c562`](https://github.com/eea/volto-eea-website-theme/commit/752c5629840d906382858f088b97d33147684ca8)] - add isPrint missing files [laszlocseh - [`d995789`](https://github.com/eea/volto-eea-website-theme/commit/d995789f337a00455d45b5ec26de9c4c0c898ce6)] +### [1.29.0](https://github.com/eea/volto-eea-website-theme/compare/1.28.3...1.29.0) - 7 March 2024 + ### [1.28.3](https://github.com/eea/volto-eea-website-theme/compare/1.28.2...1.28.3) - 5 March 2024 #### :bug: Bug Fixes