@eeacms/volto-arcgis-block 0.1.365 → 0.1.367
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/CHANGELOG.md +18 -0
- package/Dockerfile +1 -1
- package/Jenkinsfile +177 -153
- package/Makefile +33 -3
- package/jest-addon.config.js +9 -13
- package/package.json +1 -1
- package/src/components/MapViewer/MenuWidget.jsx +1 -0
- package/src/components/MapViewer/css/ArcgisMap.css +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,24 @@ 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.1.367](https://github.com/eea/volto-arcgis-block/compare/0.1.366...0.1.367) - 17 June 2025
|
|
8
|
+
|
|
9
|
+
#### :house: Internal changes
|
|
10
|
+
|
|
11
|
+
- chore: [JENKINS] fix variable, uncomment tests [valentinab25 - [`00d88b5`](https://github.com/eea/volto-arcgis-block/commit/00d88b52265cba983d1d5e21a49c051004b705b5)]
|
|
12
|
+
- chore: [JENKINS] use clms-theme pipeline [valentinab25 - [`52b392c`](https://github.com/eea/volto-arcgis-block/commit/52b392cc993f3767099525ed39249e574ce2b421)]
|
|
13
|
+
- chore: [JENKINS] use volto 16 pipeline [valentinab25 - [`a676671`](https://github.com/eea/volto-arcgis-block/commit/a676671186aa227f4c77a766b9ca852028168b5c)]
|
|
14
|
+
- chore: [JENKINS] fix Dockerfile to use eea frontend-builder [valentinab25 - [`980608c`](https://github.com/eea/volto-arcgis-block/commit/980608cc867ace42896831791a55c535838250ee)]
|
|
15
|
+
- chore: [JENKINS] update Makefile for Jenkins [valentinab25 - [`021267e`](https://github.com/eea/volto-arcgis-block/commit/021267e620d6529327a730f122a39f7fec53b293)]
|
|
16
|
+
|
|
17
|
+
#### :hammer_and_wrench: Others
|
|
18
|
+
|
|
19
|
+
- (ci): closed stages scope in Jenkinsfile [Unai Bolivar - [`c50394d`](https://github.com/eea/volto-arcgis-block/commit/c50394d5f59dc7f1d32bc3d138bdea4401515da4)]
|
|
20
|
+
- (ci): testing changes in Jenkins [Unai Bolivar - [`ca13cd9`](https://github.com/eea/volto-arcgis-block/commit/ca13cd903fbc424c2650b01473d1cd929df2bf75)]
|
|
21
|
+
- (bug): modernize Jenkins pipeline to use latest volto-addon-ci image [Unai Bolivar - [`5a91852`](https://github.com/eea/volto-arcgis-block/commit/5a918528f4dbe82460b17243d4241d5797a1a1f3)]
|
|
22
|
+
- (test): Adding a comment to test if develop branch is stable [Unai Bolivar - [`84975d7`](https://github.com/eea/volto-arcgis-block/commit/84975d702ff158926711d379372106c7278f8eb4)]
|
|
23
|
+
### [0.1.366](https://github.com/eea/volto-arcgis-block/compare/0.1.365...0.1.366) - 4 June 2025
|
|
24
|
+
|
|
7
25
|
### [0.1.365](https://github.com/eea/volto-arcgis-block/compare/0.1.364...0.1.365) - 28 May 2025
|
|
8
26
|
|
|
9
27
|
### [0.1.364](https://github.com/eea/volto-arcgis-block/compare/0.1.363...0.1.364) - 28 May 2025
|
package/Dockerfile
CHANGED
package/Jenkinsfile
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
pipeline {
|
|
2
|
-
|
|
2
|
+
tools {
|
|
3
|
+
jdk 'Java17'
|
|
4
|
+
}
|
|
5
|
+
agent {
|
|
6
|
+
node { label 'docker-host' }
|
|
7
|
+
}
|
|
3
8
|
|
|
4
9
|
environment {
|
|
5
10
|
GIT_NAME = "volto-arcgis-block"
|
|
@@ -9,10 +14,12 @@ pipeline {
|
|
|
9
14
|
BACKEND_PROFILES = "eea.kitkat:testing"
|
|
10
15
|
BACKEND_ADDONS = "clms.addon,clms.types,clms.downloadtool,clms.statstool"
|
|
11
16
|
VOLTO = "16.31.1"
|
|
17
|
+
IMAGE_NAME = BUILD_TAG.toLowerCase().replaceAll('[^a-z0-9]', '-')
|
|
18
|
+
NODEJS_VERSION = "22"
|
|
12
19
|
}
|
|
13
20
|
|
|
14
|
-
stages {
|
|
15
21
|
|
|
22
|
+
stages {
|
|
16
23
|
stage('Release') {
|
|
17
24
|
when {
|
|
18
25
|
allOf {
|
|
@@ -22,55 +29,41 @@ pipeline {
|
|
|
22
29
|
}
|
|
23
30
|
steps {
|
|
24
31
|
node(label: 'docker') {
|
|
25
|
-
withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN'),string(credentialsId: 'eea-jenkins-npm-token', variable: 'NPM_TOKEN')]) {
|
|
26
|
-
sh '''docker pull eeacms/gitflow'''
|
|
27
|
-
sh '''docker run -i --rm --name="$BUILD_TAG-gitflow-master" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" -e GIT_TOKEN="$GITHUB_TOKEN" -e NPM_TOKEN="$NPM_TOKEN" -e LANGUAGE=javascript eeacms/gitflow'''
|
|
32
|
+
withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN'), string(credentialsId: 'eea-jenkins-npm-token', variable: 'NPM_TOKEN')]) {
|
|
33
|
+
sh '''docker run -i --rm --pull always --name="$IMAGE_NAME-gitflow-master" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" -e GIT_TOKEN="$GITHUB_TOKEN" -e NPM_TOKEN="$NPM_TOKEN" -e NODEJS_VERSION="$NODEJS_VERSION" -e LANGUAGE=javascript eeacms/gitflow'''
|
|
28
34
|
}
|
|
29
35
|
}
|
|
30
36
|
}
|
|
31
37
|
}
|
|
32
38
|
|
|
33
|
-
stage('
|
|
39
|
+
stage('Check if testing needed') {
|
|
34
40
|
when {
|
|
35
41
|
allOf {
|
|
36
|
-
environment name: 'CHANGE_ID', value: ''
|
|
37
|
-
not { changelog '.*^Automated release [0-9\\.]+$' }
|
|
38
42
|
not { branch 'master' }
|
|
43
|
+
not { branch 'develop' }
|
|
44
|
+
environment name: 'CHANGE_ID', value: ''
|
|
39
45
|
}
|
|
40
46
|
}
|
|
41
47
|
steps {
|
|
42
|
-
|
|
48
|
+
script {
|
|
49
|
+
withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN')]) {
|
|
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
|
|
43
51
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
sh '''docker run -i --rm --name="$BUILD_TAG-eslint" -e VOLTO="$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:15.x eslint'''
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
"Style lint": {
|
|
52
|
-
node(label: 'docker') {
|
|
53
|
-
sh '''docker pull plone/volto-addon-ci:15.x'''
|
|
54
|
-
sh '''docker run -i --rm --name="$BUILD_TAG-stylelint" -e VOLTO="$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 stylelint'''
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
"Prettier": {
|
|
59
|
-
node(label: 'docker') {
|
|
60
|
-
sh '''docker pull plone/volto-addon-ci:15.x'''
|
|
61
|
-
sh '''docker run -i --rm --name="$BUILD_TAG-prettier" -e VOLTO="$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 prettier'''
|
|
52
|
+
if (check_result == 0) {
|
|
53
|
+
env.SKIP_TESTS = 'yes'
|
|
54
|
+
}
|
|
62
55
|
}
|
|
63
|
-
|
|
64
|
-
)
|
|
56
|
+
}
|
|
65
57
|
}
|
|
66
58
|
}
|
|
67
59
|
|
|
68
|
-
stage('
|
|
60
|
+
stage('Testing') {
|
|
69
61
|
when {
|
|
70
62
|
anyOf {
|
|
71
63
|
allOf {
|
|
72
64
|
not { environment name: 'CHANGE_ID', value: '' }
|
|
73
65
|
environment name: 'CHANGE_TARGET', value: 'develop'
|
|
66
|
+
environment name: 'SKIP_TESTS', value: ''
|
|
74
67
|
}
|
|
75
68
|
allOf {
|
|
76
69
|
environment name: 'CHANGE_ID', value: ''
|
|
@@ -78,26 +71,76 @@ pipeline {
|
|
|
78
71
|
not { changelog '.*^Automated release [0-9\\.]+$' }
|
|
79
72
|
branch 'master'
|
|
80
73
|
}
|
|
74
|
+
environment name: 'SKIP_TESTS', value: ''
|
|
81
75
|
}
|
|
82
76
|
}
|
|
83
77
|
}
|
|
84
|
-
|
|
85
|
-
|
|
78
|
+
stages {
|
|
79
|
+
stage('Build test image') {
|
|
80
|
+
steps {
|
|
81
|
+
checkout scm
|
|
82
|
+
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'''
|
|
83
|
+
}
|
|
84
|
+
}
|
|
86
85
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
86
|
+
stage('Fix code') {
|
|
87
|
+
when {
|
|
88
|
+
environment name: 'CHANGE_ID', value: ''
|
|
89
|
+
not { branch 'master' }
|
|
90
|
+
}
|
|
91
|
+
steps {
|
|
92
|
+
script {
|
|
93
|
+
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)
|
|
94
|
+
sh '''docker cp $IMAGE_NAME-fix:/app/src/addons/$GIT_NAME/src .'''
|
|
95
|
+
sh '''docker rm -v $IMAGE_NAME-fix'''
|
|
96
|
+
FOUND_FIX = sh(script: '''git diff | wc -l''', returnStdout: true).trim()
|
|
97
|
+
|
|
98
|
+
if (FOUND_FIX != '0') {
|
|
99
|
+
withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN')]) {
|
|
100
|
+
sh '''sed -i "s|url = .*|url = https://eea-jenkins:$GITHUB_TOKEN@github.com/eea/$GIT_NAME.git|" .git/config'''
|
|
101
|
+
}
|
|
102
|
+
sh '''git fetch origin $GIT_BRANCH:$GIT_BRANCH'''
|
|
103
|
+
sh '''git checkout $GIT_BRANCH'''
|
|
104
|
+
sh '''git add src/'''
|
|
105
|
+
sh '''git commit -m "style: Automated code fix" '''
|
|
106
|
+
sh '''git push --set-upstream origin $GIT_BRANCH'''
|
|
107
|
+
sh '''exit 1'''
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
stage('ES lint') {
|
|
114
|
+
steps {
|
|
115
|
+
sh '''docker run --rm --name="$IMAGE_NAME-eslint" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend lint'''
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
stage('Style lint') {
|
|
120
|
+
steps {
|
|
121
|
+
sh '''docker run --rm --name="$IMAGE_NAME-stylelint" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend stylelint'''
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
stage('Prettier') {
|
|
126
|
+
steps {
|
|
127
|
+
sh '''docker run --rm --name="$IMAGE_NAME-prettier" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend prettier'''
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
stage('Coverage Tests') {
|
|
132
|
+
parallel {
|
|
133
|
+
|
|
134
|
+
stage('Unit tests') {
|
|
135
|
+
steps {
|
|
136
|
+
script {
|
|
137
|
+
try {
|
|
138
|
+
sh '''docker run --name="$IMAGE_NAME-volto" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend test-ci'''
|
|
139
|
+
sh '''rm -rf xunit-reports'''
|
|
140
|
+
sh '''mkdir -p xunit-reports'''
|
|
141
|
+
sh '''docker cp $IMAGE_NAME-volto:/app/coverage xunit-reports/'''
|
|
142
|
+
sh '''docker cp $IMAGE_NAME-volto:/app/junit.xml xunit-reports/'''
|
|
143
|
+
publishHTML(target : [
|
|
101
144
|
allowMissing: false,
|
|
102
145
|
alwaysLinkToLastBuild: true,
|
|
103
146
|
keepAll: true,
|
|
@@ -110,16 +153,71 @@ pipeline {
|
|
|
110
153
|
catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
|
|
111
154
|
junit testResults: 'xunit-reports/junit.xml', allowEmptyResults: true
|
|
112
155
|
}
|
|
113
|
-
|
|
156
|
+
sh script: '''docker rm -v $IMAGE_NAME-volto''', returnStatus: true
|
|
157
|
+
}
|
|
114
158
|
}
|
|
115
159
|
}
|
|
116
160
|
}
|
|
161
|
+
|
|
162
|
+
// stage('Integration tests') {
|
|
163
|
+
// steps {
|
|
164
|
+
// script {
|
|
165
|
+
// try {
|
|
166
|
+
// 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'''
|
|
167
|
+
// 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'''
|
|
168
|
+
// sh '''timeout -s 9 1800 docker exec --workdir=/app/src/addons/${GIT_NAME} $IMAGE_NAME-cypress make cypress-ci'''
|
|
169
|
+
// } finally {
|
|
170
|
+
// try {
|
|
171
|
+
// sh '''rm -rf cypress-videos cypress-results cypress-coverage cypress-screenshots'''
|
|
172
|
+
// sh '''mkdir -p cypress-videos cypress-results cypress-coverage cypress-screenshots'''
|
|
173
|
+
// videos = sh script: '''docker cp $IMAGE_NAME-cypress:/app/src/addons/$GIT_NAME/cypress/videos cypress-videos/''', returnStatus: true
|
|
174
|
+
// sh '''docker cp $IMAGE_NAME-cypress:/app/src/addons/$GIT_NAME/cypress/reports cypress-results/'''
|
|
175
|
+
// screenshots = sh script: '''docker cp $IMAGE_NAME-cypress:/app/src/addons/$GIT_NAME/cypress/screenshots cypress-screenshots''', returnStatus: true
|
|
176
|
+
|
|
177
|
+
// archiveArtifacts artifacts: 'cypress-screenshots/**', fingerprint: true, allowEmptyArchive: true
|
|
178
|
+
|
|
179
|
+
// coverage = sh script: '''docker cp $IMAGE_NAME-cypress:/app/src/addons/$GIT_NAME/coverage cypress-coverage''', returnStatus: true
|
|
180
|
+
|
|
181
|
+
// if ( coverage == 0 ) {
|
|
182
|
+
// publishHTML(target : [allowMissing: false,
|
|
183
|
+
// alwaysLinkToLastBuild: true,
|
|
184
|
+
// keepAll: true,
|
|
185
|
+
// reportDir: 'cypress-coverage/coverage/lcov-report',
|
|
186
|
+
// reportFiles: 'index.html',
|
|
187
|
+
// reportName: 'CypressCoverage',
|
|
188
|
+
// reportTitles: 'Integration Tests Code Coverage'])
|
|
189
|
+
// }
|
|
190
|
+
// if ( videos == 0 ) {
|
|
191
|
+
// 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'''
|
|
192
|
+
// archiveArtifacts artifacts: 'cypress-videos/**/*.mp4', fingerprint: true, allowEmptyArchive: true
|
|
193
|
+
// }
|
|
194
|
+
// } finally {
|
|
195
|
+
// catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
|
|
196
|
+
// junit testResults: 'cypress-results/**/*.xml', allowEmptyResults: true
|
|
197
|
+
// }
|
|
198
|
+
// catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
|
|
199
|
+
// sh '''docker logs $IMAGE_NAME-cypress'''
|
|
200
|
+
// }
|
|
201
|
+
// sh script: "docker stop $IMAGE_NAME-cypress", returnStatus: true
|
|
202
|
+
// sh script: "docker stop $IMAGE_NAME-plone", returnStatus: true
|
|
203
|
+
// sh script: "docker rm -v $IMAGE_NAME-plone", returnStatus: true
|
|
204
|
+
// sh script: "docker rm -v $IMAGE_NAME-cypress", returnStatus: true
|
|
205
|
+
// }
|
|
206
|
+
// }
|
|
207
|
+
// }
|
|
208
|
+
// }
|
|
209
|
+
// }
|
|
117
210
|
}
|
|
118
|
-
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
post {
|
|
214
|
+
always {
|
|
215
|
+
sh script: "docker rmi $IMAGE_NAME-frontend", returnStatus: true
|
|
216
|
+
}
|
|
119
217
|
}
|
|
120
218
|
}
|
|
121
219
|
|
|
122
|
-
// stage('
|
|
220
|
+
// stage('Report to SonarQube') {
|
|
123
221
|
// when {
|
|
124
222
|
// anyOf {
|
|
125
223
|
// allOf {
|
|
@@ -129,60 +227,30 @@ pipeline {
|
|
|
129
227
|
// allOf {
|
|
130
228
|
// environment name: 'CHANGE_ID', value: ''
|
|
131
229
|
// anyOf {
|
|
132
|
-
//
|
|
230
|
+
// allOf {
|
|
231
|
+
// branch 'develop'
|
|
232
|
+
// not { changelog '.*^Automated release [0-9\\.]+$' }
|
|
233
|
+
// }
|
|
133
234
|
// branch 'master'
|
|
134
235
|
// }
|
|
135
236
|
// }
|
|
136
237
|
// }
|
|
137
238
|
// }
|
|
138
239
|
// steps {
|
|
139
|
-
//
|
|
140
|
-
|
|
141
|
-
//
|
|
142
|
-
//
|
|
143
|
-
//
|
|
144
|
-
//
|
|
145
|
-
//
|
|
146
|
-
//
|
|
147
|
-
// } finally {
|
|
148
|
-
// try {
|
|
149
|
-
// sh '''rm -rf cypress-reports cypress-results cypress-coverage'''
|
|
150
|
-
// sh '''mkdir -p cypress-reports cypress-results cypress-coverage'''
|
|
151
|
-
// sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/videos cypress-reports/'''
|
|
152
|
-
// sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/reports cypress-results/'''
|
|
153
|
-
// coverage = sh script: '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/coverage cypress-coverage/''', returnStatus: true
|
|
154
|
-
// if ( coverage == 0 ) {
|
|
155
|
-
// publishHTML (target : [allowMissing: false,
|
|
156
|
-
// alwaysLinkToLastBuild: true,
|
|
157
|
-
// keepAll: true,
|
|
158
|
-
// reportDir: 'cypress-coverage/coverage/lcov-report',
|
|
159
|
-
// reportFiles: 'index.html',
|
|
160
|
-
// reportName: 'CypressCoverage',
|
|
161
|
-
// reportTitles: 'Integration Tests Code Coverage'])
|
|
162
|
-
// }
|
|
163
|
-
// sh '''touch empty_file; for ok_test in $(grep -E 'file=.*failures="0"' $(grep 'testsuites .*failures="0"' $(find cypress-results -name *.xml) empty_file | awk -F: '{print $1}') empty_file | sed 's/.* file="\\(.*\\)" time.*/\\1/' | sed 's#^cypress/integration/##g' | sed 's#^../../../node_modules/@eeacms/##g'); do rm -f cypress-reports/videos/$ok_test.mp4; rm -f cypress-reports/$ok_test.mp4; done'''
|
|
164
|
-
// archiveArtifacts artifacts: 'cypress-reports/**/*.mp4', fingerprint: true, allowEmptyArchive: true
|
|
165
|
-
// stash name: "cypress-coverage", includes: "cypress-coverage/**", allowEmpty: true
|
|
166
|
-
// }
|
|
167
|
-
// finally {
|
|
168
|
-
// catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
|
|
169
|
-
// junit testResults: 'cypress-results/**/*.xml', allowEmptyResults: true
|
|
170
|
-
// }
|
|
171
|
-
// sh script: "docker stop $BUILD_TAG-plone", returnStatus: true
|
|
172
|
-
// sh script: "docker rm -v $BUILD_TAG-plone", returnStatus: true
|
|
173
|
-
// sh script: "docker rm -v $BUILD_TAG-cypress", returnStatus: true
|
|
174
|
-
|
|
175
|
-
// }
|
|
176
|
-
// }
|
|
177
|
-
// }
|
|
178
|
-
// }
|
|
240
|
+
// script {
|
|
241
|
+
// def scannerHome = tool 'SonarQubeScanner'
|
|
242
|
+
// def nodeJS = tool 'NodeJS'
|
|
243
|
+
// withSonarQubeEnv('Sonarqube') {
|
|
244
|
+
// sh '''sed -i "s#/app/src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info'''
|
|
245
|
+
// sh '''sed -i "s#src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info'''
|
|
246
|
+
// sh "export PATH=${scannerHome}/bin:${nodeJS}/bin:$PATH; sonar-scanner -Dsonar.javascript.lcov.reportPaths=./xunit-reports/coverage/lcov.info,./cypress-coverage/coverage/lcov.info -Dsonar.sources=./src -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER"
|
|
247
|
+
// sh '''try=5; while [ \$try -gt 0 ]; do curl -s -XPOST -u "${SONAR_AUTH_TOKEN}:" "${SONAR_HOST_URL}api/project_tags/set?project=${GIT_NAME}-${BRANCH_NAME}&tags=${SONARQUBE_TAGS},${BRANCH_NAME}" > set_tags_result; if [ \$(grep -ic error set_tags_result ) -eq 0 ]; then try=0; else cat set_tags_result; echo "... Will retry"; sleep 15; try=\$(( \$try - 1 )); fi; done'''
|
|
179
248
|
// }
|
|
180
|
-
|
|
181
|
-
// )
|
|
249
|
+
// }
|
|
182
250
|
// }
|
|
183
251
|
// }
|
|
184
252
|
|
|
185
|
-
// stage('
|
|
253
|
+
// stage('SonarQube compare to master') {
|
|
186
254
|
// when {
|
|
187
255
|
// anyOf {
|
|
188
256
|
// allOf {
|
|
@@ -191,65 +259,25 @@ pipeline {
|
|
|
191
259
|
// }
|
|
192
260
|
// allOf {
|
|
193
261
|
// environment name: 'CHANGE_ID', value: ''
|
|
194
|
-
//
|
|
195
|
-
//
|
|
196
|
-
// branch 'develop'
|
|
197
|
-
// not { changelog '.*^Automated release [0-9\\.]+$' }
|
|
198
|
-
// }
|
|
199
|
-
// branch 'master'
|
|
200
|
-
// }
|
|
262
|
+
// branch 'develop'
|
|
263
|
+
// not { changelog '.*^Automated release [0-9\\.]+$' }
|
|
201
264
|
// }
|
|
202
265
|
// }
|
|
203
266
|
// }
|
|
204
267
|
// steps {
|
|
205
|
-
//
|
|
206
|
-
//
|
|
207
|
-
//
|
|
208
|
-
//
|
|
209
|
-
// unstash "cypress-coverage"
|
|
210
|
-
// def scannerHome = tool 'SonarQubeScanner';
|
|
211
|
-
// def nodeJS = tool 'NodeJS';
|
|
212
|
-
// withSonarQubeEnv('Sonarqube') {
|
|
213
|
-
// sh '''sed -i "s#/opt/frontend/my-volto-project/src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info'''
|
|
214
|
-
// sh "export PATH=${scannerHome}/bin:${nodeJS}/bin:$PATH; sonar-scanner -Dsonar.javascript.lcov.reportPaths=./xunit-reports/coverage/lcov.info,./cypress-coverage/coverage/lcov.info -Dsonar.sources=./src -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER"
|
|
215
|
-
// sh '''try=2; while [ \$try -gt 0 ]; do curl -s -XPOST -u "${SONAR_AUTH_TOKEN}:" "${SONAR_HOST_URL}api/project_tags/set?project=${GIT_NAME}-${BRANCH_NAME}&tags=${SONARQUBE_TAGS},${BRANCH_NAME}" > set_tags_result; if [ \$(grep -ic error set_tags_result ) -eq 0 ]; then try=0; else cat set_tags_result; echo "... Will retry"; sleep 60; try=\$(( \$try - 1 )); fi; done'''
|
|
216
|
-
// }
|
|
268
|
+
// script {
|
|
269
|
+
// sh '''echo "Error" > checkresult.txt'''
|
|
270
|
+
// catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
|
271
|
+
// sh '''set -o pipefail; docker run -i --rm --pull always --name="$IMAGE_NAME-gitflow-sn" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" eeacms/gitflow /checkSonarqubemaster.sh | grep -v "Found script" | tee checkresult.txt'''
|
|
217
272
|
// }
|
|
273
|
+
|
|
274
|
+
// publishChecks name: 'SonarQube', title: 'Sonarqube Code Quality Check', summary: 'Quality check on the SonarQube metrics from branch develop, comparing it with the ones from master branch. No bugs are allowed',
|
|
275
|
+
// text: readFile(file: 'checkresult.txt'), conclusion: "${currentBuild.currentResult}",
|
|
276
|
+
// detailsURL: "${env.BUILD_URL}display/redirect"
|
|
218
277
|
// }
|
|
219
278
|
// }
|
|
220
279
|
// }
|
|
221
|
-
/*
|
|
222
|
-
stage('SonarQube compare to master') {
|
|
223
|
-
when {
|
|
224
|
-
anyOf {
|
|
225
|
-
allOf {
|
|
226
|
-
not { environment name: 'CHANGE_ID', value: '' }
|
|
227
|
-
environment name: 'CHANGE_TARGET', value: 'develop'
|
|
228
|
-
}
|
|
229
|
-
allOf {
|
|
230
|
-
environment name: 'CHANGE_ID', value: ''
|
|
231
|
-
branch 'develop'
|
|
232
|
-
not { changelog '.*^Automated release [0-9\\.]+$' }
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
steps {
|
|
237
|
-
node(label: 'docker') {
|
|
238
|
-
script {
|
|
239
|
-
sh '''docker pull eeacms/gitflow'''
|
|
240
|
-
sh '''echo "Error" > checkresult.txt'''
|
|
241
|
-
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
|
242
|
-
sh '''set -o pipefail; docker run -i --rm --name="$BUILD_TAG-gitflow-sn" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" eeacms/gitflow /checkSonarqubemaster.sh | grep -v "Found script" | tee checkresult.txt'''
|
|
243
|
-
}
|
|
244
280
|
|
|
245
|
-
publishChecks name: 'SonarQube', title: 'Sonarqube Code Quality Check', summary: "Quality check on the SonarQube metrics from branch develop, comparing it with the ones from master branch. No bugs are allowed",
|
|
246
|
-
text: readFile(file: 'checkresult.txt'), conclusion: "${currentBuild.currentResult}",
|
|
247
|
-
detailsURL: "${env.BUILD_URL}display/redirect"
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
*/
|
|
253
281
|
stage('Pull Request') {
|
|
254
282
|
when {
|
|
255
283
|
not {
|
|
@@ -258,20 +286,16 @@ pipeline {
|
|
|
258
286
|
environment name: 'CHANGE_TARGET', value: 'master'
|
|
259
287
|
}
|
|
260
288
|
steps {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
sh '''docker pull eeacms/gitflow'''
|
|
268
|
-
sh '''docker run -i --rm --name="$BUILD_TAG-gitflow-pr" -e GIT_CHANGE_TARGET="$CHANGE_TARGET" -e GIT_CHANGE_BRANCH="$CHANGE_BRANCH" -e GIT_CHANGE_AUTHOR="$CHANGE_AUTHOR" -e GIT_CHANGE_TITLE="$CHANGE_TITLE" -e GIT_TOKEN="$GITHUB_TOKEN" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e GIT_ORG="$GIT_ORG" -e GIT_NAME="$GIT_NAME" -e LANGUAGE=javascript eeacms/gitflow'''
|
|
269
|
-
}
|
|
289
|
+
script {
|
|
290
|
+
if (env.CHANGE_BRANCH != 'develop') {
|
|
291
|
+
error 'Pipeline aborted due to PR not made from develop branch'
|
|
292
|
+
}
|
|
293
|
+
withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN')]) {
|
|
294
|
+
sh '''docker run --pull always -i --rm --name="$IMAGE_NAME-gitflow-pr" -e GIT_CHANGE_TARGET="$CHANGE_TARGET" -e GIT_CHANGE_BRANCH="$CHANGE_BRANCH" -e GIT_CHANGE_AUTHOR="$CHANGE_AUTHOR" -e GIT_CHANGE_TITLE="$CHANGE_TITLE" -e GIT_TOKEN="$GITHUB_TOKEN" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e GIT_ORG="$GIT_ORG" -e GIT_NAME="$GIT_NAME" -e LANGUAGE=javascript eeacms/gitflow'''
|
|
270
295
|
}
|
|
271
296
|
}
|
|
272
297
|
}
|
|
273
298
|
}
|
|
274
|
-
|
|
275
299
|
}
|
|
276
300
|
|
|
277
301
|
post {
|
package/Makefile
CHANGED
|
@@ -46,10 +46,15 @@ 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?=16.31.1
|
|
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
|
|
53
|
+
RAZZLE_INTERNAL_API_PATH?="http://localhost:8080/Plone"
|
|
54
|
+
RAZZLE_DEV_PROXY_API_PATH?="${RAZZLE_INTERNAL_API_PATH}"
|
|
55
|
+
CYPRESS_API_PATH="${RAZZLE_DEV_PROXY_API_PATH}"
|
|
56
|
+
|
|
57
|
+
|
|
53
58
|
|
|
54
59
|
# Top-level targets
|
|
55
60
|
.PHONY: all
|
|
@@ -77,11 +82,11 @@ shell: ## Start a shell in the frontend container
|
|
|
77
82
|
|
|
78
83
|
.PHONY: cypress-open
|
|
79
84
|
cypress-open: ## Open cypress integration tests
|
|
80
|
-
NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress open
|
|
85
|
+
CYPRESS_API_PATH="${RAZZLE_DEV_PROXY_API_PATH}" NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress open
|
|
81
86
|
|
|
82
87
|
.PHONY: cypress-run
|
|
83
88
|
cypress-run: ## Run cypress integration tests
|
|
84
|
-
NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress run
|
|
89
|
+
CYPRESS_API_PATH="${RAZZLE_DEV_PROXY_API_PATH}" NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress run --browser chrome
|
|
85
90
|
|
|
86
91
|
.PHONY: test
|
|
87
92
|
test: ## Run jest tests
|
|
@@ -129,3 +134,28 @@ i18n: ## i18n
|
|
|
129
134
|
help: ## Show this help.
|
|
130
135
|
@echo -e "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s :)"
|
|
131
136
|
head -n 14 Makefile
|
|
137
|
+
|
|
138
|
+
.PHONY: ci-fix
|
|
139
|
+
ci-fix:
|
|
140
|
+
echo "Running lint-fix"
|
|
141
|
+
make lint-fix
|
|
142
|
+
echo "Running prettier-fix"
|
|
143
|
+
make prettier-fix
|
|
144
|
+
echo "Running stylelint-fix"
|
|
145
|
+
make stylelint-fix
|
|
146
|
+
|
|
147
|
+
.PHONY: test-ci
|
|
148
|
+
test-ci:
|
|
149
|
+
cd /app
|
|
150
|
+
RAZZLE_JEST_CONFIG=src/addons/${ADDON_PATH}/jest-addon.config.js CI=true yarn test src/addons/${ADDON_PATH}/src --watchAll=false --reporters=default --reporters=jest-junit --collectCoverage --coverageReporters lcov cobertura text
|
|
151
|
+
|
|
152
|
+
.PHONY: start-ci
|
|
153
|
+
start-ci:
|
|
154
|
+
cp .coverage.babel.config.js /app/babel.config.js
|
|
155
|
+
cd ../..
|
|
156
|
+
yarn start
|
|
157
|
+
|
|
158
|
+
.PHONY: cypress-ci
|
|
159
|
+
cypress-ci:
|
|
160
|
+
$(NODE_MODULES)/.bin/wait-on -t 240000 http://localhost:3000
|
|
161
|
+
NODE_ENV=development make cypress-run
|
package/jest-addon.config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
require('dotenv').config({ path: __dirname + '/.env' })
|
|
1
|
+
require('dotenv').config({ path: __dirname + '/.env' });
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
|
-
testMatch: ['**/src/addons/**/?(*.)+(spec|test).[jt]s
|
|
4
|
+
testMatch: ['**/src/addons/**/?(*.)+(spec|test).[jt]s(x)?'],
|
|
5
5
|
collectCoverageFrom: [
|
|
6
6
|
'src/addons/**/src/**/*.{js,jsx,ts,tsx}',
|
|
7
7
|
'!src/**/*.d.ts',
|
|
@@ -11,11 +11,11 @@ module.exports = {
|
|
|
11
11
|
'@plone/volto/cypress': '<rootDir>/node_modules/@plone/volto/cypress',
|
|
12
12
|
'@plone/volto/babel': '<rootDir>/node_modules/@plone/volto/babel',
|
|
13
13
|
'@plone/volto/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
|
|
14
|
-
'@package/(.*)$': '<rootDir>/
|
|
14
|
+
'@package/(.*)$': '<rootDir>/src/$1',
|
|
15
15
|
'@root/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
|
|
16
16
|
'@plone/volto-quanta/(.*)$': '<rootDir>/src/addons/volto-quanta/src/$1',
|
|
17
17
|
'@eeacms/(.*?)/(.*)$': '<rootDir>/node_modules/@eeacms/$1/src/$2',
|
|
18
|
-
'@plone/volto-slate
|
|
18
|
+
'@plone/volto-slate':
|
|
19
19
|
'<rootDir>/node_modules/@plone/volto/packages/volto-slate/src',
|
|
20
20
|
'@plone/volto-slate/(.*)$':
|
|
21
21
|
'<rootDir>/node_modules/@plone/volto/packages/volto-slate/src/$1',
|
|
@@ -23,15 +23,15 @@ module.exports = {
|
|
|
23
23
|
'load-volto-addons':
|
|
24
24
|
'<rootDir>/node_modules/@plone/volto/jest-addons-loader.js',
|
|
25
25
|
},
|
|
26
|
-
transformIgnorePatterns: [
|
|
27
|
-
'/node_modules/(?!(@plone|@root|@package|@eeacms)/).*/',
|
|
28
|
-
],
|
|
29
26
|
transform: {
|
|
30
27
|
'^.+\\.js(x)?$': 'babel-jest',
|
|
31
28
|
'^.+\\.(png)$': 'jest-file',
|
|
32
29
|
'^.+\\.(jpg)$': 'jest-file',
|
|
33
30
|
'^.+\\.(svg)$': './node_modules/@plone/volto/jest-svgsystem-transform.js',
|
|
34
31
|
},
|
|
32
|
+
transformIgnorePatterns: [
|
|
33
|
+
'node_modules/(?!(@eeacms/volto-clms-utils/|@eeacms/volto-tabs-block/|@plone/volto/|slick-carousel|react-input-range))',
|
|
34
|
+
],
|
|
35
35
|
coverageThreshold: {
|
|
36
36
|
global: {
|
|
37
37
|
branches: 5,
|
|
@@ -40,9 +40,5 @@ module.exports = {
|
|
|
40
40
|
statements: 5,
|
|
41
41
|
},
|
|
42
42
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
'<rootDir>/node_modules/@eeacms/volto-arcgis-block/jest.setup.js',
|
|
46
|
-
],
|
|
47
|
-
}),
|
|
48
|
-
}
|
|
43
|
+
setupFilesAfterEnv: ['<rootDir>/src/addons/volto-arcgis-block/jest.setup.js'],
|
|
44
|
+
};
|
package/package.json
CHANGED
|
@@ -1082,6 +1082,7 @@ class MenuWidget extends React.Component {
|
|
|
1082
1082
|
button.setAttribute('aria-expanded', 'true');
|
|
1083
1083
|
}
|
|
1084
1084
|
}
|
|
1085
|
+
//a comment to test develop branch
|
|
1085
1086
|
let productDropdown = node.closest('.map-menu-product-dropdown');
|
|
1086
1087
|
if (productDropdown) {
|
|
1087
1088
|
let scrollPosition = productDropdown.offsetTop;
|
|
@@ -1697,10 +1697,10 @@ div.map-container.popup-block {
|
|
|
1697
1697
|
}
|
|
1698
1698
|
|
|
1699
1699
|
.clearsearch.search-input-clear-icon-button.button {
|
|
1700
|
-
position: absolute;
|
|
1701
|
-
top: 4.3rem;
|
|
1702
|
-
left: 22.5rem;
|
|
1703
1700
|
display: none;
|
|
1701
|
+
margin-top: 0.2rem;
|
|
1702
|
+
/* position: absolute; */
|
|
1703
|
+
margin-left: -1.7rem;
|
|
1704
1704
|
}
|
|
1705
1705
|
|
|
1706
1706
|
.close-filters-icon {
|