@eeacms/volto-bise-policy 1.2.6 → 1.2.8

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/.eslintrc.js ADDED
@@ -0,0 +1,65 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const projectRootPath = fs.realpathSync(__dirname + '/../../../');
4
+
5
+ let voltoPath = path.join(projectRootPath, 'node_modules/@plone/volto');
6
+ let configFile;
7
+ if (fs.existsSync(`${projectRootPath}/tsconfig.json`))
8
+ configFile = `${projectRootPath}/tsconfig.json`;
9
+ else if (fs.existsSync(`${projectRootPath}/jsconfig.json`))
10
+ configFile = `${projectRootPath}/jsconfig.json`;
11
+
12
+ if (configFile) {
13
+ const jsConfig = require(configFile).compilerOptions;
14
+ const pathsConfig = jsConfig.paths;
15
+ if (pathsConfig['@plone/volto'])
16
+ voltoPath = `./${jsConfig.baseUrl}/${pathsConfig['@plone/volto'][0]}`;
17
+ }
18
+
19
+ const AddonConfigurationRegistry = require(`${voltoPath}/addon-registry.js`);
20
+ const reg = new AddonConfigurationRegistry(projectRootPath);
21
+
22
+ // Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
23
+ const addonAliases = Object.keys(reg.packages).map((o) => [
24
+ o,
25
+ reg.packages[o].modulePath,
26
+ ]);
27
+
28
+ const addonExtenders = reg.getEslintExtenders().map((m) => require(m));
29
+
30
+ const defaultConfig = {
31
+ extends: `${voltoPath}/.eslintrc`,
32
+ settings: {
33
+ 'import/resolver': {
34
+ alias: {
35
+ map: [
36
+ ['@plone/volto', '@plone/volto/src'],
37
+ ['@plone/volto-slate', '@plone/volto/packages/volto-slate/src'],
38
+ ...addonAliases,
39
+ ['@package', `${__dirname}/src`],
40
+ ['@root', `${__dirname}/src`],
41
+ ['~', `${__dirname}/src`],
42
+ ],
43
+ extensions: ['.js', '.jsx', '.json'],
44
+ },
45
+ 'babel-plugin-root-import': {
46
+ rootPathSuffix: 'src',
47
+ },
48
+ },
49
+ },
50
+ rules: {
51
+ 'react/jsx-no-target-blank': [
52
+ 'error',
53
+ {
54
+ allowReferrer: true,
55
+ },
56
+ ],
57
+ }
58
+ };
59
+
60
+ const config = addonExtenders.reduce(
61
+ (acc, extender) => extender.modify(acc),
62
+ defaultConfig,
63
+ );
64
+
65
+ module.exports = config;
@@ -0,0 +1,2 @@
1
+ [ -n "$CI" ] && exit 0
2
+ yarn lint-staged
package/CHANGELOG.md CHANGED
@@ -4,11 +4,53 @@ 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.6](https://github.com/eea/volto-bise-policy/compare/1.2.5...1.2.6) - 17 July 2023
7
+ ### [1.2.8](https://github.com/eea/volto-bise-policy/compare/1.2.7...1.2.8) - 9 February 2024
8
+
9
+ #### :house: Internal changes
10
+
11
+ - style: add width and height to logos -refs #264593 [ana-oprea - [`a178aad`](https://github.com/eea/volto-bise-policy/commit/a178aad4d0986962b74dba812ca76430c57ef845)]
12
+ - chore: fix package.json [ana-oprea - [`f0107dc`](https://github.com/eea/volto-bise-policy/commit/f0107dc419c7ae7e969dea15785b4e393e59264b)]
13
+ - chore: customize root theme to use volto-spotlight - refs #259794 [ana-oprea - [`347f96e`](https://github.com/eea/volto-bise-policy/commit/347f96e335139f9656abd34c308c531b05de85e7)]
14
+ - 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)]
15
+ - chore: change theme to eea-volto-theme, change config.alias - refs #259794 [ana-oprea - [`c2d08ea`](https://github.com/eea/volto-bise-policy/commit/c2d08ea08a7f0e5f6f7d32149e60ea3f3e901923)]
16
+ - chore: [JENKINS] Refactor automated testing [valentinab25 - [`a3c9488`](https://github.com/eea/volto-bise-policy/commit/a3c9488c5d09ba97fe5976675524d436080a2460)]
17
+ - chore: husky, lint-staged use fixed versions [valentinab25 - [`fddc30f`](https://github.com/eea/volto-bise-policy/commit/fddc30f11a1d8ec290edaca2d924282f5e113bc6)]
18
+ - chore:volto 16 in tests, update docs, fix stylelint overrides [valentinab25 - [`005ce74`](https://github.com/eea/volto-bise-policy/commit/005ce742dbd014fde27e417059251233365766dd)]
8
19
 
9
20
  #### :hammer_and_wrench: Others
10
21
 
11
- - fix languages options for N2K section [Claudia Ifrim - [`e9b6090`](https://github.com/eea/volto-bise-policy/commit/e9b609098964755c98c4d2332410ff07bab05a8b)]
22
+ - tests: fix deps [Claudia Ifrim - [`4a1f6fa`](https://github.com/eea/volto-bise-policy/commit/4a1f6fa42738749ceedb8bca594ddb0df668d788)]
23
+ - fix tests [Claudia Ifrim - [`a8fc12f`](https://github.com/eea/volto-bise-policy/commit/a8fc12fbf962289c1aac42f4b54352bb585af735)]
24
+ - test: in cypress don't wait for breadcrumbs [ana-oprea - [`89e3810`](https://github.com/eea/volto-bise-policy/commit/89e38104e6f8292cdbf2b948f7fe4b7dc064bcef)]
25
+ - Replace norefferer with noopener for links that open in new tab [David Ichim - [`ef3781a`](https://github.com/eea/volto-bise-policy/commit/ef3781ac7368bf8f497082aaee0c63538c0760da)]
26
+ - test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`c1277ba`](https://github.com/eea/volto-bise-policy/commit/c1277bacf840ee9feccbfd6a2c85f0b25a9a9125)]
27
+ - test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`c944153`](https://github.com/eea/volto-bise-policy/commit/c944153710fd53c5d48863cf363464273e25f52e)]
28
+ - test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`d648d52`](https://github.com/eea/volto-bise-policy/commit/d648d525a2fc5076577fe0f75ff9782bf0d1d4e9)]
29
+ - test: [JENKINS] fix jest config, fail with logs on coverage [valentinab25 - [`2a7affe`](https://github.com/eea/volto-bise-policy/commit/2a7affe33d737704bdba117c4a5c8c6748ef7a47)]
30
+ - test: [JENKINS] fix jest config, fail with logs on coverage [valentinab25 - [`5929642`](https://github.com/eea/volto-bise-policy/commit/59296420105d0e8c1f1547aa0cd17a019e478c2b)]
31
+ - test: [JENKINS] fix jest config, fail with logs on coverage [valentinab25 - [`b1142f1`](https://github.com/eea/volto-bise-policy/commit/b1142f1da3667a9f56720f65bebce897a5dd8005)]
32
+ - test: cypress should not wait for navigation, actions, types - refs #259794 [ana-oprea - [`188637c`](https://github.com/eea/volto-bise-policy/commit/188637c78a0cae71b5ee48022507d559dfaceb3e)]
33
+ - test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`fa4e473`](https://github.com/eea/volto-bise-policy/commit/fa4e473018386ec3f09d7300d655c8cccdc19a0e)]
34
+ - test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`1d9135b`](https://github.com/eea/volto-bise-policy/commit/1d9135bb878b3c7a1b828085b99b9d27d78ce60e)]
35
+ - remove cypress tests as it doesn t work on bise [Dobricean Ioan Dorian - [`ba7e2de`](https://github.com/eea/volto-bise-policy/commit/ba7e2defea2dcfd01537c3abb41fa9515ff0a3e3)]
36
+ - add mega menu layout settings as #259794 said [dobri1408 - [`b9a3683`](https://github.com/eea/volto-bise-policy/commit/b9a3683e7d85f8c88ad8feac975c47c434f62c4a)]
37
+ - test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`9181908`](https://github.com/eea/volto-bise-policy/commit/9181908c7f4b51bdf83a34f8c7f25827de9b1cc6)]
38
+ - test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`099d796`](https://github.com/eea/volto-bise-policy/commit/099d79669471e6924bf1e0bc51a79d54379c3a1a)]
39
+ - test: [JENKINS] Improve cypress time [valentinab25 - [`6d5d8e2`](https://github.com/eea/volto-bise-policy/commit/6d5d8e29b04ddb92628245570055067ca3dcbb6c)]
40
+ - test: fix comment [valentinab25 - [`4f27d5a`](https://github.com/eea/volto-bise-policy/commit/4f27d5af2e8895c7af4f1157521ca42682b96e23)]
41
+ - test: EN locales, pre-commit fix, feature PRs checks Refs #257193 [valentinab25 - [`4c2fcb0`](https://github.com/eea/volto-bise-policy/commit/4c2fcb01065e1ef962317ba7be788fd1df079618)]
42
+ - test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`89afaa1`](https://github.com/eea/volto-bise-policy/commit/89afaa15892930452027ef8c8593fc6d193cda70)]
43
+ ### [1.2.7](https://github.com/eea/volto-bise-policy/compare/1.2.6...1.2.7) - 9 August 2023
44
+
45
+ #### :house: Documentation changes
46
+
47
+ - docs: Cleanup Makefile, update DEVELOP documentation, i18n - refs #254894 [valentinab25 - [`6a0f42d`](https://github.com/eea/volto-bise-policy/commit/6a0f42ddd3156ce2ae39900bfb766fe6c1e69d81)]
48
+
49
+ #### :hammer_and_wrench: Others
50
+
51
+ - Remove Norway from language list of Natura 2000 section [Claudia Ifrim - [`2911fab`](https://github.com/eea/volto-bise-policy/commit/2911fab4b964c9bee255f6a70fd7ffc83623b453)]
52
+ ### [1.2.6](https://github.com/eea/volto-bise-policy/compare/1.2.5...1.2.6) - 17 July 2023
53
+
12
54
  ### [1.2.5](https://github.com/eea/volto-bise-policy/compare/1.2.4...1.2.5) - 5 July 2023
13
55
 
14
56
  ### [1.2.4](https://github.com/eea/volto-bise-policy/compare/1.2.3...1.2.4) - 4 July 2023
package/DEVELOP.md CHANGED
@@ -2,6 +2,30 @@
2
2
 
3
3
  ## Develop
4
4
 
5
+ 1. Make sure you have `docker` and `docker compose` installed and running on your machine:
6
+
7
+ ```Bash
8
+ git clone https://github.com/eea/volto-bise-policy.git
9
+ cd volto-bise-policy
10
+ git checkout -b bugfix-123456 develop
11
+ make
12
+ make start
13
+ ```
14
+
15
+ 1. Wait for `Volto started at 0.0.0.0:3000` meesage
16
+
17
+ 1. Go to http://localhost:3000
18
+
19
+ 1. Initialize git hooks
20
+
21
+ ```Bash
22
+ yarn prepare
23
+ ```
24
+
25
+ 1. Happy hacking!
26
+
27
+ ### Or add @eeacms/volto-bise-policy to your Volto project
28
+
5
29
  Before starting make sure your development environment is properly set. See [Volto Developer Documentation](https://docs.voltocms.com/getting-started/install/)
6
30
 
7
31
  1. Make sure you have installed `yo`, `@plone/generator-volto` and `mrs-developer`
@@ -26,18 +50,15 @@ Before starting make sure your development environment is properly set. See [Vol
26
50
 
27
51
  1. Install
28
52
 
29
- yarn develop
53
+ make develop
30
54
  yarn
31
55
 
32
56
  1. Start backend
33
57
 
34
- docker pull plone
35
- docker run -d --name plone -p 8080:8080 -e SITE=Plone -e PROFILES="profile-plone.restapi:blocks" plone
58
+ docker run --pull always -it --rm --name plone -p 8080:8080 -e SITE=Plone plone/plone-backend
36
59
 
37
60
  ...wait for backend to setup and start - `Ready to handle requests`:
38
61
 
39
- docker logs -f plone
40
-
41
62
  ...you can also check http://localhost:8080/Plone
42
63
 
43
64
  1. Start frontend
@@ -51,3 +72,37 @@ Before starting make sure your development environment is properly set. See [Vol
51
72
  cd src/addons/volto-bise-policy/
52
73
 
53
74
  s/volto-bise-policy/
75
+
76
+ ## Cypress
77
+
78
+ To run cypress locally, first make sure you don't have any Volto/Plone running on ports `8080` and `3000`.
79
+
80
+ You don't have to be in a `clean-volto-project`, you can be in any Volto Frontend
81
+ project where you added `volto-bise-policy` to `mrs.developer.json`
82
+
83
+ Go to:
84
+
85
+ ```BASH
86
+ cd src/addons/volto-bise-policy/
87
+ ```
88
+
89
+ Start:
90
+
91
+ ```Bash
92
+ make
93
+ make start
94
+ ```
95
+
96
+ This will build and start with Docker a clean `Plone backend` and `Volto Frontend` with `volto-bise-policy` block installed.
97
+
98
+ Open Cypress Interface:
99
+
100
+ ```Bash
101
+ make cypress-open
102
+ ```
103
+
104
+ Or run it:
105
+
106
+ ```Bash
107
+ make cypress-run
108
+ ```
package/README.md CHANGED
@@ -22,10 +22,23 @@ Demo GIF
22
22
 
23
23
  ## Getting started
24
24
 
25
+ ### Try volto-bise-policy with Docker
26
+
27
+ git clone https://github.com/eea/volto-bise-policy.git
28
+ cd volto-bise-policy
29
+ make
30
+ make start
31
+
32
+ Go to http://localhost:3000
33
+
25
34
  ### Add volto-bise-policy to your Volto project
26
35
 
27
36
  1. Make sure you have a [Plone backend](https://plone.org/download) up-and-running at http://localhost:8080/Plone
28
37
 
38
+ ```Bash
39
+ docker compose up backend
40
+ ```
41
+
29
42
  1. Start Volto frontend
30
43
 
31
44
  - If you already have a volto project, just update `package.json`:
package/RELEASE.md CHANGED
@@ -20,9 +20,9 @@ You need to first install the [release-it](https://github.com/release-it/release
20
20
  ```
21
21
  npm install -g release-it
22
22
  ```
23
-
23
+
24
24
  Release-it uses the configuration written in the [`.release-it.json`](./.release-it.json) file located in the root of the repository.
25
-
25
+
26
26
  Release-it is a tool that automates 4 important steps in the release process:
27
27
 
28
28
  1. Version increase in `package.json` ( increased from the current version in `package.json`)
@@ -30,45 +30,45 @@ Release-it is a tool that automates 4 important steps in the release process:
30
30
  3. GitHub release on the commit with the changelog and package.json modification on the develop branch
31
31
  4. NPM release ( by default it's disabled, but can be enabled in the configuration file )
32
32
 
33
- To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
33
+ To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
34
34
 
35
35
  ```
36
36
  export GITHUB_TOKEN=XXX-XXXXXXXXXXXXXXXXXXXXXX
37
37
  ```
38
-
38
+
39
39
  To configure npm, you can use the `npm login` command or use a configuration file with a TOKEN :
40
-
40
+
41
41
  ```
42
42
  echo "//registry.npmjs.org/:_authToken=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" > .npmrc
43
43
  ```
44
44
 
45
45
  #### Using release-it tool
46
-
46
+
47
47
  There are 3 yarn scripts that can be run to do the release
48
48
 
49
49
  ##### yarn release-beta
50
50
 
51
- Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).
51
+ Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).
52
52
 
53
53
  ```
54
- ? Select increment (next version):
55
- ❯ prepatch (0.1.1-beta.0)
56
- preminor (0.2.0-beta.0)
57
- premajor (1.0.0-beta.0)
58
- Other, please specify...
54
+ ? Select increment (next version):
55
+ ❯ prepatch (0.1.1-beta.0)
56
+ preminor (0.2.0-beta.0)
57
+ premajor (1.0.0-beta.0)
58
+ Other, please specify...
59
59
  ```
60
60
 
61
61
  ##### yarn release-major-beta
62
62
 
63
63
  Same as `yarn release-beta`, but with premajor version pre-selected.
64
-
64
+
65
65
  ##### yarn release
66
66
 
67
67
  Generic command, does not automatically add the `beta` to version, but you can still manually write it if you choose Other.
68
68
 
69
69
  #### Important notes
70
70
 
71
- > Do not use release-it tool on master branch, the commit on CHANGELOG.md file and the version increase in the package.json file can't be done without a PULL REQUEST.
71
+ > Do not use release-it tool on master branch, the commit on CHANGELOG.md file and the version increase in the package.json file can't be done without a PULL REQUEST.
72
72
 
73
73
  > Do not keep Pull Requests from develop to master branches open when you are doing beta releases from the develop branch. As long as a PR to master is open, an automatic script will run on every commit and will update both the version and the changelog to a production-ready state - ( MAJOR.MINOR.PATCH mandatory format for version).
74
74
 
package/cypress.config.js CHANGED
@@ -5,9 +5,9 @@ module.exports = defineConfig({
5
5
  defaultCommandTimeout: 8888,
6
6
  chromeWebSecurity: false,
7
7
  reporter: 'junit',
8
- video: true,
8
+ video: false,
9
9
  retries: {
10
- runMode: 8,
10
+ runMode: 2,
11
11
  openMode: 0,
12
12
  },
13
13
  reporterOptions: {
@@ -0,0 +1,32 @@
1
+ version: "3"
2
+ services:
3
+ backend:
4
+ image: eeacms/plone-backend
5
+ ports:
6
+ - "8080:8080"
7
+ environment:
8
+ SITE: "Plone"
9
+ PROFILES: "eea.kitkat:testing"
10
+
11
+ frontend:
12
+ build:
13
+ context: ./
14
+ dockerfile: ./Dockerfile
15
+ args:
16
+ ADDON_NAME: "${ADDON_NAME}"
17
+ ADDON_PATH: "${ADDON_PATH}"
18
+ VOLTO_VERSION: ${VOLTO_VERSION:-16}
19
+ ports:
20
+ - "3000:3000"
21
+ - "3001:3001"
22
+ depends_on:
23
+ - backend
24
+ volumes:
25
+ - ./:/app/src/addons/${ADDON_PATH}
26
+ environment:
27
+ CI: "true"
28
+ NODE_ENV: "development"
29
+ RAZZLE_JEST_CONFIG: "src/addons/${ADDON_PATH}/jest-addon.config.js"
30
+ RAZZLE_INTERNAL_API_PATH: "http://backend:8080/Plone"
31
+ RAZZLE_DEV_PROXY_API_PATH: "http://backend:8080/Plone"
32
+ HOST: "0.0.0.0"
@@ -1,3 +1,5 @@
1
+ require('dotenv').config({ path: __dirname + '/.env' })
2
+
1
3
  module.exports = {
2
4
  testMatch: ['**/src/addons/**/?(*.)+(spec|test).[jt]s?(x)'],
3
5
  collectCoverageFrom: [
@@ -9,16 +11,21 @@ module.exports = {
9
11
  '@plone/volto/cypress': '<rootDir>/node_modules/@plone/volto/cypress',
10
12
  '@plone/volto/babel': '<rootDir>/node_modules/@plone/volto/babel',
11
13
  '@plone/volto/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
12
- '@package/(.*)$': '<rootDir>/src/$1',
13
- '@root/(.*)$': '<rootDir>/src/$1',
14
+ '@package/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
15
+ '@root/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
14
16
  '@plone/volto-quanta/(.*)$': '<rootDir>/src/addons/volto-quanta/src/$1',
15
17
  '@eeacms/(.*?)/(.*)$': '<rootDir>/node_modules/@eeacms/$1/src/$2',
16
- '@plone/volto-slate':
18
+ '@plone/volto-slate$':
17
19
  '<rootDir>/node_modules/@plone/volto/packages/volto-slate/src',
20
+ '@plone/volto-slate/(.*)$':
21
+ '<rootDir>/node_modules/@plone/volto/packages/volto-slate/src/$1',
18
22
  '~/(.*)$': '<rootDir>/src/$1',
19
23
  'load-volto-addons':
20
24
  '<rootDir>/node_modules/@plone/volto/jest-addons-loader.js',
21
25
  },
26
+ transformIgnorePatterns: [
27
+ '/node_modules/(?!(@plone|@root|@package|@eeacms)/).*/',
28
+ ],
22
29
  transform: {
23
30
  '^.+\\.js(x)?$': 'babel-jest',
24
31
  '^.+\\.(png)$': 'jest-file',
@@ -33,4 +40,9 @@ module.exports = {
33
40
  statements: 5,
34
41
  },
35
42
  },
36
- };
43
+ ...(process.env.JEST_USE_SETUP === 'ON' && {
44
+ setupFilesAfterEnv: [
45
+ '<rootDir>/node_modules/@eeacms/volto-bise-policy/jest.setup.js',
46
+ ],
47
+ }),
48
+ }
package/jest.setup.js ADDED
@@ -0,0 +1,62 @@
1
+ import { jest } from '@jest/globals';
2
+ import configureStore from 'redux-mock-store';
3
+ import thunk from 'redux-thunk';
4
+ import config from '@plone/volto/registry';
5
+ import { blocksConfig } from '@plone/volto/config/Blocks';
6
+ import installSlate from '@plone/volto-slate/index';
7
+
8
+ config.blocks.blocksConfig = {
9
+ ...blocksConfig,
10
+ ...config.blocks.blocksConfig,
11
+ };
12
+
13
+ [installSlate].reduce((acc, apply) => apply(acc), config);
14
+
15
+ const mockStore = configureStore([thunk]);
16
+
17
+ global.store = mockStore({
18
+ intl: {
19
+ locale: 'en',
20
+ messages: {},
21
+ formatMessage: jest.fn(),
22
+ },
23
+ content: {
24
+ create: {},
25
+ subrequests: [],
26
+ },
27
+ connected_data_parameters: {},
28
+ screen: {
29
+ page: {
30
+ width: 768,
31
+ },
32
+ },
33
+ });
34
+
35
+ const mockSemanticComponents = jest.requireActual('semantic-ui-react');
36
+ const mockComponents = jest.requireActual('@plone/volto/components');
37
+
38
+ jest.mock('semantic-ui-react', () => ({
39
+ ...mockSemanticComponents,
40
+ Popup: ({ content, trigger }) => {
41
+ return (
42
+ <div className="popup">
43
+ <div className="trigger">{trigger}</div>
44
+ <div className="content">{content}</div>
45
+ </div>
46
+ );
47
+ },
48
+ }));
49
+
50
+ jest.doMock('@plone/volto/components', () => {
51
+ return {
52
+ __esModule: true,
53
+ ...mockComponents,
54
+ SidebarPortal: ({ children }) => <div id="sidebar">{children}</div>,
55
+ };
56
+ });
57
+
58
+ global.fetch = jest.fn(() =>
59
+ Promise.resolve({
60
+ json: () => Promise.resolve({}),
61
+ }),
62
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-bise-policy",
3
- "version": "1.2.6",
3
+ "version": "1.2.8",
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",
@@ -16,7 +16,8 @@
16
16
  "@eeacms/volto-datablocks",
17
17
  "@eeacms/volto-block-toc",
18
18
  "@eeacms/volto-eea-design-system",
19
- "@eeacms/volto-eea-website-theme"
19
+ "@eeacms/volto-eea-website-theme",
20
+ "@eeacms/volto-spotlight"
20
21
  ],
21
22
  "repository": {
22
23
  "type": "git",
@@ -27,15 +28,41 @@
27
28
  "@eeacms/volto-datablocks": "*",
28
29
  "@eeacms/volto-eea-design-system": "*",
29
30
  "@eeacms/volto-eea-website-theme": "*",
30
- "esri-loader": "3.7.0"
31
+ "@eeacms/volto-spotlight": "*",
32
+ "esri-loader": "3.7.0",
33
+ "plotly.js": "^2.28.0",
34
+ "react-plotly.js": "2.6.0"
31
35
  },
32
36
  "devDependencies": {
33
37
  "@cypress/code-coverage": "^3.10.0",
34
38
  "@plone/scripts": "*",
35
39
  "babel-plugin-transform-class-properties": "^6.24.1",
36
40
  "cypress-fail-fast": "^5.0.1",
37
- "md5": "^2.3.0",
38
- "react-plotly.js": "2.5.1"
41
+ "dotenv": "^16.3.2",
42
+ "husky": "^8.0.3",
43
+ "lint-staged": "^14.0.1",
44
+ "md5": "^2.3.0"
45
+ },
46
+ "lint-staged": {
47
+ "src/**/*.{js,jsx,ts,tsx,json}": [
48
+ "make lint-fix",
49
+ "make prettier-fix"
50
+ ],
51
+ "src/**/*.{jsx}": [
52
+ "make i18n"
53
+ ],
54
+ "theme/**/*.{css,less}": [
55
+ "make stylelint-fix"
56
+ ],
57
+ "src/**/*.{css,less}": [
58
+ "make stylelint-fix"
59
+ ],
60
+ "theme/**/*.overrides": [
61
+ "make stylelint-fix"
62
+ ],
63
+ "src/**/*.overrides": [
64
+ "make stylelint-fix"
65
+ ]
39
66
  },
40
67
  "scripts": {
41
68
  "release": "release-it",
@@ -54,6 +81,7 @@
54
81
  "lint:fix": "make lint-fix",
55
82
  "i18n": "make i18n",
56
83
  "cypress:run": "make cypress-run",
57
- "cypress:open": "make cypress-open"
84
+ "cypress:open": "make cypress-open",
85
+ "prepare": "husky install"
58
86
  }
59
87
  }
package/razzle.extend.js CHANGED
@@ -17,9 +17,8 @@ const modify = (config, { target, dev }, webpack) => {
17
17
  const semanticLessPath = `${projectRootPath}/node_modules/semantic-ui-less`;
18
18
  const hasDesignSystemInstalled =
19
19
  config.resolve.alias['volto-spotlight-themes'];
20
- config.resolve.alias[
21
- 'volto-spotlight-theme-folder'
22
- ] = hasDesignSystemInstalled ? themeLessPath : semanticLessPath;
20
+ config.resolve.alias['volto-spotlight-theme-folder'] =
21
+ hasDesignSystemInstalled ? themeLessPath : semanticLessPath;
23
22
 
24
23
  return config;
25
24
  };
@@ -0,0 +1,2 @@
1
+ import '@eeacms/volto-spotlight/semantic.less';
2
+ import '@plone/volto/../theme/themes/pastanaga/extras/extras.less';
@@ -178,7 +178,7 @@ const EEAHeader = ({ token, history, subsite, content, ...props }) => {
178
178
  <a
179
179
  href="https://europa.eu/european-union/contact/institutions-bodies_en"
180
180
  target="_blank"
181
- rel="noreferrer"
181
+ rel="noopener"
182
182
  onKeyDown={(evt) => evt.stopPropagation()}
183
183
  >
184
184
  See all EU institutions and bodies
@@ -211,7 +211,7 @@ const EEAHeader = ({ token, history, subsite, content, ...props }) => {
211
211
  href={item.href}
212
212
  className="site"
213
213
  target="_blank"
214
- rel="noreferrer"
214
+ rel="noopener"
215
215
  onKeyDown={(evt) => evt.stopPropagation()}
216
216
  >
217
217
  {item.title}
package/src/index.js CHANGED
@@ -38,7 +38,6 @@ const n2kLanguages = [
38
38
  { name: 'Latviešu', code: 'lv' },
39
39
  { name: 'lietuvių', code: 'lt' },
40
40
  { name: 'Malti', code: 'mt' },
41
- { name: 'Norsk', code: 'no' },
42
41
  { name: 'polski', code: 'pl' },
43
42
  { name: 'Português', code: 'pt' },
44
43
  { name: 'Română', code: 'ro' },
@@ -60,6 +59,25 @@ const applyConfig = (config) => {
60
59
  config.settings.defaultLanguage =
61
60
  config.settings.eea?.defaultLanguage || 'en';
62
61
 
62
+ // mega menu layout settings
63
+ config.settings.menuItemsLayouts = {
64
+ '/policy': {
65
+ hideChildrenFromNavigation: false,
66
+ },
67
+ '/europes-biodiversity': {
68
+ hideChildrenFromNavigation: false,
69
+ },
70
+ '/countries': {
71
+ menuItemColumns: ['eight wide column', 'four wide column'],
72
+ menuItemChildrenListColumns: [5, 2],
73
+ appendExtraMenuItemsToLastColumn: true,
74
+ hideChildrenFromNavigation: false,
75
+ },
76
+ '/resources': {
77
+ hideChildrenFromNavigation: false,
78
+ },
79
+ };
80
+
63
81
  // EEA customizations
64
82
  config.settings.eea = {
65
83
  ...(config.settings.eea || {}),