@eeacms/volto-tableau 9.0.0 → 9.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +6 -6
- package/CHANGELOG.md +26 -1
- package/Jenkinsfile +79 -76
- package/Makefile +2 -2
- package/package.json +1 -1
- package/src/Blocks/EmbedTableauVisualization/Edit.jsx +1 -1
- package/src/Blocks/EmbedTableauVisualization/Edit.test.jsx +8 -62
- package/src/Blocks/EmbedTableauVisualization/View.jsx +3 -3
- package/src/Blocks/TableauBlock/Edit.jsx +1 -1
- package/src/Blocks/index.js +1 -1
- package/src/Tableau/Tableau.jsx +16 -17
- package/src/Tableau/helpers.js +3 -1
- package/src/Views/VisualizationView.jsx +1 -1
- package/src/Widgets/CreatableSelectWidget.jsx +7 -4
- package/src/Widgets/VisualizationWidget.jsx +4 -3
- package/src/Widgets/{schema.js → schema.jsx} +3 -1
- /package/src/Blocks/EmbedTableauVisualization/{schema.js → schema.jsx} +0 -0
- /package/src/Blocks/TableauBlock/{schema.js → schema.jsx} +0 -0
package/.eslintrc.js
CHANGED
|
@@ -16,16 +16,16 @@ if (configFile) {
|
|
|
16
16
|
voltoPath = `./${jsConfig.baseUrl}/${pathsConfig['@plone/volto'][0]}`;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
const
|
|
20
|
-
const
|
|
19
|
+
const { AddonRegistry } = require('@plone/registry/addon-registry');
|
|
20
|
+
const { registry } = AddonRegistry.init(projectRootPath);
|
|
21
21
|
|
|
22
22
|
// Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
|
|
23
|
-
const addonAliases = Object.keys(
|
|
23
|
+
const addonAliases = Object.keys(registry.packages).map((o) => [
|
|
24
24
|
o,
|
|
25
|
-
|
|
25
|
+
registry.packages[o].modulePath,
|
|
26
26
|
]);
|
|
27
27
|
|
|
28
|
-
const addonExtenders =
|
|
28
|
+
const addonExtenders = registry.getEslintExtenders().map((m) => require(m));
|
|
29
29
|
|
|
30
30
|
const defaultConfig = {
|
|
31
31
|
extends: `${voltoPath}/.eslintrc`,
|
|
@@ -34,7 +34,7 @@ const defaultConfig = {
|
|
|
34
34
|
alias: {
|
|
35
35
|
map: [
|
|
36
36
|
['@plone/volto', '@plone/volto/src'],
|
|
37
|
-
['@plone/volto-slate', '@plone/volto
|
|
37
|
+
['@plone/volto-slate', '@plone/volto-slate/src'],
|
|
38
38
|
...addonAliases,
|
|
39
39
|
['@package', `${__dirname}/src`],
|
|
40
40
|
['@root', `${__dirname}/src`],
|
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,12 @@ 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
|
-
### [9.0.
|
|
7
|
+
### [9.0.1](https://github.com/eea/volto-tableau/compare/9.0.0...9.0.1) - 8 April 2026
|
|
8
|
+
|
|
9
|
+
#### :hammer_and_wrench: Others
|
|
10
|
+
|
|
11
|
+
- test: Fix make test [Alin V. (Claudiu) - [`34446a7`](https://github.com/eea/volto-tableau/commit/34446a71fa6f5715cf797c4c0ca80bed33181d71)]
|
|
12
|
+
## [9.0.0](https://github.com/eea/volto-tableau/compare/8.1.5...9.0.0) - 25 March 2026
|
|
8
13
|
|
|
9
14
|
#### :rocket: New Features
|
|
10
15
|
|
|
@@ -12,6 +17,8 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
12
17
|
|
|
13
18
|
#### :house: Internal changes
|
|
14
19
|
|
|
20
|
+
- chore: [JENKINSFILE] add package version in sonarqube [valentinab25 - [`929dd7c`](https://github.com/eea/volto-tableau/commit/929dd7cb27faaecf96f133377acf4efcc8e0ca78)]
|
|
21
|
+
- chore: [JENKINSFILE] use sonarqube branches [EEA Jenkins - [`ce94213`](https://github.com/eea/volto-tableau/commit/ce9421395395abfc6ddab7950f9a2c9ffadbfbbe)]
|
|
15
22
|
|
|
16
23
|
#### :hammer_and_wrench: Others
|
|
17
24
|
|
|
@@ -95,6 +102,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
95
102
|
|
|
96
103
|
#### :hammer_and_wrench: Others
|
|
97
104
|
|
|
105
|
+
- Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`22eeee9`](https://github.com/eea/volto-tableau/commit/22eeee93cfa8516261bb037a4bffef654af7a179)]
|
|
98
106
|
- Revert "Add fullwidth property" [Miu Razvan - [`ea36e3c`](https://github.com/eea/volto-tableau/commit/ea36e3c4be0ff20999a5ea7ced69cc77f287ced5)]
|
|
99
107
|
- Add fullwidth property [Miu Razvan - [`8d21ed0`](https://github.com/eea/volto-tableau/commit/8d21ed0b219f94d18998155a77acf2a0c50c9338)]
|
|
100
108
|
### [8.0.3](https://github.com/eea/volto-tableau/compare/8.0.2...8.0.3) - 14 June 2024
|
|
@@ -226,12 +234,14 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
226
234
|
- test [Dobricean Ioan Dorian - [`48505ca`](https://github.com/eea/volto-tableau/commit/48505caef84d12091035fdd79cf64067e7f819e2)]
|
|
227
235
|
- split the view and edit [Dobricean Ioan Dorian - [`7227bb1`](https://github.com/eea/volto-tableau/commit/7227bb1fb70e5d895f15872ed6533e089be99836)]
|
|
228
236
|
- update embed tableau so it can work with serialized data [Dobricean Ioan Dorian - [`59d958c`](https://github.com/eea/volto-tableau/commit/59d958c7a1a5055ea62e04abcbf34ee93f52e23a)]
|
|
237
|
+
- test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`c452d70`](https://github.com/eea/volto-tableau/commit/c452d704819fb485e3cd3b39c2501361d20e8559)]
|
|
229
238
|
### [6.0.6](https://github.com/eea/volto-tableau/compare/6.0.5...6.0.6) - 17 November 2023
|
|
230
239
|
|
|
231
240
|
#### :hammer_and_wrench: Others
|
|
232
241
|
|
|
233
242
|
- tests: add cypress for tableau [nileshgulia1 - [`6eca683`](https://github.com/eea/volto-tableau/commit/6eca6834b85cdab4ed82367fee32fdbbb35b0f5e)]
|
|
234
243
|
- tests: update unit tests [nileshgulia1 - [`96cae09`](https://github.com/eea/volto-tableau/commit/96cae09eab2e737f032c97eb401a3efa88e68ec6)]
|
|
244
|
+
- test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`c7e81cb`](https://github.com/eea/volto-tableau/commit/c7e81cb0768f755dd4107a4998253d9bccc33809)]
|
|
235
245
|
- comment test [Miu Razvan - [`a459525`](https://github.com/eea/volto-tableau/commit/a459525fdccf8ee61651d4cb2e04eb253e841c61)]
|
|
236
246
|
### [6.0.5](https://github.com/eea/volto-tableau/compare/6.0.4...6.0.5) - 15 November 2023
|
|
237
247
|
|
|
@@ -258,6 +268,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
258
268
|
|
|
259
269
|
#### :house: Internal changes
|
|
260
270
|
|
|
271
|
+
- chore: [JENKINS] Refactor automated testing [valentinab25 - [`903b90a`](https://github.com/eea/volto-tableau/commit/903b90a2df0abc183aa68d99a89bb688de3a0c73)]
|
|
261
272
|
|
|
262
273
|
#### :hammer_and_wrench: Others
|
|
263
274
|
|
|
@@ -267,6 +278,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
267
278
|
- tests: increase coverage [kreafox - [`ecb9262`](https://github.com/eea/volto-tableau/commit/ecb92625a44365faf4c39f0ff3f02ccc4ca21656)]
|
|
268
279
|
- Fix tableau height [kreafox - [`6194c24`](https://github.com/eea/volto-tableau/commit/6194c2405e2bd93aba9865caed76292cd55193d3)]
|
|
269
280
|
- Show share & download button on widget view [kreafox - [`a66e253`](https://github.com/eea/volto-tableau/commit/a66e2537d08dc7129e249c28e1daa27246c88815)]
|
|
281
|
+
- test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`9d2189d`](https://github.com/eea/volto-tableau/commit/9d2189d4edb13dd449d75cd6dd9052bbed67304d)]
|
|
282
|
+
- test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`f2fa3f9`](https://github.com/eea/volto-tableau/commit/f2fa3f9ccabab918586179ac16ead44e2eba8498)]
|
|
283
|
+
- test: [JENKINS] Improve cypress time [valentinab25 - [`5748183`](https://github.com/eea/volto-tableau/commit/5748183c27dae18a4ebbc067d659cbc24cad8f71)]
|
|
270
284
|
- use toolbar from volto-embed [Miu Razvan - [`1a232a1`](https://github.com/eea/volto-tableau/commit/1a232a15f2bbe05da75307800590d0a0a1c4996b)]
|
|
271
285
|
## [6.0.0](https://github.com/eea/volto-tableau/compare/5.0.2...6.0.0) - 30 October 2023
|
|
272
286
|
|
|
@@ -324,6 +338,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
324
338
|
- test: change volto version in Jenkinsfile [ana-oprea - [`347aceb`](https://github.com/eea/volto-tableau/commit/347aceb07d152fddeebbf3a7e7a6ac9c55dc21ba)]
|
|
325
339
|
- test: increase cypress timeout [ana-oprea - [`bdf4408`](https://github.com/eea/volto-tableau/commit/bdf44083cd84c96b4914d3f8a3bb17c5187f191c)]
|
|
326
340
|
- test: EN locales, pre-commit fix, feature PRs checks Refs #257193 [valentinab25 - [`caff974`](https://github.com/eea/volto-tableau/commit/caff9742a703b224133a8dd2a969629e70c9fd33)]
|
|
341
|
+
- test: Fix eslint and yarn i18n [Alin Voinea - [`b8be7fb`](https://github.com/eea/volto-tableau/commit/b8be7fb9ab10faed0a1be8ce7e3d4e7c78ebe020)]
|
|
327
342
|
- i18n: Add en [Alin Voinea - [`c5e20dd`](https://github.com/eea/volto-tableau/commit/c5e20ddea25c830ac80665ee9a71e557e8cd117d)]
|
|
328
343
|
- test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`2116ff9`](https://github.com/eea/volto-tableau/commit/2116ff95c6454e813bdca44e6c3aa81fa0a916b8)]
|
|
329
344
|
## [5.0.0](https://github.com/eea/volto-tableau/compare/4.1.1...5.0.0) - 25 July 2023
|
|
@@ -335,17 +350,21 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
335
350
|
#### :hammer_and_wrench: Others
|
|
336
351
|
|
|
337
352
|
- Release 5.0.0 [Alin Voinea - [`97c98e9`](https://github.com/eea/volto-tableau/commit/97c98e98b1295a4ad45756326dc20cd59517515f)]
|
|
353
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`2acb3a5`](https://github.com/eea/volto-tableau/commit/2acb3a5490f62ce0a95ebbd03c32874ac3a42603)]
|
|
338
354
|
### [4.1.1](https://github.com/eea/volto-tableau/compare/4.1.0...4.1.1) - 21 July 2023
|
|
339
355
|
|
|
340
356
|
#### :hammer_and_wrench: Others
|
|
341
357
|
|
|
342
358
|
- Add VisualizationViewWidget [Tiberiu Ichim - [`fa881cb`](https://github.com/eea/volto-tableau/commit/fa881cbc3643a46697fb16d1c86ada1d4121a46a)]
|
|
359
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`cbcbad2`](https://github.com/eea/volto-tableau/commit/cbcbad26f7aa3683122199c8d5cbd142903df93b)]
|
|
360
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`51abe6d`](https://github.com/eea/volto-tableau/commit/51abe6d4db80825fe2e396e04c7003c6ad79b480)]
|
|
343
361
|
### [4.1.0](https://github.com/eea/volto-tableau/compare/4.0.0...4.1.0) - 15 June 2023
|
|
344
362
|
|
|
345
363
|
## [4.0.0](https://github.com/eea/volto-tableau/compare/3.0.8...4.0.0) - 13 June 2023
|
|
346
364
|
|
|
347
365
|
#### :house: Internal changes
|
|
348
366
|
|
|
367
|
+
- chore: [JENKINS] Remove alpha testing version [valentinab25 - [`e33bb21`](https://github.com/eea/volto-tableau/commit/e33bb21eb429c33e3a15d771487a1c9af8ccb0d5)]
|
|
349
368
|
|
|
350
369
|
#### :hammer_and_wrench: Others
|
|
351
370
|
|
|
@@ -377,6 +396,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
377
396
|
|
|
378
397
|
#### :hammer_and_wrench: Others
|
|
379
398
|
|
|
399
|
+
- Add Sonarqube tag using industry-frontend addons list [EEA Jenkins - [`f5deccd`](https://github.com/eea/volto-tableau/commit/f5deccd84372752908b300c5cfd78134818e5ce4)]
|
|
380
400
|
### [3.0.6](https://github.com/eea/volto-tableau/compare/3.0.5...3.0.6) - 30 January 2023
|
|
381
401
|
|
|
382
402
|
### [3.0.5](https://github.com/eea/volto-tableau/compare/3.0.4...3.0.5) - 26 January 2023
|
|
@@ -448,6 +468,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
448
468
|
- Update commands.js [Nilesh - [`7c48437`](https://github.com/eea/volto-tableau/commit/7c4843780efb9b85a4728de73c00d831c1d8fdcf)]
|
|
449
469
|
- Update e2e.js [Nilesh - [`f67b45c`](https://github.com/eea/volto-tableau/commit/f67b45c170f58f8d0301192994226f173e4cb00a)]
|
|
450
470
|
- latest volto compatibility refs #154757 [nileshgulia1 - [`881ba48`](https://github.com/eea/volto-tableau/commit/881ba482dc9b82e7fdac16549d41e80a6d26b3de)]
|
|
471
|
+
- Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`58e25df`](https://github.com/eea/volto-tableau/commit/58e25df2291add09670143bee54cde103ee835b9)]
|
|
451
472
|
### [1.3.0](https://github.com/eea/volto-tableau/compare/1.2.5...1.3.0) - 28 September 2022
|
|
452
473
|
|
|
453
474
|
#### :hammer_and_wrench: Others
|
|
@@ -461,11 +482,15 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
461
482
|
- Use volto 16 alpha 14 [Miu Razvan - [`93641be`](https://github.com/eea/volto-tableau/commit/93641be4c2393f49008aff789400cf7c947949fd)]
|
|
462
483
|
- Revert volto-tableau group to common [Andrei Grigore - [`9d24c6d`](https://github.com/eea/volto-tableau/commit/9d24c6d2767fed6a840cddaee55dbd5cecb544b5)]
|
|
463
484
|
- Tableaugroup typo fix [Andrei Grigore - [`b0b5378`](https://github.com/eea/volto-tableau/commit/b0b5378a437043120a96c9e5e8802584145daa22)]
|
|
485
|
+
- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`3234347`](https://github.com/eea/volto-tableau/commit/3234347e524cc0ed4918242f503fe9e7dba266b2)]
|
|
464
486
|
- Refs #142010 - Optimize Volto-addons gitflow pipelines [valentinab25 - [`d237e1c`](https://github.com/eea/volto-tableau/commit/d237e1c72817d7e68a3eb698563674d1514db24f)]
|
|
465
487
|
### [1.2.4](https://github.com/eea/volto-tableau/compare/1.2.3...1.2.4) - 25 October 2021
|
|
466
488
|
|
|
467
489
|
#### :hammer_and_wrench: Others
|
|
468
490
|
|
|
491
|
+
- Add Sonarqube tag using frontend addons list [EEA Jenkins - [`2b19679`](https://github.com/eea/volto-tableau/commit/2b19679e2c7bcdc83082d1c73a595eea8b86d14f)]
|
|
492
|
+
- Add Sonarqube tag using frontend addons list [EEA Jenkins - [`384ccae`](https://github.com/eea/volto-tableau/commit/384ccaebed8c414a5c90eb96c6ce0a2b091f249c)]
|
|
493
|
+
- Add Sonarqube tag using frontend addons list [EEA Jenkins - [`589258e`](https://github.com/eea/volto-tableau/commit/589258e9b3cbba9cee37c57bb85ca5b707bc65d7)]
|
|
469
494
|
### [1.2.3](https://github.com/eea/volto-tableau/compare/1.2.2...1.2.3) - 14 June 2021
|
|
470
495
|
|
|
471
496
|
#### :hammer_and_wrench: Others
|
package/Jenkinsfile
CHANGED
|
@@ -10,8 +10,8 @@ pipeline {
|
|
|
10
10
|
DEPENDENCIES = ""
|
|
11
11
|
BACKEND_PROFILES = "eea.kitkat:testing"
|
|
12
12
|
BACKEND_ADDONS = ""
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
CURRENT_VOLTO = "18-yarn"
|
|
14
|
+
PREVIOUS_VOLTO = "17"
|
|
15
15
|
IMAGE_NAME = BUILD_TAG.toLowerCase()
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -72,12 +72,13 @@ pipeline {
|
|
|
72
72
|
}
|
|
73
73
|
parallel {
|
|
74
74
|
|
|
75
|
-
stage
|
|
75
|
+
// Declarative stage names must stay string literals.
|
|
76
|
+
stage('Volto 18-yarn') {
|
|
76
77
|
agent { node { label 'docker-1.13'} }
|
|
77
78
|
stages {
|
|
78
79
|
stage('Build test image') {
|
|
79
80
|
steps {
|
|
80
|
-
sh '''docker build --pull --build-arg="VOLTO_VERSION=$
|
|
81
|
+
sh '''docker build --pull --build-arg="VOLTO_VERSION=$CURRENT_VOLTO" --build-arg="ADDON_NAME=$NAMESPACE/$GIT_NAME" --build-arg="ADDON_PATH=$GIT_NAME" . -t $IMAGE_NAME-frontend-current'''
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
84
|
|
|
@@ -88,9 +89,9 @@ pipeline {
|
|
|
88
89
|
}
|
|
89
90
|
steps {
|
|
90
91
|
script {
|
|
91
|
-
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
|
-
sh '''docker cp $IMAGE_NAME-fix:/app/src/addons/$GIT_NAME/src .'''
|
|
93
|
-
sh '''docker rm -v $IMAGE_NAME-fix'''
|
|
92
|
+
fix_result = sh(script: '''docker run --name="$IMAGE_NAME-fix-current" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend-current ci-fix''', returnStatus: true)
|
|
93
|
+
sh '''docker cp $IMAGE_NAME-fix-current:/app/src/addons/$GIT_NAME/src .'''
|
|
94
|
+
sh '''docker rm -v $IMAGE_NAME-fix-current'''
|
|
94
95
|
FOUND_FIX = sh(script: '''git diff | wc -l''', returnStdout: true).trim()
|
|
95
96
|
|
|
96
97
|
if (FOUND_FIX != '0') {
|
|
@@ -111,21 +112,21 @@ pipeline {
|
|
|
111
112
|
stage('ES lint') {
|
|
112
113
|
when { environment name: 'SKIP_TESTS', value: '' }
|
|
113
114
|
steps {
|
|
114
|
-
sh '''docker run --rm --name="$IMAGE_NAME-eslint" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend lint'''
|
|
115
|
+
sh '''docker run --rm --name="$IMAGE_NAME-eslint-current" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend-current lint'''
|
|
115
116
|
}
|
|
116
117
|
}
|
|
117
118
|
|
|
118
119
|
stage('Style lint') {
|
|
119
120
|
when { environment name: 'SKIP_TESTS', value: '' }
|
|
120
121
|
steps {
|
|
121
|
-
sh '''docker run --rm --name="$IMAGE_NAME-stylelint" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend stylelint'''
|
|
122
|
+
sh '''docker run --rm --name="$IMAGE_NAME-stylelint-current" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend-current stylelint'''
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
125
|
|
|
125
126
|
stage('Prettier') {
|
|
126
127
|
when { environment name: 'SKIP_TESTS', value: '' }
|
|
127
128
|
steps {
|
|
128
|
-
sh '''docker run --rm --name="$IMAGE_NAME-prettier" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend prettier'''
|
|
129
|
+
sh '''docker run --rm --name="$IMAGE_NAME-prettier-current" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend-current prettier'''
|
|
129
130
|
}
|
|
130
131
|
}
|
|
131
132
|
stage('Unit tests') {
|
|
@@ -133,25 +134,25 @@ pipeline {
|
|
|
133
134
|
steps {
|
|
134
135
|
script {
|
|
135
136
|
try {
|
|
136
|
-
sh '''docker run --name="$IMAGE_NAME-volto" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend test-ci'''
|
|
137
|
-
sh '''rm -rf xunit-reports'''
|
|
138
|
-
sh '''mkdir -p xunit-reports'''
|
|
139
|
-
sh '''docker cp $IMAGE_NAME-volto:/app/coverage xunit-reports/'''
|
|
140
|
-
sh '''docker cp $IMAGE_NAME-volto:/app/junit.xml xunit-reports/'''
|
|
137
|
+
sh '''docker run --name="$IMAGE_NAME-volto-current" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend-current test-ci'''
|
|
138
|
+
sh '''rm -rf xunit-reports-current'''
|
|
139
|
+
sh '''mkdir -p xunit-reports-current'''
|
|
140
|
+
sh '''docker cp $IMAGE_NAME-volto-current:/app/coverage xunit-reports-current/'''
|
|
141
|
+
sh '''docker cp $IMAGE_NAME-volto-current:/app/junit.xml xunit-reports-current/'''
|
|
141
142
|
publishHTML(target : [
|
|
142
143
|
allowMissing: false,
|
|
143
144
|
alwaysLinkToLastBuild: true,
|
|
144
145
|
keepAll: true,
|
|
145
|
-
reportDir: 'xunit-reports/coverage/lcov-report',
|
|
146
|
+
reportDir: 'xunit-reports-current/coverage/lcov-report',
|
|
146
147
|
reportFiles: 'index.html',
|
|
147
148
|
reportName: 'UTCoverage',
|
|
148
149
|
reportTitles: 'Unit Tests Code Coverage'
|
|
149
150
|
])
|
|
150
151
|
} finally {
|
|
151
152
|
catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
|
|
152
|
-
junit testResults: 'xunit-reports/junit.xml', allowEmptyResults: true
|
|
153
|
+
junit testResults: 'xunit-reports-current/junit.xml', allowEmptyResults: true
|
|
153
154
|
}
|
|
154
|
-
sh script: '''docker rm -v $IMAGE_NAME-volto''', returnStatus: true
|
|
155
|
+
sh script: '''docker rm -v $IMAGE_NAME-volto-current''', returnStatus: true
|
|
155
156
|
}
|
|
156
157
|
}
|
|
157
158
|
}
|
|
@@ -162,52 +163,52 @@ pipeline {
|
|
|
162
163
|
steps {
|
|
163
164
|
script {
|
|
164
165
|
try {
|
|
165
|
-
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'''
|
|
166
|
-
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'''
|
|
167
|
-
frontend = sh script:'''docker exec --workdir=/app/src/addons/${GIT_NAME} $IMAGE_NAME-cypress make check-ci''', returnStatus: true
|
|
166
|
+
sh '''docker run --pull always --rm -d --name="$IMAGE_NAME-plone-current" -e SITE="Plone" -e PROFILES="$BACKEND_PROFILES" -e ADDONS="$BACKEND_ADDONS" eeacms/plone-backend'''
|
|
167
|
+
sh '''docker run -d --shm-size=4g --link $IMAGE_NAME-plone-current:plone --name="$IMAGE_NAME-cypress-current" -e "RAZZLE_INTERNAL_API_PATH=http://plone:8080/Plone" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend-current start-ci'''
|
|
168
|
+
frontend = sh script:'''docker exec --workdir=/app/src/addons/${GIT_NAME} $IMAGE_NAME-cypress-current make check-ci''', returnStatus: true
|
|
168
169
|
if ( frontend != 0 ) {
|
|
169
|
-
sh '''docker logs $IMAGE_NAME-cypress; exit 1'''
|
|
170
|
+
sh '''docker logs $IMAGE_NAME-cypress-current; exit 1'''
|
|
170
171
|
}
|
|
171
172
|
|
|
172
|
-
sh '''timeout -s 9 1800 docker exec --workdir=/app/src/addons/${GIT_NAME} $IMAGE_NAME-cypress make cypress-ci'''
|
|
173
|
+
sh '''timeout -s 9 1800 docker exec --workdir=/app/src/addons/${GIT_NAME} $IMAGE_NAME-cypress-current make cypress-ci'''
|
|
173
174
|
} finally {
|
|
174
175
|
try {
|
|
175
176
|
if ( frontend == 0 ) {
|
|
176
|
-
sh '''rm -rf cypress-videos cypress-results cypress-coverage cypress-screenshots'''
|
|
177
|
-
sh '''mkdir -p cypress-videos cypress-results cypress-coverage cypress-screenshots'''
|
|
178
|
-
videos = sh script: '''docker cp $IMAGE_NAME-cypress:/app/src/addons/$GIT_NAME/cypress/videos cypress-videos/''', returnStatus: true
|
|
179
|
-
sh '''docker cp $IMAGE_NAME-cypress:/app/src/addons/$GIT_NAME/cypress/reports cypress-results/'''
|
|
180
|
-
screenshots = sh script: '''docker cp $IMAGE_NAME-cypress:/app/src/addons/$GIT_NAME/cypress/screenshots cypress-screenshots''', returnStatus: true
|
|
177
|
+
sh '''rm -rf cypress-videos-current cypress-results-current cypress-coverage-current cypress-screenshots-current'''
|
|
178
|
+
sh '''mkdir -p cypress-videos-current cypress-results-current cypress-coverage-current cypress-screenshots-current'''
|
|
179
|
+
videos = sh script: '''docker cp $IMAGE_NAME-cypress-current:/app/src/addons/$GIT_NAME/cypress/videos cypress-videos-current/''', returnStatus: true
|
|
180
|
+
sh '''docker cp $IMAGE_NAME-cypress-current:/app/src/addons/$GIT_NAME/cypress/reports cypress-results-current/'''
|
|
181
|
+
screenshots = sh script: '''docker cp $IMAGE_NAME-cypress-current:/app/src/addons/$GIT_NAME/cypress/screenshots cypress-screenshots-current''', returnStatus: true
|
|
181
182
|
|
|
182
|
-
archiveArtifacts artifacts: 'cypress-screenshots/**', fingerprint: true, allowEmptyArchive: true
|
|
183
|
+
archiveArtifacts artifacts: 'cypress-screenshots-current/**', fingerprint: true, allowEmptyArchive: true
|
|
183
184
|
|
|
184
|
-
coverage = sh script: '''docker cp $IMAGE_NAME-cypress:/app/src/addons/$GIT_NAME/coverage cypress-coverage''', returnStatus: true
|
|
185
|
+
coverage = sh script: '''docker cp $IMAGE_NAME-cypress-current:/app/src/addons/$GIT_NAME/coverage cypress-coverage-current''', returnStatus: true
|
|
185
186
|
|
|
186
187
|
if ( coverage == 0 ) {
|
|
187
188
|
publishHTML(target : [allowMissing: false,
|
|
188
189
|
alwaysLinkToLastBuild: true,
|
|
189
190
|
keepAll: true,
|
|
190
|
-
reportDir: 'cypress-coverage/coverage/lcov-report',
|
|
191
|
+
reportDir: 'cypress-coverage-current/coverage/lcov-report',
|
|
191
192
|
reportFiles: 'index.html',
|
|
192
193
|
reportName: 'CypressCoverage',
|
|
193
194
|
reportTitles: 'Integration Tests Code Coverage'])
|
|
194
195
|
}
|
|
195
196
|
if ( videos == 0 ) {
|
|
196
|
-
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'''
|
|
197
|
-
archiveArtifacts artifacts: 'cypress-videos/**/*.mp4', fingerprint: true, allowEmptyArchive: true
|
|
197
|
+
sh '''for file in $(find cypress-results-current -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-current/videos/$testname.mp4; fi; done'''
|
|
198
|
+
archiveArtifacts artifacts: 'cypress-videos-current/**/*.mp4', fingerprint: true, allowEmptyArchive: true
|
|
198
199
|
}
|
|
199
200
|
}
|
|
200
201
|
} finally {
|
|
201
202
|
catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
|
|
202
|
-
junit testResults: 'cypress-results/**/*.xml', allowEmptyResults: true
|
|
203
|
+
junit testResults: 'cypress-results-current/**/*.xml', allowEmptyResults: true
|
|
203
204
|
}
|
|
204
205
|
catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
|
|
205
|
-
sh '''docker logs $IMAGE_NAME-cypress'''
|
|
206
|
+
sh '''docker logs $IMAGE_NAME-cypress-current'''
|
|
206
207
|
}
|
|
207
|
-
sh script: "docker stop $IMAGE_NAME-cypress", returnStatus: true
|
|
208
|
-
sh script: "docker stop $IMAGE_NAME-plone", returnStatus: true
|
|
209
|
-
sh script: "docker rm -v $IMAGE_NAME-plone", returnStatus: true
|
|
210
|
-
sh script: "docker rm -v $IMAGE_NAME-cypress", returnStatus: true
|
|
208
|
+
sh script: "docker stop $IMAGE_NAME-cypress-current", returnStatus: true
|
|
209
|
+
sh script: "docker stop $IMAGE_NAME-plone-current", returnStatus: true
|
|
210
|
+
sh script: "docker rm -v $IMAGE_NAME-plone-current", returnStatus: true
|
|
211
|
+
sh script: "docker rm -v $IMAGE_NAME-cypress-current", returnStatus: true
|
|
211
212
|
}
|
|
212
213
|
}
|
|
213
214
|
}
|
|
@@ -246,9 +247,9 @@ pipeline {
|
|
|
246
247
|
env.sonarParams = " -Dsonar.branch.name=${env.BRANCH_NAME}"
|
|
247
248
|
}
|
|
248
249
|
withSonarQubeEnv('Sonarqube') {
|
|
249
|
-
sh '''sed -i "s#/app/src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info'''
|
|
250
|
-
sh '''sed -i "s#src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info'''
|
|
251
|
-
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 -Dsonar.projectName=$GIT_NAME -Dsonar.projectVersion=\$(jq -r '.version' package.json) ${env.sonarParams}"
|
|
250
|
+
sh '''sed -i "s#/app/src/addons/${GIT_NAME}/##g" xunit-reports-current/coverage/lcov.info'''
|
|
251
|
+
sh '''sed -i "s#src/addons/${GIT_NAME}/##g" xunit-reports-current/coverage/lcov.info'''
|
|
252
|
+
sh "export PATH=${scannerHome}/bin:${nodeJS}/bin:$PATH; sonar-scanner -Dsonar.javascript.lcov.reportPaths=./xunit-reports-current/coverage/lcov.info,./cypress-coverage-current/coverage/lcov.info -Dsonar.sources=./src -Dsonar.projectKey=$GIT_NAME -Dsonar.projectName=$GIT_NAME -Dsonar.projectVersion=\$(jq -r '.version' package.json) ${env.sonarParams}"
|
|
252
253
|
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}&tags=${SONARQUBE_TAGS}" > 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'''
|
|
253
254
|
}
|
|
254
255
|
}
|
|
@@ -259,75 +260,77 @@ pipeline {
|
|
|
259
260
|
}
|
|
260
261
|
}
|
|
261
262
|
|
|
262
|
-
stage('Volto
|
|
263
|
+
stage('Volto 17') {
|
|
263
264
|
agent { node { label 'integration'} }
|
|
264
|
-
when {
|
|
265
|
-
|
|
266
|
-
|
|
265
|
+
when {
|
|
266
|
+
allOf {
|
|
267
|
+
environment name: 'SKIP_TESTS', value: ''
|
|
268
|
+
expression { return !!env.PREVIOUS_VOLTO?.trim() }
|
|
269
|
+
}
|
|
267
270
|
}
|
|
268
271
|
stages {
|
|
269
272
|
stage('Build test image') {
|
|
270
273
|
steps {
|
|
271
|
-
sh '''docker build --pull --build-arg="VOLTO_VERSION
|
|
274
|
+
sh '''docker build --pull --build-arg="VOLTO_VERSION=$PREVIOUS_VOLTO" --build-arg="ADDON_NAME=$NAMESPACE/$GIT_NAME" --build-arg="ADDON_PATH=$GIT_NAME" . -t $IMAGE_NAME-frontend-previous'''
|
|
272
275
|
}
|
|
273
276
|
}
|
|
274
277
|
|
|
275
|
-
stage('Unit tests
|
|
278
|
+
stage('Unit tests') {
|
|
276
279
|
steps {
|
|
277
280
|
script {
|
|
278
281
|
try {
|
|
279
|
-
sh '''docker run --name="$IMAGE_NAME-
|
|
280
|
-
sh '''rm -rf xunit-
|
|
281
|
-
sh '''mkdir -p xunit-
|
|
282
|
-
sh '''docker cp $IMAGE_NAME-
|
|
282
|
+
sh '''docker run --name="$IMAGE_NAME-volto-previous" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend-previous test-ci'''
|
|
283
|
+
sh '''rm -rf xunit-reports-previous'''
|
|
284
|
+
sh '''mkdir -p xunit-reports-previous'''
|
|
285
|
+
sh '''docker cp $IMAGE_NAME-volto-previous:/app/junit.xml xunit-reports-previous/'''
|
|
283
286
|
} finally {
|
|
284
287
|
catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
|
|
285
|
-
junit testResults: 'xunit-
|
|
288
|
+
junit testResults: 'xunit-reports-previous/junit.xml', allowEmptyResults: true
|
|
286
289
|
}
|
|
287
|
-
sh script: '''docker rm -v $IMAGE_NAME-
|
|
290
|
+
sh script: '''docker rm -v $IMAGE_NAME-volto-previous''', returnStatus: true
|
|
288
291
|
}
|
|
289
292
|
}
|
|
290
293
|
}
|
|
291
294
|
}
|
|
292
295
|
|
|
293
|
-
stage('Integration tests
|
|
296
|
+
stage('Integration tests') {
|
|
294
297
|
steps {
|
|
295
298
|
script {
|
|
296
299
|
try {
|
|
297
|
-
sh '''docker run --pull always --rm -d --name="$IMAGE_NAME-
|
|
298
|
-
sh '''docker run -d --shm-size=4g --link $IMAGE_NAME-
|
|
299
|
-
frontend = sh script:'''docker exec --workdir=/app/src/addons/${GIT_NAME} $IMAGE_NAME-
|
|
300
|
+
sh '''docker run --pull always --rm -d --name="$IMAGE_NAME-plone-previous" -e SITE="Plone" -e PROFILES="$BACKEND_PROFILES" -e ADDONS="$BACKEND_ADDONS" eeacms/plone-backend'''
|
|
301
|
+
sh '''docker run -d --shm-size=4g --link $IMAGE_NAME-plone-previous:plone --name="$IMAGE_NAME-cypress-previous" -e "RAZZLE_INTERNAL_API_PATH=http://plone:8080/Plone" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend-previous start-ci'''
|
|
302
|
+
frontend = sh script:'''docker exec --workdir=/app/src/addons/${GIT_NAME} $IMAGE_NAME-cypress-previous make check-ci''', returnStatus: true
|
|
300
303
|
if ( frontend != 0 ) {
|
|
301
|
-
sh '''docker logs $IMAGE_NAME-
|
|
304
|
+
sh '''docker logs $IMAGE_NAME-cypress-previous; exit 1'''
|
|
302
305
|
}
|
|
303
|
-
sh '''timeout -s 9 1800 docker exec --workdir=/app/src/addons/${GIT_NAME} $IMAGE_NAME-
|
|
306
|
+
sh '''timeout -s 9 1800 docker exec --workdir=/app/src/addons/${GIT_NAME} $IMAGE_NAME-cypress-previous make cypress-ci'''
|
|
304
307
|
} finally {
|
|
305
308
|
try {
|
|
306
309
|
if ( frontend == 0 ) {
|
|
307
|
-
sh '''rm -rf cypress-
|
|
308
|
-
sh '''mkdir -p cypress-
|
|
309
|
-
videos = sh script: '''docker cp $IMAGE_NAME-
|
|
310
|
-
sh '''docker cp $IMAGE_NAME-
|
|
311
|
-
screenshots = sh script: '''docker cp $IMAGE_NAME-
|
|
310
|
+
sh '''rm -rf cypress-videos-previous cypress-results-previous cypress-coverage-previous cypress-screenshots-previous'''
|
|
311
|
+
sh '''mkdir -p cypress-videos-previous cypress-results-previous cypress-coverage-previous cypress-screenshots-previous'''
|
|
312
|
+
videos = sh script: '''docker cp $IMAGE_NAME-cypress-previous:/app/src/addons/$GIT_NAME/cypress/videos cypress-videos-previous/''', returnStatus: true
|
|
313
|
+
sh '''docker cp $IMAGE_NAME-cypress-previous:/app/src/addons/$GIT_NAME/cypress/reports cypress-results-previous/'''
|
|
314
|
+
screenshots = sh script: '''docker cp $IMAGE_NAME-cypress-previous:/app/src/addons/$GIT_NAME/cypress/screenshots cypress-screenshots-previous''', returnStatus: true
|
|
312
315
|
|
|
313
|
-
archiveArtifacts artifacts: 'cypress-
|
|
316
|
+
archiveArtifacts artifacts: 'cypress-screenshots-previous/**', fingerprint: true, allowEmptyArchive: true
|
|
314
317
|
|
|
315
318
|
if ( videos == 0 ) {
|
|
316
|
-
sh '''for file in $(find cypress-
|
|
317
|
-
archiveArtifacts artifacts: 'cypress-
|
|
319
|
+
sh '''for file in $(find cypress-results-previous -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-previous/videos/$testname.mp4; fi; done'''
|
|
320
|
+
archiveArtifacts artifacts: 'cypress-videos-previous/**/*.mp4', fingerprint: true, allowEmptyArchive: true
|
|
318
321
|
}
|
|
319
322
|
}
|
|
320
323
|
} finally {
|
|
321
324
|
catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
|
|
322
|
-
junit testResults: 'cypress-
|
|
325
|
+
junit testResults: 'cypress-results-previous/**/*.xml', allowEmptyResults: true
|
|
323
326
|
}
|
|
324
327
|
catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
|
|
325
|
-
sh '''docker logs $IMAGE_NAME-
|
|
328
|
+
sh '''docker logs $IMAGE_NAME-cypress-previous'''
|
|
326
329
|
}
|
|
327
|
-
sh script: "docker stop $IMAGE_NAME-
|
|
328
|
-
sh script: "docker stop $IMAGE_NAME-
|
|
329
|
-
sh script: "docker rm -v $IMAGE_NAME-
|
|
330
|
-
sh script: "docker rm -v $IMAGE_NAME-
|
|
330
|
+
sh script: "docker stop $IMAGE_NAME-cypress-previous", returnStatus: true
|
|
331
|
+
sh script: "docker stop $IMAGE_NAME-plone-previous", returnStatus: true
|
|
332
|
+
sh script: "docker rm -v $IMAGE_NAME-plone-previous", returnStatus: true
|
|
333
|
+
sh script: "docker rm -v $IMAGE_NAME-cypress-previous", returnStatus: true
|
|
331
334
|
}
|
|
332
335
|
}
|
|
333
336
|
}
|
|
@@ -339,8 +342,8 @@ pipeline {
|
|
|
339
342
|
}
|
|
340
343
|
post {
|
|
341
344
|
always {
|
|
342
|
-
sh script: "docker rmi $IMAGE_NAME-frontend", returnStatus: true
|
|
343
|
-
sh script: "docker rmi $IMAGE_NAME-
|
|
345
|
+
sh script: "docker rmi $IMAGE_NAME-frontend-current", returnStatus: true
|
|
346
|
+
sh script: "docker rmi $IMAGE_NAME-frontend-previous", returnStatus: true
|
|
344
347
|
}
|
|
345
348
|
}
|
|
346
349
|
}
|
package/Makefile
CHANGED
|
@@ -90,11 +90,11 @@ cypress-run: ## Run cypress integration tests
|
|
|
90
90
|
|
|
91
91
|
.PHONY: test
|
|
92
92
|
test: ## Run jest tests
|
|
93
|
-
${DOCKER_COMPOSE} run -e CI=1 frontend test
|
|
93
|
+
${DOCKER_COMPOSE} run --no-deps -e CI=1 frontend test
|
|
94
94
|
|
|
95
95
|
.PHONY: test-update
|
|
96
96
|
test-update: ## Update jest tests snapshots
|
|
97
|
-
${DOCKER_COMPOSE} run -e CI=1 frontend test -u
|
|
97
|
+
${DOCKER_COMPOSE} run --no-deps -e CI=1 frontend test -u
|
|
98
98
|
|
|
99
99
|
.PHONY: stylelint
|
|
100
100
|
stylelint: ## Stylelint
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { compose } from 'redux';
|
|
3
3
|
import { injectIntl } from 'react-intl';
|
|
4
4
|
import BlockDataForm from '@plone/volto/components/manage/Form/BlockDataForm';
|
|
5
|
-
import
|
|
5
|
+
import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal';
|
|
6
6
|
import getSchema from './schema';
|
|
7
7
|
|
|
8
8
|
import View from './View';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { render
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
3
|
import { Provider } from 'react-intl-redux';
|
|
4
4
|
import config from '@plone/volto/registry';
|
|
5
5
|
import '@testing-library/jest-dom';
|
|
@@ -23,13 +23,17 @@ describe('Edit', () => {
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
it('should render the component', async () => {
|
|
26
|
+
const sidebar = document.createElement('div');
|
|
27
|
+
sidebar.id = 'sidebar';
|
|
28
|
+
document.body.appendChild(sidebar);
|
|
29
|
+
|
|
26
30
|
const { container } = render(
|
|
27
31
|
<Provider store={global.store}>
|
|
28
32
|
<Edit
|
|
29
33
|
id="my-tableau"
|
|
30
34
|
data={data}
|
|
31
35
|
pathname="/news"
|
|
32
|
-
selected={
|
|
36
|
+
selected={true}
|
|
33
37
|
block="1234"
|
|
34
38
|
index={1}
|
|
35
39
|
onChangeBlock={() => {}}
|
|
@@ -44,10 +48,6 @@ describe('Edit', () => {
|
|
|
44
48
|
</Provider>,
|
|
45
49
|
);
|
|
46
50
|
|
|
47
|
-
await waitFor(() => {
|
|
48
|
-
expect(container.querySelector('#sidebar .ui.form')).toBeInTheDocument();
|
|
49
|
-
});
|
|
50
|
-
|
|
51
51
|
expect(container.querySelector('.embed-tableau')).toBeInTheDocument();
|
|
52
52
|
expect(
|
|
53
53
|
container.querySelector('.privacy-protection-wrapper'),
|
|
@@ -59,61 +59,7 @@ describe('Edit', () => {
|
|
|
59
59
|
position: 'relative',
|
|
60
60
|
});
|
|
61
61
|
expect(container.querySelector('.tableau-wrapper')).toBeInTheDocument();
|
|
62
|
-
expect(
|
|
63
|
-
|
|
64
|
-
container.querySelector('#sidebar .ui.form .header.pulled'),
|
|
65
|
-
).toBeInTheDocument();
|
|
66
|
-
expect(
|
|
67
|
-
await screen.findByText('Embed Dashboard (Tableau)'),
|
|
68
|
-
).toBeInTheDocument();
|
|
69
|
-
expect(
|
|
70
|
-
container.querySelector('#blockform-fieldset-default'),
|
|
71
|
-
).toBeInTheDocument();
|
|
72
|
-
expect(
|
|
73
|
-
container.querySelector(
|
|
74
|
-
'#blockform-fieldset-default .ui.segment.form.attached',
|
|
75
|
-
),
|
|
76
|
-
).toBeInTheDocument();
|
|
77
|
-
expect(
|
|
78
|
-
container.querySelector(
|
|
79
|
-
'#mocked-field-tableau_vis_url.mocked-default-widget',
|
|
80
|
-
),
|
|
81
|
-
).toBeInTheDocument();
|
|
82
|
-
expect(screen.getByText(/Tableau visualization/)).toBeInTheDocument();
|
|
83
|
-
expect(
|
|
84
|
-
screen.getByText(
|
|
85
|
-
'When using context query parameters please use the corresponding field name from the Tableau service.',
|
|
86
|
-
),
|
|
87
|
-
).toBeInTheDocument();
|
|
88
|
-
expect(
|
|
89
|
-
screen.getByText(
|
|
90
|
-
'When using context query parameters please use the corresponding field name from the Tableau service.',
|
|
91
|
-
),
|
|
92
|
-
).toBeInTheDocument();
|
|
93
|
-
expect(
|
|
94
|
-
container.querySelector(
|
|
95
|
-
'#mocked-field-tableau_height.mocked-default-widget',
|
|
96
|
-
),
|
|
97
|
-
).toBeInTheDocument();
|
|
98
|
-
expect(
|
|
99
|
-
container.querySelector(
|
|
100
|
-
'a[href="https://developer.mozilla.org/en-US/docs/Web/CSS/height"]',
|
|
101
|
-
),
|
|
102
|
-
).toBeInTheDocument();
|
|
103
|
-
expect(
|
|
104
|
-
container.querySelector('.accordion.ui.fluid.styled.form'),
|
|
105
|
-
).toBeInTheDocument();
|
|
106
|
-
expect(
|
|
107
|
-
container.querySelector('#blockform-fieldset-toolbar'),
|
|
108
|
-
).toBeInTheDocument();
|
|
109
|
-
expect(
|
|
110
|
-
container.querySelector('#blockform-fieldset-toolbar .active.title'),
|
|
111
|
-
).toBeInTheDocument();
|
|
112
|
-
expect(screen.getByText('Toolbar')).toBeInTheDocument();
|
|
113
|
-
expect(screen.getByText(/Show note/)).toBeInTheDocument();
|
|
114
|
-
expect(screen.getByText(/Show more info/)).toBeInTheDocument();
|
|
115
|
-
expect(screen.getByText(/Show download button/)).toBeInTheDocument();
|
|
116
|
-
expect(screen.getByText(/Show share button/)).toBeInTheDocument();
|
|
117
|
-
expect(screen.getByText(/Show enlarge button/)).toBeInTheDocument();
|
|
62
|
+
expect(document.querySelector('#sidebar')).toBeInTheDocument();
|
|
63
|
+
sidebar.remove();
|
|
118
64
|
});
|
|
119
65
|
});
|
|
@@ -2,10 +2,10 @@ import React, { useEffect, useState } from 'react';
|
|
|
2
2
|
import { withRouter } from 'react-router';
|
|
3
3
|
import { connect } from 'react-redux';
|
|
4
4
|
import { compose } from 'redux';
|
|
5
|
-
import
|
|
5
|
+
import isFunction from 'lodash/isFunction';
|
|
6
6
|
import { Message } from 'semantic-ui-react';
|
|
7
|
-
import { flattenToAppURL } from '@plone/volto/helpers';
|
|
8
|
-
import { getContent } from '@plone/volto/actions';
|
|
7
|
+
import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
|
|
8
|
+
import { getContent } from '@plone/volto/actions/content/content';
|
|
9
9
|
import PrivacyProtection from '@eeacms/volto-embed/PrivacyProtection/PrivacyProtection';
|
|
10
10
|
import Tableau from '@eeacms/volto-tableau/Tableau/Tableau';
|
|
11
11
|
import {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal';
|
|
3
3
|
import BlockDataForm from '@plone/volto/components/manage/Form/InlineForm';
|
|
4
4
|
import config from '@plone/volto/registry';
|
|
5
5
|
import getSchema from './schema';
|
package/src/Blocks/index.js
CHANGED
package/src/Tableau/Tableau.jsx
CHANGED
|
@@ -9,26 +9,25 @@ import React, {
|
|
|
9
9
|
} from 'react';
|
|
10
10
|
import { connect } from 'react-redux';
|
|
11
11
|
import { toast } from 'react-toastify';
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
toNumber,
|
|
27
|
-
} from 'lodash';
|
|
12
|
+
import isEqual from 'lodash/isEqual';
|
|
13
|
+
import isUndefined from 'lodash/isUndefined';
|
|
14
|
+
import isNaN from 'lodash/isNaN';
|
|
15
|
+
import isNumber from 'lodash/isNumber';
|
|
16
|
+
import forOwn from 'lodash/forOwn';
|
|
17
|
+
import find from 'lodash/find';
|
|
18
|
+
import includes from 'lodash/includes';
|
|
19
|
+
import isArray from 'lodash/isArray';
|
|
20
|
+
import isString from 'lodash/isString';
|
|
21
|
+
import isInteger from 'lodash/isInteger';
|
|
22
|
+
import isBoolean from 'lodash/isBoolean';
|
|
23
|
+
import toString from 'lodash/toString';
|
|
24
|
+
import toInteger from 'lodash/toInteger';
|
|
25
|
+
import toNumber from 'lodash/toNumber';
|
|
28
26
|
import qs from 'qs';
|
|
29
27
|
import cx from 'classnames';
|
|
30
28
|
import { Button } from 'semantic-ui-react';
|
|
31
|
-
import
|
|
29
|
+
import Toast from '@plone/volto/components/manage/Toast/Toast';
|
|
30
|
+
import Icon from '@plone/volto/components/theme/Icon/Icon';
|
|
32
31
|
import {
|
|
33
32
|
FigureNote,
|
|
34
33
|
Sources,
|
package/src/Tableau/helpers.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import reduce from 'lodash/reduce';
|
|
2
|
+
import isUndefined from 'lodash/isUndefined';
|
|
3
|
+
import isString from 'lodash/isString';
|
|
2
4
|
import qs from 'query-string';
|
|
3
5
|
import { pickMetadata } from '@eeacms/volto-embed/helpers';
|
|
4
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { withRouter } from 'react-router';
|
|
3
3
|
import { Container } from 'semantic-ui-react';
|
|
4
|
-
import { hasBlocksData } from '@plone/volto/helpers';
|
|
4
|
+
import { hasBlocksData } from '@plone/volto/helpers/Blocks/Blocks';
|
|
5
5
|
import config from '@plone/volto/registry';
|
|
6
6
|
import RenderBlocks from '@plone/volto/components/theme/View/RenderBlocks';
|
|
7
7
|
import Tableau from '@eeacms/volto-tableau/Tableau/Tableau';
|
|
@@ -7,15 +7,18 @@ import React, { Component } from 'react';
|
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { connect } from 'react-redux';
|
|
9
9
|
import { compose } from 'redux';
|
|
10
|
-
import
|
|
10
|
+
import map from 'lodash/map';
|
|
11
11
|
import { defineMessages, injectIntl } from 'react-intl';
|
|
12
12
|
import {
|
|
13
13
|
getVocabFromHint,
|
|
14
14
|
getVocabFromField,
|
|
15
15
|
getVocabFromItems,
|
|
16
|
-
} from '@plone/volto/helpers';
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
16
|
+
} from '@plone/volto/helpers/Vocabularies/Vocabularies';
|
|
17
|
+
import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
|
|
18
|
+
import {
|
|
19
|
+
getVocabulary,
|
|
20
|
+
getVocabularyTokenTitle,
|
|
21
|
+
} from '@plone/volto/actions/vocabularies/vocabularies';
|
|
19
22
|
import { normalizeValue } from '@plone/volto/components/manage/Widgets/SelectUtils';
|
|
20
23
|
|
|
21
24
|
import {
|
|
@@ -3,10 +3,11 @@ import { withRouter } from 'react-router';
|
|
|
3
3
|
import { connect } from 'react-redux';
|
|
4
4
|
import { injectIntl } from 'react-intl';
|
|
5
5
|
import { compose } from 'redux';
|
|
6
|
-
import
|
|
6
|
+
import isEqual from 'lodash/isEqual';
|
|
7
7
|
import { Modal, Button, Grid } from 'semantic-ui-react';
|
|
8
8
|
import config from '@plone/volto/registry';
|
|
9
|
-
import
|
|
9
|
+
import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
|
|
10
|
+
import InlineForm from '@plone/volto/components/manage/Form/InlineForm';
|
|
10
11
|
import Tableau from '@eeacms/volto-tableau/Tableau/Tableau';
|
|
11
12
|
import getSchema from './schema';
|
|
12
13
|
import {
|
|
@@ -17,7 +18,7 @@ import {
|
|
|
17
18
|
} from '@eeacms/volto-tableau/Tableau/helpers';
|
|
18
19
|
|
|
19
20
|
import '@eeacms/volto-tableau/less/tableau.less';
|
|
20
|
-
import { getBaseUrl } from '@plone/volto/helpers';
|
|
21
|
+
import { getBaseUrl } from '@plone/volto/helpers/Url/Url';
|
|
21
22
|
|
|
22
23
|
function blobToBase64(blob) {
|
|
23
24
|
return new Promise((resolve, reject) => {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { defineMessages } from 'react-intl';
|
|
2
|
-
import
|
|
2
|
+
import find from 'lodash/find';
|
|
3
|
+
import includes from 'lodash/includes';
|
|
4
|
+
import uniq from 'lodash/uniq';
|
|
3
5
|
import { canChangeVizData } from '@eeacms/volto-tableau/Tableau/helpers';
|
|
4
6
|
|
|
5
7
|
const messages = defineMessages({
|
|
File without changes
|
|
File without changes
|