@eeacms/volto-bise-policy 1.0.4 → 1.0.5

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,7 +4,14 @@ 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.0.4](https://github.com/eea/volto-bise-policy/compare/1.0.3...1.0.4) - 25 April 2023
7
+ ### [1.0.5](https://github.com/eea/volto-bise-policy/compare/1.0.4...1.0.5) - 26 April 2023
8
+
9
+ #### :nail_care: Enhancements
10
+
11
+ - refactor(Header.jsx): remove unused lodash find import statement [Miu Razvan - [`708256c`](https://github.com/eea/volto-bise-policy/commit/708256c75bef332c18c0102246ad3cd6cf66ade9)]
12
+ - refactor(Footer.jsx): remove unused code and simplify code [Miu Razvan - [`3ed838d`](https://github.com/eea/volto-bise-policy/commit/3ed838d4f9ba20b1fbc5c968b044912144983c27)]
13
+
14
+ ### [1.0.4](https://github.com/eea/volto-bise-policy/compare/1.0.3...1.0.4) - 26 April 2023
8
15
 
9
16
  #### :rocket: New Features
10
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-bise-policy",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "@eeacms/volto-bise-policy: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -149,6 +149,7 @@ const EEAHeader = ({ token, history, subsite, content, ...props }) => {
149
149
  href="https://europa.eu/european-union/contact/institutions-bodies_en"
150
150
  target="_blank"
151
151
  rel="noreferrer"
152
+ onKeyDown={(evt) => evt.stopPropagation()}
152
153
  >
153
154
  See all EU institutions and bodies
154
155
  </a>
@@ -176,14 +177,15 @@ const EEAHeader = ({ token, history, subsite, content, ...props }) => {
176
177
  </Dropdown.Item>
177
178
  {headerOpts.partnerLinks.links.map((item, index) => (
178
179
  <Dropdown.Item key={index}>
179
- <UniversalLink
180
+ <a
180
181
  href={item.href}
181
182
  className="site"
182
- target={item.target || '_blank'}
183
+ target="_blank"
183
184
  rel="noreferrer"
185
+ onKeyDown={(evt) => evt.stopPropagation()}
184
186
  >
185
187
  {item.title}
186
- </UniversalLink>
188
+ </a>
187
189
  </Dropdown.Item>
188
190
  ))}
189
191
  </div>
@@ -1,90 +0,0 @@
1
- /**
2
- * Footer component.
3
- * @module components/theme/Footer/Footer
4
- */
5
-
6
- import React from 'react';
7
- import { useSelector, shallowEqual } from 'react-redux';
8
- import { flattenToAppURL } from '@plone/volto/helpers';
9
- import EEAFooter from '@eeacms/volto-eea-design-system/ui/Footer/Footer';
10
- import config from '@plone/volto/registry';
11
-
12
- const Footer = () => {
13
- const { eea } = config.settings;
14
- const {
15
- footerActions = [],
16
- copyrightActions = [],
17
- socialActions = [],
18
- contactActions = [],
19
- contactExtraActions = [],
20
- } = useSelector(
21
- (state) => ({
22
- footerActions: state.actions?.actions?.footer_actions,
23
- copyrightActions: state.actions?.actions?.copyright_actions,
24
- socialActions: state.actions?.actions?.social_actions,
25
- contactActions: state.actions?.actions?.contact_actions,
26
- contactExtraActions: state.actions?.actions?.contact_extra_actions,
27
- }),
28
- shallowEqual,
29
- );
30
- // ZMI > portal_actions > footer_actions
31
- const actions = footerActions.length
32
- ? footerActions.map((action) => ({
33
- title: action.title,
34
- link: flattenToAppURL(action.url),
35
- }))
36
- : eea.footerOpts.actions;
37
-
38
- // ZMI > portal_actions > copyright_actions
39
- const copyright = copyrightActions.length
40
- ? copyrightActions.map((action) => ({
41
- title: action.title,
42
- site: action.title,
43
- link: flattenToAppURL(action.url),
44
- }))
45
- : eea.footerOpts.copyright;
46
-
47
- // ZMI > portal_actions > social_actions
48
- const social = socialActions.length
49
- ? socialActions.map((action) => ({
50
- name: action.id,
51
- icon: action.icon,
52
- link: action.url,
53
- }))
54
- : eea.footerOpts.social;
55
-
56
- // ZMI > portal_actions > contact_actions
57
- const contacts = contactActions.length
58
- ? contactActions.map((action, idx) => ({
59
- text: action.title,
60
- icon: action.icon,
61
- link: flattenToAppURL(action.url),
62
- children:
63
- idx === 0
64
- ? contactExtraActions.map((child) => ({
65
- text: child.title,
66
- icon: child.icon,
67
- link: flattenToAppURL(child.url),
68
- }))
69
- : [],
70
- }))
71
- : eea.footerOpts.contacts;
72
-
73
- // Update options with actions from backend
74
- const options = {
75
- ...eea.footerOpts,
76
- social,
77
- contacts,
78
- };
79
-
80
- return (
81
- <EEAFooter>
82
- <EEAFooter.SubFooter {...options} />
83
- <EEAFooter.Header>{eea.footerOpts.header}</EEAFooter.Header>
84
- <EEAFooter.Sites sites={eea.footerOpts.sites} />
85
- <EEAFooter.Actions actions={actions} copyright={copyright} />
86
- </EEAFooter>
87
- );
88
- };
89
-
90
- export default Footer;