Skip to content

Commit 420a3ac

Browse files
authored
Merge pull request #10 from eea/develop
Use latest volto & cypress
2 parents 011475f + 6251969 commit 420a3ac

22 files changed

+727
-251
lines changed

.coverage.babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const defaultBabel = require('@plone/volto/babel');
22

33
function applyDefault(api) {
44
const voltoBabel = defaultBabel(api);
5-
voltoBabel.plugins.push('@babel/plugin-transform-modules-commonjs', 'transform-class-properties', 'istanbul');
5+
voltoBabel.plugins.push('istanbul');
66
return voltoBabel;
77
}
88

.gitignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
.vscode/
22
.history
3+
.eslintrc.js
4+
.nyc_output
5+
project
6+
coverage
37
logs
48
*.log
59
npm-debug.log*
610
.DS_Store
711
*.swp
812
yarn-error.log
13+
yarn.lock
14+
package-lock.json
915

1016
node_modules
1117
build
1218
dist
13-
screenshots
1419
cypress/videos
1520
cypress/reports
21+
screenshots
22+
videos
1623
.env.local
1724
.env.development.local
1825
.env.test.local
1926
.env.production.local
27+
*~

.i18n.babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('@plone/volto/babel');

.npmignore

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# https://docs.npmjs.com/using-npm/developers.html#keeping-files-out-of-your-package
2+
3+
# Directories
4+
api/
5+
bin/
6+
build/
7+
lib/
8+
g-api/
9+
tests/
10+
11+
# Docs
12+
docs/
13+
14+
# Cypress
15+
cypress/
16+
17+
# Tests
18+
__tests__/
19+
*.snap
20+
21+
# Files
22+
.travis.yml
23+
requirements-docs.txt
24+
requirements-tests.txt
25+
yarn.lock
26+
.dockerignore
27+
.gitattributes
28+
.yarnrc
29+
.nvmrc
30+
changelogupdater.js
31+
pip-selfcheck.json
32+
Dockerfile
33+
CNAME
34+
entrypoint.sh
35+
Jenkinsfile
36+
Makefile
37+
38+
# Logs
39+
logs
40+
*.log
41+
npm-debug.log*
42+
yarn-debug.log*
43+
yarn-error.log*
44+
45+
# Runtime data
46+
pids
47+
*.pid
48+
*.seed
49+
*.pid.lock
50+
51+
# Directory for instrumented libs generated by jscoverage/JSCover
52+
lib-cov
53+
54+
# Coverage directory used by tools like istanbul
55+
coverage
56+
57+
# nyc test coverage
58+
.nyc_output
59+
60+
# node-waf configuration
61+
.lock-wscript
62+
63+
# Compiled binary addons (https://nodejs.org/api/addons.html)
64+
build/Release
65+
66+
# Dependency directories
67+
node_modules/
68+
jspm_packages/
69+
70+
# TypeScript v1 declaration files
71+
typings/
72+
73+
# Optional npm cache directory
74+
.npm
75+
76+
# Optional eslint cache
77+
.eslintcache
78+
79+
# Optional REPL history
80+
.node_repl_history
81+
82+
# Output of 'npm pack'
83+
*.tgz
84+
85+
# Yarn Integrity file
86+
.yarn-integrity
87+
88+
# dotenv environment variables file
89+
.env
90+
91+
# next.js build output
92+
.next
93+
94+
styleguide.config
95+
.vscode
96+
packages

