@eeacms/volto-embed 5.0.4 → 6.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/.husky/pre-commit +2 -0
- package/CHANGELOG.md +30 -9
- package/DEVELOP.md +67 -13
- package/README.md +28 -11
- package/RELEASE.md +14 -14
- package/cypress.config.js +2 -2
- package/docker-compose.yml +32 -0
- package/jest-addon.config.js +3 -0
- package/locales/de/LC_MESSAGES/volto.po +67 -0
- package/locales/en/LC_MESSAGES/volto.po +67 -0
- package/locales/it/LC_MESSAGES/volto.po +67 -0
- package/locales/ro/LC_MESSAGES/volto.po +67 -0
- package/locales/volto.pot +69 -0
- package/package.json +38 -13
- package/src/Iframe/EditIframe.test.jsx +88 -0
- package/src/PrivacyProtection/PrivacyProtection.test.jsx +340 -0
- package/src/PrivacyProtection/helpers.test.js +19 -0
- package/.i18n.babel.config.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,36 @@ 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
|
+
### [6.0.1](https://github.com/eea/volto-embed/compare/6.0.0...6.0.1) - 12 October 2023
|
|
8
|
+
|
|
9
|
+
#### :house: Internal changes
|
|
10
|
+
|
|
11
|
+
- chore:volto 16 in tests, update docs, fix stylelint overrides [valentinab25 - [`ab77039`](https://github.com/eea/volto-embed/commit/ab770391a5b212db9b77498738cbf831659caf27)]
|
|
12
|
+
- chore: change volto version in Jenkinsfile [ana-oprea - [`b382243`](https://github.com/eea/volto-embed/commit/b382243a05df7ac778dd33c7f6303aceb2fb06dc)]
|
|
13
|
+
- style: lint-staged reorder in package.json [Alin Voinea - [`81a3585`](https://github.com/eea/volto-embed/commit/81a358528a5212c095ad03fd1af247ed10bb8c55)]
|
|
14
|
+
|
|
15
|
+
#### :house: Documentation changes
|
|
16
|
+
|
|
17
|
+
- docs: Update README and DEVELOP [Alin Voinea - [`838e5ae`](https://github.com/eea/volto-embed/commit/838e5ae54be7fe3779ca2136b20a4a672c5df61f)]
|
|
18
|
+
- docs: Cleanup Makefile, update DEVELOP documentation, i18n - refs #254894 [valentinab25 - [`403a755`](https://github.com/eea/volto-embed/commit/403a7555d7036b3e6f162b2f5278707f9ce9b77c)]
|
|
19
|
+
|
|
20
|
+
#### :hammer_and_wrench: Others
|
|
21
|
+
|
|
22
|
+
- test: EN locales, pre-commit fix, feature PRs checks Refs #257193 [valentinab25 - [`dc2de20`](https://github.com/eea/volto-embed/commit/dc2de2084b53043f240ee1efa2588b5037326ed7)]
|
|
23
|
+
- test: Fix package.json scripts to use makefile [Alin Voinea - [`b4ffca2`](https://github.com/eea/volto-embed/commit/b4ffca24bb8cc4ba2007cc1040cc7b55dc7cc779)]
|
|
24
|
+
- i18n: Add en [Alin Voinea - [`b4e0694`](https://github.com/eea/volto-embed/commit/b4e0694ee40ecc195536fd1826adfab8876c5061)]
|
|
25
|
+
- test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`8f228ca`](https://github.com/eea/volto-embed/commit/8f228ca0644cee0f777a01114895583f387a395c)]
|
|
26
|
+
- test: increase test coverage - refs #254313 [ana-oprea - [`30354d8`](https://github.com/eea/volto-embed/commit/30354d8a10a78e4fc322e37f4be20ff85cd00bbc)]
|
|
27
|
+
## [6.0.0](https://github.com/eea/volto-embed/compare/5.0.4...6.0.0) - 25 July 2023
|
|
28
|
+
|
|
29
|
+
#### :nail_care: Enhancements
|
|
30
|
+
|
|
31
|
+
- refactor: remove countup - refs #254634 [Alin Voinea - [`386028c`](https://github.com/eea/volto-embed/commit/386028cff5f347981123dc96fefa4aa60b47d898)]
|
|
32
|
+
|
|
33
|
+
#### :hammer_and_wrench: Others
|
|
34
|
+
|
|
35
|
+
- Release 6.0.0 [Alin Voinea - [`fd9518c`](https://github.com/eea/volto-embed/commit/fd9518c2e07292562ea0fa409209518ee63650cc)]
|
|
36
|
+
- remove react-countup [Dobricean Ioan Dorian - [`8713115`](https://github.com/eea/volto-embed/commit/8713115396fef6d952891ba142085e559240c2ba)]
|
|
7
37
|
### [5.0.4](https://github.com/eea/volto-embed/compare/5.0.3...5.0.4) - 13 June 2023
|
|
8
38
|
|
|
9
39
|
#### :hammer_and_wrench: Others
|
|
@@ -19,9 +49,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
19
49
|
|
|
20
50
|
- Add react-countup to resolutions [kreafox - [`36eb637`](https://github.com/eea/volto-embed/commit/36eb637c0cb9413b0b0e0ce53e621b2289929d65)]
|
|
21
51
|
- Move generic classes to privacy-protection [kreafox - [`715d559`](https://github.com/eea/volto-embed/commit/715d559e370bf7a3489b64d357b0a6cd7b1a3af2)]
|
|
22
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`5715b4d`](https://github.com/eea/volto-embed/commit/5715b4d3fcc14a34e031c383275c685d88f4db44)]
|
|
23
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`ef24ac0`](https://github.com/eea/volto-embed/commit/ef24ac05b17f4f4dbf05ceafbee677012a7f28f5)]
|
|
24
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`81f957b`](https://github.com/eea/volto-embed/commit/81f957b51aef7be59214530b774de8547bee3f5f)]
|
|
25
52
|
### [5.0.2](https://github.com/eea/volto-embed/compare/5.0.1...5.0.2) - 20 March 2023
|
|
26
53
|
|
|
27
54
|
#### :hammer_and_wrench: Others
|
|
@@ -36,7 +63,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
36
63
|
- update .project.eslintrc.js [Miu Razvan - [`628fd40`](https://github.com/eea/volto-embed/commit/628fd402b00d075ce319b9be92ff5f0e4d0ca2c4)]
|
|
37
64
|
- rename schema.jsx [Miu Razvan - [`62794e3`](https://github.com/eea/volto-embed/commit/62794e398eab5117132e5622cab735f6cf4f79fd)]
|
|
38
65
|
- improving code quality as per sonarqube reported issues [tedw87 - [`c7842f7`](https://github.com/eea/volto-embed/commit/c7842f7795f344e9d30538ddf2da04e97e319ebe)]
|
|
39
|
-
- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`fe3a2de`](https://github.com/eea/volto-embed/commit/fe3a2de6180796c3d6b569733d2b9365a669c23e)]
|
|
40
66
|
## [5.0.0](https://github.com/eea/volto-embed/compare/4.0.4...5.0.0) - 31 October 2022
|
|
41
67
|
|
|
42
68
|
#### :hammer_and_wrench: Others
|
|
@@ -56,8 +82,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
56
82
|
|
|
57
83
|
- use specific alpha for addon test [andreiggr - [`e6df633`](https://github.com/eea/volto-embed/commit/e6df633aa4d2b0ee7eeb6b5aafa21528f14cd1df)]
|
|
58
84
|
- add optional height to privacy container [andreiggr - [`e2ac711`](https://github.com/eea/volto-embed/commit/e2ac711db4e461b474cade42109346a73bb8ecbd)]
|
|
59
|
-
- Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`9f3f358`](https://github.com/eea/volto-embed/commit/9f3f35882fb367d72c7916abe7cbf366dbd8d5b6)]
|
|
60
|
-
- Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`7677140`](https://github.com/eea/volto-embed/commit/767714006abf7cbe336c5ab00d76c7232d5bc798)]
|
|
61
85
|
### [4.0.2](https://github.com/eea/volto-embed/compare/4.0.1...4.0.2) - 15 July 2022
|
|
62
86
|
|
|
63
87
|
#### :hammer_and_wrench: Others
|
|
@@ -97,7 +121,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
97
121
|
|
|
98
122
|
- Update package.json [Nilesh - [`0ec673a`](https://github.com/eea/volto-embed/commit/0ec673a8178731b8c1e010101caee2a3c9fafaca)]
|
|
99
123
|
- Update package.json [Nilesh - [`b8b94ec`](https://github.com/eea/volto-embed/commit/b8b94ec64672229f464b9108b4ac01a848827c00)]
|
|
100
|
-
- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`cfe04d8`](https://github.com/eea/volto-embed/commit/cfe04d885255bb8e472a3b268b98e3d7b9022437)]
|
|
101
124
|
- Refs #142010 - Optimize Volto-addons gitflow pipelines [valentinab25 - [`bf197dd`](https://github.com/eea/volto-embed/commit/bf197dd6516f9c18994add19b1141e061a96e2b6)]
|
|
102
125
|
- no hardcoded text [Daniela Mormocea - [`4001bb4`](https://github.com/eea/volto-embed/commit/4001bb414df05c1516f95e4dcec4a328406dc63f)]
|
|
103
126
|
- fix [Daniela Mormocea - [`a41ca9a`](https://github.com/eea/volto-embed/commit/a41ca9a2795a59f2633fb97938244e335dca8c43)]
|
|
@@ -171,8 +194,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
171
194
|
- revert use of custom bg image [nileshgulia1 - [`63a74b7`](https://github.com/eea/volto-embed/commit/63a74b7e671d85b602b0190c7a18e6d6ad71341b)]
|
|
172
195
|
- PrivacyProtection update & accept bg image [Andrei Grigore - [`f3f05d1`](https://github.com/eea/volto-embed/commit/f3f05d1d21fc88b90de3f68a995242b6c359e03a)]
|
|
173
196
|
- fix loading of cookies [nileshgulia1 - [`46348d8`](https://github.com/eea/volto-embed/commit/46348d8321b4633a3d5fdcbfb2c4f01912d7ed2a)]
|
|
174
|
-
- Add Sonarqube tag using frontend addons list [EEA Jenkins - [`a1e1f50`](https://github.com/eea/volto-embed/commit/a1e1f50db8a1ebc11261c3a24c39687c00ca7eea)]
|
|
175
|
-
- Add Sonarqube tag using frontend addons list [EEA Jenkins - [`1e1471e`](https://github.com/eea/volto-embed/commit/1e1471ebab5ba6e5bf0c231ddd0de94d8fe6c846)]
|
|
176
197
|
### [2.0.1](https://github.com/eea/volto-embed/compare/2.0.0...2.0.1) - 28 May 2021
|
|
177
198
|
|
|
178
199
|
#### :hammer_and_wrench: Others
|
package/DEVELOP.md
CHANGED
|
@@ -2,25 +2,47 @@
|
|
|
2
2
|
|
|
3
3
|
## Develop
|
|
4
4
|
|
|
5
|
+
1. Make sure you have `docker` and `docker compose` installed and running on your machine:
|
|
6
|
+
|
|
7
|
+
```Bash
|
|
8
|
+
git clone https://github.com/eea/volto-embed.git
|
|
9
|
+
cd volto-embed
|
|
10
|
+
git checkout -b bugfix-123456 develop
|
|
11
|
+
make
|
|
12
|
+
make start
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
1. Wait for `Volto started at 0.0.0.0:3000` meesage
|
|
16
|
+
|
|
17
|
+
1. Go to http://localhost:3000
|
|
18
|
+
|
|
19
|
+
1. Initialize git hooks
|
|
20
|
+
|
|
21
|
+
```Bash
|
|
22
|
+
yarn prepare
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
1. Happy hacking!
|
|
26
|
+
|
|
27
|
+
### Or add @eeacms/volto-embed to your Volto project
|
|
28
|
+
|
|
5
29
|
Before starting make sure your development environment is properly set. See [Volto Developer Documentation](https://docs.voltocms.com/getting-started/install/)
|
|
6
30
|
|
|
7
31
|
1. Make sure you have installed `yo`, `@plone/generator-volto` and `mrs-developer`
|
|
8
32
|
|
|
9
|
-
|
|
10
|
-
$ npm install -g @plone/generator-volto
|
|
11
|
-
$ npm install -g mrs-developer
|
|
33
|
+
npm install -g yo @plone/generator-volto mrs-developer
|
|
12
34
|
|
|
13
35
|
1. Create new volto app
|
|
14
36
|
|
|
15
|
-
|
|
16
|
-
|
|
37
|
+
yo @plone/volto my-volto-project --addon @eeacms/volto-embed --skip-install
|
|
38
|
+
cd my-volto-project
|
|
17
39
|
|
|
18
40
|
1. Add the following to `mrs.developer.json`:
|
|
19
41
|
|
|
20
42
|
{
|
|
21
43
|
"volto-embed": {
|
|
22
44
|
"url": "https://github.com/eea/volto-embed.git",
|
|
23
|
-
"package": "volto-embed",
|
|
45
|
+
"package": "@eeacms/volto-embed",
|
|
24
46
|
"branch": "develop",
|
|
25
47
|
"path": "src"
|
|
26
48
|
}
|
|
@@ -28,25 +50,57 @@ Before starting make sure your development environment is properly set. See [Vol
|
|
|
28
50
|
|
|
29
51
|
1. Install
|
|
30
52
|
|
|
31
|
-
|
|
32
|
-
|
|
53
|
+
make develop
|
|
54
|
+
yarn
|
|
33
55
|
|
|
34
56
|
1. Start backend
|
|
35
57
|
|
|
36
|
-
|
|
58
|
+
docker run --pull always -it --rm --name plone -p 8080:8080 -e SITE=Plone plone/plone-backend
|
|
37
59
|
|
|
38
60
|
...wait for backend to setup and start - `Ready to handle requests`:
|
|
39
61
|
|
|
40
|
-
$ docker logs -f plone
|
|
41
|
-
|
|
42
62
|
...you can also check http://localhost:8080/Plone
|
|
43
63
|
|
|
44
64
|
1. Start frontend
|
|
45
65
|
|
|
46
|
-
|
|
66
|
+
yarn start
|
|
47
67
|
|
|
48
68
|
1. Go to http://localhost:3000
|
|
49
69
|
|
|
50
70
|
1. Happy hacking!
|
|
51
71
|
|
|
52
|
-
|
|
72
|
+
cd src/addons/volto-embed/
|
|
73
|
+
|
|
74
|
+
## Cypress
|
|
75
|
+
|
|
76
|
+
To run cypress locally, first make sure you don't have any Volto/Plone running on ports `8080` and `3000`.
|
|
77
|
+
|
|
78
|
+
You don't have to be in a `clean-volto-project`, you can be in any Volto Frontend
|
|
79
|
+
project where you added `volto-embed` to `mrs.developer.json`
|
|
80
|
+
|
|
81
|
+
Go to:
|
|
82
|
+
|
|
83
|
+
```BASH
|
|
84
|
+
cd src/addons/volto-embed/
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Start:
|
|
88
|
+
|
|
89
|
+
```Bash
|
|
90
|
+
make
|
|
91
|
+
make start
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
This will build and start with Docker a clean `Plone backend` and `Volto Frontend` with `volto-embed` block installed.
|
|
95
|
+
|
|
96
|
+
Open Cypress Interface:
|
|
97
|
+
|
|
98
|
+
```Bash
|
|
99
|
+
make cypress-open
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Or run it:
|
|
103
|
+
|
|
104
|
+
```Bash
|
|
105
|
+
make cypress-run
|
|
106
|
+
```
|
package/README.md
CHANGED
|
@@ -29,33 +29,50 @@ See `src/Iframe/ViewIframe` for details on how to implement.
|
|
|
29
29
|
|
|
30
30
|
## Getting started
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
### Try volto-embed with Docker
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
git clone https://github.com/eea/volto-embed.git
|
|
35
|
+
cd volto-embed
|
|
36
|
+
make
|
|
37
|
+
make start
|
|
38
|
+
|
|
39
|
+
Go to http://localhost:3000
|
|
40
|
+
|
|
41
|
+
### Add volto-embed to your Volto project
|
|
37
42
|
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
1. Make sure you have a [Plone backend](https://plone.org/download) up-and-running at http://localhost:8080/Plone
|
|
44
|
+
|
|
45
|
+
```Bash
|
|
46
|
+
docker compose up backend
|
|
40
47
|
```
|
|
41
48
|
|
|
42
|
-
1.
|
|
49
|
+
1. Start Volto frontend
|
|
50
|
+
|
|
51
|
+
* If you already have a volto project, just update `package.json`:
|
|
43
52
|
|
|
44
53
|
```JSON
|
|
45
54
|
"addons": [
|
|
46
|
-
|
|
55
|
+
"@eeacms/volto-embed"
|
|
47
56
|
],
|
|
48
57
|
|
|
49
58
|
"dependencies": {
|
|
50
|
-
|
|
59
|
+
"@eeacms/volto-embed": "*"
|
|
51
60
|
}
|
|
52
61
|
```
|
|
53
62
|
|
|
63
|
+
* If not, create one:
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
npm install -g yo @plone/generator-volto
|
|
67
|
+
yo @plone/volto my-volto-project --canary --addon @eeacms/volto-embed
|
|
68
|
+
cd my-volto-project
|
|
69
|
+
```
|
|
70
|
+
|
|
54
71
|
1. Install new add-ons and restart Volto:
|
|
55
72
|
|
|
56
73
|
```
|
|
57
|
-
|
|
58
|
-
|
|
74
|
+
yarn
|
|
75
|
+
yarn start
|
|
59
76
|
```
|
|
60
77
|
|
|
61
78
|
1. Go to http://localhost:3000
|
package/RELEASE.md
CHANGED
|
@@ -20,9 +20,9 @@ You need to first install the [release-it](https://github.com/release-it/release
|
|
|
20
20
|
```
|
|
21
21
|
npm install -g release-it
|
|
22
22
|
```
|
|
23
|
-
|
|
23
|
+
|
|
24
24
|
Release-it uses the configuration written in the [`.release-it.json`](./.release-it.json) file located in the root of the repository.
|
|
25
|
-
|
|
25
|
+
|
|
26
26
|
Release-it is a tool that automates 4 important steps in the release process:
|
|
27
27
|
|
|
28
28
|
1. Version increase in `package.json` ( increased from the current version in `package.json`)
|
|
@@ -30,45 +30,45 @@ Release-it is a tool that automates 4 important steps in the release process:
|
|
|
30
30
|
3. GitHub release on the commit with the changelog and package.json modification on the develop branch
|
|
31
31
|
4. NPM release ( by default it's disabled, but can be enabled in the configuration file )
|
|
32
32
|
|
|
33
|
-
To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
|
|
33
|
+
To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
|
|
34
34
|
|
|
35
35
|
```
|
|
36
36
|
export GITHUB_TOKEN=XXX-XXXXXXXXXXXXXXXXXXXXXX
|
|
37
37
|
```
|
|
38
|
-
|
|
38
|
+
|
|
39
39
|
To configure npm, you can use the `npm login` command or use a configuration file with a TOKEN :
|
|
40
|
-
|
|
40
|
+
|
|
41
41
|
```
|
|
42
42
|
echo "//registry.npmjs.org/:_authToken=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" > .npmrc
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
#### Using release-it tool
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
There are 3 yarn scripts that can be run to do the release
|
|
48
48
|
|
|
49
49
|
##### yarn release-beta
|
|
50
50
|
|
|
51
|
-
Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).
|
|
51
|
+
Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).
|
|
52
52
|
|
|
53
53
|
```
|
|
54
|
-
? Select increment (next version):
|
|
55
|
-
❯ prepatch (0.1.1-beta.0)
|
|
56
|
-
preminor (0.2.0-beta.0)
|
|
57
|
-
premajor (1.0.0-beta.0)
|
|
58
|
-
Other, please specify...
|
|
54
|
+
? Select increment (next version):
|
|
55
|
+
❯ prepatch (0.1.1-beta.0)
|
|
56
|
+
preminor (0.2.0-beta.0)
|
|
57
|
+
premajor (1.0.0-beta.0)
|
|
58
|
+
Other, please specify...
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
##### yarn release-major-beta
|
|
62
62
|
|
|
63
63
|
Same as `yarn release-beta`, but with premajor version pre-selected.
|
|
64
|
-
|
|
64
|
+
|
|
65
65
|
##### yarn release
|
|
66
66
|
|
|
67
67
|
Generic command, does not automatically add the `beta` to version, but you can still manually write it if you choose Other.
|
|
68
68
|
|
|
69
69
|
#### Important notes
|
|
70
70
|
|
|
71
|
-
> Do not use release-it tool on master branch, the commit on CHANGELOG.md file and the version increase in the package.json file can't be done without a PULL REQUEST.
|
|
71
|
+
> Do not use release-it tool on master branch, the commit on CHANGELOG.md file and the version increase in the package.json file can't be done without a PULL REQUEST.
|
|
72
72
|
|
|
73
73
|
> Do not keep Pull Requests from develop to master branches open when you are doing beta releases from the develop branch. As long as a PR to master is open, an automatic script will run on every commit and will update both the version and the changelog to a production-ready state - ( MAJOR.MINOR.PATCH mandatory format for version).
|
|
74
74
|
|
package/cypress.config.js
CHANGED
|
@@ -2,12 +2,12 @@ const { defineConfig } = require('cypress');
|
|
|
2
2
|
|
|
3
3
|
module.exports = defineConfig({
|
|
4
4
|
viewportWidth: 1280,
|
|
5
|
-
defaultCommandTimeout:
|
|
5
|
+
defaultCommandTimeout: 5000,
|
|
6
6
|
chromeWebSecurity: false,
|
|
7
7
|
reporter: 'junit',
|
|
8
8
|
video: true,
|
|
9
9
|
retries: {
|
|
10
|
-
runMode:
|
|
10
|
+
runMode: 1,
|
|
11
11
|
openMode: 0,
|
|
12
12
|
},
|
|
13
13
|
reporterOptions: {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
version: "3"
|
|
2
|
+
services:
|
|
3
|
+
backend:
|
|
4
|
+
image: eeacms/plone-backend
|
|
5
|
+
ports:
|
|
6
|
+
- "8080:8080"
|
|
7
|
+
environment:
|
|
8
|
+
SITE: "Plone"
|
|
9
|
+
PROFILES: "eea.kitkat:testing"
|
|
10
|
+
|
|
11
|
+
frontend:
|
|
12
|
+
build:
|
|
13
|
+
context: ./
|
|
14
|
+
dockerfile: ./Dockerfile
|
|
15
|
+
args:
|
|
16
|
+
ADDON_NAME: "${ADDON_NAME}"
|
|
17
|
+
ADDON_PATH: "${ADDON_PATH}"
|
|
18
|
+
VOLTO_VERSION: ${VOLTO_VERSION:-16}
|
|
19
|
+
ports:
|
|
20
|
+
- "3000:3000"
|
|
21
|
+
- "3001:3001"
|
|
22
|
+
depends_on:
|
|
23
|
+
- backend
|
|
24
|
+
volumes:
|
|
25
|
+
- ./:/app/src/addons/${ADDON_PATH}
|
|
26
|
+
environment:
|
|
27
|
+
CI: "true"
|
|
28
|
+
NODE_ENV: "development"
|
|
29
|
+
RAZZLE_JEST_CONFIG: "src/addons/${ADDON_PATH}/jest-addon.config.js"
|
|
30
|
+
RAZZLE_INTERNAL_API_PATH: "http://backend:8080/Plone"
|
|
31
|
+
RAZZLE_DEV_PROXY_API_PATH: "http://backend:8080/Plone"
|
|
32
|
+
HOST: "0.0.0.0"
|
package/jest-addon.config.js
CHANGED
|
@@ -25,6 +25,9 @@ module.exports = {
|
|
|
25
25
|
'^.+\\.(jpg)$': 'jest-file',
|
|
26
26
|
'^.+\\.(svg)$': './node_modules/@plone/volto/jest-svgsystem-transform.js',
|
|
27
27
|
},
|
|
28
|
+
transformIgnorePatterns: [
|
|
29
|
+
'node_modules/(?!@eeacms)/volto-datablocks/helpers',
|
|
30
|
+
],
|
|
28
31
|
coverageThreshold: {
|
|
29
32
|
global: {
|
|
30
33
|
branches: 5,
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
msgid ""
|
|
2
|
+
msgstr ""
|
|
3
|
+
"Project-Id-Version: \n"
|
|
4
|
+
"Report-Msgid-Bugs-To: \n"
|
|
5
|
+
"POT-Creation-Date: \n"
|
|
6
|
+
"PO-Revision-Date: \n"
|
|
7
|
+
"Last-Translator: \n"
|
|
8
|
+
"Language: \n"
|
|
9
|
+
"Language-Team: \n"
|
|
10
|
+
"Content-Type: \n"
|
|
11
|
+
"Content-Transfer-Encoding: \n"
|
|
12
|
+
"Plural-Forms: \n"
|
|
13
|
+
|
|
14
|
+
#: Iframe/EditIframe
|
|
15
|
+
# defaultMessage: Center
|
|
16
|
+
msgid "Center"
|
|
17
|
+
msgstr ""
|
|
18
|
+
|
|
19
|
+
#: Iframe/EditIframe
|
|
20
|
+
# defaultMessage: Embed code error, please follow the instructions and try again.
|
|
21
|
+
msgid "Embed code error, please follow the instructions and try again."
|
|
22
|
+
msgstr ""
|
|
23
|
+
|
|
24
|
+
#: Iframe/ViewIframe
|
|
25
|
+
# defaultMessage: Embeded Google Maps
|
|
26
|
+
msgid "Embeded Google Maps"
|
|
27
|
+
msgstr ""
|
|
28
|
+
|
|
29
|
+
#: Iframe/EditIframe
|
|
30
|
+
# defaultMessage: Enter map Embed Code
|
|
31
|
+
msgid "Enter map Embed Code"
|
|
32
|
+
msgstr ""
|
|
33
|
+
|
|
34
|
+
#: Iframe/EditIframe
|
|
35
|
+
# defaultMessage: Full
|
|
36
|
+
msgid "Full"
|
|
37
|
+
msgstr ""
|
|
38
|
+
|
|
39
|
+
#: Iframe/EditIframe
|
|
40
|
+
# defaultMessage: Google Maps Embedded Block
|
|
41
|
+
msgid "Google Maps Embedded Block"
|
|
42
|
+
msgstr ""
|
|
43
|
+
|
|
44
|
+
#: Iframe/EditIframe
|
|
45
|
+
# defaultMessage: Left
|
|
46
|
+
msgid "Left"
|
|
47
|
+
msgstr ""
|
|
48
|
+
|
|
49
|
+
#: PrivacyProtection/PrivacyProtection
|
|
50
|
+
# defaultMessage: Live image generated
|
|
51
|
+
msgid "Live image generated"
|
|
52
|
+
msgstr ""
|
|
53
|
+
|
|
54
|
+
#: Iframe/EditIframe
|
|
55
|
+
# defaultMessage: Please enter the Embed Code provided by Google Maps -> Share -> Embed map. It should contain the <iframe> code on it.
|
|
56
|
+
msgid "Please enter the Embed Code provided by Google Maps -> Share -> Embed map. It should contain the <iframe> code on it."
|
|
57
|
+
msgstr ""
|
|
58
|
+
|
|
59
|
+
#: Iframe/EditIframe
|
|
60
|
+
# defaultMessage: Right
|
|
61
|
+
msgid "Right"
|
|
62
|
+
msgstr ""
|
|
63
|
+
|
|
64
|
+
#: PrivacyProtection/PrivacyProtection
|
|
65
|
+
# defaultMessage: Success
|
|
66
|
+
msgid "Success"
|
|
67
|
+
msgstr ""
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
msgid ""
|
|
2
|
+
msgstr ""
|
|
3
|
+
"Project-Id-Version: \n"
|
|
4
|
+
"Report-Msgid-Bugs-To: \n"
|
|
5
|
+
"POT-Creation-Date: \n"
|
|
6
|
+
"PO-Revision-Date: \n"
|
|
7
|
+
"Last-Translator: \n"
|
|
8
|
+
"Language: \n"
|
|
9
|
+
"Language-Team: \n"
|
|
10
|
+
"Content-Type: \n"
|
|
11
|
+
"Content-Transfer-Encoding: \n"
|
|
12
|
+
"Plural-Forms: \n"
|
|
13
|
+
|
|
14
|
+
#: Iframe/EditIframe
|
|
15
|
+
# defaultMessage: Center
|
|
16
|
+
msgid "Center"
|
|
17
|
+
msgstr ""
|
|
18
|
+
|
|
19
|
+
#: Iframe/EditIframe
|
|
20
|
+
# defaultMessage: Embed code error, please follow the instructions and try again.
|
|
21
|
+
msgid "Embed code error, please follow the instructions and try again."
|
|
22
|
+
msgstr ""
|
|
23
|
+
|
|
24
|
+
#: Iframe/ViewIframe
|
|
25
|
+
# defaultMessage: Embeded Google Maps
|
|
26
|
+
msgid "Embeded Google Maps"
|
|
27
|
+
msgstr ""
|
|
28
|
+
|
|
29
|
+
#: Iframe/EditIframe
|
|
30
|
+
# defaultMessage: Enter map Embed Code
|
|
31
|
+
msgid "Enter map Embed Code"
|
|
32
|
+
msgstr ""
|
|
33
|
+
|
|
34
|
+
#: Iframe/EditIframe
|
|
35
|
+
# defaultMessage: Full
|
|
36
|
+
msgid "Full"
|
|
37
|
+
msgstr ""
|
|
38
|
+
|
|
39
|
+
#: Iframe/EditIframe
|
|
40
|
+
# defaultMessage: Google Maps Embedded Block
|
|
41
|
+
msgid "Google Maps Embedded Block"
|
|
42
|
+
msgstr ""
|
|
43
|
+
|
|
44
|
+
#: Iframe/EditIframe
|
|
45
|
+
# defaultMessage: Left
|
|
46
|
+
msgid "Left"
|
|
47
|
+
msgstr ""
|
|
48
|
+
|
|
49
|
+
#: PrivacyProtection/PrivacyProtection
|
|
50
|
+
# defaultMessage: Live image generated
|
|
51
|
+
msgid "Live image generated"
|
|
52
|
+
msgstr ""
|
|
53
|
+
|
|
54
|
+
#: Iframe/EditIframe
|
|
55
|
+
# defaultMessage: Please enter the Embed Code provided by Google Maps -> Share -> Embed map. It should contain the <iframe> code on it.
|
|
56
|
+
msgid "Please enter the Embed Code provided by Google Maps -> Share -> Embed map. It should contain the <iframe> code on it."
|
|
57
|
+
msgstr ""
|
|
58
|
+
|
|
59
|
+
#: Iframe/EditIframe
|
|
60
|
+
# defaultMessage: Right
|
|
61
|
+
msgid "Right"
|
|
62
|
+
msgstr ""
|
|
63
|
+
|
|
64
|
+
#: PrivacyProtection/PrivacyProtection
|
|
65
|
+
# defaultMessage: Success
|
|
66
|
+
msgid "Success"
|
|
67
|
+
msgstr ""
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
msgid ""
|
|
2
|
+
msgstr ""
|
|
3
|
+
"Project-Id-Version: \n"
|
|
4
|
+
"Report-Msgid-Bugs-To: \n"
|
|
5
|
+
"POT-Creation-Date: \n"
|
|
6
|
+
"PO-Revision-Date: \n"
|
|
7
|
+
"Last-Translator: \n"
|
|
8
|
+
"Language: \n"
|
|
9
|
+
"Language-Team: \n"
|
|
10
|
+
"Content-Type: \n"
|
|
11
|
+
"Content-Transfer-Encoding: \n"
|
|
12
|
+
"Plural-Forms: \n"
|
|
13
|
+
|
|
14
|
+
#: Iframe/EditIframe
|
|
15
|
+
# defaultMessage: Center
|
|
16
|
+
msgid "Center"
|
|
17
|
+
msgstr ""
|
|
18
|
+
|
|
19
|
+
#: Iframe/EditIframe
|
|
20
|
+
# defaultMessage: Embed code error, please follow the instructions and try again.
|
|
21
|
+
msgid "Embed code error, please follow the instructions and try again."
|
|
22
|
+
msgstr ""
|
|
23
|
+
|
|
24
|
+
#: Iframe/ViewIframe
|
|
25
|
+
# defaultMessage: Embeded Google Maps
|
|
26
|
+
msgid "Embeded Google Maps"
|
|
27
|
+
msgstr ""
|
|
28
|
+
|
|
29
|
+
#: Iframe/EditIframe
|
|
30
|
+
# defaultMessage: Enter map Embed Code
|
|
31
|
+
msgid "Enter map Embed Code"
|
|
32
|
+
msgstr ""
|
|
33
|
+
|
|
34
|
+
#: Iframe/EditIframe
|
|
35
|
+
# defaultMessage: Full
|
|
36
|
+
msgid "Full"
|
|
37
|
+
msgstr ""
|
|
38
|
+
|
|
39
|
+
#: Iframe/EditIframe
|
|
40
|
+
# defaultMessage: Google Maps Embedded Block
|
|
41
|
+
msgid "Google Maps Embedded Block"
|
|
42
|
+
msgstr ""
|
|
43
|
+
|
|
44
|
+
#: Iframe/EditIframe
|
|
45
|
+
# defaultMessage: Left
|
|
46
|
+
msgid "Left"
|
|
47
|
+
msgstr ""
|
|
48
|
+
|
|
49
|
+
#: PrivacyProtection/PrivacyProtection
|
|
50
|
+
# defaultMessage: Live image generated
|
|
51
|
+
msgid "Live image generated"
|
|
52
|
+
msgstr ""
|
|
53
|
+
|
|
54
|
+
#: Iframe/EditIframe
|
|
55
|
+
# defaultMessage: Please enter the Embed Code provided by Google Maps -> Share -> Embed map. It should contain the <iframe> code on it.
|
|
56
|
+
msgid "Please enter the Embed Code provided by Google Maps -> Share -> Embed map. It should contain the <iframe> code on it."
|
|
57
|
+
msgstr ""
|
|
58
|
+
|
|
59
|
+
#: Iframe/EditIframe
|
|
60
|
+
# defaultMessage: Right
|
|
61
|
+
msgid "Right"
|
|
62
|
+
msgstr ""
|
|
63
|
+
|
|
64
|
+
#: PrivacyProtection/PrivacyProtection
|
|
65
|
+
# defaultMessage: Success
|
|
66
|
+
msgid "Success"
|
|
67
|
+
msgstr ""
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
msgid ""
|
|
2
|
+
msgstr ""
|
|
3
|
+
"Project-Id-Version: \n"
|
|
4
|
+
"Report-Msgid-Bugs-To: \n"
|
|
5
|
+
"POT-Creation-Date: \n"
|
|
6
|
+
"PO-Revision-Date: \n"
|
|
7
|
+
"Last-Translator: \n"
|
|
8
|
+
"Language: \n"
|
|
9
|
+
"Language-Team: \n"
|
|
10
|
+
"Content-Type: \n"
|
|
11
|
+
"Content-Transfer-Encoding: \n"
|
|
12
|
+
"Plural-Forms: \n"
|
|
13
|
+
|
|
14
|
+
#: Iframe/EditIframe
|
|
15
|
+
# defaultMessage: Center
|
|
16
|
+
msgid "Center"
|
|
17
|
+
msgstr ""
|
|
18
|
+
|
|
19
|
+
#: Iframe/EditIframe
|
|
20
|
+
# defaultMessage: Embed code error, please follow the instructions and try again.
|
|
21
|
+
msgid "Embed code error, please follow the instructions and try again."
|
|
22
|
+
msgstr ""
|
|
23
|
+
|
|
24
|
+
#: Iframe/ViewIframe
|
|
25
|
+
# defaultMessage: Embeded Google Maps
|
|
26
|
+
msgid "Embeded Google Maps"
|
|
27
|
+
msgstr ""
|
|
28
|
+
|
|
29
|
+
#: Iframe/EditIframe
|
|
30
|
+
# defaultMessage: Enter map Embed Code
|
|
31
|
+
msgid "Enter map Embed Code"
|
|
32
|
+
msgstr ""
|
|
33
|
+
|
|
34
|
+
#: Iframe/EditIframe
|
|
35
|
+
# defaultMessage: Full
|
|
36
|
+
msgid "Full"
|
|
37
|
+
msgstr ""
|
|
38
|
+
|
|
39
|
+
#: Iframe/EditIframe
|
|
40
|
+
# defaultMessage: Google Maps Embedded Block
|
|
41
|
+
msgid "Google Maps Embedded Block"
|
|
42
|
+
msgstr ""
|
|
43
|
+
|
|
44
|
+
#: Iframe/EditIframe
|
|
45
|
+
# defaultMessage: Left
|
|
46
|
+
msgid "Left"
|
|
47
|
+
msgstr ""
|
|
48
|
+
|
|
49
|
+
#: PrivacyProtection/PrivacyProtection
|
|
50
|
+
# defaultMessage: Live image generated
|
|
51
|
+
msgid "Live image generated"
|
|
52
|
+
msgstr ""
|
|
53
|
+
|
|
54
|
+
#: Iframe/EditIframe
|
|
55
|
+
# defaultMessage: Please enter the Embed Code provided by Google Maps -> Share -> Embed map. It should contain the <iframe> code on it.
|
|
56
|
+
msgid "Please enter the Embed Code provided by Google Maps -> Share -> Embed map. It should contain the <iframe> code on it."
|
|
57
|
+
msgstr ""
|
|
58
|
+
|
|
59
|
+
#: Iframe/EditIframe
|
|
60
|
+
# defaultMessage: Right
|
|
61
|
+
msgid "Right"
|
|
62
|
+
msgstr ""
|
|
63
|
+
|
|
64
|
+
#: PrivacyProtection/PrivacyProtection
|
|
65
|
+
# defaultMessage: Success
|
|
66
|
+
msgid "Success"
|
|
67
|
+
msgstr ""
|
package/locales/volto.pot
CHANGED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
msgid ""
|
|
2
|
+
msgstr ""
|
|
3
|
+
"Project-Id-Version: Plone\n"
|
|
4
|
+
"POT-Creation-Date: 2023-08-29T17:13:33.263Z\n"
|
|
5
|
+
"Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
|
|
6
|
+
"Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
|
|
7
|
+
"MIME-Version: 1.0\n"
|
|
8
|
+
"Content-Type: text/plain; charset=utf-8\n"
|
|
9
|
+
"Content-Transfer-Encoding: 8bit\n"
|
|
10
|
+
"Plural-Forms: nplurals=1; plural=0;\n"
|
|
11
|
+
"Language-Code: en\n"
|
|
12
|
+
"Language-Name: English\n"
|
|
13
|
+
"Preferred-Encodings: utf-8\n"
|
|
14
|
+
"Domain: volto\n"
|
|
15
|
+
|
|
16
|
+
#: Iframe/EditIframe
|
|
17
|
+
# defaultMessage: Center
|
|
18
|
+
msgid "Center"
|
|
19
|
+
msgstr ""
|
|
20
|
+
|
|
21
|
+
#: Iframe/EditIframe
|
|
22
|
+
# defaultMessage: Embed code error, please follow the instructions and try again.
|
|
23
|
+
msgid "Embed code error, please follow the instructions and try again."
|
|
24
|
+
msgstr ""
|
|
25
|
+
|
|
26
|
+
#: Iframe/ViewIframe
|
|
27
|
+
# defaultMessage: Embeded Google Maps
|
|
28
|
+
msgid "Embeded Google Maps"
|
|
29
|
+
msgstr ""
|
|
30
|
+
|
|
31
|
+
#: Iframe/EditIframe
|
|
32
|
+
# defaultMessage: Enter map Embed Code
|
|
33
|
+
msgid "Enter map Embed Code"
|
|
34
|
+
msgstr ""
|
|
35
|
+
|
|
36
|
+
#: Iframe/EditIframe
|
|
37
|
+
# defaultMessage: Full
|
|
38
|
+
msgid "Full"
|
|
39
|
+
msgstr ""
|
|
40
|
+
|
|
41
|
+
#: Iframe/EditIframe
|
|
42
|
+
# defaultMessage: Google Maps Embedded Block
|
|
43
|
+
msgid "Google Maps Embedded Block"
|
|
44
|
+
msgstr ""
|
|
45
|
+
|
|
46
|
+
#: Iframe/EditIframe
|
|
47
|
+
# defaultMessage: Left
|
|
48
|
+
msgid "Left"
|
|
49
|
+
msgstr ""
|
|
50
|
+
|
|
51
|
+
#: PrivacyProtection/PrivacyProtection
|
|
52
|
+
# defaultMessage: Live image generated
|
|
53
|
+
msgid "Live image generated"
|
|
54
|
+
msgstr ""
|
|
55
|
+
|
|
56
|
+
#: Iframe/EditIframe
|
|
57
|
+
# defaultMessage: Please enter the Embed Code provided by Google Maps -> Share -> Embed map. It should contain the <iframe> code on it.
|
|
58
|
+
msgid "Please enter the Embed Code provided by Google Maps -> Share -> Embed map. It should contain the <iframe> code on it."
|
|
59
|
+
msgstr ""
|
|
60
|
+
|
|
61
|
+
#: Iframe/EditIframe
|
|
62
|
+
# defaultMessage: Right
|
|
63
|
+
msgid "Right"
|
|
64
|
+
msgstr ""
|
|
65
|
+
|
|
66
|
+
#: PrivacyProtection/PrivacyProtection
|
|
67
|
+
# defaultMessage: Success
|
|
68
|
+
msgid "Success"
|
|
69
|
+
msgstr ""
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eeacms/volto-embed",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.1",
|
|
4
4
|
"description": "Embed external content",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"author": "European Environment Agency: IDM2 A-Team",
|
|
@@ -18,9 +18,6 @@
|
|
|
18
18
|
"@eeacms/volto-corsproxy",
|
|
19
19
|
"@eeacms/volto-datablocks"
|
|
20
20
|
],
|
|
21
|
-
"resolutions": {
|
|
22
|
-
"react-countup/countup.js": "2.5.0"
|
|
23
|
-
},
|
|
24
21
|
"dependencies": {
|
|
25
22
|
"@eeacms/volto-corsproxy": "*",
|
|
26
23
|
"@eeacms/volto-datablocks": "*",
|
|
@@ -30,21 +27,49 @@
|
|
|
30
27
|
"@cypress/code-coverage": "^3.10.0",
|
|
31
28
|
"@plone/scripts": "*",
|
|
32
29
|
"babel-plugin-transform-class-properties": "^6.24.1",
|
|
30
|
+
"husky": "*",
|
|
31
|
+
"lint-staged": "*",
|
|
33
32
|
"md5": "^2.3.0"
|
|
34
33
|
},
|
|
34
|
+
"lint-staged": {
|
|
35
|
+
"src/**/*.{js,jsx,ts,tsx,json}": [
|
|
36
|
+
"make lint-fix",
|
|
37
|
+
"make prettier-fix"
|
|
38
|
+
],
|
|
39
|
+
"src/**/*.{jsx}": [
|
|
40
|
+
"make i18n"
|
|
41
|
+
],
|
|
42
|
+
"theme/**/*.{css,less}": [
|
|
43
|
+
"make stylelint-fix"
|
|
44
|
+
],
|
|
45
|
+
"src/**/*.{css,less}": [
|
|
46
|
+
"make stylelint-fix"
|
|
47
|
+
],
|
|
48
|
+
"theme/**/*.overrides": [
|
|
49
|
+
"make stylelint-fix"
|
|
50
|
+
],
|
|
51
|
+
"src/**/*.overrides": [
|
|
52
|
+
"make stylelint-fix"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
35
55
|
"scripts": {
|
|
36
56
|
"release": "release-it",
|
|
37
57
|
"release-major-beta": "release-it major --preRelease=beta",
|
|
38
58
|
"release-beta": "release-it --preRelease=beta",
|
|
39
59
|
"bootstrap": "npm install -g ejs; npm link ejs; node bootstrap",
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
60
|
+
"test": "make test",
|
|
61
|
+
"test:fix": "make test-update",
|
|
62
|
+
"pre-commit": "yarn stylelint:fix && yarn prettier:fix && yarn lint:fix",
|
|
63
|
+
"stylelint": "make stylelint",
|
|
64
|
+
"stylelint:overrides": "make stylelint-overrides",
|
|
65
|
+
"stylelint:fix": "make stylelint-fix",
|
|
66
|
+
"prettier": "make prettier",
|
|
67
|
+
"prettier:fix": "make prettier-fix",
|
|
68
|
+
"lint": "make lint",
|
|
69
|
+
"lint:fix": "make lint-fix",
|
|
70
|
+
"i18n": "make i18n",
|
|
71
|
+
"cypress:run": "make cypress-run",
|
|
72
|
+
"cypress:open": "make cypress-open",
|
|
73
|
+
"prepare": "husky install"
|
|
49
74
|
}
|
|
50
75
|
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, fireEvent } from '@testing-library/react';
|
|
3
|
+
import { Provider } from 'react-intl-redux';
|
|
4
|
+
import configureStore from 'redux-mock-store';
|
|
5
|
+
import Edit from './EditIframe';
|
|
6
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
7
|
+
|
|
8
|
+
const mockStore = configureStore();
|
|
9
|
+
|
|
10
|
+
const store = mockStore(() => ({
|
|
11
|
+
connected_data_parameters: {},
|
|
12
|
+
router: {
|
|
13
|
+
location: {
|
|
14
|
+
pathname: '',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
intl: {
|
|
18
|
+
locale: 'en',
|
|
19
|
+
messages: {},
|
|
20
|
+
},
|
|
21
|
+
}));
|
|
22
|
+
|
|
23
|
+
describe('Edit', () => {
|
|
24
|
+
it('renders without crashing', () => {
|
|
25
|
+
render(
|
|
26
|
+
<Provider store={store}>
|
|
27
|
+
<Provider store={store}>
|
|
28
|
+
<Edit
|
|
29
|
+
selected={false}
|
|
30
|
+
block="block"
|
|
31
|
+
index={1}
|
|
32
|
+
data={{
|
|
33
|
+
url: 'test',
|
|
34
|
+
}}
|
|
35
|
+
pathname="/"
|
|
36
|
+
onChangeBlock={() => {}}
|
|
37
|
+
onSelectBlock={() => {}}
|
|
38
|
+
onDeleteBlock={() => {}}
|
|
39
|
+
onFocusPreviousBlock={() => {}}
|
|
40
|
+
onFocusNextBlock={() => {}}
|
|
41
|
+
handleKeyDown={() => {}}
|
|
42
|
+
/>
|
|
43
|
+
</Provider>
|
|
44
|
+
</Provider>,
|
|
45
|
+
);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('submits url when button is clicked', () => {
|
|
49
|
+
const { container, getByPlaceholderText } = render(
|
|
50
|
+
<Provider store={store}>
|
|
51
|
+
<Provider store={store}>
|
|
52
|
+
<Edit
|
|
53
|
+
selected={false}
|
|
54
|
+
block="block"
|
|
55
|
+
index={1}
|
|
56
|
+
data={{
|
|
57
|
+
dataprotection: {
|
|
58
|
+
privacy_statement: 'test',
|
|
59
|
+
},
|
|
60
|
+
}}
|
|
61
|
+
pathname="/"
|
|
62
|
+
onChangeBlock={() => {}}
|
|
63
|
+
onSelectBlock={() => {}}
|
|
64
|
+
onDeleteBlock={() => {}}
|
|
65
|
+
onFocusPreviousBlock={() => {}}
|
|
66
|
+
onFocusNextBlock={() => {}}
|
|
67
|
+
handleKeyDown={() => {}}
|
|
68
|
+
/>
|
|
69
|
+
</Provider>
|
|
70
|
+
</Provider>,
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
const input = getByPlaceholderText('Enter map Embed Code');
|
|
74
|
+
fireEvent.click(input);
|
|
75
|
+
fireEvent.change(input, { target: { value: 'test url' } });
|
|
76
|
+
fireEvent.click(container.querySelector('button.cancel'));
|
|
77
|
+
fireEvent.change(input, { target: { value: 'test url' } });
|
|
78
|
+
fireEvent.keyDown(input, { key: 'Enter', code: 'Enter' });
|
|
79
|
+
fireEvent.keyDown(input, { key: 'Escape', code: 'Escape' });
|
|
80
|
+
fireEvent.keyDown(input, { key: 'KeyA', code: 'KeyA' });
|
|
81
|
+
|
|
82
|
+
fireEvent.change(input, { target: { value: '<iframe src="test"/>' } });
|
|
83
|
+
fireEvent.keyDown(input, { key: 'Enter', code: 'Enter' });
|
|
84
|
+
|
|
85
|
+
const button = container.querySelector('button.ui.basic.primary.button');
|
|
86
|
+
fireEvent.click(button);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, fireEvent, act } from '@testing-library/react';
|
|
3
|
+
import { CookiesProvider } from 'react-cookie';
|
|
4
|
+
import { Provider } from 'react-intl-redux';
|
|
5
|
+
import configureStore from 'redux-mock-store';
|
|
6
|
+
import PrivacyProtection from './PrivacyProtection';
|
|
7
|
+
import config from '@plone/volto/registry';
|
|
8
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
9
|
+
|
|
10
|
+
const mockStore = configureStore();
|
|
11
|
+
|
|
12
|
+
const store = mockStore(() => ({
|
|
13
|
+
connected_data_parameters: {},
|
|
14
|
+
router: {
|
|
15
|
+
location: {
|
|
16
|
+
pathname: '',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
intl: {
|
|
20
|
+
locale: 'en',
|
|
21
|
+
messages: {},
|
|
22
|
+
},
|
|
23
|
+
}));
|
|
24
|
+
|
|
25
|
+
jest.mock('@plone/volto-slate/editor/render', () => ({
|
|
26
|
+
serializeNodes: jest.fn(() => 'serialized nodes'),
|
|
27
|
+
}));
|
|
28
|
+
|
|
29
|
+
jest.mock('@eeacms/volto-datablocks/helpers', () => ({
|
|
30
|
+
getFilteredURL: jest.fn(() => 'filtered url'),
|
|
31
|
+
getConnectedDataParametersForContext: jest.fn(() => 'connected data params'),
|
|
32
|
+
}));
|
|
33
|
+
|
|
34
|
+
global.fetch = jest.fn(() =>
|
|
35
|
+
Promise.resolve({
|
|
36
|
+
blob: () => Promise.resolve(new Blob(['test'])),
|
|
37
|
+
}),
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
jest.mock('react-toastify', () => ({
|
|
41
|
+
toast: {
|
|
42
|
+
success: jest.fn(),
|
|
43
|
+
},
|
|
44
|
+
}));
|
|
45
|
+
|
|
46
|
+
jest.mock('./helpers', () => ({
|
|
47
|
+
createImageUrl: () => 'test',
|
|
48
|
+
}));
|
|
49
|
+
|
|
50
|
+
global.URL.createObjectURL = jest.fn(() => 'test');
|
|
51
|
+
|
|
52
|
+
jest.mock('react-visibility-sensor', () => ({
|
|
53
|
+
__esModule: true,
|
|
54
|
+
default: (props) => {
|
|
55
|
+
return <div onChange={props.onChange(true)}>{props.children}</div>;
|
|
56
|
+
},
|
|
57
|
+
}));
|
|
58
|
+
|
|
59
|
+
describe('PrivacyProtection', () => {
|
|
60
|
+
it('renders without crashing', () => {
|
|
61
|
+
render(
|
|
62
|
+
<Provider store={store}>
|
|
63
|
+
<CookiesProvider>
|
|
64
|
+
<PrivacyProtection />
|
|
65
|
+
</CookiesProvider>
|
|
66
|
+
</Provider>,
|
|
67
|
+
);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('renders loader', async () => {
|
|
71
|
+
const props = {
|
|
72
|
+
data: {
|
|
73
|
+
dataprotection: {
|
|
74
|
+
enabled: true,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
cookies: {
|
|
78
|
+
get: () => 'false',
|
|
79
|
+
getAll: () => {},
|
|
80
|
+
addChangeListener: () => {},
|
|
81
|
+
removeChangeListener: () => {},
|
|
82
|
+
},
|
|
83
|
+
editable: true,
|
|
84
|
+
};
|
|
85
|
+
const { container } = render(
|
|
86
|
+
<Provider store={store}>
|
|
87
|
+
<CookiesProvider>
|
|
88
|
+
<PrivacyProtection {...props} />
|
|
89
|
+
</CookiesProvider>
|
|
90
|
+
</Provider>,
|
|
91
|
+
);
|
|
92
|
+
expect(container.querySelector('.ui.loader')).toBeInTheDocument();
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it('renders loader', async () => {
|
|
96
|
+
const props = {
|
|
97
|
+
data: {
|
|
98
|
+
dataprotection: {
|
|
99
|
+
enabled: true,
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
cookies: {
|
|
103
|
+
get: () => 'false',
|
|
104
|
+
getAll: () => {},
|
|
105
|
+
addChangeListener: () => {},
|
|
106
|
+
removeChangeListener: () => {},
|
|
107
|
+
},
|
|
108
|
+
editable: false,
|
|
109
|
+
};
|
|
110
|
+
const { container } = render(
|
|
111
|
+
<Provider store={store}>
|
|
112
|
+
<CookiesProvider>
|
|
113
|
+
<PrivacyProtection {...props} />
|
|
114
|
+
</CookiesProvider>
|
|
115
|
+
</Provider>,
|
|
116
|
+
);
|
|
117
|
+
expect(container.querySelector('.ui.loader')).toBeInTheDocument();
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it('renders the wrapper and children', async () => {
|
|
121
|
+
const props = {
|
|
122
|
+
data: {
|
|
123
|
+
dataprotection: {
|
|
124
|
+
enabled: false,
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
cookies: {
|
|
128
|
+
get: () => 'true',
|
|
129
|
+
getAll: () => {},
|
|
130
|
+
addChangeListener: () => {},
|
|
131
|
+
removeChangeListener: () => {},
|
|
132
|
+
},
|
|
133
|
+
editable: false,
|
|
134
|
+
};
|
|
135
|
+
const { container, getByText } = render(
|
|
136
|
+
<Provider store={store}>
|
|
137
|
+
<CookiesProvider>
|
|
138
|
+
<PrivacyProtection {...props}>
|
|
139
|
+
<div>test test</div>
|
|
140
|
+
</PrivacyProtection>
|
|
141
|
+
</CookiesProvider>
|
|
142
|
+
</Provider>,
|
|
143
|
+
);
|
|
144
|
+
expect(getByText('test test')).toBeInTheDocument();
|
|
145
|
+
expect(
|
|
146
|
+
container.querySelector('.privacy-protection-wrapper'),
|
|
147
|
+
).toBeInTheDocument();
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
it('renders the wrapper and children', async () => {
|
|
151
|
+
config.settings = {
|
|
152
|
+
embedCookieExpirationDays: 30,
|
|
153
|
+
};
|
|
154
|
+
const props = {
|
|
155
|
+
data: {
|
|
156
|
+
dataprotection: {
|
|
157
|
+
enabled: true,
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
cookies: {
|
|
161
|
+
get: () => 'true',
|
|
162
|
+
getAll: () => {},
|
|
163
|
+
addChangeListener: () => {},
|
|
164
|
+
removeChangeListener: () => {},
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
const { container, getByText } = render(
|
|
168
|
+
<Provider store={store}>
|
|
169
|
+
<CookiesProvider>
|
|
170
|
+
<PrivacyProtection {...props}>
|
|
171
|
+
<div>test test</div>
|
|
172
|
+
</PrivacyProtection>
|
|
173
|
+
</CookiesProvider>
|
|
174
|
+
</Provider>,
|
|
175
|
+
);
|
|
176
|
+
expect(getByText('test test')).toBeInTheDocument();
|
|
177
|
+
expect(
|
|
178
|
+
container.querySelector('.privacy-protection-wrapper'),
|
|
179
|
+
).toBeInTheDocument();
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
it('renders popup with external content, button', async () => {
|
|
183
|
+
const props = {
|
|
184
|
+
data: {
|
|
185
|
+
dataprotection: {
|
|
186
|
+
enabled: true,
|
|
187
|
+
background_image: 'test',
|
|
188
|
+
privacy_statement: {
|
|
189
|
+
nodes: [],
|
|
190
|
+
getAttributes: () => {},
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
cookies: {
|
|
195
|
+
get: () => false,
|
|
196
|
+
set: () => {},
|
|
197
|
+
getAll: () => {},
|
|
198
|
+
addChangeListener: () => {},
|
|
199
|
+
removeChangeListener: () => {},
|
|
200
|
+
},
|
|
201
|
+
};
|
|
202
|
+
const { container, queryByText, getByText } = render(
|
|
203
|
+
<Provider store={store}>
|
|
204
|
+
<CookiesProvider>
|
|
205
|
+
<PrivacyProtection {...props}>
|
|
206
|
+
<div>test test</div>
|
|
207
|
+
</PrivacyProtection>
|
|
208
|
+
</CookiesProvider>
|
|
209
|
+
</Provider>,
|
|
210
|
+
);
|
|
211
|
+
expect(
|
|
212
|
+
container.querySelector('.privacy-protection-wrapper'),
|
|
213
|
+
).toBeInTheDocument();
|
|
214
|
+
expect(container.querySelector('.privacy-protection')).toBeInTheDocument();
|
|
215
|
+
|
|
216
|
+
expect(
|
|
217
|
+
container.querySelector(
|
|
218
|
+
'.overlay .wrapped .privacy-button .primary.button',
|
|
219
|
+
),
|
|
220
|
+
).toBeInTheDocument();
|
|
221
|
+
expect(
|
|
222
|
+
container.querySelector(
|
|
223
|
+
'.overlay .wrapped .privacy-toggle .ui.toggle.checkbox input',
|
|
224
|
+
),
|
|
225
|
+
).toBeInTheDocument();
|
|
226
|
+
|
|
227
|
+
expect(getByText('Show external content')).toBeInTheDocument();
|
|
228
|
+
expect(getByText('Remember my choice')).toBeInTheDocument();
|
|
229
|
+
expect(getByText('serialized nodes')).toBeInTheDocument();
|
|
230
|
+
fireEvent.click(getByText('Show external content'));
|
|
231
|
+
await act(() => Promise.resolve());
|
|
232
|
+
expect(queryByText('Show external content')).toBe(null);
|
|
233
|
+
expect(getByText('test test')).toBeInTheDocument();
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
it('renders popup with external content, button', async () => {
|
|
237
|
+
const props = {
|
|
238
|
+
data: {
|
|
239
|
+
dataprotection: {
|
|
240
|
+
enabled: true,
|
|
241
|
+
background_image: 'test',
|
|
242
|
+
privacy_statement: {
|
|
243
|
+
nodes: [],
|
|
244
|
+
getAttributes: () => {},
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
cookies: {
|
|
249
|
+
get: () => 'false',
|
|
250
|
+
set: () => {},
|
|
251
|
+
getAll: () => {},
|
|
252
|
+
addChangeListener: () => {},
|
|
253
|
+
removeChangeListener: () => {},
|
|
254
|
+
},
|
|
255
|
+
};
|
|
256
|
+
const { container, queryByText, getByText } = render(
|
|
257
|
+
<Provider store={store}>
|
|
258
|
+
<CookiesProvider>
|
|
259
|
+
<PrivacyProtection {...props}>
|
|
260
|
+
<div>test test</div>
|
|
261
|
+
</PrivacyProtection>
|
|
262
|
+
</CookiesProvider>
|
|
263
|
+
</Provider>,
|
|
264
|
+
);
|
|
265
|
+
expect(
|
|
266
|
+
container.querySelector('.privacy-protection-wrapper'),
|
|
267
|
+
).toBeInTheDocument();
|
|
268
|
+
expect(container.querySelector('.privacy-protection')).toBeInTheDocument();
|
|
269
|
+
|
|
270
|
+
expect(
|
|
271
|
+
container.querySelector(
|
|
272
|
+
'.overlay .wrapped .privacy-button .primary.button',
|
|
273
|
+
),
|
|
274
|
+
).toBeInTheDocument();
|
|
275
|
+
expect(
|
|
276
|
+
container.querySelector(
|
|
277
|
+
'.overlay .wrapped .privacy-toggle .ui.toggle.checkbox input',
|
|
278
|
+
),
|
|
279
|
+
).toBeInTheDocument();
|
|
280
|
+
|
|
281
|
+
expect(getByText('Show external content')).toBeInTheDocument();
|
|
282
|
+
expect(getByText('Remember my choice')).toBeInTheDocument();
|
|
283
|
+
expect(getByText('serialized nodes')).toBeInTheDocument();
|
|
284
|
+
fireEvent.click(getByText('Show external content'));
|
|
285
|
+
await act(() => Promise.resolve());
|
|
286
|
+
expect(queryByText('Show external content')).toBe(null);
|
|
287
|
+
expect(getByText('test test')).toBeInTheDocument();
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
it('renders popup with external content, button', () => {
|
|
291
|
+
const props = {
|
|
292
|
+
data: {
|
|
293
|
+
dataprotection: {
|
|
294
|
+
enabled: true,
|
|
295
|
+
background_image: 'test',
|
|
296
|
+
privacy_statement: {
|
|
297
|
+
nodes: [],
|
|
298
|
+
getAttributes: () => {},
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
cookies: {
|
|
303
|
+
get: () => 'false',
|
|
304
|
+
set: () => {},
|
|
305
|
+
getAll: () => {},
|
|
306
|
+
addChangeListener: () => {},
|
|
307
|
+
removeChangeListener: () => {},
|
|
308
|
+
},
|
|
309
|
+
};
|
|
310
|
+
const { container, getByText } = render(
|
|
311
|
+
<Provider store={store}>
|
|
312
|
+
<CookiesProvider>
|
|
313
|
+
<PrivacyProtection {...props}>
|
|
314
|
+
<div>test test</div>
|
|
315
|
+
</PrivacyProtection>
|
|
316
|
+
</CookiesProvider>
|
|
317
|
+
</Provider>,
|
|
318
|
+
);
|
|
319
|
+
expect(
|
|
320
|
+
container.querySelector('.privacy-protection-wrapper'),
|
|
321
|
+
).toBeInTheDocument();
|
|
322
|
+
expect(container.querySelector('.privacy-protection')).toBeInTheDocument();
|
|
323
|
+
|
|
324
|
+
expect(
|
|
325
|
+
container.querySelector(
|
|
326
|
+
'.overlay .wrapped .privacy-button .primary.button',
|
|
327
|
+
),
|
|
328
|
+
).toBeInTheDocument();
|
|
329
|
+
expect(
|
|
330
|
+
container.querySelector(
|
|
331
|
+
'.overlay .wrapped .privacy-toggle .ui.toggle.checkbox input',
|
|
332
|
+
),
|
|
333
|
+
).toBeInTheDocument();
|
|
334
|
+
|
|
335
|
+
expect(getByText('Show external content')).toBeInTheDocument();
|
|
336
|
+
expect(getByText('Remember my choice')).toBeInTheDocument();
|
|
337
|
+
expect(getByText('serialized nodes')).toBeInTheDocument();
|
|
338
|
+
fireEvent.click(getByText('Remember my choice'));
|
|
339
|
+
});
|
|
340
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createImageUrl } from './helpers';
|
|
2
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
3
|
+
|
|
4
|
+
global.window.atob = jest.fn();
|
|
5
|
+
|
|
6
|
+
global.URL.createObjectURL = jest.fn(() => 'mocked-url');
|
|
7
|
+
|
|
8
|
+
describe('createImageUrl', () => {
|
|
9
|
+
it('should return a valid image URL', () => {
|
|
10
|
+
const result = {
|
|
11
|
+
data: 'VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGluZyB0byBkZWNvZGU=',
|
|
12
|
+
'content-type': 'image/jpeg',
|
|
13
|
+
};
|
|
14
|
+
global.window.atob.mockReturnValue('This is a base64 encoding to decode');
|
|
15
|
+
const imageUrl = createImageUrl(result);
|
|
16
|
+
|
|
17
|
+
expect(typeof imageUrl).toBe('string');
|
|
18
|
+
});
|
|
19
|
+
});
|
package/.i18n.babel.config.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('@plone/volto/babel');
|