@eeacms/volto-eea-website-theme 4.0.5 → 4.1.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 +18 -0
- package/README.md +4 -0
- package/package.json +1 -1
- package/src/actions/eea-settings.js +9 -0
- package/src/actions/index.js +1 -0
- package/src/config.js +32 -19
- package/src/constants/ActionTypes.js +1 -0
- package/src/customizations/volto/components/manage/Blocks/Block/Order/Item.jsx +146 -0
- package/src/customizations/volto/components/theme/Header/Header.jsx +4 -1
- package/src/customizations/volto/server.jsx +3 -0
- package/src/index.js +2 -1
- package/src/reducers/eea-settings.js +33 -0
- package/src/reducers/index.js +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,24 @@ 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
|
+
### [4.1.1](https://github.com/eea/volto-eea-website-theme/compare/4.1.0...4.1.1) - 17 April 2026
|
|
8
|
+
|
|
9
|
+
#### :bug: Bug Fixes
|
|
10
|
+
|
|
11
|
+
- fix(order-sidebar): respect required and fixed block restrictions - refs #302095 [Alin Voinea - [`51557f2`](https://github.com/eea/volto-eea-website-theme/commit/51557f220fbe3992110e96862f4ab0ba987d42ed)]
|
|
12
|
+
|
|
13
|
+
### [4.1.0](https://github.com/eea/volto-eea-website-theme/compare/4.0.5...4.1.0) - 17 April 2026
|
|
14
|
+
|
|
15
|
+
#### :house: Internal changes
|
|
16
|
+
|
|
17
|
+
- style: Automated code fix [eea-jenkins - [`791197c`](https://github.com/eea/volto-eea-website-theme/commit/791197cdab091e73cd4ddc5a7c6f7a4fc777642a)]
|
|
18
|
+
|
|
19
|
+
#### :hammer_and_wrench: Others
|
|
20
|
+
|
|
21
|
+
- update config [Miu Razvan - [`863717b`](https://github.com/eea/volto-eea-website-theme/commit/863717bec385ac98a69cf86578efef6377de3189)]
|
|
22
|
+
- change default settings for headerSearchBox [Miu Razvan - [`8343209`](https://github.com/eea/volto-eea-website-theme/commit/834320954a7b358dd112641fbf8e5ede2cae4085)]
|
|
23
|
+
- update [Miu Razvan - [`16b13d0`](https://github.com/eea/volto-eea-website-theme/commit/16b13d0a40ce14d9cc40f9a3b22b3b1486037178)]
|
|
24
|
+
- update [Miu Razvan - [`3602223`](https://github.com/eea/volto-eea-website-theme/commit/3602223822f0346551fd13c196c89015621a1833)]
|
|
7
25
|
### [4.0.5](https://github.com/eea/volto-eea-website-theme/compare/4.0.4...4.0.5) - 16 April 2026
|
|
8
26
|
|
|
9
27
|
### [4.0.4](https://github.com/eea/volto-eea-website-theme/compare/4.0.3...4.0.4) - 10 April 2026
|
package/README.md
CHANGED
|
@@ -18,6 +18,10 @@ EEA Website [Volto](https://github.com/plone/volto) Theme
|
|
|
18
18
|
|
|
19
19
|
## Upgrade
|
|
20
20
|
|
|
21
|
+
### Upgrading to ^4.1.x
|
|
22
|
+
|
|
23
|
+
* This version requires `^eea.volto.policy@12.0`
|
|
24
|
+
|
|
21
25
|
### Upgrading to 3.x.x
|
|
22
26
|
|
|
23
27
|
* This version removes some Volto customizations and it requires **Volto 17.20.0+**. See [CHANGELOG.md](https://github.com/eea/volto-eea-website-theme/blob/master/CHANGELOG.md)
|
package/package.json
CHANGED
package/src/actions/index.js
CHANGED
package/src/config.js
CHANGED
|
@@ -289,31 +289,44 @@ export const logoTargetUrl = '/';
|
|
|
289
289
|
|
|
290
290
|
export const headerSearchBox = [
|
|
291
291
|
{
|
|
292
|
-
|
|
292
|
+
type: 'search-input',
|
|
293
|
+
searchSuggestions: {},
|
|
293
294
|
path: '/en/advanced-search',
|
|
294
295
|
placeholder: 'Search or ask your question...',
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
'What countries had the highest land take in the EEA-39?',
|
|
308
|
-
'How many people are exposed to air pollution?',
|
|
309
|
-
],
|
|
310
|
-
},
|
|
296
|
+
maxToShow: 6,
|
|
297
|
+
suggestionsTitle: 'Try our suggestions',
|
|
298
|
+
suggestions: [
|
|
299
|
+
'What is PFAS?',
|
|
300
|
+
'Which transport mode has the lowest pollution?',
|
|
301
|
+
'Which countries use most renewable energy?',
|
|
302
|
+
'How many premature deaths are attributed to PM2.5?',
|
|
303
|
+
'How many premature deaths are attributed to air pollution?',
|
|
304
|
+
'How much have new cars co2 emissions decreased?',
|
|
305
|
+
'What countries had the highest land take in the EEA-39?',
|
|
306
|
+
'How many people are exposed to air pollution?',
|
|
307
|
+
],
|
|
311
308
|
},
|
|
312
309
|
{
|
|
310
|
+
type: 'search-input',
|
|
313
311
|
path: '/en/datahub',
|
|
314
312
|
placeholder: 'Search Datahub...',
|
|
315
|
-
|
|
316
|
-
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
type: 'info',
|
|
316
|
+
content: [
|
|
317
|
+
{ text: 'For more search options' },
|
|
318
|
+
{ text: 'Looking for more information?', path: '/en/datahub' },
|
|
319
|
+
],
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
type: 'button-link',
|
|
323
|
+
title: 'Go to advanced search',
|
|
324
|
+
url: '/en/advanced-search',
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
type: 'button-link',
|
|
328
|
+
title: 'Ask AI',
|
|
329
|
+
url: '/en/ask-ai',
|
|
317
330
|
},
|
|
318
331
|
];
|
|
319
332
|
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
4
|
+
import includes from 'lodash/includes';
|
|
5
|
+
import isBoolean from 'lodash/isBoolean';
|
|
6
|
+
import cx from 'classnames';
|
|
7
|
+
import Icon from '@plone/volto/components/theme/Icon/Icon';
|
|
8
|
+
import { setUIState } from '@plone/volto/actions/form/form';
|
|
9
|
+
import config from '@plone/volto/registry';
|
|
10
|
+
|
|
11
|
+
import deleteSVG from '@plone/volto/icons/delete.svg';
|
|
12
|
+
import dragSVG from '@plone/volto/icons/drag.svg';
|
|
13
|
+
|
|
14
|
+
// TEMPORARY PATCH (Volto issue #6481):
|
|
15
|
+
// Remove this customization once the upstream fixes are released and adopted.
|
|
16
|
+
// Upstream PRs: https://github.com/plone/volto/pull/8124 and
|
|
17
|
+
// https://github.com/plone/volto/pull/8125
|
|
18
|
+
export const Item = forwardRef(
|
|
19
|
+
(
|
|
20
|
+
{
|
|
21
|
+
clone,
|
|
22
|
+
data,
|
|
23
|
+
depth,
|
|
24
|
+
disableSelection,
|
|
25
|
+
disableInteraction,
|
|
26
|
+
ghost,
|
|
27
|
+
id,
|
|
28
|
+
handleProps,
|
|
29
|
+
indentationWidth,
|
|
30
|
+
onRemove,
|
|
31
|
+
onSelectBlock,
|
|
32
|
+
parentId,
|
|
33
|
+
parentType,
|
|
34
|
+
style,
|
|
35
|
+
value,
|
|
36
|
+
wrapperRef,
|
|
37
|
+
errors,
|
|
38
|
+
...props
|
|
39
|
+
},
|
|
40
|
+
ref,
|
|
41
|
+
) => {
|
|
42
|
+
const selected = useSelector((state) => state.form.ui.selected);
|
|
43
|
+
const hovered = useSelector((state) => state.form.ui.hovered);
|
|
44
|
+
const multiSelected = useSelector((state) => state.form.ui.multiSelected);
|
|
45
|
+
const gridSelected = useSelector((state) => state.form.ui.gridSelected);
|
|
46
|
+
const dispatch = useDispatch();
|
|
47
|
+
|
|
48
|
+
const icon =
|
|
49
|
+
config.blocks.blocksConfig[data?.['@type']]?.icon ||
|
|
50
|
+
config.blocks.blocksConfig.title?.icon;
|
|
51
|
+
|
|
52
|
+
const required = isBoolean(data?.required)
|
|
53
|
+
? data.required
|
|
54
|
+
: includes(config.blocks.requiredBlocks, data?.['@type']);
|
|
55
|
+
const fixed = !!data?.fixed;
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<li
|
|
59
|
+
className={classNames(
|
|
60
|
+
'tree-item-wrapper',
|
|
61
|
+
clone && 'clone',
|
|
62
|
+
ghost && 'ghost',
|
|
63
|
+
disableSelection && 'disable-selection',
|
|
64
|
+
disableInteraction && 'disable-interaction',
|
|
65
|
+
)}
|
|
66
|
+
role="presentation"
|
|
67
|
+
onMouseOver={() => dispatch(setUIState({ hovered: id }))}
|
|
68
|
+
onFocus={() => dispatch(setUIState({ hovered: id }))}
|
|
69
|
+
onMouseLeave={() => dispatch(setUIState({ hovered: null }))}
|
|
70
|
+
onClick={(e) => {
|
|
71
|
+
if (depth === 0) {
|
|
72
|
+
const isMultipleSelection = e.shiftKey || e.ctrlKey || e.metaKey;
|
|
73
|
+
selected !== id &&
|
|
74
|
+
onSelectBlock(
|
|
75
|
+
id,
|
|
76
|
+
selected === id ? false : isMultipleSelection,
|
|
77
|
+
e,
|
|
78
|
+
);
|
|
79
|
+
} else {
|
|
80
|
+
dispatch(
|
|
81
|
+
setUIState({
|
|
82
|
+
selected: parentId,
|
|
83
|
+
multiSelected: [],
|
|
84
|
+
gridSelected: id,
|
|
85
|
+
}),
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
}}
|
|
89
|
+
ref={wrapperRef}
|
|
90
|
+
style={{
|
|
91
|
+
'--spacing': `${indentationWidth * depth}px`,
|
|
92
|
+
}}
|
|
93
|
+
{...props}
|
|
94
|
+
>
|
|
95
|
+
<div
|
|
96
|
+
className={classNames(
|
|
97
|
+
'tree-item',
|
|
98
|
+
(selected === id || gridSelected === id) && 'selected',
|
|
99
|
+
hovered === id && 'hovered',
|
|
100
|
+
includes(multiSelected, id) && 'multiSelected',
|
|
101
|
+
`depth-${depth}`,
|
|
102
|
+
)}
|
|
103
|
+
ref={ref}
|
|
104
|
+
style={style}
|
|
105
|
+
>
|
|
106
|
+
{!fixed && (
|
|
107
|
+
<button
|
|
108
|
+
ref={ref}
|
|
109
|
+
{...handleProps}
|
|
110
|
+
className={classNames('action', 'drag')}
|
|
111
|
+
tabIndex={0}
|
|
112
|
+
data-cypress="draggable-handle"
|
|
113
|
+
>
|
|
114
|
+
<Icon name={dragSVG} size="16px" />
|
|
115
|
+
</button>
|
|
116
|
+
)}
|
|
117
|
+
<span
|
|
118
|
+
className={cx('text', {
|
|
119
|
+
errored: errors && Object.keys(errors).length > 0,
|
|
120
|
+
})}
|
|
121
|
+
>
|
|
122
|
+
{icon && (
|
|
123
|
+
<Icon
|
|
124
|
+
name={icon}
|
|
125
|
+
size="20px"
|
|
126
|
+
style={{ verticalAlign: 'middle' }}
|
|
127
|
+
/>
|
|
128
|
+
)}{' '}
|
|
129
|
+
{data?.plaintext ||
|
|
130
|
+
config.blocks.blocksConfig[data?.['@type']]?.title ||
|
|
131
|
+
data?.title}
|
|
132
|
+
</span>
|
|
133
|
+
{!clone && onRemove && !required && (
|
|
134
|
+
<button
|
|
135
|
+
onClick={onRemove}
|
|
136
|
+
className={classNames('action', 'delete')}
|
|
137
|
+
tabIndex={0}
|
|
138
|
+
>
|
|
139
|
+
<Icon name={deleteSVG} size="18" />
|
|
140
|
+
</button>
|
|
141
|
+
)}
|
|
142
|
+
</div>
|
|
143
|
+
</li>
|
|
144
|
+
);
|
|
145
|
+
},
|
|
146
|
+
);
|
|
@@ -57,10 +57,13 @@ const EEAHeader = ({ pathname, token, items, history, subsite }) => {
|
|
|
57
57
|
|
|
58
58
|
const { eea } = config.settings;
|
|
59
59
|
const headerOpts = eea.headerOpts || {};
|
|
60
|
-
const headerSearchBox = eea.headerSearchBox || [];
|
|
61
60
|
const { logo, logoWhite } = headerOpts;
|
|
62
61
|
const width = useSelector((state) => state.screen?.width);
|
|
63
62
|
const dispatch = useDispatch();
|
|
63
|
+
|
|
64
|
+
const eeaSettings = useSelector((state) => state.eeaSettings?.data);
|
|
65
|
+
const headerSearchBox =
|
|
66
|
+
eeaSettings?.header?.searchBox || eea.headerSearchBox || [];
|
|
64
67
|
const previousToken = usePrevious(token);
|
|
65
68
|
const navigationSettings =
|
|
66
69
|
useSelector((state) => state.navigationSettings?.settings) ||
|
|
@@ -33,6 +33,8 @@ import {
|
|
|
33
33
|
import { changeLanguage } from '@plone/volto/actions/language/language';
|
|
34
34
|
|
|
35
35
|
import userSession from '@plone/volto/reducers/userSession/userSession';
|
|
36
|
+
import { getEEASettings } from '@eeacms/volto-eea-website-theme/actions';
|
|
37
|
+
|
|
36
38
|
import configureStore from '@plone/volto/store';
|
|
37
39
|
import ErrorPage from '@plone/volto/error';
|
|
38
40
|
import {
|
|
@@ -262,6 +264,7 @@ server.get('/*', (req, res) => {
|
|
|
262
264
|
const location = parseUrl(url);
|
|
263
265
|
|
|
264
266
|
loadOnServer({ store, location, routes, api })
|
|
267
|
+
.then(() => Promise.all([store.dispatch(getEEASettings())]).catch(() => {}))
|
|
265
268
|
.then(() => {
|
|
266
269
|
const initialLang =
|
|
267
270
|
req.universalCookies.get('I18N_LANGUAGE') ||
|
package/src/index.js
CHANGED
|
@@ -49,7 +49,7 @@ import okMiddleware from './middleware/ok';
|
|
|
49
49
|
import voltoCustomCSSMiddleware from './middleware/voltoCustom';
|
|
50
50
|
import { voltoCustomJsMiddleware } from './middleware/voltoCustom';
|
|
51
51
|
import installSlate from './slate';
|
|
52
|
-
import { print, navigationSettings } from './reducers';
|
|
52
|
+
import { print, navigationSettings, eeaSettings } from './reducers';
|
|
53
53
|
|
|
54
54
|
import * as eea from './config';
|
|
55
55
|
|
|
@@ -676,6 +676,7 @@ const applyConfig = (config) => {
|
|
|
676
676
|
...(config.addonReducers || {}),
|
|
677
677
|
print,
|
|
678
678
|
navigationSettings,
|
|
679
|
+
eeaSettings,
|
|
679
680
|
};
|
|
680
681
|
|
|
681
682
|
// Mega menu object
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { GET_EEA_SETTINGS } from '../constants/ActionTypes';
|
|
2
|
+
|
|
3
|
+
const initialState = {
|
|
4
|
+
error: null,
|
|
5
|
+
loaded: false,
|
|
6
|
+
loading: false,
|
|
7
|
+
data: {},
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default function eeaSettings(state = initialState, action = {}) {
|
|
11
|
+
switch (action.type) {
|
|
12
|
+
case `${GET_EEA_SETTINGS}_PENDING`:
|
|
13
|
+
return { ...state, error: null, loaded: false, loading: true };
|
|
14
|
+
case `${GET_EEA_SETTINGS}_SUCCESS`:
|
|
15
|
+
return {
|
|
16
|
+
...state,
|
|
17
|
+
error: null,
|
|
18
|
+
loaded: true,
|
|
19
|
+
loading: false,
|
|
20
|
+
data: action.result || {},
|
|
21
|
+
};
|
|
22
|
+
case `${GET_EEA_SETTINGS}_FAIL`:
|
|
23
|
+
return {
|
|
24
|
+
...state,
|
|
25
|
+
error: action.error,
|
|
26
|
+
loaded: false,
|
|
27
|
+
loading: false,
|
|
28
|
+
data: {},
|
|
29
|
+
};
|
|
30
|
+
default:
|
|
31
|
+
return state;
|
|
32
|
+
}
|
|
33
|
+
}
|
package/src/reducers/index.js
CHANGED