@eeacms/volto-clms-theme 1.1.70 → 1.1.71
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 +24 -0
- package/Dockerfile +1 -1
- package/Jenkinsfile +206 -165
- package/Makefile +36 -3
- package/cypress/e2e/block-basics.cy.js +26 -26
- package/cypress/reports/.gitkeep +0 -0
- package/cypress/videos/.gitkeep +0 -0
- package/package.json +1 -1
- package/src/components/CLMSDatasetDetailView/DownloadDataSetContent.jsx +2 -1
- package/src/customizations/volto/components/manage/Blocks/Search/hocs/withSearch.jsx +10 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,30 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
+
### [1.1.71](https://github.com/eea/volto-clms-theme/compare/1.1.70...1.1.71) - 31 October 2023
|
|
8
|
+
|
|
9
|
+
#### :rocket: New Features
|
|
10
|
+
|
|
11
|
+
- feat: trying to reduce querystringsearch requests [Ion Lizarazu - [`513dee0`](https://github.com/eea/volto-clms-theme/commit/513dee01e6fc03be886d58a5296b76e2b735014e)]
|
|
12
|
+
|
|
13
|
+
#### :house: Internal changes
|
|
14
|
+
|
|
15
|
+
- chore: [JENKINS] Refactor automated testing [valentinab25 - [`67ca3bb`](https://github.com/eea/volto-clms-theme/commit/67ca3bb111f34842569c12b9c87a2a91bd14b09e)]
|
|
16
|
+
|
|
17
|
+
#### :hammer_and_wrench: Others
|
|
18
|
+
|
|
19
|
+
- comment cypress stuff in Jenkinsfile [Ion Lizarazu - [`723d466`](https://github.com/eea/volto-clms-theme/commit/723d466fd3fca4e92c25aea0be7be7ae4beb734f)]
|
|
20
|
+
- comment Integration tests [Ion Lizarazu - [`d31ce76`](https://github.com/eea/volto-clms-theme/commit/d31ce76a170dd4750949af4b7f2899f61c892c3a)]
|
|
21
|
+
- volto version makfile [Ion Lizarazu - [`eeb122a`](https://github.com/eea/volto-clms-theme/commit/eeb122ac92bc93508ab98a2a4d8f298f4a8e5ad0)]
|
|
22
|
+
- add backend addons [Ion Lizarazu - [`be277c1`](https://github.com/eea/volto-clms-theme/commit/be277c1a0c32fd718b417c3ad40700144ea0f61d)]
|
|
23
|
+
- revert Makefile modification [Ion Lizarazu - [`a24bbb5`](https://github.com/eea/volto-clms-theme/commit/a24bbb5ac3f1a45dab6d59a4b50c3bb891111e85)]
|
|
24
|
+
- remove cp from Makefile [Ion Lizarazu - [`a339104`](https://github.com/eea/volto-clms-theme/commit/a33910476aa6cff1f9ef885b30e7c95832a8bdd9)]
|
|
25
|
+
- comment cypress tests [Ion Lizarazu - [`b4a35ee`](https://github.com/eea/volto-clms-theme/commit/b4a35ee3f67534966fbf227631af10d87b223a50)]
|
|
26
|
+
- add cypress/reports folder [Ion Lizarazu - [`659f806`](https://github.com/eea/volto-clms-theme/commit/659f80691eb0a9578067ffd05609f4b84080528c)]
|
|
27
|
+
- cypress videos folder [Ion Lizarazu - [`609cbdc`](https://github.com/eea/volto-clms-theme/commit/609cbdc1668a2a6d991fcbdb1820ca4c102f4942)]
|
|
28
|
+
- .gitignore [Ion Lizarazu - [`c4ccbd7`](https://github.com/eea/volto-clms-theme/commit/c4ccbd75de8be0d34252b1155c0ebac388fd2e50)]
|
|
29
|
+
- [CLMS-2753] download_by_area_extra_text depends in downloadable_full_dataset [Ion Lizarazu - [`a425be2`](https://github.com/eea/volto-clms-theme/commit/a425be2c74cb954f83ed2cfc196024ecfcf3e9ce)]
|
|
30
|
+
- add deepData to withSearch useEffect [Ion Lizarazu - [`6476637`](https://github.com/eea/volto-clms-theme/commit/64766379f4d7f946f82ffe1a2887c7342dcef5ec)]
|
|
7
31
|
### [1.1.70](https://github.com/eea/volto-clms-theme/compare/1.1.69...1.1.70) - 26 October 2023
|
|
8
32
|
|
|
9
33
|
#### :hammer_and_wrench: Others
|
package/Dockerfile
CHANGED
package/Jenkinsfile
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
pipeline {
|
|
2
|
-
agent
|
|
2
|
+
agent {
|
|
3
|
+
node { label 'docker-host' }
|
|
4
|
+
}
|
|
3
5
|
|
|
4
6
|
environment {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
GIT_NAME = "volto-clms-theme"
|
|
8
|
+
NAMESPACE = "@eeacms"
|
|
9
|
+
SONARQUBE_TAGS = "clms.land.copernicus.eu,volto.eea.europa.eu,clmsdemo.devel6cph.eea.europa.eu,land.copernicus.eu"
|
|
10
|
+
DEPENDENCIES = ""
|
|
11
|
+
BACKEND_PROFILES = "eea.kitkat:testing"
|
|
12
|
+
BACKEND_ADDONS = "clms.addon,clms.types,clms.downloadtool,clms.statstool"
|
|
13
|
+
VOLTO = "16.24.0"
|
|
14
|
+
IMAGE_NAME = BUILD_TAG.toLowerCase()
|
|
15
|
+
}
|
|
11
16
|
|
|
12
17
|
stages {
|
|
13
|
-
|
|
14
18
|
stage('Release') {
|
|
15
19
|
when {
|
|
16
20
|
allOf {
|
|
@@ -20,73 +24,118 @@ pipeline {
|
|
|
20
24
|
}
|
|
21
25
|
steps {
|
|
22
26
|
node(label: 'docker') {
|
|
23
|
-
withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN'),string(credentialsId: 'eea-jenkins-npm-token', variable: 'NPM_TOKEN')]) {
|
|
24
|
-
sh '''docker pull eeacms/gitflow'''
|
|
25
|
-
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'''
|
|
27
|
+
withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN'), string(credentialsId: 'eea-jenkins-npm-token', variable: 'NPM_TOKEN')]) {
|
|
28
|
+
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 LANGUAGE=javascript eeacms/gitflow'''
|
|
26
29
|
}
|
|
27
30
|
}
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
33
|
|
|
31
|
-
stage('
|
|
34
|
+
stage('Check if testing needed') {
|
|
32
35
|
when {
|
|
33
36
|
allOf {
|
|
34
|
-
environment name: 'CHANGE_ID', value: ''
|
|
35
|
-
not { changelog '.*^Automated release [0-9\\.]+$' }
|
|
36
37
|
not { branch 'master' }
|
|
38
|
+
not { branch 'develop' }
|
|
39
|
+
environment name: 'CHANGE_ID', value: ''
|
|
37
40
|
}
|
|
38
41
|
}
|
|
39
42
|
steps {
|
|
40
|
-
|
|
43
|
+
script {
|
|
44
|
+
withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN')]) {
|
|
45
|
+
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
|
|
41
46
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
47
|
+
if (check_result == 0) {
|
|
48
|
+
env.SKIP_TESTS = 'yes'
|
|
49
|
+
}
|
|
45
50
|
}
|
|
46
|
-
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
47
54
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
55
|
+
stage('Testing') {
|
|
56
|
+
when {
|
|
57
|
+
anyOf {
|
|
58
|
+
allOf {
|
|
59
|
+
not { environment name: 'CHANGE_ID', value: '' }
|
|
60
|
+
environment name: 'CHANGE_TARGET', value: 'develop'
|
|
61
|
+
environment name: 'SKIP_TESTS', value: ''
|
|
62
|
+
}
|
|
63
|
+
allOf {
|
|
64
|
+
environment name: 'CHANGE_ID', value: ''
|
|
65
|
+
anyOf {
|
|
66
|
+
not { changelog '.*^Automated release [0-9\\.]+$' }
|
|
67
|
+
branch 'master'
|
|
51
68
|
}
|
|
52
|
-
|
|
69
|
+
environment name: 'SKIP_TESTS', value: ''
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
stages {
|
|
74
|
+
stage('Build test image') {
|
|
75
|
+
steps {
|
|
76
|
+
checkout scm
|
|
77
|
+
sh '''docker build --build-arg="VOLTO_VERSION=$VOLTO" --build-arg="ADDON_NAME=$NAMESPACE/$GIT_NAME" --build-arg="ADDON_PATH=$GIT_NAME" . -t $IMAGE_NAME-frontend'''
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
stage('Fix code') {
|
|
82
|
+
when {
|
|
83
|
+
environment name: 'CHANGE_ID', value: ''
|
|
84
|
+
not { branch 'master' }
|
|
85
|
+
}
|
|
86
|
+
steps {
|
|
87
|
+
script {
|
|
88
|
+
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)
|
|
89
|
+
sh '''docker cp $IMAGE_NAME-fix:/app/src/addons/$GIT_NAME/src .'''
|
|
90
|
+
sh '''docker rm -v $IMAGE_NAME-fix'''
|
|
91
|
+
FOUND_FIX = sh(script: '''git diff | wc -l''', returnStdout: true).trim()
|
|
53
92
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
93
|
+
if (FOUND_FIX != '0') {
|
|
94
|
+
withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN')]) {
|
|
95
|
+
sh '''sed -i "s|url = .*|url = https://eea-jenkins:$GITHUB_TOKEN@github.com/eea/$GIT_NAME.git|" .git/config'''
|
|
96
|
+
}
|
|
97
|
+
sh '''git fetch origin $GIT_BRANCH:$GIT_BRANCH'''
|
|
98
|
+
sh '''git checkout $GIT_BRANCH'''
|
|
99
|
+
sh '''git add src/'''
|
|
100
|
+
sh '''git commit -m "style: Automated code fix" '''
|
|
101
|
+
sh '''git push --set-upstream origin $GIT_BRANCH'''
|
|
102
|
+
sh '''exit 1'''
|
|
103
|
+
}
|
|
57
104
|
}
|
|
58
105
|
}
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
}
|
|
106
|
+
}
|
|
62
107
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
108
|
+
stage('ES lint') {
|
|
109
|
+
steps {
|
|
110
|
+
sh '''docker run --rm --name="$IMAGE_NAME-eslint" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend lint'''
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
stage('Style lint') {
|
|
115
|
+
steps {
|
|
116
|
+
sh '''docker run --rm --name="$IMAGE_NAME-stylelint" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend stylelint'''
|
|
70
117
|
}
|
|
71
118
|
}
|
|
72
|
-
}
|
|
73
|
-
steps {
|
|
74
|
-
parallel(
|
|
75
119
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
120
|
+
stage('Prettier') {
|
|
121
|
+
steps {
|
|
122
|
+
sh '''docker run --rm --name="$IMAGE_NAME-prettier" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend prettier'''
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
stage('Coverage Tests') {
|
|
127
|
+
parallel {
|
|
128
|
+
|
|
129
|
+
stage('Unit tests') {
|
|
130
|
+
steps {
|
|
131
|
+
script {
|
|
132
|
+
try {
|
|
133
|
+
sh '''docker run --name="$IMAGE_NAME-volto" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend test-ci'''
|
|
134
|
+
sh '''rm -rf xunit-reports'''
|
|
135
|
+
sh '''mkdir -p xunit-reports'''
|
|
136
|
+
sh '''docker cp $IMAGE_NAME-volto:/app/coverage xunit-reports/'''
|
|
137
|
+
sh '''docker cp $IMAGE_NAME-volto:/app/junit.xml xunit-reports/'''
|
|
138
|
+
publishHTML(target : [
|
|
90
139
|
allowMissing: false,
|
|
91
140
|
alwaysLinkToLastBuild: true,
|
|
92
141
|
keepAll: true,
|
|
@@ -99,129 +148,125 @@ pipeline {
|
|
|
99
148
|
catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
|
|
100
149
|
junit testResults: 'xunit-reports/junit.xml', allowEmptyResults: true
|
|
101
150
|
}
|
|
102
|
-
|
|
151
|
+
sh script: '''docker rm -v $IMAGE_NAME-volto''', returnStatus: true
|
|
152
|
+
}
|
|
103
153
|
}
|
|
104
154
|
}
|
|
105
155
|
}
|
|
106
|
-
}
|
|
107
|
-
)
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
156
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
157
|
+
// stage('Integration tests') {
|
|
158
|
+
// steps {
|
|
159
|
+
// script {
|
|
160
|
+
// try {
|
|
161
|
+
// 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'''
|
|
162
|
+
// sh '''docker run --link $IMAGE_NAME-plone:plone --entrypoint=make --name="$IMAGE_NAME-cypress" --workdir=/app/src/addons/${GIT_NAME} -e "RAZZLE_INTERNAL_API_PATH=http://plone:8080/Plone" $IMAGE_NAME-frontend cypress-ci'''
|
|
163
|
+
// } finally {
|
|
164
|
+
// try {
|
|
165
|
+
// sh '''rm -rf cypress-videos cypress-results cypress-coverage cypress-screenshots'''
|
|
166
|
+
// sh '''mkdir -p cypress-videos cypress-results cypress-coverage cypress-screenshots'''
|
|
167
|
+
// sh '''docker cp $IMAGE_NAME-cypress:/app/src/addons/$GIT_NAME/cypress/videos cypress-videos/'''
|
|
168
|
+
// sh '''docker cp $IMAGE_NAME-cypress:/app/src/addons/$GIT_NAME/cypress/reports cypress-results/'''
|
|
169
|
+
// screenshots = sh script: '''docker cp $IMAGE_NAME-cypress:/app/src/addons/$GIT_NAME/cypress/screenshots cypress-screenshots''', returnStatus: true
|
|
123
170
|
|
|
124
|
-
|
|
125
|
-
// node(label: 'docker') {
|
|
126
|
-
// script {
|
|
127
|
-
// try {
|
|
128
|
-
// 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 VOLTO=$VOLTO plone/volto-addon-ci cypress'''
|
|
130
|
-
// } finally {
|
|
131
|
-
// try {
|
|
132
|
-
// sh '''rm -rf cypress-reports cypress-results cypress-coverage'''
|
|
133
|
-
// sh '''mkdir -p cypress-reports cypress-results cypress-coverage'''
|
|
134
|
-
// sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/videos cypress-reports/'''
|
|
135
|
-
// sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/reports cypress-results/'''
|
|
136
|
-
// coverage = sh script: '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/coverage cypress-coverage/''', returnStatus: true
|
|
137
|
-
// if ( coverage == 0 ) {
|
|
138
|
-
// publishHTML (target : [allowMissing: false,
|
|
139
|
-
// alwaysLinkToLastBuild: true,
|
|
140
|
-
// keepAll: true,
|
|
141
|
-
// reportDir: 'cypress-coverage/coverage/lcov-report',
|
|
142
|
-
// reportFiles: 'index.html',
|
|
143
|
-
// reportName: 'CypressCoverage',
|
|
144
|
-
// reportTitles: 'Integration Tests Code Coverage'])
|
|
145
|
-
// }
|
|
146
|
-
// 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'''
|
|
147
|
-
// archiveArtifacts artifacts: 'cypress-reports/**/*.mp4', fingerprint: true, allowEmptyArchive: true
|
|
148
|
-
// stash name: "cypress-coverage", includes: "cypress-coverage/**", allowEmpty: true
|
|
149
|
-
// }
|
|
150
|
-
// finally {
|
|
151
|
-
// catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
|
|
152
|
-
// junit testResults: 'cypress-results/**/*.xml', allowEmptyResults: true
|
|
153
|
-
// }
|
|
154
|
-
// sh script: "docker stop $BUILD_TAG-plone", returnStatus: true
|
|
155
|
-
// sh script: "docker rm -v $BUILD_TAG-plone", returnStatus: true
|
|
156
|
-
// sh script: "docker rm -v $BUILD_TAG-cypress", returnStatus: true
|
|
171
|
+
// archiveArtifacts artifacts: 'cypress-screenshots/**', fingerprint: true, allowEmptyArchive: true
|
|
157
172
|
|
|
158
|
-
|
|
159
|
-
// }
|
|
160
|
-
// }
|
|
161
|
-
// }
|
|
162
|
-
// }
|
|
173
|
+
// coverage = sh script: '''docker cp $IMAGE_NAME-cypress:/app/src/addons/$GIT_NAME/coverage cypress-coverage''', returnStatus: true
|
|
163
174
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
175
|
+
// if ( coverage == 0 ) {
|
|
176
|
+
// publishHTML(target : [allowMissing: false,
|
|
177
|
+
// alwaysLinkToLastBuild: true,
|
|
178
|
+
// keepAll: true,
|
|
179
|
+
// reportDir: 'cypress-coverage/coverage/lcov-report',
|
|
180
|
+
// reportFiles: 'index.html',
|
|
181
|
+
// reportName: 'CypressCoverage',
|
|
182
|
+
// reportTitles: 'Integration Tests Code Coverage'])
|
|
183
|
+
// }
|
|
184
|
+
// 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'''
|
|
185
|
+
// archiveArtifacts artifacts: 'cypress-videos/**', fingerprint: true, allowEmptyArchive: true
|
|
186
|
+
// } finally {
|
|
187
|
+
// catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
|
|
188
|
+
// junit testResults: 'cypress-results/**/*.xml', allowEmptyResults: true
|
|
189
|
+
// }
|
|
190
|
+
// sh script: "docker stop $IMAGE_NAME-plone", returnStatus: true
|
|
191
|
+
// sh script: "docker rm -v $IMAGE_NAME-plone", returnStatus: true
|
|
192
|
+
// sh script: "docker rm -v $IMAGE_NAME-cypress", returnStatus: true
|
|
193
|
+
// }
|
|
194
|
+
// }
|
|
195
|
+
// }
|
|
196
|
+
// }
|
|
197
|
+
// }
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
post {
|
|
202
|
+
always {
|
|
203
|
+
sh script: "docker rmi $IMAGE_NAME-frontend", returnStatus: true
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
167
207
|
|
|
168
208
|
stage('Report to SonarQube') {
|
|
169
209
|
when {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
210
|
+
anyOf {
|
|
211
|
+
allOf {
|
|
212
|
+
not { environment name: 'CHANGE_ID', value: '' }
|
|
213
|
+
environment name: 'CHANGE_TARGET', value: 'develop'
|
|
214
|
+
}
|
|
215
|
+
allOf {
|
|
216
|
+
environment name: 'CHANGE_ID', value: ''
|
|
217
|
+
anyOf {
|
|
218
|
+
allOf {
|
|
219
|
+
branch 'develop'
|
|
220
|
+
not { changelog '.*^Automated release [0-9\\.]+$' }
|
|
221
|
+
}
|
|
222
|
+
branch 'master'
|
|
177
223
|
}
|
|
178
224
|
}
|
|
179
225
|
}
|
|
180
226
|
}
|
|
181
227
|
steps {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
// 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"
|
|
193
|
-
sh "export PATH=${scannerHome}/bin:${nodeJS}/bin:$PATH; sonar-scanner -Dsonar.javascript.lcov.reportPaths=./xunit-reports/coverage/lcov.info -Dsonar.sources=./src -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER"
|
|
194
|
-
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'''
|
|
195
|
-
}
|
|
228
|
+
script {
|
|
229
|
+
def scannerHome = tool 'SonarQubeScanner'
|
|
230
|
+
def nodeJS = tool 'NodeJS'
|
|
231
|
+
withSonarQubeEnv('Sonarqube') {
|
|
232
|
+
sh '''sed -i "s#/app/src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info'''
|
|
233
|
+
sh '''sed -i "s#src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info'''
|
|
234
|
+
sh '''cat xunit-reports/coverage/lcov.info'''
|
|
235
|
+
// sh '''cat cypress-coverage/coverage/lcov.info'''
|
|
236
|
+
// 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"
|
|
237
|
+
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'''
|
|
196
238
|
}
|
|
197
239
|
}
|
|
198
240
|
}
|
|
199
241
|
}
|
|
200
242
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
243
|
+
stage('SonarQube compare to master') {
|
|
244
|
+
when {
|
|
245
|
+
anyOf {
|
|
246
|
+
allOf {
|
|
247
|
+
not { environment name: 'CHANGE_ID', value: '' }
|
|
248
|
+
environment name: 'CHANGE_TARGET', value: 'develop'
|
|
249
|
+
}
|
|
250
|
+
allOf {
|
|
251
|
+
environment name: 'CHANGE_ID', value: ''
|
|
252
|
+
branch 'develop'
|
|
253
|
+
not { changelog '.*^Automated release [0-9\\.]+$' }
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
steps {
|
|
258
|
+
script {
|
|
259
|
+
sh '''echo "Error" > checkresult.txt'''
|
|
260
|
+
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
|
261
|
+
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'''
|
|
262
|
+
}
|
|
217
263
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
// }
|
|
264
|
+
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',
|
|
265
|
+
text: readFile(file: 'checkresult.txt'), conclusion: "${currentBuild.currentResult}",
|
|
266
|
+
detailsURL: "${env.BUILD_URL}display/redirect"
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
225
270
|
|
|
226
271
|
stage('Pull Request') {
|
|
227
272
|
when {
|
|
@@ -231,20 +276,16 @@ pipeline {
|
|
|
231
276
|
environment name: 'CHANGE_TARGET', value: 'master'
|
|
232
277
|
}
|
|
233
278
|
steps {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
sh '''docker pull eeacms/gitflow'''
|
|
241
|
-
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'''
|
|
242
|
-
}
|
|
279
|
+
script {
|
|
280
|
+
if (env.CHANGE_BRANCH != 'develop') {
|
|
281
|
+
error 'Pipeline aborted due to PR not made from develop branch'
|
|
282
|
+
}
|
|
283
|
+
withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN')]) {
|
|
284
|
+
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'''
|
|
243
285
|
}
|
|
244
286
|
}
|
|
245
287
|
}
|
|
246
288
|
}
|
|
247
|
-
|
|
248
289
|
}
|
|
249
290
|
|
|
250
291
|
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.24.0
|
|
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?="${RAZZLE_DEV_PROXY_API_PATH}"
|
|
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
|
|
85
90
|
|
|
86
91
|
.PHONY: test
|
|
87
92
|
test: ## Run jest tests
|
|
@@ -129,3 +134,31 @@ 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
|
+
cd ../..
|
|
155
|
+
yarn start &
|
|
156
|
+
|
|
157
|
+
.PHONY: cypress-ci
|
|
158
|
+
cypress-ci:
|
|
159
|
+
cp .coverage.babel.config.js /app/babel.config.js
|
|
160
|
+
make start-ci
|
|
161
|
+
$(NODE_MODULES)/.bin/wait-on -t 240000 http://localhost:3000
|
|
162
|
+
NODE_ENV=development make cypress-run
|
|
163
|
+
|
|
164
|
+
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { setupBeforeEach, tearDownAfterEach } from '../support/e2e';
|
|
1
|
+
// import { setupBeforeEach, tearDownAfterEach } from '../support/e2e';
|
|
2
2
|
|
|
3
|
-
describe('Blocks Tests', () => {
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
// describe('Blocks Tests', () => {
|
|
4
|
+
// beforeEach(setupBeforeEach);
|
|
5
|
+
// afterEach(tearDownAfterEach);
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
// it('Add Block: Empty', () => {
|
|
8
|
+
// // Change page title
|
|
9
|
+
// cy.get('.documentFirstHeading')
|
|
10
|
+
// .focused()
|
|
11
|
+
// .clear()
|
|
12
|
+
// .type('My Add-on Page')
|
|
13
|
+
// .get('.documentFirstHeading')
|
|
14
|
+
// .contains('My Add-on Page');
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
// cy.get('.documentFirstHeading') /* .focused() */
|
|
17
|
+
// .type('{enter}');
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
// // Add block
|
|
20
|
+
// cy.get('.ui.basic.icon.button.block-add-button').first().click();
|
|
21
|
+
// cy.get('.blocks-chooser .title').contains('Media').click();
|
|
22
|
+
// cy.get('.content.active.media .button.image').contains('Image').click();
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
// // Save
|
|
25
|
+
// cy.get('#toolbar-save').click();
|
|
26
|
+
// cy.url().should('eq', Cypress.config().baseUrl + '/cypress/my-page');
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
});
|
|
28
|
+
// // then the page view should contain our changes
|
|
29
|
+
// cy.contains('My Add-on Page');
|
|
30
|
+
// //cy.get('.block.image');
|
|
31
|
+
// });
|
|
32
|
+
// });
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -62,7 +62,8 @@ const DownloadDataSetContent = (data, token) => {
|
|
|
62
62
|
</div>
|
|
63
63
|
)}
|
|
64
64
|
|
|
65
|
-
{data
|
|
65
|
+
{data?.downloadable_full_dataset &&
|
|
66
|
+
data.download_by_area_extra_text?.data &&
|
|
66
67
|
data.download_by_area_extra_text?.data !== '<p><br/><p>' &&
|
|
67
68
|
data.download_by_area_extra_text?.data !== '<p></p>' && (
|
|
68
69
|
<div className="dataset-download-area">
|
|
@@ -326,11 +326,19 @@ const withSearch = (options) => (WrappedComponent) => {
|
|
|
326
326
|
);
|
|
327
327
|
|
|
328
328
|
const deepFacets = JSON.stringify(facets);
|
|
329
|
+
const deepData = JSON.stringify(data);
|
|
329
330
|
React.useEffect(() => {
|
|
330
331
|
setSearchData(
|
|
331
|
-
getInitialState(
|
|
332
|
+
getInitialState(
|
|
333
|
+
JSON.parse(deepData),
|
|
334
|
+
JSON.parse(deepFacets),
|
|
335
|
+
urlSearchText,
|
|
336
|
+
id,
|
|
337
|
+
sortOn,
|
|
338
|
+
sortOrder,
|
|
339
|
+
),
|
|
332
340
|
);
|
|
333
|
-
}, [
|
|
341
|
+
}, [deepData, deepFacets, urlSearchText, id, sortOn, sortOrder]);
|
|
334
342
|
|
|
335
343
|
const timeoutRef = React.useRef();
|
|
336
344
|
const facetSettings = data?.facets;
|