@eeacms/volto-bise-policy 1.0.4 → 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,7 +4,20 @@ 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.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)]
14
+ ### [1.0.5](https://github.com/eea/volto-bise-policy/compare/1.0.4...1.0.5) - 26 April 2023
15
+
16
+ #### :nail_care: Enhancements
17
+
18
+ - refactor(Header.jsx): remove unused lodash find import statement [Miu Razvan - [`708256c`](https://github.com/eea/volto-bise-policy/commit/708256c75bef332c18c0102246ad3cd6cf66ade9)]
19
+
20
+ ### [1.0.4](https://github.com/eea/volto-bise-policy/compare/1.0.3...1.0.4) - 26 April 2023
8
21
 
9
22
  #### :rocket: New Features
10
23
 
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.6",
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",
@@ -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 = ['', '/', '/edit', '/edit/'].includes(pathname);
77
+ const isHomePageInverse =
78
+ content_pathname === '' && ['', '/'].includes(pathname);
78
79
 
79
80
  const isMultilingual =
80
81
  config.settings.isMultilingual || (isSubsite && subsite.isMultilingual);
@@ -149,6 +150,7 @@ const EEAHeader = ({ token, history, subsite, content, ...props }) => {
149
150
  href="https://europa.eu/european-union/contact/institutions-bodies_en"
150
151
  target="_blank"
151
152
  rel="noreferrer"
153
+ onKeyDown={(evt) => evt.stopPropagation()}
152
154
  >
153
155
  See all EU institutions and bodies
154
156
  </a>
@@ -176,14 +178,15 @@ const EEAHeader = ({ token, history, subsite, content, ...props }) => {
176
178
  </Dropdown.Item>
177
179
  {headerOpts.partnerLinks.links.map((item, index) => (
178
180
  <Dropdown.Item key={index}>
179
- <UniversalLink
181
+ <a
180
182
  href={item.href}
181
183
  className="site"
182
- target={item.target || '_blank'}
184
+ target="_blank"
183
185
  rel="noreferrer"
186
+ onKeyDown={(evt) => evt.stopPropagation()}
184
187
  >
185
188
  {item.title}
186
- </UniversalLink>
189
+ </a>
187
190
  </Dropdown.Item>
188
191
  ))}
189
192
  </div>
@@ -259,6 +262,7 @@ const EEAHeader = ({ token, history, subsite, content, ...props }) => {
259
262
  >
260
263
  <Header.Main
261
264
  pathname={router_pathname}
265
+ headerSearchBox={headerSearchBox}
262
266
  inverted={isHomePageInverse ? true : false}
263
267
  transparency={isHomePageInverse ? true : false}
264
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 full site search',
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,
@@ -127,8 +127,9 @@
127
127
  .item {
128
128
  &:not(:last-child) {
129
129
  &:before {
130
- top: 6px;
131
- height: 60%;
130
+ top: 50%;
131
+ transform: translateY(-50%);
132
+ height: 50%;
132
133
  background: rgba(34, 36, 38, 0.8);
133
134
  }
134
135
  }
@@ -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;