@eeacms/volto-widget-toggle 4.0.0 → 5.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 +59 -1
- package/DEVELOP.md +19 -17
- package/README.md +33 -19
- package/docker-compose.yml +1 -1
- package/jest-addon.config.js +11 -4
- package/locales/volto.pot +2 -2
- package/package.json +1 -1
- package/src/components/manage/Widgets/CheckboxWidget.jsx +1 -1
- package/src/components/manage/Widgets/CheckboxWidget.test.jsx +9 -7
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,32 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
-
### [
|
|
7
|
+
### [5.0.1](https://github.com/eea/volto-widget-toggle/compare/5.0.0...5.0.1) - 8 April 2026
|
|
8
|
+
|
|
9
|
+
#### :hammer_and_wrench: Others
|
|
10
|
+
|
|
11
|
+
- test: Fix make test [Alin V. (Claudiu) - [`8cf30a1`](https://github.com/eea/volto-widget-toggle/commit/8cf30a17057899a44781075fdf7ed962d9607920)]
|
|
12
|
+
## [5.0.0](https://github.com/eea/volto-widget-toggle/compare/4.0.0...5.0.0) - 25 March 2026
|
|
13
|
+
|
|
14
|
+
#### :rocket: New Features
|
|
15
|
+
|
|
16
|
+
- feat: Volto 18 support - refs #287700 [Alin Voinea - [`e8d9163`](https://github.com/eea/volto-widget-toggle/commit/e8d9163a2df3e87871914b77b9c04730d686e970)]
|
|
17
|
+
|
|
18
|
+
#### :house: Internal changes
|
|
19
|
+
|
|
20
|
+
- chore: [JENKINSFILE] add package version in sonarqube [valentinab25 - [`691da0c`](https://github.com/eea/volto-widget-toggle/commit/691da0c9f93f118ed6170984a3ae379ed5fe3757)]
|
|
21
|
+
- chore: [JENKINSFILE] use sonarqube branches [EEA Jenkins - [`b15a0a7`](https://github.com/eea/volto-widget-toggle/commit/b15a0a778364dad6918fa4a3f932a168c2fb099c)]
|
|
22
|
+
|
|
23
|
+
#### :hammer_and_wrench: Others
|
|
24
|
+
|
|
25
|
+
- tests: Fix Sonar Qube tags - refs #297339 [Alin Voinea - [`ed169f3`](https://github.com/eea/volto-widget-toggle/commit/ed169f3c6e44d0b109d69440b67db55ad3c09864)]
|
|
26
|
+
- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`350b65a`](https://github.com/eea/volto-widget-toggle/commit/350b65af9951fbcb9a8fb54a7aed8d786edd8ae6)]
|
|
27
|
+
- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`a992ac5`](https://github.com/eea/volto-widget-toggle/commit/a992ac5f81f7c2a3b9cbc5b9b33a88429125529d)]
|
|
28
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`19d59fc`](https://github.com/eea/volto-widget-toggle/commit/19d59fc2538ea4062eb66af3fa1e759855eae5d7)]
|
|
29
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`e171afa`](https://github.com/eea/volto-widget-toggle/commit/e171afad2a5fc90fc2ee284021e419291c4336bf)]
|
|
30
|
+
- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`d5af697`](https://github.com/eea/volto-widget-toggle/commit/d5af697b6918ad93832fc2bfa29195653fe2941e)]
|
|
31
|
+
- Add Sonarqube tag using ied-frontend addons list [EEA Jenkins - [`e007d29`](https://github.com/eea/volto-widget-toggle/commit/e007d29544dc1bf94ba433dcac1ab4cf66167513)]
|
|
32
|
+
## [4.0.0](https://github.com/eea/volto-widget-toggle/compare/3.1.4...4.0.0) - 22 April 2024
|
|
8
33
|
|
|
9
34
|
#### :rocket: New Features
|
|
10
35
|
|
|
@@ -13,10 +38,19 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
13
38
|
|
|
14
39
|
#### :house: Internal changes
|
|
15
40
|
|
|
41
|
+
- chore: [JENKINS] Refactor automated testing [valentinab25 - [`ecd9264`](https://github.com/eea/volto-widget-toggle/commit/ecd9264bbf3eaef23e09e7323c264ec1d5954c53)]
|
|
16
42
|
- chore: husky, lint-staged use fixed versions [valentinab25 - [`78c47fe`](https://github.com/eea/volto-widget-toggle/commit/78c47fea7a704d1addd796ac5f515d262379da92)]
|
|
17
43
|
|
|
18
44
|
#### :hammer_and_wrench: Others
|
|
19
45
|
|
|
46
|
+
- Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`46ff8ad`](https://github.com/eea/volto-widget-toggle/commit/46ff8ad8fb0c50ffb7527ac292a3b4b7a8d0edc0)]
|
|
47
|
+
- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`a9b8e96`](https://github.com/eea/volto-widget-toggle/commit/a9b8e967be630d5893bf8b5134124cf07137f99b)]
|
|
48
|
+
- Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`4684626`](https://github.com/eea/volto-widget-toggle/commit/4684626e63b7103fc4d132d91b9696d91cc968ec)]
|
|
49
|
+
- test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`0e8e6e5`](https://github.com/eea/volto-widget-toggle/commit/0e8e6e5b4dc2b183cb77734c7b9dbcace0428a42)]
|
|
50
|
+
- test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`8daf138`](https://github.com/eea/volto-widget-toggle/commit/8daf138f2a820d27111bbbae878d35c1eb514e70)]
|
|
51
|
+
- test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`7f73f01`](https://github.com/eea/volto-widget-toggle/commit/7f73f01bddfb9d1bc52d1d13fcd322f8659527ed)]
|
|
52
|
+
- test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`45d1523`](https://github.com/eea/volto-widget-toggle/commit/45d1523d342925b6e61200f96e44e898df39c51d)]
|
|
53
|
+
- test: [JENKINS] Improve cypress time [valentinab25 - [`cd49aca`](https://github.com/eea/volto-widget-toggle/commit/cd49aca874da556ce3d18e8c259cbbe9a1d93c8b)]
|
|
20
54
|
### [3.1.4](https://github.com/eea/volto-widget-toggle/compare/3.1.3...3.1.4) - 16 October 2023
|
|
21
55
|
|
|
22
56
|
#### :house: Internal changes
|
|
@@ -41,6 +75,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
41
75
|
|
|
42
76
|
- test: EN locales, pre-commit fix, feature PRs checks Refs #257193 [valentinab25 - [`b2f509e`](https://github.com/eea/volto-widget-toggle/commit/b2f509eb236e0beeccfc8bc89f4c6527a3fca223)]
|
|
43
77
|
- test: Fix package.json scripts to use makefile [Alin Voinea - [`72e8245`](https://github.com/eea/volto-widget-toggle/commit/72e8245a4741988849eaa73e5fd238ff6d340fa9)]
|
|
78
|
+
- test: Fix eslint and yarn i18n [Alin Voinea - [`034eaf8`](https://github.com/eea/volto-widget-toggle/commit/034eaf890faa3a9c09aa6f4ddca1bc04e46782a8)]
|
|
44
79
|
- i18n: Add en [Alin Voinea - [`e60d799`](https://github.com/eea/volto-widget-toggle/commit/e60d799a64230544e37e1f4796dc73bbc0e674c6)]
|
|
45
80
|
- test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`f86b2f7`](https://github.com/eea/volto-widget-toggle/commit/f86b2f7119f24b637e8bc8101effc2c2c3416a65)]
|
|
46
81
|
### [3.1.2](https://github.com/eea/volto-widget-toggle/compare/3.1.1...3.1.2) - 24 July 2023
|
|
@@ -51,11 +86,20 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
51
86
|
|
|
52
87
|
- test: jest should look for addons in node_modules Refs #253277 [valentinab25 - [`da228a9`](https://github.com/eea/volto-widget-toggle/commit/da228a925ea784b4b418f37ea07418de87759670)]
|
|
53
88
|
- test: Fix test config, coverage Refs #253277 [valentinab25 - [`b4f3492`](https://github.com/eea/volto-widget-toggle/commit/b4f3492448826968dfbb979fad00f0b65d644017)]
|
|
89
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`08bfec1`](https://github.com/eea/volto-widget-toggle/commit/08bfec176ebdf6dff13a7db969a73ca9d8415ee8)]
|
|
90
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`1324cce`](https://github.com/eea/volto-widget-toggle/commit/1324cceab3305bf02ab2004a4ff77d492f44481e)]
|
|
91
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`13d684d`](https://github.com/eea/volto-widget-toggle/commit/13d684daf218103723779a470ff3dc7f101e93c1)]
|
|
54
92
|
### [3.1.0](https://github.com/eea/volto-widget-toggle/compare/3.0.1...3.1.0) - 27 March 2023
|
|
55
93
|
|
|
56
94
|
#### :hammer_and_wrench: Others
|
|
57
95
|
|
|
96
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`11a80c7`](https://github.com/eea/volto-widget-toggle/commit/11a80c7ce1f66aa0c7ec600c626875ab7ac8c1cb)]
|
|
97
|
+
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`c353ca1`](https://github.com/eea/volto-widget-toggle/commit/c353ca1794b99b2e5f6681ad93ab844ef33e117e)]
|
|
98
|
+
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`143e5be`](https://github.com/eea/volto-widget-toggle/commit/143e5be8400af60658baa34a7934f707df121f83)]
|
|
58
99
|
- test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`c658d9f`](https://github.com/eea/volto-widget-toggle/commit/c658d9f0fc0fc6cc4b26041b79c93c0982b152c5)]
|
|
100
|
+
- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`6f8b43e`](https://github.com/eea/volto-widget-toggle/commit/6f8b43e0fe92d2065725be355b800446fedf2992)]
|
|
101
|
+
- yarn 3 [Alin Voinea - [`02d53da`](https://github.com/eea/volto-widget-toggle/commit/02d53daff4ee2886f5533ce8afd0d4e67cd0a9f1)]
|
|
102
|
+
- Add Sonarqube tag using demo-kitkat-frontend addons list [EEA Jenkins - [`42059ef`](https://github.com/eea/volto-widget-toggle/commit/42059efe39cf11c31b1a48ddf6503aaf9da14db7)]
|
|
59
103
|
### [3.0.1](https://github.com/eea/volto-widget-toggle/compare/3.0.0...3.0.1) - 16 November 2022
|
|
60
104
|
|
|
61
105
|
#### :hammer_and_wrench: Others
|
|
@@ -68,15 +112,21 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
68
112
|
- Cleanup [Alin Voinea - [`f0bfe89`](https://github.com/eea/volto-widget-toggle/commit/f0bfe892db782472d0911b3562346d80bed2fb94)]
|
|
69
113
|
- Typo [Miu Razvan - [`f1faa3d`](https://github.com/eea/volto-widget-toggle/commit/f1faa3d1c0239d377a75b375dcf092cea048c121)]
|
|
70
114
|
- Use latest cypress [Miu Razvan - [`165ef4a`](https://github.com/eea/volto-widget-toggle/commit/165ef4a017833e757a69da734985acd18155228e)]
|
|
115
|
+
- Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`45037b0`](https://github.com/eea/volto-widget-toggle/commit/45037b01295d0593929af9ff6f53823e51129f43)]
|
|
116
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`de17f98`](https://github.com/eea/volto-widget-toggle/commit/de17f983029cda87580f39b6ab7b1a0139e080cd)]
|
|
71
117
|
- update(jest): add @plone/volto-slate resolver refs- #153447 [nileshgulia1 - [`b5e6889`](https://github.com/eea/volto-widget-toggle/commit/b5e6889bc22efaeec2025bd79dfe2a839650e4a6)]
|
|
72
118
|
### [2.2.7](https://github.com/eea/volto-widget-toggle/compare/2.2.6...2.2.7) - 30 June 2022
|
|
73
119
|
|
|
74
120
|
#### :hammer_and_wrench: Others
|
|
75
121
|
|
|
122
|
+
- Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`78e846a`](https://github.com/eea/volto-widget-toggle/commit/78e846a63de32fc42db181a07859a886b10d8b4e)]
|
|
123
|
+
- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`75191c3`](https://github.com/eea/volto-widget-toggle/commit/75191c366506d17db335e2b305e5ea8f058e9dfb)]
|
|
124
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`3806c6c`](https://github.com/eea/volto-widget-toggle/commit/3806c6c481c069ab939b7603c7d3e102563276dd)]
|
|
76
125
|
### [2.2.6](https://github.com/eea/volto-widget-toggle/compare/2.2.5...2.2.6) - 3 January 2022
|
|
77
126
|
|
|
78
127
|
#### :hammer_and_wrench: Others
|
|
79
128
|
|
|
129
|
+
- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`c2e3484`](https://github.com/eea/volto-widget-toggle/commit/c2e3484b3396dbabf38a8b9e8f6df0b89d4aa663)]
|
|
80
130
|
### [2.2.5](https://github.com/eea/volto-widget-toggle/compare/2.2.4...2.2.5) - 16 December 2021
|
|
81
131
|
|
|
82
132
|
### [2.2.4](https://github.com/eea/volto-widget-toggle/compare/2.2.3...2.2.4) - 10 December 2021
|
|
@@ -84,6 +134,13 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
84
134
|
#### :hammer_and_wrench: Others
|
|
85
135
|
|
|
86
136
|
- Refs #142010 - Optimize Volto-addons gitflow pipelines [valentinab25 - [`2bd2039`](https://github.com/eea/volto-widget-toggle/commit/2bd203979963ee5cb15592470e1d341d1bd65291)]
|
|
137
|
+
- Add Sonarqube tag using industry-frontend addons list [EEA Jenkins - [`af5afe1`](https://github.com/eea/volto-widget-toggle/commit/af5afe1263aff21801bbb8239163ac01644f2a7e)]
|
|
138
|
+
- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`2d60373`](https://github.com/eea/volto-widget-toggle/commit/2d60373b280dcb2f902e4dc6fff0bdb8ea7d7ac7)]
|
|
139
|
+
- Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`80527c1`](https://github.com/eea/volto-widget-toggle/commit/80527c1f72bd8cc325ff1c072def18d24c3e99ae)]
|
|
140
|
+
- Add Sonarqube tag using sustainability-frontend addons list [EEA Jenkins - [`bc52e72`](https://github.com/eea/volto-widget-toggle/commit/bc52e72e32197ca82f93bac645f0094bc7db7ab1)]
|
|
141
|
+
- Add Sonarqube tag using climate-energy-frontend addons list [EEA Jenkins - [`30397bd`](https://github.com/eea/volto-widget-toggle/commit/30397bde9a045be3c2e6614af798ce11f18e3039)]
|
|
142
|
+
- Add Sonarqube tag using ims-frontend addons list [EEA Jenkins - [`dd3fb67`](https://github.com/eea/volto-widget-toggle/commit/dd3fb67693900db1ce6d8f631c61a2a5c25d9b70)]
|
|
143
|
+
- Add Sonarqube tag using frontend addons list [EEA Jenkins - [`54d09d1`](https://github.com/eea/volto-widget-toggle/commit/54d09d164591f1cf3d47a69838ccbd9abb8f22b6)]
|
|
87
144
|
### [2.2.3](https://github.com/eea/volto-widget-toggle/compare/2.2.2...2.2.3) - 28 June 2021
|
|
88
145
|
|
|
89
146
|
#### :hammer_and_wrench: Others
|
|
@@ -117,6 +174,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
117
174
|
|
|
118
175
|
- Release 1.0.1 [Alin Voinea - [`454220f`](https://github.com/eea/volto-widget-toggle/commit/454220fa61495427f874fb9b56401fe69689f4fe)]
|
|
119
176
|
- Auto-release npm [Alin Voinea - [`10b31b3`](https://github.com/eea/volto-widget-toggle/commit/10b31b3b64330d41f69a033a45030e49d20c16b5)]
|
|
177
|
+
- yarn prettier [Alin Voinea - [`5136059`](https://github.com/eea/volto-widget-toggle/commit/51360595bf452c815e526ce10f15aa8a84ad186f)]
|
|
120
178
|
## [1.0.0](https://github.com/eea/volto-widget-toggle/compare/0.1.0...1.0.0) - 29 September 2020
|
|
121
179
|
|
|
122
180
|
#### :hammer_and_wrench: Others
|
package/DEVELOP.md
CHANGED
|
@@ -26,21 +26,20 @@
|
|
|
26
26
|
|
|
27
27
|
### Or add @eeacms/volto-widget-toggle to your Volto project
|
|
28
28
|
|
|
29
|
-
Before starting make sure your development environment is properly set. See [Volto
|
|
29
|
+
Before starting make sure your development environment is properly set. See the official Plone documentation for [creating a project with Cookieplone](https://6.docs.plone.org/install/create-project-cookieplone.html) and [installing an add-on in development mode in Volto 18 and 19](https://6.docs.plone.org/volto/development/add-ons/install-an-add-on-dev-18.html).
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
For new Volto 18+ projects, use Cookieplone. It includes `mrs-developer` by default.
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
1. Create a new Volto project with Cookieplone
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
yo @plone/volto my-volto-project --addon @eeacms/volto-widget-toggle --skip-install
|
|
38
|
-
cd my-volto-project
|
|
35
|
+
uvx cookieplone project
|
|
36
|
+
cd project-title
|
|
39
37
|
|
|
40
38
|
1. Add the following to `mrs.developer.json`:
|
|
41
39
|
|
|
42
40
|
{
|
|
43
41
|
"volto-widget-toggle": {
|
|
42
|
+
"output": "packages",
|
|
44
43
|
"url": "https://github.com/eea/volto-widget-toggle.git",
|
|
45
44
|
"package": "@eeacms/volto-widget-toggle",
|
|
46
45
|
"branch": "develop",
|
|
@@ -48,28 +47,31 @@ Before starting make sure your development environment is properly set. See [Vol
|
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
49
|
|
|
51
|
-
1.
|
|
50
|
+
1. Add `@eeacms/volto-widget-toggle` to the `addons` key in your project `volto.config.js`
|
|
51
|
+
|
|
52
|
+
1. Install or refresh the project setup
|
|
52
53
|
|
|
53
|
-
make
|
|
54
|
-
yarn
|
|
54
|
+
make install
|
|
55
55
|
|
|
56
|
-
1. Start backend
|
|
56
|
+
1. Start backend in one terminal
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
make backend-start
|
|
59
59
|
|
|
60
|
-
...wait for backend to setup and start
|
|
60
|
+
...wait for backend to setup and start, ending with `Ready to handle requests`
|
|
61
61
|
|
|
62
62
|
...you can also check http://localhost:8080/Plone
|
|
63
63
|
|
|
64
|
-
1. Start frontend
|
|
64
|
+
1. Start frontend in a second terminal
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
make frontend-start
|
|
67
67
|
|
|
68
68
|
1. Go to http://localhost:3000
|
|
69
69
|
|
|
70
70
|
1. Happy hacking!
|
|
71
71
|
|
|
72
|
-
cd
|
|
72
|
+
cd packages/volto-widget-toggle
|
|
73
|
+
|
|
74
|
+
For legacy Volto 17 projects, keep using the yarn-based workflow from the Volto 17 documentation.
|
|
73
75
|
|
|
74
76
|
## Cypress
|
|
75
77
|
|
|
@@ -81,7 +83,7 @@ project where you added `volto-widget-toggle` to `mrs.developer.json`
|
|
|
81
83
|
Go to:
|
|
82
84
|
|
|
83
85
|
```BASH
|
|
84
|
-
cd
|
|
86
|
+
cd packages/volto-widget-toggle/
|
|
85
87
|
```
|
|
86
88
|
|
|
87
89
|
Start:
|
package/README.md
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
[](https://github.com/eea/volto-widget-toggle/releases)
|
|
4
4
|
|
|
5
5
|
[](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-widget-toggle/job/master/display/redirect)
|
|
6
|
-
[](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-widget-toggle
|
|
6
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-widget-toggle)
|
|
7
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-widget-toggle)
|
|
8
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-widget-toggle)
|
|
9
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-widget-toggle)
|
|
10
10
|
|
|
11
11
|
[](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-widget-toggle/job/develop/display/redirect)
|
|
12
|
-
[](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-widget-toggle
|
|
12
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-widget-toggle&branch=develop)
|
|
13
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-widget-toggle&branch=develop)
|
|
14
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-widget-toggle&branch=develop)
|
|
15
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-widget-toggle&branch=develop)
|
|
16
16
|
|
|
17
17
|
[Volto](https://github.com/plone/volto) add-on: Replace any checkbox with a nice toggle button within edit forms
|
|
18
18
|
|
|
@@ -31,6 +31,11 @@
|
|
|
31
31
|
|
|
32
32
|
Go to http://localhost:3000
|
|
33
33
|
|
|
34
|
+
`make start` now defaults to Volto 18. To run the same setup against Volto 17, use:
|
|
35
|
+
|
|
36
|
+
VOLTO_VERSION=17 make
|
|
37
|
+
VOLTO_VERSION=17 make start
|
|
38
|
+
|
|
34
39
|
### Add volto-widget-toggle to your Volto project
|
|
35
40
|
|
|
36
41
|
1. Make sure you have a [Plone backend](https://plone.org/download) up-and-running at http://localhost:8080/Plone
|
|
@@ -44,30 +49,39 @@ Go to http://localhost:3000
|
|
|
44
49
|
* If you already have a volto project, just update `package.json`:
|
|
45
50
|
|
|
46
51
|
```JSON
|
|
47
|
-
"addons": [
|
|
48
|
-
"@eeacms/volto-widget-toggle"
|
|
49
|
-
],
|
|
50
|
-
|
|
51
52
|
"dependencies": {
|
|
52
53
|
"@eeacms/volto-widget-toggle": "*"
|
|
53
54
|
}
|
|
54
55
|
```
|
|
55
56
|
|
|
56
|
-
|
|
57
|
+
and `volto.config.js`:
|
|
58
|
+
|
|
59
|
+
```JavaScript
|
|
60
|
+
const addons = ['@eeacms/volto-widget-toggle'];
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
* If not, create one with Cookieplone, as recommended by the official Plone documentation for Volto 18+:
|
|
57
64
|
|
|
58
65
|
```
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
cd my-volto-project
|
|
66
|
+
uvx cookieplone project
|
|
67
|
+
cd project-title
|
|
62
68
|
```
|
|
63
69
|
|
|
64
|
-
1. Install
|
|
70
|
+
1. Install or update dependencies, then start the project:
|
|
65
71
|
|
|
66
72
|
```
|
|
67
|
-
|
|
68
|
-
yarn start
|
|
73
|
+
make install
|
|
69
74
|
```
|
|
70
75
|
|
|
76
|
+
For a Cookieplone project, start the backend and frontend in separate terminals:
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
make backend-start
|
|
80
|
+
make frontend-start
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
For a legacy Volto 17 project, install the package with `yarn` and restart the frontend as usual.
|
|
84
|
+
|
|
71
85
|
1. Go to http://localhost:3000
|
|
72
86
|
|
|
73
87
|
1. Happy editing!
|
package/docker-compose.yml
CHANGED
package/jest-addon.config.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
require('dotenv').config({ path: __dirname + '/.env' })
|
|
2
2
|
|
|
3
|
+
const fs = require('fs')
|
|
4
|
+
const path = require('path')
|
|
5
|
+
|
|
6
|
+
const voltoSlatePath = fs.existsSync(
|
|
7
|
+
path.join(__dirname, '../../../node_modules/@plone/volto-slate/src'),
|
|
8
|
+
)
|
|
9
|
+
? '<rootDir>/node_modules/@plone/volto-slate/src'
|
|
10
|
+
: '<rootDir>/node_modules/@plone/volto/packages/volto-slate/src'
|
|
11
|
+
|
|
3
12
|
module.exports = {
|
|
4
13
|
testMatch: ['**/src/addons/**/?(*.)+(spec|test).[jt]s?(x)'],
|
|
5
14
|
collectCoverageFrom: [
|
|
@@ -17,10 +26,8 @@ module.exports = {
|
|
|
17
26
|
'@eeacms/search/(.*)$': '<rootDir>/src/addons/volto-searchlib/searchlib/$1',
|
|
18
27
|
'@eeacms/search': '<rootDir>/src/addons/volto-searchlib/searchlib',
|
|
19
28
|
'@eeacms/(.*?)/(.*)$': '<rootDir>/node_modules/@eeacms/$1/src/$2',
|
|
20
|
-
'@plone/volto-slate$':
|
|
21
|
-
|
|
22
|
-
'@plone/volto-slate/(.*)$':
|
|
23
|
-
'<rootDir>/node_modules/@plone/volto/packages/volto-slate/src/$1',
|
|
29
|
+
'@plone/volto-slate$': voltoSlatePath,
|
|
30
|
+
'@plone/volto-slate/(.*)$': `${voltoSlatePath}/$1`,
|
|
24
31
|
'~/(.*)$': '<rootDir>/src/$1',
|
|
25
32
|
'load-volto-addons':
|
|
26
33
|
'<rootDir>/node_modules/@plone/volto/jest-addons-loader.js',
|
package/locales/volto.pot
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
msgid ""
|
|
2
2
|
msgstr ""
|
|
3
3
|
"Project-Id-Version: Plone\n"
|
|
4
|
-
"POT-Creation-Date:
|
|
4
|
+
"POT-Creation-Date: 2026-03-10T22:14:45.028Z\n"
|
|
5
5
|
"Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
|
|
6
6
|
"Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
|
|
7
|
-
"MIME-Version: 1.0\n"
|
|
8
7
|
"Content-Type: text/plain; charset=utf-8\n"
|
|
9
8
|
"Content-Transfer-Encoding: 8bit\n"
|
|
10
9
|
"Plural-Forms: nplurals=1; plural=0;\n"
|
|
10
|
+
"MIME-Version: 1.0\n"
|
|
11
11
|
"Language-Code: en\n"
|
|
12
12
|
"Language-Name: English\n"
|
|
13
13
|
"Preferred-Encodings: utf-8\n"
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@ import PropTypes from 'prop-types';
|
|
|
8
8
|
import { Checkbox } from 'semantic-ui-react';
|
|
9
9
|
|
|
10
10
|
import { injectIntl } from 'react-intl';
|
|
11
|
-
import
|
|
11
|
+
import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* CheckboxWidget component class.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
2
|
+
import { render, waitFor } from '@testing-library/react';
|
|
3
3
|
import { Provider } from 'react-intl-redux';
|
|
4
4
|
import CheckboxWidget from './CheckboxWidget';
|
|
5
5
|
import configureStore from 'redux-mock-store';
|
|
6
|
-
import '@testing-library/jest-dom
|
|
6
|
+
import '@testing-library/jest-dom';
|
|
7
7
|
|
|
8
8
|
const mockStore = configureStore([]);
|
|
9
9
|
const store = mockStore({
|
|
@@ -21,8 +21,8 @@ describe('CheckboxWidget', () => {
|
|
|
21
21
|
jest.clearAllMocks();
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
it('renders a checkbox', () => {
|
|
25
|
-
const {
|
|
24
|
+
it('renders a checkbox', async () => {
|
|
25
|
+
const { findByText } = render(
|
|
26
26
|
<Provider store={store} locale="en">
|
|
27
27
|
<CheckboxWidget
|
|
28
28
|
id="test"
|
|
@@ -31,10 +31,10 @@ describe('CheckboxWidget', () => {
|
|
|
31
31
|
/>
|
|
32
32
|
</Provider>,
|
|
33
33
|
);
|
|
34
|
-
expect(
|
|
34
|
+
expect(await findByText('Test Checkbox')).toBeInTheDocument();
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
it('sets a default value if given', () => {
|
|
37
|
+
it('sets a default value if given', async () => {
|
|
38
38
|
render(
|
|
39
39
|
<Provider store={store} locale="en">
|
|
40
40
|
<CheckboxWidget
|
|
@@ -45,7 +45,9 @@ describe('CheckboxWidget', () => {
|
|
|
45
45
|
/>
|
|
46
46
|
</Provider>,
|
|
47
47
|
);
|
|
48
|
-
|
|
48
|
+
await waitFor(() => {
|
|
49
|
+
expect(mockOnChange).toHaveBeenCalledWith('test', true);
|
|
50
|
+
});
|
|
49
51
|
});
|
|
50
52
|
|
|
51
53
|
it('does not set a default value if already having a value', () => {
|