@eeacms/volto-bise-policy 1.0.5 → 1.0.6
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,12 +4,18 @@ 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.6](https://github.com/eea/volto-bise-policy/compare/1.0.5...1.0.6) - 23 May 2023
|
|
8
|
+
|
|
9
|
+
#### :hammer_and_wrench: Others
|
|
10
|
+
|
|
11
|
+
- update [Miu Razvan - [`427a1e8`](https://github.com/eea/volto-bise-policy/commit/427a1e8f947cf0912fe0ad2455c6a9ac4d934cb7)]
|
|
12
|
+
- es lint [Zoltan Szabo - [`917fba3`](https://github.com/eea/volto-bise-policy/commit/917fba3dcc07eec3de91008eda8afe209865b436)]
|
|
13
|
+
- updated search popup [Zoltan Szabo - [`27618e1`](https://github.com/eea/volto-bise-policy/commit/27618e1aac391c2f89882d2a6478be456f6c60c7)]
|
|
7
14
|
### [1.0.5](https://github.com/eea/volto-bise-policy/compare/1.0.4...1.0.5) - 26 April 2023
|
|
8
15
|
|
|
9
16
|
#### :nail_care: Enhancements
|
|
10
17
|
|
|
11
18
|
- 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
19
|
|
|
14
20
|
### [1.0.4](https://github.com/eea/volto-bise-policy/compare/1.0.3...1.0.4) - 26 April 2023
|
|
15
21
|
|
package/package.json
CHANGED
|
@@ -53,7 +53,7 @@ const EEAHeader = ({ token, history, subsite, content, ...props }) => {
|
|
|
53
53
|
const previousToken = usePrevious(token);
|
|
54
54
|
const { items } = props;
|
|
55
55
|
const { eea } = config.settings;
|
|
56
|
-
const { headerOpts } = eea || {};
|
|
56
|
+
const { headerOpts, headerSearchBox } = eea || {};
|
|
57
57
|
const { logo, logoWhite } = headerOpts || {};
|
|
58
58
|
|
|
59
59
|
const width = useSelector((state) => state.screen?.width);
|
|
@@ -74,7 +74,8 @@ const EEAHeader = ({ token, history, subsite, content, ...props }) => {
|
|
|
74
74
|
pathname = content_pathname;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
const isHomePageInverse =
|
|
77
|
+
const isHomePageInverse =
|
|
78
|
+
content_pathname === '' && ['', '/'].includes(pathname);
|
|
78
79
|
|
|
79
80
|
const isMultilingual =
|
|
80
81
|
config.settings.isMultilingual || (isSubsite && subsite.isMultilingual);
|
|
@@ -261,6 +262,7 @@ const EEAHeader = ({ token, history, subsite, content, ...props }) => {
|
|
|
261
262
|
>
|
|
262
263
|
<Header.Main
|
|
263
264
|
pathname={router_pathname}
|
|
265
|
+
headerSearchBox={headerSearchBox}
|
|
264
266
|
inverted={isHomePageInverse ? true : false}
|
|
265
267
|
transparency={isHomePageInverse ? true : false}
|
|
266
268
|
hideSearch={isSubsite}
|
package/src/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getBlocks } from '@plone/volto/helpers';
|
|
1
2
|
import installLink from '@plone/volto-slate/editor/plugins/AdvancedLink';
|
|
2
3
|
import { addStylingFieldsetSchemaEnhancer } from '@eeacms/volto-bise-policy/components/manage/Blocks/schema';
|
|
3
4
|
|
|
@@ -30,15 +31,13 @@ const applyConfig = (config) => {
|
|
|
30
31
|
headerSearchBox: [
|
|
31
32
|
{
|
|
32
33
|
isDefault: true,
|
|
34
|
+
// to replace search path change path to whatever you want and match with the page in volto website
|
|
33
35
|
path: '/advanced-search',
|
|
34
|
-
placeholder: 'Search...',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
path: 'datahub',
|
|
38
|
-
placeholder: 'Search Datahub...',
|
|
36
|
+
placeholder: 'Search BISE...',
|
|
39
37
|
description:
|
|
40
38
|
'Looking for more information? Try searching the full EEA website content',
|
|
41
|
-
buttonTitle: 'Go to
|
|
39
|
+
buttonTitle: 'Go to advanced search',
|
|
40
|
+
buttonUrl: 'https://www.eea.europa.eu/en/advanced-search',
|
|
42
41
|
},
|
|
43
42
|
],
|
|
44
43
|
logoTargetUrl: '/',
|
|
@@ -86,6 +85,28 @@ const applyConfig = (config) => {
|
|
|
86
85
|
if (config.blocks.blocksConfig.columnsBlock) {
|
|
87
86
|
config.blocks.blocksConfig.columnsBlock.mostUsed = true;
|
|
88
87
|
config.blocks.blocksConfig.columnsBlock.schemaEnhancer = addStylingFieldsetSchemaEnhancer;
|
|
88
|
+
config.blocks.blocksConfig.columnsBlock.tocEntry = undefined;
|
|
89
|
+
config.blocks.blocksConfig.columnsBlock.tocEntries = (
|
|
90
|
+
block = {},
|
|
91
|
+
tocData,
|
|
92
|
+
) => {
|
|
93
|
+
// integration with volto-block-toc
|
|
94
|
+
const headlines = tocData.levels || ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
95
|
+
// const column_blocks = block?.data?.blocks || {};
|
|
96
|
+
let entries = [];
|
|
97
|
+
const sorted_column_blocks = getBlocks(block?.data || {});
|
|
98
|
+
sorted_column_blocks.forEach((column_block) => {
|
|
99
|
+
const sorted_blocks = getBlocks(column_block[1]);
|
|
100
|
+
sorted_blocks.forEach((block) => {
|
|
101
|
+
const { value, plaintext } = block[1];
|
|
102
|
+
const type = value?.[0]?.type;
|
|
103
|
+
if (headlines.includes(type)) {
|
|
104
|
+
entries.push([parseInt(type.slice(1)), plaintext, block[0]]);
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
return entries;
|
|
109
|
+
};
|
|
89
110
|
}
|
|
90
111
|
|
|
91
112
|
// Listing
|
|
@@ -99,6 +120,18 @@ const applyConfig = (config) => {
|
|
|
99
120
|
config.blocks.blocksConfig.hero_image_left.schemaEnhancer = addStylingFieldsetSchemaEnhancer;
|
|
100
121
|
}
|
|
101
122
|
|
|
123
|
+
// Plotly bise color
|
|
124
|
+
config.settings.plotlyCustomColors = [
|
|
125
|
+
{
|
|
126
|
+
title: 'Biodiversity Default',
|
|
127
|
+
colorscale: ['#094238', '#12957D', '#19C4A5'],
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
title: '',
|
|
131
|
+
colorscale: ['#12957D', '#F9EA8A', '#DD552B', '#AEB0B3'],
|
|
132
|
+
},
|
|
133
|
+
];
|
|
134
|
+
|
|
102
135
|
return [installBlocks, installStyles].reduce(
|
|
103
136
|
(acc, apply) => apply(acc),
|
|
104
137
|
config,
|