@eeacms/volto-slate-footnote 6.2.3 → 7.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.
package/.env ADDED
@@ -0,0 +1,3 @@
1
+ # Jest configuration variables
2
+ # - possible values: ON, OFF
3
+ JEST_USE_SETUP=OFF
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;
package/CHANGELOG.md CHANGED
@@ -4,15 +4,33 @@ 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
+ ### [7.0.0](https://github.com/eea/volto-slate-footnote/compare/6.3.0...7.0.0) - 22 April 2024
8
+
9
+ #### :rocket: New Features
10
+
11
+ - feat: Release 7.0.0 - Volto 17 support [alin - [`9d04cb5`](https://github.com/eea/volto-slate-footnote/commit/9d04cb54fca5e925785511883573fab7a5ff4c76)]
12
+
13
+ #### :hammer_and_wrench: Others
14
+
15
+ ### [6.3.0](https://github.com/eea/volto-slate-footnote/compare/6.2.3...6.3.0) - 28 March 2024
16
+
17
+ #### :hammer_and_wrench: Others
18
+
19
+ - Update package.json [ichim-david - [`497b720`](https://github.com/eea/volto-slate-footnote/commit/497b720a79a9debff93b677d7289de3f2766a9ea)]
20
+ - (fix): Make tabs open when footnote in it #63 from eea/table-and-tabs [ichim-david - [`bcd71a4`](https://github.com/eea/volto-slate-footnote/commit/bcd71a441bdbf28927cbac8a50094fac4606f58d)]
21
+ - Update extensions.js [dobri1408 - [`1245061`](https://github.com/eea/volto-slate-footnote/commit/124506189082d04bcf7d4c47efb4be7b8381cb09)]
22
+ - fix eslint [Dobricean Ioan Dorian - [`f11cd5e`](https://github.com/eea/volto-slate-footnote/commit/f11cd5ed4063e648741bc583f5c20b14c73fba66)]
23
+ - fix issue in table [Dobricean Ioan Dorian - [`3f8a31a`](https://github.com/eea/volto-slate-footnote/commit/3f8a31afbbb2917d02ceb831e7be46ce7f69e893)]
24
+ - open tab if footnote in it [Dobricean Ioan Dorian - [`191c39a`](https://github.com/eea/volto-slate-footnote/commit/191c39aef5f03649db8cdd170afdee1ca17c1392)]
7
25
  ### [6.2.3](https://github.com/eea/volto-slate-footnote/compare/6.2.2...6.2.3) - 6 March 2024
8
26
 
9
27
  #### :bug: Bug Fixes
10
28
 
29
+ - fix(slate-notes): crash when hovering over notes due to faulty ref initialization #64 from eea/develop [ichim-david - [`cc5e9ac`](https://github.com/eea/volto-slate-footnote/commit/cc5e9ac269f324e5d35117b348ebf41f93f34bfa)]
11
30
  - fix: Refs#265202 - footnotes hover crash [Claudia Ifrim - [`71e236d`](https://github.com/eea/volto-slate-footnote/commit/71e236df5785a0878a243658601030f3d7e670c9)]
12
31
 
13
32
  #### :hammer_and_wrench: Others
14
33
 
15
- - Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`aa335f9`](https://github.com/eea/volto-slate-footnote/commit/aa335f9eedd9d994b6fbceb57102d848dbdbae15)]
16
34
  ### [6.2.2](https://github.com/eea/volto-slate-footnote/compare/6.2.1...6.2.2) - 20 January 2024
17
35
 
18
36
  #### :hammer_and_wrench: Others
@@ -37,15 +55,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
37
55
 
38
56
  #### :house: Internal changes
39
57
 
40
- - chore: [JENKINS] Refactor automated testing [valentinab25 - [`5a5e1ad`](https://github.com/eea/volto-slate-footnote/commit/5a5e1adf997af84e93a4015dc66b7299abba0874)]
41
58
 
42
59
  #### :hammer_and_wrench: Others
43
60
 
44
- - test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`af6d78f`](https://github.com/eea/volto-slate-footnote/commit/af6d78f60dd040fe61ebb225f4a689ac21ffb55c)]
45
- - test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`7f4c07f`](https://github.com/eea/volto-slate-footnote/commit/7f4c07f1fc2e9893d1f925152a473855a7e0f064)]
46
- - test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`0670217`](https://github.com/eea/volto-slate-footnote/commit/0670217cca01571e8a3bd64ee3d85bb53ce447be)]
47
- - test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`ec08749`](https://github.com/eea/volto-slate-footnote/commit/ec08749f9547d2c133b2174ab8d60cf2bdb1b23a)]
48
- - test: [JENKINS] Improve cypress time [valentinab25 - [`237e6a3`](https://github.com/eea/volto-slate-footnote/commit/237e6a331e3608aa35d1c93a03c435daf330c2bd)]
49
61
  ### [6.1.8](https://github.com/eea/volto-slate-footnote/compare/6.1.7...6.1.8) - 22 October 2023
50
62
 
51
63
  #### :house: Internal changes
@@ -115,25 +127,17 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
115
127
 
116
128
  #### :house: Internal changes
117
129
 
118
- - chore: [JENKINS] Deprecate circularity website [valentinab25 - [`ded882a`](https://github.com/eea/volto-slate-footnote/commit/ded882a1ca1183c2ba74ff4246111123ee36e6cb)]
119
130
 
120
131
  #### :hammer_and_wrench: Others
121
132
 
122
133
  - test: jest should look for addons in node_modules Refs #253277 [valentinab25 - [`3e0749c`](https://github.com/eea/volto-slate-footnote/commit/3e0749cc5bd7f5810ac6fd7a3feee4df0435ee0a)]
123
134
  - test: Add unit tests for utils - refs #253277 [ana-oprea - [`a709895`](https://github.com/eea/volto-slate-footnote/commit/a709895d9953742ef6d39f8d9673c06b2efe6a64)]
124
135
  - test: Fix test config, coverage Refs #253277 [valentinab25 - [`dc4d6dc`](https://github.com/eea/volto-slate-footnote/commit/dc4d6dc9b39bfe2c892156f32c764153d1366486)]
125
- - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`4f0ecee`](https://github.com/eea/volto-slate-footnote/commit/4f0ecee224d5d6604dfbb562556e45437edbb8ec)]
126
136
  ### [6.1.0](https://github.com/eea/volto-slate-footnote/compare/6.0.2...6.1.0) - 27 March 2023
127
137
 
128
138
  #### :hammer_and_wrench: Others
129
139
 
130
- - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`23959ee`](https://github.com/eea/volto-slate-footnote/commit/23959ee43d45ec5eaa483590415a75fc58faae03)]
131
- - Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`7aa6f34`](https://github.com/eea/volto-slate-footnote/commit/7aa6f3439953cc3d8f28875eff9fbcc24084cbc7)]
132
- - Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`b117d15`](https://github.com/eea/volto-slate-footnote/commit/b117d15e51b3cf10717b9dd9dfef8304d46ad556)]
133
140
  - test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`97ed8fb`](https://github.com/eea/volto-slate-footnote/commit/97ed8fbd92f76c2b3128b62cdc1a77611e79410a)]
134
- - Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`cb22f5e`](https://github.com/eea/volto-slate-footnote/commit/cb22f5e8e9d3aed0a3b4374b6d4d80c8c2bb66e1)]
135
- - yarn 3 [Alin Voinea - [`f5bb904`](https://github.com/eea/volto-slate-footnote/commit/f5bb904eecf740ffd57dbccf9a597c99ea2dfc0c)]
136
- - Add Sonarqube tag using demo-kitkat-frontend addons list [EEA Jenkins - [`59cf6d3`](https://github.com/eea/volto-slate-footnote/commit/59cf6d334a460e373dda3e2e28754fcdd9fb0281)]
137
141
  ### [6.0.2](https://github.com/eea/volto-slate-footnote/compare/6.0.1...6.0.2) - 16 November 2022
138
142
 
139
143
  #### :hammer_and_wrench: Others
@@ -149,37 +153,27 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
149
153
 
150
154
  #### :hammer_and_wrench: Others
151
155
 
152
- - Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`dc3c7de`](https://github.com/eea/volto-slate-footnote/commit/dc3c7deaa8c692689ea0cec66cf019f05f9c4e22)]
153
- - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`133969a`](https://github.com/eea/volto-slate-footnote/commit/133969a37a6153a19af121d2f6031a70bc67cc9d)]
154
156
  ### [5.0.1](https://github.com/eea/volto-slate-footnote/compare/5.0.0...5.0.1) - 30 June 2022
155
157
 
156
158
  #### :hammer_and_wrench: Others
157
159
 
158
- - Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`4d5af13`](https://github.com/eea/volto-slate-footnote/commit/4d5af1345aad9071c031f7f00efd6bc5da04541f)]
159
160
  ## [5.0.0](https://github.com/eea/volto-slate-footnote/compare/4.0.5...5.0.0) - 19 May 2022
160
161
 
161
162
  ### [4.0.5](https://github.com/eea/volto-slate-footnote/compare/4.0.4...4.0.5) - 17 May 2022
162
163
 
163
164
  #### :hammer_and_wrench: Others
164
165
 
165
- - Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`85a16ee`](https://github.com/eea/volto-slate-footnote/commit/85a16ee73d21d696282dc24933169d3c31383027)]
166
- - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`418349c`](https://github.com/eea/volto-slate-footnote/commit/418349ce22d98bf5dee58130d6f1cb9f45bbaa46)]
167
166
  ### [4.0.4](https://github.com/eea/volto-slate-footnote/compare/4.0.3...4.0.4) - 3 January 2022
168
167
 
169
168
  ### [4.0.3](https://github.com/eea/volto-slate-footnote/compare/4.0.2...4.0.3) - 18 December 2021
170
169
 
171
170
  #### :hammer_and_wrench: Others
172
171
 
173
- - Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`ad06940`](https://github.com/eea/volto-slate-footnote/commit/ad0694074a06eb56ec1891256b262e9854c0303d)]
174
172
  - Refs #142010 - Optimize Volto-addons gitflow pipelines [valentinab25 - [`1081079`](https://github.com/eea/volto-slate-footnote/commit/1081079444f5ac806e9d56765c4ccf0b9e415a73)]
175
- - Add Sonarqube tag using industry-frontend addons list [EEA Jenkins - [`307687b`](https://github.com/eea/volto-slate-footnote/commit/307687b93d966e0df5c4a3f813dbb19442d2e169)]
176
- - Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`0460e2a`](https://github.com/eea/volto-slate-footnote/commit/0460e2a73a4c8ede00b0c1fc3f05624eaa345a33)]
177
- - Add Sonarqube tag using forests-frontend addons list [EEA Jenkins - [`8aecee9`](https://github.com/eea/volto-slate-footnote/commit/8aecee99f11387e4ce31825209798772d7fee060)]
178
173
  ### [4.0.2](https://github.com/eea/volto-slate-footnote/compare/4.0.1...4.0.2) - 30 September 2021
179
174
 
180
175
  #### :hammer_and_wrench: Others
181
176
 
182
- - Add Sonarqube tag using sustainability-frontend addons list [EEA Jenkins - [`cf33efe`](https://github.com/eea/volto-slate-footnote/commit/cf33efec91b4b8d13562b8c8f660e7a78191d9e0)]
183
177
  - Remove :asDefault dependency from volto-slate [Alin Voinea - [`13dad5e`](https://github.com/eea/volto-slate-footnote/commit/13dad5ed23043fa7a24682e1ac6addc86632bfe0)]
184
178
  ### [4.0.1](https://github.com/eea/volto-slate-footnote/compare/4.0.0...4.0.1) - 29 September 2021
185
179
 
@@ -187,7 +181,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
187
181
 
188
182
  #### :hammer_and_wrench: Others
189
183
 
190
- - Add Sonarqube tag using climate-energy-frontend addons list [EEA Jenkins - [`80a159b`](https://github.com/eea/volto-slate-footnote/commit/80a159bb67698cddedadc494e7ae2da32a96faea)]
191
184
  ### [3.2.0](https://github.com/eea/volto-slate-footnote/compare/3.1.1...3.2.0) - 13 September 2021
192
185
 
193
186
  #### :hammer_and_wrench: Others
@@ -200,7 +193,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
200
193
  - Remove console.log [Alin Voinea - [`b5d83e7`](https://github.com/eea/volto-slate-footnote/commit/b5d83e7c13240151f602d122ecf09ba9b8e335f3)]
201
194
  - Fix slate json field default value in DX layout [Alin Voinea - [`f2805bb`](https://github.com/eea/volto-slate-footnote/commit/f2805bbc15c51ebd914ee5f4eb9dd34ef32e095b)]
202
195
  - Fix cypress api_url [Alin Voinea - [`6a4966a`](https://github.com/eea/volto-slate-footnote/commit/6a4966a2f92e932e1d0df35351989cda535f15c8)]
203
- - Add Sonarqube tag using ims-frontend addons list [EEA Jenkins - [`aed3984`](https://github.com/eea/volto-slate-footnote/commit/aed39840ecd467689eaf0adb352bd00ce95bdbbe)]
204
196
  ### [3.1.0](https://github.com/eea/volto-slate-footnote/compare/3.0.0...3.1.0) - 9 September 2021
205
197
 
206
198
  #### :hammer_and_wrench: Others
@@ -221,7 +213,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
221
213
  - Bump version to 2.4.0 [Alin Voinea - [`bef0d34`](https://github.com/eea/volto-slate-footnote/commit/bef0d34c2b9c20915578ffaefb4fd30cbf42f0a1)]
222
214
  - Fix Slate point from DOM crash [Alin Voinea - [`c852f79`](https://github.com/eea/volto-slate-footnote/commit/c852f7987ffe8db433235b70792002d40ade690f)]
223
215
  - Fix crash on copy&paste beforeInsert condition [Alin Voinea - [`85172cf`](https://github.com/eea/volto-slate-footnote/commit/85172cff3e2ea95a86d4b4fb452f3c0287b80e8f)]
224
- - Add Sonarqube tag using frontend addons list [EEA Jenkins - [`b471c41`](https://github.com/eea/volto-slate-footnote/commit/b471c418d198b1bde95acfe0b256f642bacc6865)]
225
216
  ### [2.3.1](https://github.com/eea/volto-slate-footnote/compare/2.3.0...2.3.1) - 25 June 2021
226
217
 
227
218
  ### [2.3.0](https://github.com/eea/volto-slate-footnote/compare/2.2.2...2.3.0) - 12 June 2021
package/Jenkinsfile CHANGED
@@ -9,11 +9,12 @@ pipeline {
9
9
  environment {
10
10
  GIT_NAME = "volto-slate-footnote"
11
11
  NAMESPACE = "@eeacms"
12
- SONARQUBE_TAGS = "volto.eea.europa.eu,biodiversity.europa.eu,www.eea.europa.eu-ims,climate-energy.eea.europa.eu,sustainability.eionet.europa.eu,forest.eea.europa.eu,clms.land.copernicus.eu,industry.eea.europa.eu,water.europa.eu-freshwater,demo-www.eea.europa.eu,clmsdemo.devel6cph.eea.europa.eu,water.europa.eu-marine,climate-adapt.eea.europa.eu,climate-advisory-board.devel4cph.eea.europa.eu,climate-advisory-board.europa.eu,www.eea.europa.eu-en,insitu-frontend.eionet.europa.eu"
12
+ SONARQUBE_TAGS = "volto.eea.europa.eu,biodiversity.europa.eu,www.eea.europa.eu-ims,climate-energy.eea.europa.eu,forest.eea.europa.eu,clms.land.copernicus.eu,industry.eea.europa.eu,water.europa.eu-freshwater,demo-www.eea.europa.eu,clmsdemo.devel6cph.eea.europa.eu,water.europa.eu-marine,climate-adapt.eea.europa.eu,climate-advisory-board.devel4cph.eea.europa.eu,climate-advisory-board.europa.eu,www.eea.europa.eu-en,insitu-frontend.eionet.europa.eu,insitu.copernicus.eu"
13
13
  DEPENDENCIES = ""
14
14
  BACKEND_PROFILES = "eea.kitkat:testing"
15
15
  BACKEND_ADDONS = ""
16
- VOLTO = "16"
16
+ VOLTO = "17"
17
+ VOLTO16_BREAKING_CHANGES = "no"
17
18
  IMAGE_NAME = BUILD_TAG.toLowerCase()
18
19
  }
19
20
 
@@ -44,6 +45,7 @@ pipeline {
44
45
  }
45
46
  steps {
46
47
  script {
48
+ checkout scm
47
49
  withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN')]) {
48
50
  check_result = sh script: '''docker run --pull always -i --rm --name="$IMAGE_NAME-gitflow-check" -e GIT_TOKEN="$GITHUB_TOKEN" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_ORG="$GIT_ORG" -e GIT_NAME="$GIT_NAME" eeacms/gitflow /check_if_testing_needed.sh''', returnStatus: true
49
51
 
@@ -61,7 +63,6 @@ pipeline {
61
63
  allOf {
62
64
  not { environment name: 'CHANGE_ID', value: '' }
63
65
  environment name: 'CHANGE_TARGET', value: 'develop'
64
- environment name: 'SKIP_TESTS', value: ''
65
66
  }
66
67
  allOf {
67
68
  environment name: 'CHANGE_ID', value: ''
@@ -69,25 +70,27 @@ pipeline {
69
70
  not { changelog '.*^Automated release [0-9\\.]+$' }
70
71
  branch 'master'
71
72
  }
72
- environment name: 'SKIP_TESTS', value: ''
73
73
  }
74
74
  }
75
75
  }
76
- stages {
77
- stage('Build test image') {
78
- steps {
79
- checkout scm
80
- sh '''docker build --pull --build-arg="VOLTO_VERSION=$VOLTO" --build-arg="ADDON_NAME=$NAMESPACE/$GIT_NAME" --build-arg="ADDON_PATH=$GIT_NAME" . -t $IMAGE_NAME-frontend'''
76
+ parallel {
77
+
78
+ stage('Volto 17') {
79
+ agent { node { label 'docker-1.13'} }
80
+ stages {
81
+ stage('Build test image') {
82
+ steps {
83
+ sh '''docker build --pull --build-arg="VOLTO_VERSION=$VOLTO" --build-arg="ADDON_NAME=$NAMESPACE/$GIT_NAME" --build-arg="ADDON_PATH=$GIT_NAME" . -t $IMAGE_NAME-frontend'''
84
+ }
81
85
  }
82
- }
83
-
84
- stage('Fix code') {
85
- when {
86
+
87
+ stage('Fix code') {
88
+ when {
86
89
  environment name: 'CHANGE_ID', value: ''
87
90
  not { branch 'master' }
88
- }
89
- steps {
90
- script {
91
+ }
92
+ steps {
93
+ script {
91
94
  fix_result = sh(script: '''docker run --name="$IMAGE_NAME-fix" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend ci-fix''', returnStatus: true)
92
95
  sh '''docker cp $IMAGE_NAME-fix:/app/src/addons/$GIT_NAME/src .'''
93
96
  sh '''docker rm -v $IMAGE_NAME-fix'''
@@ -105,31 +108,31 @@ pipeline {
105
108
  sh '''exit 1'''
106
109
  }
107
110
  }
111
+ }
108
112
  }
109
- }
110
113
 
111
- stage('ES lint') {
112
- steps {
113
- sh '''docker run --rm --name="$IMAGE_NAME-eslint" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend lint'''
114
+ stage('ES lint') {
115
+ when { environment name: 'SKIP_TESTS', value: '' }
116
+ steps {
117
+ sh '''docker run --rm --name="$IMAGE_NAME-eslint" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend lint'''
118
+ }
114
119
  }
115
- }
116
120
 
117
- stage('Style lint') {
118
- steps {
119
- sh '''docker run --rm --name="$IMAGE_NAME-stylelint" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend stylelint'''
121
+ stage('Style lint') {
122
+ when { environment name: 'SKIP_TESTS', value: '' }
123
+ steps {
124
+ sh '''docker run --rm --name="$IMAGE_NAME-stylelint" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend stylelint'''
125
+ }
120
126
  }
121
- }
122
127
 
123
- stage('Prettier') {
124
- steps {
125
- sh '''docker run --rm --name="$IMAGE_NAME-prettier" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend prettier'''
128
+ stage('Prettier') {
129
+ when { environment name: 'SKIP_TESTS', value: '' }
130
+ steps {
131
+ sh '''docker run --rm --name="$IMAGE_NAME-prettier" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend prettier'''
132
+ }
126
133
  }
127
- }
128
-
129
- stage('Coverage Tests') {
130
- parallel {
131
-
132
- stage('Unit tests') {
134
+ stage('Unit tests') {
135
+ when { environment name: 'SKIP_TESTS', value: '' }
133
136
  steps {
134
137
  script {
135
138
  try {
@@ -155,17 +158,24 @@ pipeline {
155
158
  }
156
159
  }
157
160
  }
158
- }
161
+ }
159
162
 
160
- stage('Integration tests') {
163
+ stage('Integration tests') {
164
+ when { environment name: 'SKIP_TESTS', value: '' }
161
165
  steps {
162
166
  script {
163
167
  try {
164
168
  sh '''docker run --pull always --rm -d --name="$IMAGE_NAME-plone" -e SITE="Plone" -e PROFILES="$BACKEND_PROFILES" -e ADDONS="$BACKEND_ADDONS" eeacms/plone-backend'''
165
- sh '''docker run -d --shm-size=3g --link $IMAGE_NAME-plone:plone --name="$IMAGE_NAME-cypress" -e "RAZZLE_INTERNAL_API_PATH=http://plone:8080/Plone" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend start-ci'''
169
+ sh '''docker run -d --shm-size=4g --link $IMAGE_NAME-plone:plone --name="$IMAGE_NAME-cypress" -e "RAZZLE_INTERNAL_API_PATH=http://plone:8080/Plone" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend start-ci'''
170
+ frontend = sh script:'''docker exec --workdir=/app/src/addons/${GIT_NAME} $IMAGE_NAME-cypress make check-ci''', returnStatus: true
171
+ if ( frontend != 0 ) {
172
+ sh '''docker logs $IMAGE_NAME-cypress; exit 1'''
173
+ }
174
+
166
175
  sh '''timeout -s 9 1800 docker exec --workdir=/app/src/addons/${GIT_NAME} $IMAGE_NAME-cypress make cypress-ci'''
167
176
  } finally {
168
177
  try {
178
+ if ( frontend == 0 ) {
169
179
  sh '''rm -rf cypress-videos cypress-results cypress-coverage cypress-screenshots'''
170
180
  sh '''mkdir -p cypress-videos cypress-results cypress-coverage cypress-screenshots'''
171
181
  videos = sh script: '''docker cp $IMAGE_NAME-cypress:/app/src/addons/$GIT_NAME/cypress/videos cypress-videos/''', returnStatus: true
@@ -189,6 +199,7 @@ pipeline {
189
199
  sh '''for file in $(find cypress-results -name *.xml); do if [ $(grep -E 'failures="[1-9].*"' $file | wc -l) -eq 0 ]; then testname=$(grep -E 'file=.*failures="0"' $file | sed 's#.* file=".*\\/\\(.*\\.[jsxt]\\+\\)" time.*#\\1#' ); rm -f cypress-videos/videos/$testname.mp4; fi; done'''
190
200
  archiveArtifacts artifacts: 'cypress-videos/**/*.mp4', fingerprint: true, allowEmptyArchive: true
191
201
  }
202
+ }
192
203
  } finally {
193
204
  catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
194
205
  junit testResults: 'cypress-results/**/*.xml', allowEmptyResults: true
@@ -204,16 +215,7 @@ pipeline {
204
215
  }
205
216
  }
206
217
  }
207
- }
208
218
  }
209
- }
210
- }
211
- post {
212
- always {
213
- sh script: "docker rmi $IMAGE_NAME-frontend", returnStatus: true
214
- }
215
- }
216
- }
217
219
 
218
220
  stage('Report to SonarQube') {
219
221
  when {
@@ -221,9 +223,11 @@ pipeline {
221
223
  allOf {
222
224
  not { environment name: 'CHANGE_ID', value: '' }
223
225
  environment name: 'CHANGE_TARGET', value: 'develop'
226
+ environment name: 'SKIP_TESTS', value: ''
224
227
  }
225
228
  allOf {
226
229
  environment name: 'CHANGE_ID', value: ''
230
+ environment name: 'SKIP_TESTS', value: ''
227
231
  anyOf {
228
232
  allOf {
229
233
  branch 'develop'
@@ -248,14 +252,107 @@ pipeline {
248
252
  }
249
253
  }
250
254
 
255
+
256
+ }
257
+ }
258
+
259
+ stage('Volto 16') {
260
+ agent { node { label 'integration'} }
261
+ when {
262
+ environment name: 'SKIP_TESTS', value: ''
263
+ not { environment name: 'VOLTO16_BREAKING_CHANGES', value: 'yes' }
264
+ }
265
+ stages {
266
+ stage('Build test image') {
267
+ steps {
268
+ sh '''docker build --pull --build-arg="VOLTO_VERSION=16" --build-arg="ADDON_NAME=$NAMESPACE/$GIT_NAME" --build-arg="ADDON_PATH=$GIT_NAME" . -t $IMAGE_NAME-frontend16'''
269
+ }
270
+ }
271
+
272
+ stage('Unit tests Volto 16') {
273
+ steps {
274
+ script {
275
+ try {
276
+ sh '''docker run --name="$IMAGE_NAME-volto16" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend16 test-ci'''
277
+ sh '''rm -rf xunit-reports16'''
278
+ sh '''mkdir -p xunit-reports16'''
279
+ sh '''docker cp $IMAGE_NAME-volto16:/app/junit.xml xunit-reports16/'''
280
+ } finally {
281
+ catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
282
+ junit testResults: 'xunit-reports16/junit.xml', allowEmptyResults: true
283
+ }
284
+ sh script: '''docker rm -v $IMAGE_NAME-volto16''', returnStatus: true
285
+ }
286
+ }
287
+ }
288
+ }
289
+
290
+ stage('Integration tests Volto 16') {
291
+ steps {
292
+ script {
293
+ try {
294
+ sh '''docker run --pull always --rm -d --name="$IMAGE_NAME-plone16" -e SITE="Plone" -e PROFILES="$BACKEND_PROFILES" -e ADDONS="$BACKEND_ADDONS" eeacms/plone-backend'''
295
+ sh '''docker run -d --shm-size=4g --link $IMAGE_NAME-plone16:plone --name="$IMAGE_NAME-cypress16" -e "RAZZLE_INTERNAL_API_PATH=http://plone:8080/Plone" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend16 start-ci'''
296
+ frontend = sh script:'''docker exec --workdir=/app/src/addons/${GIT_NAME} $IMAGE_NAME-cypress16 make check-ci''', returnStatus: true
297
+ if ( frontend != 0 ) {
298
+ sh '''docker logs $IMAGE_NAME-cypress16; exit 1'''
299
+ }
300
+ sh '''timeout -s 9 1800 docker exec --workdir=/app/src/addons/${GIT_NAME} $IMAGE_NAME-cypress16 make cypress-ci'''
301
+ } finally {
302
+ try {
303
+ if ( frontend == 0 ) {
304
+ sh '''rm -rf cypress-videos16 cypress-results16 cypress-coverage16 cypress-screenshots16'''
305
+ sh '''mkdir -p cypress-videos16 cypress-results16 cypress-coverage16 cypress-screenshots16'''
306
+ videos = sh script: '''docker cp $IMAGE_NAME-cypress16:/app/src/addons/$GIT_NAME/cypress/videos cypress-videos16/''', returnStatus: true
307
+ sh '''docker cp $IMAGE_NAME-cypress16:/app/src/addons/$GIT_NAME/cypress/reports cypress-results16/'''
308
+ screenshots = sh script: '''docker cp $IMAGE_NAME-cypress16:/app/src/addons/$GIT_NAME/cypress/screenshots cypress-screenshots16''', returnStatus: true
309
+
310
+ archiveArtifacts artifacts: 'cypress-screenshots16/**', fingerprint: true, allowEmptyArchive: true
311
+
312
+ if ( videos == 0 ) {
313
+ sh '''for file in $(find cypress-results16 -name *.xml); do if [ $(grep -E 'failures="[1-9].*"' $file | wc -l) -eq 0 ]; then testname=$(grep -E 'file=.*failures="0"' $file | sed 's#.* file=".*\\/\\(.*\\.[jsxt]\\+\\)" time.*#\\1#' ); rm -f cypress-videos16/videos/$testname.mp4; fi; done'''
314
+ archiveArtifacts artifacts: 'cypress-videos16/**/*.mp4', fingerprint: true, allowEmptyArchive: true
315
+ }
316
+ }
317
+ } finally {
318
+ catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
319
+ junit testResults: 'cypress-results16/**/*.xml', allowEmptyResults: true
320
+ }
321
+ catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
322
+ sh '''docker logs $IMAGE_NAME-cypress16'''
323
+ }
324
+ sh script: "docker stop $IMAGE_NAME-cypress16", returnStatus: true
325
+ sh script: "docker stop $IMAGE_NAME-plone16", returnStatus: true
326
+ sh script: "docker rm -v $IMAGE_NAME-plone16", returnStatus: true
327
+ sh script: "docker rm -v $IMAGE_NAME-cypress16", returnStatus: true
328
+ }
329
+ }
330
+ }
331
+ }
332
+ }
333
+
334
+ }
335
+ }
336
+ }
337
+ post {
338
+ always {
339
+ sh script: "docker rmi $IMAGE_NAME-frontend", returnStatus: true
340
+ sh script: "docker rmi $IMAGE_NAME-frontend16", returnStatus: true
341
+ }
342
+ }
343
+ }
344
+
345
+
251
346
  stage('SonarQube compare to master') {
252
347
  when {
253
348
  anyOf {
254
349
  allOf {
255
350
  not { environment name: 'CHANGE_ID', value: '' }
256
351
  environment name: 'CHANGE_TARGET', value: 'develop'
352
+ environment name: 'SKIP_TESTS', value: ''
257
353
  }
258
354
  allOf {
355
+ environment name: 'SKIP_TESTS', value: ''
259
356
  environment name: 'CHANGE_ID', value: ''
260
357
  branch 'develop'
261
358
  not { changelog '.*^Automated release [0-9\\.]+$' }
@@ -316,3 +413,4 @@ pipeline {
316
413
  }
317
414
  }
318
415
  }
416
+
package/Makefile CHANGED
@@ -46,7 +46,7 @@ endif
46
46
  DIR=$(shell basename $$(pwd))
47
47
  NODE_MODULES?="../../../node_modules"
48
48
  PLONE_VERSION?=6
49
- VOLTO_VERSION?=16
49
+ VOLTO_VERSION?=17
50
50
  ADDON_PATH="${DIR}"
51
51
  ADDON_NAME="@eeacms/${ADDON_PATH}"
52
52
  DOCKER_COMPOSE=PLONE_VERSION=${PLONE_VERSION} VOLTO_VERSION=${VOLTO_VERSION} ADDON_NAME=${ADDON_NAME} ADDON_PATH=${ADDON_PATH} docker compose
@@ -86,7 +86,7 @@ cypress-open: ## Open cypress integration tests
86
86
 
87
87
  .PHONY: cypress-run
88
88
  cypress-run: ## Run cypress integration tests
89
- CYPRESS_API_PATH="${RAZZLE_DEV_PROXY_API_PATH}" NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress run --browser chromium
89
+ CYPRESS_API_PATH="${RAZZLE_DEV_PROXY_API_PATH}" NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress run
90
90
 
91
91
  .PHONY: test
92
92
  test: ## Run jest tests
@@ -98,7 +98,7 @@ test-update: ## Update jest tests snapshots
98
98
 
99
99
  .PHONY: stylelint
100
100
  stylelint: ## Stylelint
101
- $(NODE_MODULES)/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'
101
+ $(NODE_MODULES)/.bin/stylelint --allow-empty-input 'src/**/*.{css,less}'
102
102
 
103
103
  .PHONY: stylelint-overrides
104
104
  stylelint-overrides:
@@ -106,7 +106,7 @@ stylelint-overrides:
106
106
 
107
107
  .PHONY: stylelint-fix
108
108
  stylelint-fix: ## Fix stylelint
109
- $(NODE_MODULES)/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}' --fix
109
+ $(NODE_MODULES)/.bin/stylelint --allow-empty-input 'src/**/*.{css,less}' --fix
110
110
  $(NODE_MODULES)/.bin/stylelint --custom-syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides' --fix
111
111
 
112
112
  .PHONY: prettier
@@ -119,11 +119,11 @@ prettier-fix: ## Fix prettier
119
119
 
120
120
  .PHONY: lint
121
121
  lint: ## ES Lint
122
- $(NODE_MODULES)/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'
122
+ $(NODE_MODULES)/.bin/eslint --max-warnings=0 'src/**/*.{js,jsx}'
123
123
 
124
124
  .PHONY: lint-fix
125
125
  lint-fix: ## Fix ES Lint
126
- $(NODE_MODULES)/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'
126
+ $(NODE_MODULES)/.bin/eslint --fix 'src/**/*.{js,jsx}'
127
127
 
128
128
  .PHONY: i18n
129
129
  i18n: ## i18n
@@ -155,8 +155,11 @@ start-ci:
155
155
  cd ../..
156
156
  yarn start
157
157
 
158
+ .PHONY: check-ci
159
+ check-ci:
160
+ $(NODE_MODULES)/.bin/wait-on -t 240000 http://localhost:3000
161
+
158
162
  .PHONY: cypress-ci
159
163
  cypress-ci:
160
164
  $(NODE_MODULES)/.bin/wait-on -t 240000 http://localhost:3000
161
- NODE_ENV=development make cypress-run
162
-
165
+ CYPRESS_API_PATH="${RAZZLE_DEV_PROXY_API_PATH}" NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress run --browser chromium
@@ -35,10 +35,6 @@ export const slateBeforeEach = (contentType = 'Document') => {
35
35
  path: 'cypress',
36
36
  });
37
37
  cy.visit('/cypress/my-page');
38
- cy.waitForResourceToLoad('@navigation');
39
- cy.waitForResourceToLoad('@breadcrumbs');
40
- cy.waitForResourceToLoad('@actions');
41
- cy.waitForResourceToLoad('@types');
42
38
  cy.waitForResourceToLoad('my-page');
43
39
  cy.navigate('/cypress/my-page/edit');
44
40
  };
@@ -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,18 +11,26 @@ 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',
17
+ '@eeacms/search/(.*)$': '<rootDir>/src/addons/volto-searchlib/searchlib/$1',
18
+ '@eeacms/search': '<rootDir>/src/addons/volto-searchlib/searchlib',
15
19
  '@eeacms/(.*?)/(.*)$': '<rootDir>/node_modules/@eeacms/$1/src/$2',
16
- '@plone/volto-slate':
20
+ '@plone/volto-slate$':
17
21
  '<rootDir>/node_modules/@plone/volto/packages/volto-slate/src',
22
+ '@plone/volto-slate/(.*)$':
23
+ '<rootDir>/node_modules/@plone/volto/packages/volto-slate/src/$1',
18
24
  '~/(.*)$': '<rootDir>/src/$1',
19
25
  'load-volto-addons':
20
26
  '<rootDir>/node_modules/@plone/volto/jest-addons-loader.js',
21
27
  },
28
+ transformIgnorePatterns: [
29
+ '/node_modules/(?!(@plone|@root|@package|@eeacms)/).*/',
30
+ ],
22
31
  transform: {
23
32
  '^.+\\.js(x)?$': 'babel-jest',
33
+ '^.+\\.ts(x)?$': 'babel-jest',
24
34
  '^.+\\.(png)$': 'jest-file',
25
35
  '^.+\\.(jpg)$': 'jest-file',
26
36
  '^.+\\.(svg)$': './node_modules/@plone/volto/jest-svgsystem-transform.js',
@@ -33,4 +43,9 @@ module.exports = {
33
43
  statements: 5,
34
44
  },
35
45
  },
36
- };
46
+ ...(process.env.JEST_USE_SETUP === 'ON' && {
47
+ setupFilesAfterEnv: [
48
+ '<rootDir>/node_modules/@eeacms/volto-slate-footnote/jest.setup.js',
49
+ ],
50
+ }),
51
+ }