@eeacms/volto-bise-policy 1.2.17 → 1.2.19

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,32 @@ 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.2.17](https://github.com/eea/volto-bise-policy/compare/1.2.16...1.2.17) - 23 May 2025
7
+ ### [1.2.19](https://github.com/eea/volto-bise-policy/compare/1.2.18...1.2.19) - 30 June 2025
8
+
9
+ #### :bug: Bug Fixes
10
+
11
+ - fix: extend column schema to populate choices [nileshgulia1 - [`6897739`](https://github.com/eea/volto-bise-policy/commit/6897739b206ba4d7618dc222b5c2d2b88a99d6af)]
12
+
13
+ #### :house: Internal changes
14
+
15
+ - style: Automated code fix [eea-jenkins - [`9b23b7c`](https://github.com/eea/volto-bise-policy/commit/9b23b7c7f1646feb814b03d4ee88ca79d093b536)]
16
+ - style: Automated code fix [eea-jenkins - [`0767bb6`](https://github.com/eea/volto-bise-policy/commit/0767bb68e90dae2570edead9201b36d5a99319e6)]
17
+
18
+ #### :hammer_and_wrench: Others
19
+
20
+ - add custom css basic block [Claudia Ifrim - [`3a43d19`](https://github.com/eea/volto-bise-policy/commit/3a43d1909e185be80e17a82434917c1c42ee6c77)]
21
+ - custom js block [Claudia Ifrim - [`8e40d21`](https://github.com/eea/volto-bise-policy/commit/8e40d219592b816d274c3b3143c39f0737de82da)]
22
+ - rename simple data table customization [Claudia Ifrim - [`9e1bc9e`](https://github.com/eea/volto-bise-policy/commit/9e1bc9e0af3d3c2be9eaf129b2bb03d72a0805eb)]
23
+ ### [1.2.18](https://github.com/eea/volto-bise-policy/compare/1.2.17...1.2.18) - 23 June 2025
24
+
25
+ #### :house: Internal changes
26
+
27
+ - style: Automated code fix [eea-jenkins - [`58c352b`](https://github.com/eea/volto-bise-policy/commit/58c352b8c54e2c62795f2a468b02ee4b71aa6030)]
28
+
29
+ #### :hammer_and_wrench: Others
30
+
31
+ - hide expert view header link on national and emerald sites [Claudia Ifrim - [`a65b6b4`](https://github.com/eea/volto-bise-policy/commit/a65b6b407a51d93bfe150b62e2bff7dd63f4e423)]
32
+ ### [1.2.17](https://github.com/eea/volto-bise-policy/compare/1.2.16...1.2.17) - 26 May 2025
8
33
 
9
34
  #### :bug: Bug Fixes
10
35
 
@@ -89,7 +114,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
89
114
  - chore: customize root theme to use volto-spotlight - refs #259794 [ana-oprea - [`347f96e`](https://github.com/eea/volto-bise-policy/commit/347f96e335139f9656abd34c308c531b05de85e7)]
90
115
  - chore: change the theme and alias to volto-spotlight and add volto-spotlight to package.json - refs #259794 [ana-oprea - [`52732a1`](https://github.com/eea/volto-bise-policy/commit/52732a17b3247a04ffae0a3f5118e173afa98157)]
91
116
  - chore: change theme to eea-volto-theme, change config.alias - refs #259794 [ana-oprea - [`c2d08ea`](https://github.com/eea/volto-bise-policy/commit/c2d08ea08a7f0e5f6f7d32149e60ea3f3e901923)]
92
- - chore: [JENKINS] Refactor automated testing [valentinab25 - [`a3c9488`](https://github.com/eea/volto-bise-policy/commit/a3c9488c5d09ba97fe5976675524d436080a2460)]
93
117
  - chore: husky, lint-staged use fixed versions [valentinab25 - [`fddc30f`](https://github.com/eea/volto-bise-policy/commit/fddc30f11a1d8ec290edaca2d924282f5e113bc6)]
94
118
  - chore:volto 16 in tests, update docs, fix stylelint overrides [valentinab25 - [`005ce74`](https://github.com/eea/volto-bise-policy/commit/005ce742dbd014fde27e417059251233365766dd)]
95
119
 
@@ -102,17 +126,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
102
126
  - test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`c1277ba`](https://github.com/eea/volto-bise-policy/commit/c1277bacf840ee9feccbfd6a2c85f0b25a9a9125)]
103
127
  - test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`c944153`](https://github.com/eea/volto-bise-policy/commit/c944153710fd53c5d48863cf363464273e25f52e)]
104
128
  - test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`d648d52`](https://github.com/eea/volto-bise-policy/commit/d648d525a2fc5076577fe0f75ff9782bf0d1d4e9)]
105
- - test: [JENKINS] fix jest config, fail with logs on coverage [valentinab25 - [`2a7affe`](https://github.com/eea/volto-bise-policy/commit/2a7affe33d737704bdba117c4a5c8c6748ef7a47)]
106
- - test: [JENKINS] fix jest config, fail with logs on coverage [valentinab25 - [`5929642`](https://github.com/eea/volto-bise-policy/commit/59296420105d0e8c1f1547aa0cd17a019e478c2b)]
107
- - test: [JENKINS] fix jest config, fail with logs on coverage [valentinab25 - [`b1142f1`](https://github.com/eea/volto-bise-policy/commit/b1142f1da3667a9f56720f65bebce897a5dd8005)]
108
129
  - test: cypress should not wait for navigation, actions, types - refs #259794 [ana-oprea - [`188637c`](https://github.com/eea/volto-bise-policy/commit/188637c78a0cae71b5ee48022507d559dfaceb3e)]
109
- - test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`fa4e473`](https://github.com/eea/volto-bise-policy/commit/fa4e473018386ec3f09d7300d655c8cccdc19a0e)]
110
- - test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`1d9135b`](https://github.com/eea/volto-bise-policy/commit/1d9135bb878b3c7a1b828085b99b9d27d78ce60e)]
111
130
  - remove cypress tests as it doesn t work on bise [Dobricean Ioan Dorian - [`ba7e2de`](https://github.com/eea/volto-bise-policy/commit/ba7e2defea2dcfd01537c3abb41fa9515ff0a3e3)]
112
131
  - add mega menu layout settings as #259794 said [dobri1408 - [`b9a3683`](https://github.com/eea/volto-bise-policy/commit/b9a3683e7d85f8c88ad8feac975c47c434f62c4a)]
113
- - test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`9181908`](https://github.com/eea/volto-bise-policy/commit/9181908c7f4b51bdf83a34f8c7f25827de9b1cc6)]
114
- - test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`099d796`](https://github.com/eea/volto-bise-policy/commit/099d79669471e6924bf1e0bc51a79d54379c3a1a)]
115
- - test: [JENKINS] Improve cypress time [valentinab25 - [`6d5d8e2`](https://github.com/eea/volto-bise-policy/commit/6d5d8e29b04ddb92628245570055067ca3dcbb6c)]
116
132
  - test: fix comment [valentinab25 - [`4f27d5a`](https://github.com/eea/volto-bise-policy/commit/4f27d5af2e8895c7af4f1157521ca42682b96e23)]
117
133
  - test: EN locales, pre-commit fix, feature PRs checks Refs #257193 [valentinab25 - [`4c2fcb0`](https://github.com/eea/volto-bise-policy/commit/4c2fcb01065e1ef962317ba7be788fd1df079618)]
118
134
  - test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`89afaa1`](https://github.com/eea/volto-bise-policy/commit/89afaa15892930452027ef8c8593fc6d193cda70)]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-bise-policy",
3
- "version": "1.2.17",
3
+ "version": "1.2.19",
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",
@@ -0,0 +1,16 @@
1
+ import { TextareaWidget } from '@plone/volto/components';
2
+
3
+ const CustomCSSBlockEdit = ({ data, onChangeBlock, block }) => {
4
+ return (
5
+ <TextareaWidget
6
+ id="cssCode"
7
+ title="Inline CSS"
8
+ value={data.cssCode}
9
+ onChange={(id, value) =>
10
+ onChangeBlock(block, { ...data, cssCode: value })
11
+ }
12
+ />
13
+ );
14
+ };
15
+
16
+ export default CustomCSSBlockEdit;
@@ -0,0 +1,17 @@
1
+ import { useEffect } from 'react';
2
+
3
+ const CustomCSSBlockView = ({ data }) => {
4
+ useEffect(() => {
5
+ const style = document.createElement('style');
6
+ style.innerHTML = data?.cssCode || '';
7
+ document.head.appendChild(style);
8
+
9
+ return () => {
10
+ document.head.removeChild(style);
11
+ };
12
+ }, [data]);
13
+
14
+ return null;
15
+ };
16
+
17
+ export default CustomCSSBlockView;
@@ -0,0 +1,26 @@
1
+ import codeSVG from '@plone/volto/icons/code.svg';
2
+ import CustomCSSView from './CustomCSSView';
3
+ import CustomCSSEdit from './CustomCSSEdit';
4
+
5
+ const config = (config) => {
6
+ config.blocks.blocksConfig.biseCustomCSS = {
7
+ id: 'biseCustomCSS',
8
+ title: 'Custom CSS',
9
+ icon: codeSVG,
10
+ group: 'custom_addons',
11
+ view: CustomCSSView,
12
+ edit: CustomCSSEdit,
13
+ restricted: false,
14
+ mostUsed: false,
15
+ blockHasOwnFocusManagement: false,
16
+ sidebarTab: 1,
17
+ security: {
18
+ addPermission: [],
19
+ view: [],
20
+ },
21
+ };
22
+
23
+ return config;
24
+ };
25
+
26
+ export default config;
@@ -0,0 +1,14 @@
1
+ import { TextareaWidget } from '@plone/volto/components';
2
+
3
+ const CustomJSBlockEdit = ({ data, onChangeBlock, block }) => {
4
+ return (
5
+ <TextareaWidget
6
+ id="jsCode"
7
+ title="Inline JavaScript"
8
+ value={data.jsCode}
9
+ onChange={(id, value) => onChangeBlock(block, { ...data, jsCode: value })}
10
+ />
11
+ );
12
+ };
13
+
14
+ export default CustomJSBlockEdit;
@@ -0,0 +1,18 @@
1
+ import { useEffect } from 'react';
2
+
3
+ const CustomJSBlockView = ({ data }) => {
4
+ useEffect(() => {
5
+ const script = document.createElement('script');
6
+ script.type = 'text/javascript';
7
+ script.innerHTML = data?.jsCode || '';
8
+ document.body.appendChild(script);
9
+
10
+ return () => {
11
+ document.body.removeChild(script);
12
+ };
13
+ }, [data]);
14
+
15
+ return null;
16
+ };
17
+
18
+ export default CustomJSBlockView;
@@ -0,0 +1,26 @@
1
+ import codeSVG from '@plone/volto/icons/code.svg';
2
+ import CustomJSView from './CustomJSView';
3
+ import CustomJSEdit from './CustomJSEdit';
4
+
5
+ const config = (config) => {
6
+ config.blocks.blocksConfig.biseCustomJS = {
7
+ id: 'biseCustomJS',
8
+ title: 'Custom JS',
9
+ icon: codeSVG,
10
+ group: 'custom_addons',
11
+ view: CustomJSView,
12
+ edit: CustomJSEdit,
13
+ restricted: false,
14
+ mostUsed: false,
15
+ blockHasOwnFocusManagement: false,
16
+ sidebarTab: 1,
17
+ security: {
18
+ addPermission: [],
19
+ view: [],
20
+ },
21
+ };
22
+
23
+ return config;
24
+ };
25
+
26
+ export default config;
@@ -1,4 +1,6 @@
1
1
  import installBodyClass from './BodyClass';
2
+ import installCustomJS from './CustomJS';
3
+ import installCustomCSS from './CustomCSS';
2
4
  import installRedirect from './Redirect';
3
5
  import installFactsheetsListing from './FactsheetsListing';
4
6
  import installKeyFacts from './KeyFacts';
@@ -8,6 +10,8 @@ import installNavigation from './Navigation';
8
10
  const config = (config) => {
9
11
  return [
10
12
  installBodyClass,
13
+ installCustomJS,
14
+ installCustomCSS,
11
15
  installRedirect,
12
16
  installFactsheetsListing,
13
17
  installKeyFacts,
@@ -69,13 +69,14 @@ class Edit extends Component {
69
69
 
70
70
  if (!provider_data) return schema;
71
71
 
72
- const choices = Array.from(Object.keys(provider_data).sort()).map((n) => [
73
- n,
74
- n,
75
- ]);
76
-
77
- schema.properties.columns.schema.properties.column.choices = choices;
78
- schema.properties.columns.schema.properties.column_link.choices = choices;
72
+ const choices = Array.from(
73
+ Object.keys(provider_data).sort((a, b) => a - b),
74
+ ).map((n) => [n, n]);
75
+ schema.properties.columns.schemaExtender = (schema) => {
76
+ schema.properties.column.choices = choices;
77
+ schema.properties.column_link.choices = choices;
78
+ return schema;
79
+ };
79
80
 
80
81
  return schema;
81
82
  };
@@ -109,7 +110,7 @@ const EditWrapper = compose(
109
110
  }),
110
111
  )(injectIntl(Edit));
111
112
 
112
- const $Edit = (props) => {
113
+ const SimpleDataTableEdit = (props) => {
113
114
  return (
114
115
  <VisibilitySensor offset={{ top: -150, bottom: -150 }}>
115
116
  <EditWrapper {...props} />
@@ -117,4 +118,4 @@ const $Edit = (props) => {
117
118
  );
118
119
  };
119
120
 
120
- export default $Edit;
121
+ export default SimpleDataTableEdit;
@@ -11,12 +11,12 @@ import { ColoredTableView, coloredTableSchema } from './templates/colored';
11
11
  const applyConfig = (config) => {
12
12
  config.blocks.blocksConfig.simpleDataConnectedTable = {
13
13
  id: 'simpleDataConnectedTable',
14
- title: 'Data Table',
14
+ title: 'Simple Data Table',
15
15
  icon: tableSVG,
16
16
  group: 'data_blocks',
17
17
  view: SimpleDataTableView,
18
18
  edit: SimpleDataTableEdit,
19
- restricted: true,
19
+ restricted: false,
20
20
  mostUsed: false,
21
21
  sidebarTab: 1,
22
22
  security: {
@@ -61,14 +61,16 @@ const View = (props) => {
61
61
  clearTimeout(timeoutRef.current);
62
62
  props.dispatch({ type: 'TABLE_START_SEARCH', query: data.value });
63
63
  timeoutRef.current = setTimeout(() => {
64
- props.history.push({
65
- search:
66
- '?' +
67
- qs.stringify({
68
- ...props.query,
69
- searchTerm: data.value,
70
- }),
71
- });
64
+ if (props.history) {
65
+ props.history.push({
66
+ search:
67
+ '?' +
68
+ qs.stringify({
69
+ ...props.query,
70
+ searchTerm: data.value,
71
+ }),
72
+ });
73
+ }
72
74
  if (data.value.length === 0) {
73
75
  props.dispatch({ type: 'TABLE_CLEAN_QUERY' });
74
76
  return;
@@ -233,9 +235,7 @@ const View = (props) => {
233
235
  {placeholder}
234
236
  </Table.Cell>
235
237
  </Table.Row>
236
- ) : (
237
- ''
238
- )}
238
+ ) : null}
239
239
  </Table.Body>
240
240
  {Math.ceil(items.length / row_size) > 1 ? (
241
241
  <Table.Footer>
@@ -258,9 +258,7 @@ const View = (props) => {
258
258
  </Table.HeaderCell>
259
259
  </Table.Row>
260
260
  </Table.Footer>
261
- ) : (
262
- ''
263
- )}
261
+ ) : null}
264
262
  </Table>
265
263
  </div>
266
264
  );
@@ -74,7 +74,18 @@ const EEAHeader = ({ token, history, subsite, content, screen, ...props }) => {
74
74
 
75
75
  const isN2KSite = useMemo(() => {
76
76
  return !!matchPath(pathname, {
77
- path: ['/natura2000/sites/site', '/natura2000/sites/site_cdda'],
77
+ path: [
78
+ '/natura2000/sites/site',
79
+ '/natura2000/sites/site_cdda',
80
+ '/natura2000/sites/emerald',
81
+ ],
82
+ exact: false,
83
+ });
84
+ }, [pathname]);
85
+
86
+ const hideExpertView = useMemo(() => {
87
+ return !!matchPath(pathname, {
88
+ path: ['/natura2000/sites/site_cdda', '/natura2000/sites/emerald'],
78
89
  exact: false,
79
90
  });
80
91
  }, [pathname]);
@@ -343,7 +354,10 @@ const EEAHeader = ({ token, history, subsite, content, screen, ...props }) => {
343
354
  className: 'deep-dive',
344
355
  target: params.site_code ? '_blank' : null,
345
356
  },
346
- ]
357
+ ].filter(
358
+ (item) =>
359
+ item.title !== 'GO TO EXPERT VIEW' || !hideExpertView,
360
+ )
347
361
  : isSubsite && !subsite.isRoot && !isN2KSpecies && !isN2KHabitat
348
362
  ? getSubsiteItems()
349
363
  : items.filter((item) => item.url !== '/natura2000')