.project.eslintrc.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
4+
const projectRootPath = fs.realpathSync('./project'); // __dirname
5+
const packageJson = require(path.join(projectRootPath, 'package.json'));
6+
const jsConfig = require(path.join(projectRootPath, 'jsconfig.json')).compilerOptions;
7+
8+
const pathsConfig = jsConfig.paths;
9+
10+
let voltoPath = path.join(projectRootPath, 'node_modules/@plone/volto');
11+
12+
Object.keys(pathsConfig).forEach(pkg => {
13+
if (pkg === '@plone/volto') {
14+
voltoPath = `./${jsConfig.baseUrl}/${pathsConfig[pkg][0]}`;
15+
}
16+
});
17+
const AddonConfigurationRegistry = require(`${voltoPath}/addon-registry.js`);
18+
const reg = new AddonConfigurationRegistry(projectRootPath);
19+
20+
// Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
21+
const addonAliases = Object.keys(reg.packages).map(o => [
22+
o,
23+
reg.packages[o].modulePath,
24+
]);
25+
26+
27+
module.exports = {
28+
extends: `${projectRootPath}/node_modules/@plone/volto/.eslintrc`,
29+
settings: {
30+
'import/resolver': {
31+
alias: {
32+
map: [
33+
['@plone/volto', '@plone/volto/src'],
34+
...addonAliases,
35+
['@package', `${__dirname}/src`],
36+
['~', `${__dirname}/src`],
37+
],
38+
extensions: ['.js', '.jsx', '.json'],
39+
},
40+
'babel-plugin-root-import': {
41+
rootPathSuffix: 'src',
42+
},
43+
},
44+
},
45+
};
46+

CHANGELOG.md

Lines changed: 42 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -4,83 +4,70 @@ All notable changes to this project will be documented in this file. Dates are d
44

55
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
66

7-
#### [2.2.7](https://github.com/eea/volto-widget-toggle/compare/2.2.6...2.2.7)
7+
### [3.0.0](https://github.com/eea/volto-widget-toggle/compare/2.2.7...3.0.0) - 26 October 2022
88

9+
#### :hammer_and_wrench: Others
910

