@eeacms/volto-bise-policy 1.2.12 → 1.2.14

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,6 +4,15 @@ 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.14](https://github.com/eea/volto-bise-policy/compare/1.2.13...1.2.14) - 11 December 2024
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - fix eslint [Miu Razvan - [`cb8d143`](https://github.com/eea/volto-bise-policy/commit/cb8d1438cdfd37840639879ea235fbd0eb69d59f)]
12
+ - fix eslint [Miu Razvan - [`49f38f4`](https://github.com/eea/volto-bise-policy/commit/49f38f4509ae68e0658137511eacd521bac6c078)]
13
+ - restrict factsheet block [Miu Razvan - [`daf4dcd`](https://github.com/eea/volto-bise-policy/commit/daf4dcd4684e121ccc86e26a2155ad127dbd7204)]
14
+ ### [1.2.13](https://github.com/eea/volto-bise-policy/compare/1.2.12...1.2.13) - 12 November 2024
15
+
7
16
  ### [1.2.12](https://github.com/eea/volto-bise-policy/compare/1.2.11...1.2.12) - 6 November 2024
8
17
 
9
18
  #### :bug: Bug Fixes
@@ -23,7 +32,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
23
32
  - update [Miu Razvan - [`48277be`](https://github.com/eea/volto-bise-policy/commit/48277bed1c4dc9ed7c24c3deddce76a0bb5b2d97)]
24
33
  - lint fix [Miu Razvan - [`a60d19d`](https://github.com/eea/volto-bise-policy/commit/a60d19d8c999e99a212bab03ef5b8118ab5c3690)]
25
34
  - merge develop into header-style [Miu Razvan - [`2ebf224`](https://github.com/eea/volto-bise-policy/commit/2ebf224cd30787516653244350e03dbf8624070a)]
26
- - update n2k style [Miu Razvan - [`1751cd2`](https://github.com/eea/volto-bise-policy/commit/1751cd227c849601d6d7b7fc071ffb977dff59c8)]
27
35
  - test: Update to volto 17 PR30 [valentinab25 - [`3ae5e75`](https://github.com/eea/volto-bise-policy/commit/3ae5e752557618a5acd617a7ce3f5bff5df65ec1)]
28
36
  - test: Update to volto 17 PR30 [valentinab25 - [`4cd82f2`](https://github.com/eea/volto-bise-policy/commit/4cd82f24a4bfec508a1a4de9035ffe4c75bda0ad)]
29
37
  ### [1.2.11](https://github.com/eea/volto-bise-policy/compare/1.2.10...1.2.11) - 28 May 2024
@@ -55,6 +63,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
55
63
  - chore: customize root theme to use volto-spotlight - refs #259794 [ana-oprea - [`347f96e`](https://github.com/eea/volto-bise-policy/commit/347f96e335139f9656abd34c308c531b05de85e7)]
56
64
  - 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)]
57
65
  - chore: change theme to eea-volto-theme, change config.alias - refs #259794 [ana-oprea - [`c2d08ea`](https://github.com/eea/volto-bise-policy/commit/c2d08ea08a7f0e5f6f7d32149e60ea3f3e901923)]
66
+ - chore: [JENKINS] Refactor automated testing [valentinab25 - [`a3c9488`](https://github.com/eea/volto-bise-policy/commit/a3c9488c5d09ba97fe5976675524d436080a2460)]
58
67
  - chore: husky, lint-staged use fixed versions [valentinab25 - [`fddc30f`](https://github.com/eea/volto-bise-policy/commit/fddc30f11a1d8ec290edaca2d924282f5e113bc6)]
59
68
  - chore:volto 16 in tests, update docs, fix stylelint overrides [valentinab25 - [`005ce74`](https://github.com/eea/volto-bise-policy/commit/005ce742dbd014fde27e417059251233365766dd)]
60
69
 
@@ -67,9 +76,17 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
67
76
  - test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`c1277ba`](https://github.com/eea/volto-bise-policy/commit/c1277bacf840ee9feccbfd6a2c85f0b25a9a9125)]
68
77
  - test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`c944153`](https://github.com/eea/volto-bise-policy/commit/c944153710fd53c5d48863cf363464273e25f52e)]
69
78
  - test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`d648d52`](https://github.com/eea/volto-bise-policy/commit/d648d525a2fc5076577fe0f75ff9782bf0d1d4e9)]
79
+ - test: [JENKINS] fix jest config, fail with logs on coverage [valentinab25 - [`2a7affe`](https://github.com/eea/volto-bise-policy/commit/2a7affe33d737704bdba117c4a5c8c6748ef7a47)]
80
+ - test: [JENKINS] fix jest config, fail with logs on coverage [valentinab25 - [`5929642`](https://github.com/eea/volto-bise-policy/commit/59296420105d0e8c1f1547aa0cd17a019e478c2b)]
81
+ - test: [JENKINS] fix jest config, fail with logs on coverage [valentinab25 - [`b1142f1`](https://github.com/eea/volto-bise-policy/commit/b1142f1da3667a9f56720f65bebce897a5dd8005)]
70
82
  - test: cypress should not wait for navigation, actions, types - refs #259794 [ana-oprea - [`188637c`](https://github.com/eea/volto-bise-policy/commit/188637c78a0cae71b5ee48022507d559dfaceb3e)]
83
+ - test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`fa4e473`](https://github.com/eea/volto-bise-policy/commit/fa4e473018386ec3f09d7300d655c8cccdc19a0e)]
84
+ - test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`1d9135b`](https://github.com/eea/volto-bise-policy/commit/1d9135bb878b3c7a1b828085b99b9d27d78ce60e)]
71
85
  - remove cypress tests as it doesn t work on bise [Dobricean Ioan Dorian - [`ba7e2de`](https://github.com/eea/volto-bise-policy/commit/ba7e2defea2dcfd01537c3abb41fa9515ff0a3e3)]
72
86
  - add mega menu layout settings as #259794 said [dobri1408 - [`b9a3683`](https://github.com/eea/volto-bise-policy/commit/b9a3683e7d85f8c88ad8feac975c47c434f62c4a)]
87
+ - test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`9181908`](https://github.com/eea/volto-bise-policy/commit/9181908c7f4b51bdf83a34f8c7f25827de9b1cc6)]
88
+ - test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`099d796`](https://github.com/eea/volto-bise-policy/commit/099d79669471e6924bf1e0bc51a79d54379c3a1a)]
89
+ - test: [JENKINS] Improve cypress time [valentinab25 - [`6d5d8e2`](https://github.com/eea/volto-bise-policy/commit/6d5d8e29b04ddb92628245570055067ca3dcbb6c)]
73
90
  - test: fix comment [valentinab25 - [`4f27d5a`](https://github.com/eea/volto-bise-policy/commit/4f27d5af2e8895c7af4f1157521ca42682b96e23)]
74
91
  - test: EN locales, pre-commit fix, feature PRs checks Refs #257193 [valentinab25 - [`4c2fcb0`](https://github.com/eea/volto-bise-policy/commit/4c2fcb01065e1ef962317ba7be788fd1df079618)]
75
92
  - 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.12",
3
+ "version": "1.2.14",
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",
package/razzle.extend.js CHANGED
@@ -2,23 +2,12 @@ const path = require('path');
2
2
  const plugins = (defaultPlugins) => {
3
3
  return defaultPlugins;
4
4
  };
5
- const modify = (config, { target, dev }, webpack) => {
5
+ const modify = (config) => {
6
6
  const themeConfigPath = `${__dirname}/theme/theme.config`;
7
7
  config.resolve.alias['../../theme.config$'] = themeConfigPath;
8
8
  config.resolve.alias['../../theme.config'] = themeConfigPath;
9
- config.resolve.alias['../../theme'] = `${__dirname}/theme`;
10
- const projectRootPath = path.resolve('.');
11
- const themeLessPath = `${projectRootPath}/node_modules/@eeacms/volto-spotlight/theme`;
12
-
13
- config.resolve.alias['volto-spotlight-theme'] = dev
14
- ? `${projectRootPath}/src/addons/volto-spotlight/theme/themes/spotlight`
15
- : `${themeLessPath}/themes/spotlight`;
16
9
 
17
- const semanticLessPath = `${projectRootPath}/node_modules/semantic-ui-less`;
18
- const hasDesignSystemInstalled =
19
- config.resolve.alias['volto-spotlight-themes'];
20
- config.resolve.alias['volto-spotlight-theme-folder'] =
21
- hasDesignSystemInstalled ? themeLessPath : semanticLessPath;
10
+ config.resolve.alias['../../theme'] = `${__dirname}/theme`;
22
11
 
23
12
  return config;
24
13
  };
@@ -10,7 +10,7 @@ const config = (config) => {
10
10
  group: 'custom_addons',
11
11
  view: FactsheetsListingView,
12
12
  edit: FactsheetsListingEdit,
13
- restricted: false,
13
+ restricted: true,
14
14
  mostUsed: false,
15
15
  blockHasOwnFocusManagement: false,
16
16
  sidebarTab: 1,
@@ -1,64 +1,61 @@
1
- import React, { Component } from 'react';
1
+ import { useMemo } from 'react';
2
2
  import { compose } from 'redux';
3
3
  import cx from 'classnames';
4
4
  import { SidebarPortal } from '@plone/volto/components'; // EditBlock
5
5
  import InlineForm from '@plone/volto/components/manage/Form/InlineForm';
6
6
 
7
- import MaesViewerSchema from './schema';
7
+ import maesViewrSchema from './schema';
8
8
  import { connectToProviderData } from '@eeacms/volto-datablocks/hocs';
9
9
  import MaesViewerView from './MaesViewerView';
10
10
  import { defaultHoverTemplate } from './constants';
11
11
 
12
- class Edit extends Component {
13
- constructor(props) {
14
- super(props);
15
- this.schema = MaesViewerSchema();
16
- }
12
+ function Edit(props) {
13
+ const { data, provider_data, block, selected, onChangeBlock } = props;
17
14
 
18
- getSchema = () => {
19
- if (!this.props.provider_data) return this.schema;
20
- const provider_data = this.props.provider_data || {};
15
+ const schema = useMemo(() => {
16
+ if (!provider_data) return maesViewrSchema;
21
17
 
22
18
  const select_field = 'Ecosystem_level2';
23
19
  const choices = Array.from(
24
20
  new Set(provider_data?.[select_field] || []),
25
21
  ).map((n) => [n, n]);
26
22
 
27
- const newSchema = this.schema;
23
+ const newSchema = { ...maesViewrSchema };
28
24
  newSchema.properties.ecosystem.choices = choices;
29
25
 
30
- if (this.props.data && !this.props.data.hoverTemplate) {
31
- this.props.onChangeBlock(this.props.block, {
32
- ...this.props.data,
26
+ if (data && !data.hoverTemplate) {
27
+ onChangeBlock(block, {
28
+ ...data,
33
29
  hoverTemplate: defaultHoverTemplate,
34
30
  });
35
31
  }
36
32
 
37
33
  return newSchema;
38
- };
39
-
40
- render() {
41
- const schema = this.getSchema();
42
- return (
43
- <div className={cx('block', { selected: this.props.selected })}>
44
- <MaesViewerView data={this.props.data} />
45
-
46
- <SidebarPortal selected={this.props.selected}>
47
- <InlineForm
48
- schema={schema}
49
- title={schema.title}
50
- onChangeField={(id, value) => {
51
- this.props.onChangeBlock(this.props.block, {
52
- ...this.props.data,
53
- [id]: value,
54
- });
55
- }}
56
- formData={this.props.data}
57
- />
58
- </SidebarPortal>
59
- </div>
60
- );
61
- }
34
+ }, [block, data, onChangeBlock, provider_data]);
35
+
36
+ return (
37
+ <div className={cx('block', { selected })}>
38
+ <MaesViewerView data={data} />
39
+
40
+ <SidebarPortal selected={selected}>
41
+ <InlineForm
42
+ schema={schema}
43
+ title={schema.title}
44
+ onChangeField={(id, value) => {
45
+ onChangeBlock(block, {
46
+ ...data,
47
+ [id]: value,
48
+ });
49
+ }}
50
+ formData={data}
51
+ />
52
+ </SidebarPortal>
53
+ </div>
54
+ );
62
55
  }
63
56
 
64
- export default compose(connectToProviderData)(Edit);
57
+ export default compose(
58
+ connectToProviderData((props) => ({
59
+ provider_url: props.data?.provider_url,
60
+ })),
61
+ )(Edit);
@@ -133,4 +133,8 @@ const View = ({ data, provider_data, id, ...rest }) => {
133
133
  );
134
134
  };
135
135
 
136
- export default compose(connectToProviderData)(View);
136
+ export default compose(
137
+ connectToProviderData((props) => ({
138
+ provider_url: props.data?.provider_url,
139
+ })),
140
+ )(View);
@@ -1,7 +1,6 @@
1
- import React from 'react';
2
1
  import { defaultHoverTemplate } from './constants';
3
2
 
4
- const MaesViewerSchema = () => ({
3
+ const maesViewrSchema = {
5
4
  title: 'Edit MAES Viewer',
6
5
 
7
6
  fieldsets: [
@@ -27,7 +26,7 @@ const MaesViewerSchema = () => ({
27
26
  widget: 'slate_richtext',
28
27
  },
29
28
  provider_url: {
30
- widget: 'pick_provider',
29
+ widget: 'internal_url',
31
30
  title: 'Data provider',
32
31
  },
33
32
  ecosystem: {
@@ -55,6 +54,6 @@ const MaesViewerSchema = () => ({
55
54
  },
56
55
 
57
56
  required: ['provider_url'],
58
- });
57
+ };
59
58
 
60
- export default MaesViewerSchema;
59
+ export default maesViewrSchema;
@@ -16,7 +16,7 @@ const applyConfig = (config) => {
16
16
  group: 'data_blocks',
17
17
  view: SimpleDataTableView,
18
18
  edit: SimpleDataTableEdit,
19
- restricted: false,
19
+ restricted: true,
20
20
  mostUsed: false,
21
21
  sidebarTab: 1,
22
22
  security: {
@@ -127,7 +127,7 @@
127
127
  /*******************************
128
128
  Import Theme
129
129
  *******************************/
130
- @import (multiple) "~volto-spotlight-theme-folder/theme.less";
130
+ @import (multiple) "~volto-spotlight-themes/../theme.less";
131
131
 
132
132
  @fontPath: "~volto-themes/default/assets/fonts";
133
133
 
@@ -1,7 +0,0 @@
1
- /*******************************
2
- Accordion
3
- *******************************/
4
-
5
- /* Icon */
6
- @iconColor: #fff;
7
- @iconColorActive: #fff;