@eeacms/volto-eea-website-theme 1.8.2 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,30 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ ### [1.9.1](https://github.com/eea/volto-eea-website-theme/compare/1.9.0...1.9.1) - 28 February 2023
8
+
9
+ #### :bug: Bug Fixes
10
+
11
+ - fix(search): Fix accessibility for search suggestions #112 from eea/search-accessibility [ichim-david - [`d09551e`](https://github.com/eea/volto-eea-website-theme/commit/d09551e14ca630c2f0c93345c94a1c367e9d8bec)]
12
+ - fix(search): Fix accessibility for search suggestions [kreafox - [`037cb79`](https://github.com/eea/volto-eea-website-theme/commit/037cb7941755de82cebc8168fdca4cced80f2806)]
13
+
14
+ ### [1.9.0](https://github.com/eea/volto-eea-website-theme/compare/1.8.2...1.9.0) - 21 February 2023
15
+
16
+ #### :rocket: New Features
17
+
18
+ - feat(contact-form): Redirect to config.settings.contactForm - refs #160689 [Alin Voinea - [`8d93c76`](https://github.com/eea/volto-eea-website-theme/commit/8d93c76f022d0036a43ff1564189dc49530ca4e1)]
19
+
20
+ #### :bug: Bug Fixes
21
+
22
+ - fix(dropdown): navigation of links when using the keyboard only [David Ichim - [`1d97367`](https://github.com/eea/volto-eea-website-theme/commit/1d973671a2941ebb1463ba65ae6bbee5447edf1a)]
23
+
24
+ #### :nail_care: Enhancements
25
+
26
+ - change(language): hide language dropdown by default on eea-website-theme [David Ichim - [`23ba000`](https://github.com/eea/volto-eea-website-theme/commit/23ba000e7c8998c5f1a6f706f706027e95abeb84)]
27
+
28
+ #### :hammer_and_wrench: Others
29
+
30
+ - Release 1.9.0 [Alin Voinea - [`895e0ae`](https://github.com/eea/volto-eea-website-theme/commit/895e0ae0f6174976a5ad4965274bfebb2c65433f)]
7
31
  ### [1.8.2](https://github.com/eea/volto-eea-website-theme/compare/1.8.1...1.8.2) - 14 February 2023
8
32
 
9
33
  #### :rocket: New Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-website-theme",
3
- "version": "1.8.2",
3
+ "version": "1.9.1",
4
4
  "description": "@eeacms/volto-eea-website-theme: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect } from 'react';
2
2
  import { Container, Input, List } from 'semantic-ui-react';
3
- import { withRouter } from 'react-router-dom';
3
+ import { withRouter, Link } from 'react-router-dom';
4
4
  import { useClickOutside } from '@eeacms/volto-eea-design-system/helpers';
5
5
  import config from '@plone/volto/registry';
6
6
 
@@ -63,8 +63,6 @@ function HeaderSearchPopUp({
63
63
  };
64
64
 
65
65
  const onClickHandler = (suggestion) => {
66
- history.push(`${path}?q=${suggestion}`);
67
-
68
66
  if (window?.searchContext?.resetSearch) {
69
67
  window.searchContext.resetSearch({ searchTerm: suggestion });
70
68
  }
@@ -97,8 +95,13 @@ function HeaderSearchPopUp({
97
95
  <List>
98
96
  {visibleSuggestions.map((item, i) => {
99
97
  return (
100
- <List.Item key={i} onClick={() => onClickHandler(item)}>
101
- {item}
98
+ <List.Item key={i}>
99
+ <Link
100
+ to={`${path}?q=${item}`}
101
+ onClick={() => onClickHandler(item)}
102
+ >
103
+ {item}
104
+ </Link>
102
105
  </List.Item>
103
106
  );
104
107
  })}
@@ -0,0 +1,27 @@
1
+ import React, { Component } from 'react';
2
+ import { UniversalLink } from '@plone/volto/components';
3
+ import { FormattedMessage } from 'react-intl';
4
+ import { Container } from 'semantic-ui-react';
5
+ import config from '@plone/volto/registry';
6
+
7
+ export class ContactFormComponent extends Component {
8
+ componentDidMount() {
9
+ if (config.settings.contactForm) {
10
+ this.props.history.replace(config.settings.contactForm);
11
+ }
12
+ }
13
+
14
+ render() {
15
+ const remoteUrl = config.settings.contactForm;
16
+ return (
17
+ <Container id="page-document">
18
+ <p>
19
+ <FormattedMessage id="Contact us:" defaultMessage="Contact us:" />{' '}
20
+ <UniversalLink href={remoteUrl}>{remoteUrl}</UniversalLink>
21
+ </p>
22
+ </Container>
23
+ );
24
+ }
25
+ }
26
+
27
+ export default ContactFormComponent;
@@ -101,10 +101,9 @@ const EEAHeader = ({ pathname, token, items, history, subsite }) => {
101
101
  className=""
102
102
  viewportWidth={width}
103
103
  >
104
+ {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}
104
105
  <div
105
106
  className="content"
106
- role="menu"
107
- tabIndex="0"
108
107
  onClick={(evt) => evt.stopPropagation()}
109
108
  onKeyDown={(evt) => evt.stopPropagation()}
110
109
  >
@@ -116,8 +115,7 @@ const EEAHeader = ({ pathname, token, items, history, subsite }) => {
116
115
  href="https://europa.eu/european-union/contact/institutions-bodies_en"
117
116
  target="_blank"
118
117
  rel="noreferrer"
119
- role="option"
120
- aria-selected="false"
118
+ onKeyDown={(evt) => evt.stopPropagation()}
121
119
  >
122
120
  See all EU institutions and bodies
123
121
  </a>
@@ -140,6 +138,7 @@ const EEAHeader = ({ pathname, token, items, history, subsite }) => {
140
138
  className="site"
141
139
  target="_blank"
142
140
  rel="noreferrer"
141
+ onKeyDown={(evt) => evt.stopPropagation()}
143
142
  >
144
143
  {item.title}
145
144
  </a>
@@ -154,7 +153,10 @@ const EEAHeader = ({ pathname, token, items, history, subsite }) => {
154
153
  <Header.TopDropdownMenu
155
154
  id="language-switcher"
156
155
  className="item"
157
- hasLanguageDropdown={config.settings.supportedLanguages.length > 1}
156
+ hasLanguageDropdown={
157
+ config.settings.supportedLanguages.length > 1 &&
158
+ config.settings.hasLanguageDropdown
159
+ }
158
160
  text={`${language.toUpperCase()}`}
159
161
  mobileText={`${language.toUpperCase()}`}
160
162
  icon={
@@ -210,7 +212,14 @@ const EEAHeader = ({ pathname, token, items, history, subsite }) => {
210
212
 
211
213
  {!!subsite && subsite.title && (
212
214
  <UniversalLink item={subsite} className="subsite-logo">
213
- {subsite.title}
215
+ {subsite.subsite_logo ? (
216
+ <Image
217
+ src={subsite.subsite_logo.scales.mini.download}
218
+ alt={subsite.title}
219
+ />
220
+ ) : (
221
+ subsite.title
222
+ )}
214
223
  </UniversalLink>
215
224
  )}
216
225
  </div>
package/src/index.js CHANGED
@@ -20,6 +20,9 @@ const applyConfig = (config) => {
20
20
  ...(config.settings.eea || {}),
21
21
  };
22
22
 
23
+ // #160689 Redirect contact-form to contact-us
24
+ config.settings.contactForm = '/contact';
25
+
23
26
  // Insert scripts on Error pages
24
27
  if (config.settings?.serverConfig?.extractScripts) {
25
28
  config.settings.serverConfig.extractScripts.errorPages = true;
@@ -115,6 +118,9 @@ const applyConfig = (config) => {
115
118
  // Custom block-style colors
116
119
  config.settings.available_colors = eea.colors;
117
120
 
121
+ // hide language dropdown by default
122
+ config.settings.hasLanguageDropdown = false;
123
+
118
124
  // Site theme colors
119
125
  config.settings.themeColors = [
120
126
  { value: undefined, title: 'No theme' },