10-
#### [2.2.6](https://github.com/eea/volto-widget-toggle/compare/2.2.5...2.2.6)
11+
- Cleanup [Alin Voinea - [`f0bfe89`](https://github.com/eea/volto-widget-toggle/commit/f0bfe892db782472d0911b3562346d80bed2fb94)]
12+
- Typo [Miu Razvan - [`f1faa3d`](https://github.com/eea/volto-widget-toggle/commit/f1faa3d1c0239d377a75b375dcf092cea048c121)]
13+
- Use latest cypress [Miu Razvan - [`165ef4a`](https://github.com/eea/volto-widget-toggle/commit/165ef4a017833e757a69da734985acd18155228e)]
14+
- update(jest): add @plone/volto-slate resolver refs- #153447 [nileshgulia1 - [`b5e6889`](https://github.com/eea/volto-widget-toggle/commit/b5e6889bc22efaeec2025bd79dfe2a839650e4a6)]
15+
### [2.2.7](https://github.com/eea/volto-widget-toggle/compare/2.2.6...2.2.7) - 30 June 2022
1116

12-
> 3 January 2022
17+
#### :hammer_and_wrench: Others
1318

14-
- Release [`#8`](https://github.com/eea/volto-widget-toggle/pull/8)
19+
### [2.2.6](https://github.com/eea/volto-widget-toggle/compare/2.2.5...2.2.6) - 3 January 2022
1520

16-
#### [2.2.5](https://github.com/eea/volto-widget-toggle/compare/2.2.4...2.2.5)
21+
#### :hammer_and_wrench: Others
1722

18-
> 16 December 2021
23+
### [2.2.5](https://github.com/eea/volto-widget-toggle/compare/2.2.4...2.2.5) - 16 December 2021
1924

20-
- Add SonarQube badges [`#7`](https://github.com/eea/volto-widget-toggle/pull/7)
25+
### [2.2.4](https://github.com/eea/volto-widget-toggle/compare/2.2.3...2.2.4) - 10 December 2021
2126

22-
#### [2.2.4](https://github.com/eea/volto-widget-toggle/compare/2.2.3...2.2.4)
27+
#### :hammer_and_wrench: Others
2328

24-
> 10 December 2021
29+
- Refs #142010 - Optimize Volto-addons gitflow pipelines [valentinab25 - [`2bd2039`](https://github.com/eea/volto-widget-toggle/commit/2bd203979963ee5cb15592470e1d341d1bd65291)]
30+
### [2.2.3](https://github.com/eea/volto-widget-toggle/compare/2.2.2...2.2.3) - 28 June 2021
2531

26-
- Develop [`#6`](https://github.com/eea/volto-widget-toggle/pull/6)
27-
- Correct Cypress tests [`#5`](https://github.com/eea/volto-widget-toggle/pull/5)
28-
- Refs #142010 - Optimize Volto-addons gitflow pipelines [`2bd2039`](https://github.com/eea/volto-widget-toggle/commit/2bd203979963ee5cb15592470e1d341d1bd65291)
32+
#### :hammer_and_wrench: Others
2933

30-
#### [2.2.3](https://github.com/eea/volto-widget-toggle/compare/2.2.2...2.2.3)
34+
- refactor code, introduce defaultValue prop to handle default state when value is null [nileshgulia1 - [`560d23f`](https://github.com/eea/volto-widget-toggle/commit/560d23f785e7780cdb30197c2ebc999b85961f46)]
35+
### [2.2.2](https://github.com/eea/volto-widget-toggle/compare/2.2.1...2.2.2) - 4 June 2021
3136

32-
> 28 June 2021
37+
### [2.2.1](https://github.com/eea/volto-widget-toggle/compare/2.2.0...2.2.1) - 14 May 2021
3338

34-
- refactor code, introduce defaultValue prop to handle default state when value is null or undefined [`#4`](https://github.com/eea/volto-widget-toggle/pull/4)
35-
- refactor code, introduce defaultValue prop to handle default state when value is null [`560d23f`](https://github.com/eea/volto-widget-toggle/commit/560d23f785e7780cdb30197c2ebc999b85961f46)
39+
### [2.2.0](https://github.com/eea/volto-widget-toggle/compare/2.1.0...2.2.0) - 25 March 2021
3640

37-
#### [2.2.2](https://github.com/eea/volto-widget-toggle/compare/2.2.1...2.2.2)
41+
#### :hammer_and_wrench: Others
3842

39-
> 4 June 2021
43+
- Release 2.2.0 [Alin Voinea - [`6d37e80`](https://github.com/eea/volto-widget-toggle/commit/6d37e80dec78143118ce76be39aba02b82d4d895)]
44+
- Fix uncontrolled input of type checkbox to be controlled. [Alin Voinea - [`137f5a0`](https://github.com/eea/volto-widget-toggle/commit/137f5a0d72ccf47d29c7c7f9a4bd29ec9ef0598d)]
45+
### [2.1.0](https://github.com/eea/volto-widget-toggle/compare/2.0.0...2.1.0) - 8 March 2021
4046

41-
- Cypress coverage [`#3`](https://github.com/eea/volto-widget-toggle/pull/3)
47+
#### :hammer_and_wrench: Others
4248

43-
#### [2.2.1](https://github.com/eea/volto-widget-toggle/compare/2.2.0...2.2.1)
49+
- Release 2.1.0 [Alin Voinea - [`8a77751`](https://github.com/eea/volto-widget-toggle/commit/8a77751a8eaa3817f4831a21365768387321dc50)]
50+
- Cleanup DEPENDENCIES from Jenkinsfile [Alin Voinea - [`41eb8ba`](https://github.com/eea/volto-widget-toggle/commit/41eb8ba076da6feed4bfc8f05ed1c18678b4a434)]
51+
## [2.0.0](https://github.com/eea/volto-widget-toggle/compare/1.0.1...2.0.0) - 26 February 2021
4452

45-
> 14 May 2021
53+
#### :hammer_and_wrench: Others
4654

55+
- Release 2.0.0 [Alin Voinea - [`28f4b1d`](https://github.com/eea/volto-widget-toggle/commit/28f4b1d2706e4a7a06c05fbd079e195a74059ff1)]
56+
- Volto 12 upgrade: ~/config -> @plone/volto/registry [Alin Voinea - [`f50d72a`](https://github.com/eea/volto-widget-toggle/commit/f50d72a9ec54cf9a53507059ef89a7fe60dcb118)]
57+
### [1.0.1](https://github.com/eea/volto-widget-toggle/compare/1.0.0...1.0.1) - 16 November 2020
4758

48-
#### [2.2.0](https://github.com/eea/volto-widget-toggle/compare/2.1.0...2.2.0)
59+
#### :hammer_and_wrench: Others
4960

50-
> 25 March 2021
61+
- Release 1.0.1 [Alin Voinea - [`454220f`](https://github.com/eea/volto-widget-toggle/commit/454220fa61495427f874fb9b56401fe69689f4fe)]
62+
- Auto-release npm [Alin Voinea - [`10b31b3`](https://github.com/eea/volto-widget-toggle/commit/10b31b3b64330d41f69a033a45030e49d20c16b5)]
63+
## [1.0.0](https://github.com/eea/volto-widget-toggle/compare/0.1.0...1.0.0) - 29 September 2020
5164

52-
- Release 2.2.0 [`6d37e80`](https://github.com/eea/volto-widget-toggle/commit/6d37e80dec78143118ce76be39aba02b82d4d895)
53-
- Fix uncontrolled input of type checkbox to be controlled. [`137f5a0`](https://github.com/eea/volto-widget-toggle/commit/137f5a0d72ccf47d29c7c7f9a4bd29ec9ef0598d)
65+
#### :hammer_and_wrench: Others
5466

55-
#### [2.1.0](https://github.com/eea/volto-widget-toggle/compare/2.0.0...2.1.0)
67+
- Release 1.0.0 [Alin Voinea - [`9298d3d`](https://github.com/eea/volto-widget-toggle/commit/9298d3d68642670c7b16e31ede0c9299e84c8b65)]
68+
### 0.1.0 - 3 September 2020
5669

57-
> 8 March 2021
70+
#### :hammer_and_wrench: Others
5871

59-
- Release 2.1.0 [`8a77751`](https://github.com/eea/volto-widget-toggle/commit/8a77751a8eaa3817f4831a21365768387321dc50)
60-
61-
### [2.0.0](https://github.com/eea/volto-widget-toggle/compare/1.0.1...2.0.0)
62-
63-
> 26 February 2021
64-
65-
- Release 2.0.0 [`28f4b1d`](https://github.com/eea/volto-widget-toggle/commit/28f4b1d2706e4a7a06c05fbd079e195a74059ff1)
66-
- Volto 12 upgrade: ~/config -> @plone/volto/registry [`f50d72a`](https://github.com/eea/volto-widget-toggle/commit/f50d72a9ec54cf9a53507059ef89a7fe60dcb118)
67-
68-
#### [1.0.1](https://github.com/eea/volto-widget-toggle/compare/1.0.0...1.0.1)
69-
70-
> 16 November 2020
71-
72-
- Release 1.0.1 [`454220f`](https://github.com/eea/volto-widget-toggle/commit/454220fa61495427f874fb9b56401fe69689f4fe)
73-
- Auto-release npm [`10b31b3`](https://github.com/eea/volto-widget-toggle/commit/10b31b3b64330d41f69a033a45030e49d20c16b5)
74-
75-
### [1.0.0](https://github.com/eea/volto-widget-toggle/compare/0.1.0...1.0.0)
76-
77-
> 29 September 2020
78-
79-
- Release 1.0.0 [`9298d3d`](https://github.com/eea/volto-widget-toggle/commit/9298d3d68642670c7b16e31ede0c9299e84c8b65)
80-
81-
#### 0.1.0
82-
83-
> 3 September 2020
84-
85-
- Add toggle checkbox [`e5f0fc1`](https://github.com/eea/volto-widget-toggle/commit/e5f0fc1e6a42fdc9e64da274f4781d73bfd270e2)
86-
- Initial commit [`51b8080`](https://github.com/eea/volto-widget-toggle/commit/51b8080f06ba25c85ef293e053284a66a0b7b845)
72+
- Add toggle checkbox [Alin Voinea - [`e5f0fc1`](https://github.com/eea/volto-widget-toggle/commit/e5f0fc1e6a42fdc9e64da274f4781d73bfd270e2)]
73+
- Initial commit [Alin Voinea - [`51b8080`](https://github.com/eea/volto-widget-toggle/commit/51b8080f06ba25c85ef293e053284a66a0b7b845)]

Jenkinsfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pipeline {
44
environment {
55
GIT_NAME = "volto-widget-toggle"
66
NAMESPACE = "@eeacms"
7-
SONARQUBE_TAGS = "volto.eea.europa.eu,forest.eea.europa.eu,www.eea.europa.eu-ims,climate-energy.eea.europa.eu,sustainability.eionet.europa.eu,biodiversity.europa.eu,clms.land.copernicus.eu,industry.eea.europa.eu,water.europa.eu-freshwater,demo-www.eea.europa.eu,clmsdemo.devel6cph.eea.europa.eu,circularity.eea.europa.eu"
7+
SONARQUBE_TAGS = "volto.eea.europa.eu,forest.eea.europa.eu,www.eea.europa.eu-ims,climate-energy.eea.europa.eu,sustainability.eionet.europa.eu,biodiversity.europa.eu,clms.land.copernicus.eu,industry.eea.europa.eu,water.europa.eu-freshwater,demo-www.eea.europa.eu,clmsdemo.devel6cph.eea.europa.eu,circularity.eea.europa.eu,prod-www.eea.europa.eu,water.europa.eu-marine"
88
DEPENDENCIES = ""
99
VOLTO = "alpha"
1010
}
@@ -41,19 +41,19 @@ pipeline {
4141

4242
"ES lint": {
4343
node(label: 'docker') {
44-
sh '''docker run -i --rm --name="$BUILD_TAG-eslint" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci eslint'''
44+
sh '''docker run -i --rm --name="$BUILD_TAG-eslint" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e VOLTO=$VOLTO plone/volto-addon-ci:alpha eslint'''
4545
}
4646
},
4747

4848
"Style lint": {
4949
node(label: 'docker') {
50-
sh '''docker run -i --rm --name="$BUILD_TAG-stylelint" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci stylelint'''
50+
sh '''docker run -i --rm --name="$BUILD_TAG-stylelint" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e VOLTO=$VOLTO plone/volto-addon-ci:alpha stylelint'''
5151
}
5252
},
5353

5454
"Prettier": {
5555
node(label: 'docker') {
56-
sh '''docker run -i --rm --name="$BUILD_TAG-prettier" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci prettier'''
56+
sh '''docker run -i --rm --name="$BUILD_TAG-prettier" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e VOLTO=$VOLTO plone/volto-addon-ci:alpha prettier'''
5757
}
5858
}
5959
)
@@ -77,8 +77,8 @@ pipeline {
7777
node(label: 'docker') {
7878
script {
7979
try {
80-
sh '''docker pull plone/volto-addon-ci'''
81-
sh '''docker run -i --name="$BUILD_TAG-volto" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci'''
80+
sh '''docker pull plone/volto-addon-ci:alpha'''
81+
sh '''docker run -i --name="$BUILD_TAG-volto" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e VOLTO=$VOLTO plone/volto-addon-ci:alpha'''
8282
sh '''rm -rf xunit-reports'''
8383
sh '''mkdir -p xunit-reports'''
8484
sh '''docker cp $BUILD_TAG-volto:/opt/frontend/my-volto-project/coverage xunit-reports/'''
@@ -126,7 +126,7 @@ pipeline {
126126
script {
127127
try {
128128
sh '''docker pull eeacms/plone-backend; docker run --rm -d --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="eea.kitkat:testing" eeacms/plone-backend'''
129-
sh '''docker pull plone/volto-addon-ci; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" -e NODE_ENV=development -e VOLTO="$VOLTO" plone/volto-addon-ci cypress'''
129+
sh '''docker pull plone/volto-addon-ci:alpha; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" -e NODE_ENV=development -e VOLTO=$VOLTO plone/volto-addon-ci:alpha cypress'''
130130
} finally {
131131
try {
132132
sh '''rm -rf cypress-reports cypress-results cypress-coverage'''

0 commit comments

Comments
 (0)