@eeacms/volto-eea-website-policy 0.4.1 → 1.0.0

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.
@@ -2,7 +2,7 @@ const defaultBabel = require('@plone/volto/babel');
2
2
 
3
3
  function applyDefault(api) {
4
4
  const voltoBabel = defaultBabel(api);
5
- voltoBabel.plugins.push('@babel/plugin-transform-modules-commonjs', 'transform-class-properties', 'istanbul');
5
+ voltoBabel.plugins.push('istanbul');
6
6
  return voltoBabel;
7
7
  }
8
8
 
@@ -0,0 +1 @@
1
+ module.exports = require('@plone/volto/babel');
package/CHANGELOG.md CHANGED
@@ -4,6 +4,18 @@ 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.0](https://github.com/eea/volto-eea-website-policy/compare/0.4.2...1.0.0) - 28 October 2022
8
+
9
+ #### :nail_care: Enhancements
10
+
11
+ - refactor(cypress): Cypress 10 / Razzle 4 [Alin Voinea - [`12ab932`](https://github.com/eea/volto-eea-website-policy/commit/12ab932bd0e66c2990a5e02e04025c58f50fb1a9)]
12
+ - refactor(volto-slate): Upgrade to @plone/volto-slate - refs #153447 [Alin Voinea - [`e642f85`](https://github.com/eea/volto-eea-website-policy/commit/e642f85f2a57131c7a84dbc22f17e5c1a34a7dc2)]
13
+
14
+ #### :hammer_and_wrench: Others
15
+
16
+ - Cleanup [Alin Voinea - [`624f797`](https://github.com/eea/volto-eea-website-policy/commit/624f797b6ac4f46fb1a5699a22f966d0579953d3)]
17
+ ### [0.4.2](https://github.com/eea/volto-eea-website-policy/compare/0.4.1...0.4.2) - 28 September 2022
18
+
7
19
  ### [0.4.1](https://github.com/eea/volto-eea-website-policy/compare/0.4.0...0.4.1) - 28 September 2022
8
20
 
9
21
  #### :bug: Bug Fixes
package/README.md CHANGED
@@ -23,28 +23,6 @@ EEA Main Website (Plone 6) [Volto](https://github.com/plone/volto) Frontend Poli
23
23
 
24
24
  ## Getting started
25
25
 
26
- ### Try volto-eea-website-policy with Docker
27
-
28
- 1. Get the latest Docker images
29
-
30
- ```
31
- docker pull plone
32
- docker pull plone/volto
33
- ```
34
-
35
- 1. Start Plone backend
36
- ```
37
- docker run -d --name plone -p 8080:8080 -e SITE=Plone eeacms/eea-website-backend
38
- ```
39
-
40
- 1. Start Volto frontend
41
-
42
- ```
43
- docker run -it --rm -p 3000:3000 --link plone -e ADDONS="@eeacms/volto-eea-website-policy" plone/volto
44
- ```
45
-
46
- 1. Go to http://localhost:3000
47
-
48
26
  ### Add volto-eea-website-policy to your Volto project
49
27
 
50
28
  1. Make sure you have a [Plone backend](https://plone.org/download) up-and-running at http://localhost:8080/Plone
package/babel.config.js CHANGED
@@ -1,6 +1,6 @@
1
1
  module.exports = function (api) {
2
2
  api.cache(true);
3
- const presets = ['razzle/babel'];
3
+ const presets = ['razzle'];
4
4
  const plugins = [
5
5
  [
6
6
  'react-intl', // React Intl extractor, required for the whole i18n infrastructure to work
@@ -0,0 +1,26 @@
1
+ const { defineConfig } = require('cypress');
2
+
3
+ module.exports = defineConfig({
4
+ viewportWidth: 1280,
5
+ defaultCommandTimeout: 8888,
6
+ chromeWebSecurity: false,
7
+ reporter: 'junit',
8
+ video: true,
9
+ retries: {
10
+ runMode: 8,
11
+ openMode: 0,
12
+ },
13
+ reporterOptions: {
14
+ mochaFile: 'cypress/reports/cypress-[hash].xml',
15
+ jenkinsMode: true,
16
+ toConsole: true,
17
+ },
18
+ e2e: {
19
+ setupNodeEvents(on, config) {
20
+ // e2e testing node events setup code
21
+ require('@cypress/code-coverage/task')(on, config);
22
+ return config;
23
+ },
24
+ baseUrl: 'http://localhost:3000',
25
+ },
26
+ });
@@ -12,16 +12,15 @@ module.exports = {
12
12
  '@root/(.*)$': '<rootDir>/src/$1',
13
13
  '@plone/volto-quanta/(.*)$': '<rootDir>/src/addons/volto-quanta/src/$1',
14
14
  '@eeacms/(.*?)/(.*)$': '<rootDir>/src/addons/$1/src/$2',
15
- 'volto-slate/(.*)$': '<rootDir>/src/addons/volto-slate/src/$1',
15
+ '@plone/volto-slate':
16
+ '<rootDir>/node_modules/@plone/volto/packages/volto-slate/src',
16
17
  '~/(.*)$': '<rootDir>/src/$1',
17
18
  'load-volto-addons':
18
19
  '<rootDir>/node_modules/@plone/volto/jest-addons-loader.js',
20
+ '\\.(css|less|scss|sass)$': 'identity-obj-proxy',
19
21
  },
20
22
  transform: {
21
23
  '^.+\\.js(x)?$': 'babel-jest',
22
- '^.+\\.css$': 'jest-css-modules',
23
- '^.+\\.less$': 'jest-css-modules',
24
- '^.+\\.scss$': 'jest-css-modules',
25
24
  '^.+\\.(png)$': 'jest-file',
26
25
  '^.+\\.(jpg)$': 'jest-file',
27
26
  '^.+\\.(svg)$': './node_modules/@plone/volto/jest-svgsystem-transform.js',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-website-policy",
3
- "version": "0.4.1",
3
+ "version": "1.0.0",
4
4
  "description": "@eeacms/volto-eea-website-policy: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -16,32 +16,31 @@
16
16
  "type": "git",
17
17
  "url": "git@github.com:eea/volto-eea-website-policy.git"
18
18
  },
19
- "addons": [
20
- "volto-slate"
21
- ],
22
- "dependencies": {
23
- "@plone/scripts": "*",
24
- "volto-slate": "*"
25
- },
19
+ "addons": [],
20
+ "dependencies": {},
26
21
  "devDependencies": {
27
- "@cypress/code-coverage": "^3.9.5",
28
- "babel-plugin-transform-class-properties": "^6.24.1"
22
+ "@plone/scripts": "*",
23
+ "@cypress/code-coverage": "^3.10.0",
24
+ "babel-plugin-transform-class-properties": "^6.24.1",
25
+ "md5": "^2.3.0"
29
26
  },
30
27
  "scripts": {
31
28
  "release": "release-it",
29
+ "release-major-beta": "release-it major --preRelease=beta",
30
+ "release-beta": "release-it --preRelease=beta",
32
31
  "bootstrap": "npm install -g ejs; npm link ejs; node bootstrap",
33
32
  "test": "make test",
34
33
  "test:fix": "make test-update",
35
34
  "pre-commit": "yarn stylelint:fix && yarn prettier:fix && yarn lint:fix",
36
- "stylelint": "if [ -d ./project ]; then ./project/node_modules/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'; else ../../../node_modules/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'; fi",
37
- "stylelint:overrides": "if [ -d ./project ]; then ./project/node_modules/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'; else ../../../node_modules/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'; fi",
38
- "stylelint:fix": "yarn stylelint --fix && yarn stylelint:overrides --fix",
39
- "prettier": "if [ -d ./project ]; then ./project/node_modules/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json,css,less,md}'; else ../../../node_modules/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json,css,less,md}'; fi",
40
- "prettier:fix": "if [ -d ./project ]; then ./project/node_modules/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json,css,less,md}'; else ../../../node_modules/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json,css,less,md}'; fi",
41
- "lint": "if [ -d ./project ]; then ./project/node_modules/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'; else ../../../node_modules/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'; fi",
42
- "lint:fix": "if [ -d ./project ]; then ./project/node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'; else ../../../node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'; fi",
43
- "i18n": "rm -rf build/messages && NODE_ENV=production i18n --addon",
44
- "cypress:run": "if [ -d ./project ]; then NODE_ENV=development ./project/node_modules/cypress/bin/cypress run; else NODE_ENV=development ../../../node_modules/cypress/bin/cypress run; fi",
45
- "cypress:open": "if [ -d ./project ]; then NODE_ENV=development ./project/node_modules/cypress/bin/cypress open; else NODE_ENV=development ../../../node_modules/cypress/bin/cypress open; fi"
35
+ "stylelint": "make stylelint",
36
+ "stylelint:overrides": "make stylelint-overrides",
37
+ "stylelint:fix": "make stylelint-fix",
38
+ "prettier": "make prettier",
39
+ "prettier:fix": "make prettier-fix",
40
+ "lint": "make lint",
41
+ "lint:fix": "make lint-fix",
42
+ "i18n": "make i18n",
43
+ "cypress:run": "make cypress-run",
44
+ "cypress:open": "make cypress-open"
46
45
  }
47
46
  }
package/src/helpers.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { isArray } from 'lodash';
2
2
  import config from '@plone/volto/registry';
3
- import { serializeNodes } from 'volto-slate/editor/render';
3
+ import { serializeNodes } from '@plone/volto-slate/editor/render';
4
4
 
5
5
  export const createSlateParagraph = (text) => {
6
6
  return isArray(text) ? text : config.settings.slate.defaultValue();
package/src/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { runtimeConfig } from '@plone/volto/runtime_config';
2
- import installCallout from 'volto-slate/editor/plugins/Callout';
2
+ import installCallout from '@plone/volto-slate/editor/plugins/Callout';
3
3
  import installContextNavigationBlock from '@eeacms/volto-eea-website-policy/components/Blocks/ContextNavigation';
4
4
 
5
5
  const applyConfig = (config) => {
@@ -92,6 +92,11 @@ const applyConfig = (config) => {
92
92
  config.blocks.blocksConfig.columnsBlock.mostUsed = true;
93
93
  }
94
94
 
95
+ // Accordion
96
+ if (config.blocks.blocksConfig.accordion) {
97
+ config.blocks.blocksConfig.accordion.mostUsed = true;
98
+ }
99
+
95
100
  // Listing
96
101
  if (config.blocks.blocksConfig.listing) {
97
102
  config.blocks.blocksConfig.listing.title = 'Listing (Content)';
package/cypress.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "baseUrl": "http://localhost:3000",
3
- "viewportWidth": 1280,
4
- "defaultCommandTimeout": 8888,
5
- "chromeWebSecurity": false,
6
- "reporter": "junit",
7
- "video": true,
8
- "retries": {
9
- "runMode": 8,
10
- "openMode": 0
11
- },
12
- "reporterOptions": {
13
- "mochaFile": "cypress/reports/cypress-[hash].xml",
14
- "jenkinsMode": true,
15
- "toConsole": true
16
- }
17
- }