@eeacms/volto-eea-website-policy 0.4.2 → 1.0.1

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,11 +4,23 @@ 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
- ### [0.4.2](https://github.com/eea/volto-eea-website-policy/compare/0.4.1...0.4.2) - 28 September 2022
7
+ ### [1.0.1](https://github.com/eea/volto-eea-website-policy/compare/1.0.0...1.0.1) - 28 October 2022
8
+
9
+ #### :nail_care: Enhancements
10
+
11
+ - refactor(customizations): Upgrade Toolbar customization to volto 16 alpha 45 [Alin Voinea - [`08b14d6`](https://github.com/eea/volto-eea-website-policy/commit/08b14d64958316f434f79dc4b3308164a3f1df38)]
12
+
13
+ ## [1.0.0](https://github.com/eea/volto-eea-website-policy/compare/0.4.2...1.0.0) - 28 October 2022
8
14
 
9
- #### :rocket: New Features
15
+ #### :nail_care: Enhancements
16
+
17
+ - refactor(cypress): Cypress 10 / Razzle 4 [Alin Voinea - [`12ab932`](https://github.com/eea/volto-eea-website-policy/commit/12ab932bd0e66c2990a5e02e04025c58f50fb1a9)]
18
+ - refactor(volto-slate): Upgrade to @plone/volto-slate - refs #153447 [Alin Voinea - [`e642f85`](https://github.com/eea/volto-eea-website-policy/commit/e642f85f2a57131c7a84dbc22f17e5c1a34a7dc2)]
10
19
 
11
- - feat(accordion): Most used - refs #148213 [Alin Voinea - [`46a160c`](https://github.com/eea/volto-eea-website-policy/commit/46a160c97ae958df2e14d684bd2f9133f8a8497d)]
20
+ #### :hammer_and_wrench: Others
21
+
22
+ - Cleanup [Alin Voinea - [`624f797`](https://github.com/eea/volto-eea-website-policy/commit/624f797b6ac4f46fb1a5699a22f966d0579953d3)]
23
+ ### [0.4.2](https://github.com/eea/volto-eea-website-policy/compare/0.4.1...0.4.2) - 28 September 2022
12
24
 
13
25
  ### [0.4.1](https://github.com/eea/volto-eea-website-policy/compare/0.4.0...0.4.1) - 28 September 2022
14
26
 
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.2",
3
+ "version": "1.0.1",
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
  }
@@ -38,6 +38,7 @@ import folderSVG from '@plone/volto/icons/folder.svg';
38
38
  import addSVG from '@plone/volto/icons/add-document.svg';
39
39
  import moreSVG from '@plone/volto/icons/more.svg';
40
40
  import userSVG from '@plone/volto/icons/user.svg';
41
+ import backSVG from '@plone/volto/icons/back.svg';
41
42
  import clearSVG from '@plone/volto/icons/clear.svg';
42
43
 
43
44
  const messages = defineMessages({
@@ -272,6 +273,14 @@ class Toolbar extends Component {
272
273
  showMenu: !state.showMenu,
273
274
  menuStyle: { bottom: 0 },
274
275
  }));
276
+ } else if (selector === 'more') {
277
+ this.setState((state) => ({
278
+ showMenu: !state.showMenu,
279
+ menuStyle: {
280
+ overflow: 'visible',
281
+ top: 0,
282
+ },
283
+ }));
275
284
  } else {
276
285
  this.setState((state) => ({
277
286
  showMenu: !state.showMenu,
@@ -467,8 +476,8 @@ class Toolbar extends Component {
467
476
  )}
468
477
  >
469
478
  <Icon
470
- name={clearSVG}
471
- className="contents circled"
479
+ name={backSVG}
480
+ className="circled"
472
481
  size="30px"
473
482
  title={this.props.intl.formatMessage(messages.back)}
474
483
  />
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) => {
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
- }