@eeacms/volto-bise-policy 1.0.5 → 1.0.7

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,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
+ ### [1.0.7](https://github.com/eea/volto-bise-policy/compare/1.0.6...1.0.7) - 23 May 2023
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - clean up [Miu Razvan - [`81951e8`](https://github.com/eea/volto-bise-policy/commit/81951e815b6db1b1a54d78f0b1769208e1bed586)]
12
+ - restrict some blocks [Miu Razvan - [`c61e7d0`](https://github.com/eea/volto-bise-policy/commit/c61e7d0c03e7e29f0b4f3150f0382e2201c8d620)]
13
+ ### [1.0.6](https://github.com/eea/volto-bise-policy/compare/1.0.5...1.0.6) - 23 May 2023
14
+
15
+ #### :hammer_and_wrench: Others
16
+
17
+ - update [Miu Razvan - [`427a1e8`](https://github.com/eea/volto-bise-policy/commit/427a1e8f947cf0912fe0ad2455c6a9ac4d934cb7)]
18
+ - es lint [Zoltan Szabo - [`917fba3`](https://github.com/eea/volto-bise-policy/commit/917fba3dcc07eec3de91008eda8afe209865b436)]
19
+ - updated search popup [Zoltan Szabo - [`27618e1`](https://github.com/eea/volto-bise-policy/commit/27618e1aac391c2f89882d2a6478be456f6c60c7)]
7
20
  ### [1.0.5](https://github.com/eea/volto-bise-policy/compare/1.0.4...1.0.5) - 26 April 2023
8
21
 
9
22
  #### :nail_care: Enhancements
10
23
 
11
24
  - 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
25
 
14
26
  ### [1.0.4](https://github.com/eea/volto-bise-policy/compare/1.0.3...1.0.4) - 26 April 2023
15
27
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-bise-policy",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
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);
@@ -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
 
@@ -7,6 +8,12 @@ import installStyles from './components/manage/Styles';
7
8
  import biseLogo from '@eeacms/volto-bise-policy/../theme//assets/images/Header/bise-logo.svg';
8
9
  import biseWhiteLogo from '@eeacms/volto-bise-policy/../theme//assets/images/Header/bise-logo-white.svg';
9
10
 
11
+ const restrictedBlocks = [
12
+ 'imagecards',
13
+ 'embed_eea_tableau_block',
14
+ 'embed_eea_map_block',
15
+ ];
16
+
10
17
  const applyConfig = (config) => {
11
18
  // Volto specific settings
12
19
  config.settings = {
@@ -30,15 +37,13 @@ const applyConfig = (config) => {
30
37
  headerSearchBox: [
31
38
  {
32
39
  isDefault: true,
40
+ // to replace search path change path to whatever you want and match with the page in volto website
33
41
  path: '/advanced-search',
34
- placeholder: 'Search...',
35
- },
36
- {
37
- path: 'datahub',
38
- placeholder: 'Search Datahub...',
42
+ placeholder: 'Search BISE...',
39
43
  description:
40
44
  'Looking for more information? Try searching the full EEA website content',
41
- buttonTitle: 'Go to full site search',
45
+ buttonTitle: 'Go to advanced search',
46
+ buttonUrl: 'https://www.eea.europa.eu/en/advanced-search',
42
47
  },
43
48
  ],
44
49
  logoTargetUrl: '/',
@@ -59,11 +64,6 @@ const applyConfig = (config) => {
59
64
  multilingualSubsites: ['/natura2000'],
60
65
  };
61
66
 
62
- config.settings.apiExpanders.push({
63
- match: '/',
64
- GET_CONTENT: ['translations'],
65
- });
66
-
67
67
  config.blocks.requiredBlocks = [];
68
68
 
69
69
  config.blocks.blocksConfig.html.restricted = false;
@@ -86,6 +86,27 @@ const applyConfig = (config) => {
86
86
  if (config.blocks.blocksConfig.columnsBlock) {
87
87
  config.blocks.blocksConfig.columnsBlock.mostUsed = true;
88
88
  config.blocks.blocksConfig.columnsBlock.schemaEnhancer = addStylingFieldsetSchemaEnhancer;
89
+ config.blocks.blocksConfig.columnsBlock.tocEntry = undefined;
90
+ config.blocks.blocksConfig.columnsBlock.tocEntries = (
91
+ block = {},
92
+ tocData,
93
+ ) => {
94
+ // integration with volto-block-toc
95
+ const headlines = tocData.levels || ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
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,25 @@ 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
+
135
+ // Disable some blocks
136
+ restrictedBlocks.forEach((block) => {
137
+ if (config.blocks.blocksConfig[block]) {
138
+ config.blocks.blocksConfig[block].restricted = true;
139
+ }
140
+ });
141
+
102
142
  return [installBlocks, installStyles].reduce(
103
143
  (acc, apply) => apply(acc),
104
144
  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
  }