@eeacms/volto-eea-website-theme 3.19.0 → 4.0.0
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 +7 -6
- package/CHANGELOG.md +28 -0
- package/DEVELOP.md +19 -17
- package/README.md +27 -15
- package/docker-compose.yml +1 -1
- package/jest-addon.config.js +8 -4
- package/package.json +1 -1
- package/src/actions/navigation.js +1 -1
- package/src/components/manage/Blocks/ContextNavigation/ContextNavigationEdit.jsx +4 -2
- package/src/components/manage/Blocks/ContextNavigation/ContextNavigationEdit.test.jsx +25 -19
- package/src/components/manage/Blocks/ContextNavigation/ContextNavigationView.jsx +2 -1
- package/src/components/manage/Blocks/ContextNavigation/ContextNavigationView.test.jsx +6 -4
- package/src/components/manage/Blocks/ContextNavigation/variations/Accordion.jsx +2 -2
- package/src/components/manage/Blocks/ContextNavigation/variations/ReportNavigation.jsx +4 -2
- package/src/components/manage/Blocks/ContextNavigation/variations/ReportNavigation.test.jsx +1 -1
- package/src/components/manage/Blocks/GroupBlockTemplate/FlexGroup/FlexGroup.jsx +12 -44
- package/src/components/manage/Blocks/GroupBlockTemplate/FlexGroup/RenderBlocks.jsx +5 -4
- package/src/components/manage/Blocks/GroupBlockTemplate/FlexGroup/editor-flex.less +45 -4
- package/src/components/manage/Blocks/LayoutSettings/LayoutSettingsEdit.jsx +2 -1
- package/src/components/manage/Blocks/LayoutSettings/LayoutSettingsEdit.test.jsx +12 -4
- package/src/components/manage/Blocks/LayoutSettings/LayoutSettingsView.jsx +1 -1
- package/src/components/manage/Blocks/Title/Edit.jsx +3 -3
- package/src/components/manage/Blocks/Title/View.jsx +2 -1
- package/src/components/manage/Blocks/Title/variations/WebReport.jsx +2 -2
- package/src/components/manage/Blocks/Title/variations/WebReport.test.jsx +6 -4
- package/src/components/manage/Blocks/Title/variations/WebReportPage.jsx +2 -2
- package/src/components/manage/Blocks/Title/variations/WebReportPage.test.jsx +6 -4
- package/src/components/theme/Banner/View.jsx +1 -1
- package/src/components/theme/BaseTag.jsx +2 -1
- package/src/components/theme/BaseTag.test.jsx +7 -2
- package/src/components/theme/DraftBackground/DraftBackground.jsx +2 -1
- package/src/components/theme/Homepage/HomePageInverseView.jsx +3 -3
- package/src/components/theme/Homepage/HomePageInverseView.test.jsx +1 -1
- package/src/components/theme/Homepage/HomePageView.jsx +3 -3
- package/src/components/theme/Homepage/HomePageView.test.jsx +1 -1
- package/src/components/theme/Logo.jsx +3 -3
- package/src/components/theme/NotFound/GoneView.jsx +3 -2
- package/src/components/theme/NotFound/GoneView.test.jsx +5 -4
- package/src/components/theme/NotFound/NotFound.jsx +1 -1
- package/src/components/theme/NotFound/NotFound.test.jsx +3 -2
- package/src/components/theme/PrintLoader/PrintLoader.test.jsx +1 -1
- package/src/components/theme/SubsiteClass.jsx +6 -4
- package/src/components/theme/SubsiteClass.test.jsx +3 -2
- package/src/components/theme/WebReport/WebReportSectionView.jsx +2 -2
- package/src/components/theme/WebReport/WebReportSectionView.test.jsx +10 -5
- package/src/components/theme/Widgets/ADUserGroupSelectWidget.jsx +2 -2
- package/src/components/theme/Widgets/ContributorsViewWidget.jsx +1 -1
- package/src/components/theme/Widgets/CreatableSelectWidget.jsx +7 -4
- package/src/components/theme/Widgets/CreatorsViewWidget.jsx +1 -1
- package/src/components/theme/Widgets/DateWidget.jsx +1 -1
- package/src/components/theme/Widgets/DateWidget.test.js +1 -1
- package/src/components/theme/Widgets/DatetimeWidget.jsx +1 -1
- package/src/components/theme/Widgets/DatetimeWidget.test.js +1 -1
- package/src/components/theme/Widgets/ImageViewWidget.jsx +1 -0
- package/src/components/theme/Widgets/NavigationBehaviorWidget.jsx +7 -3
- package/src/components/theme/Widgets/NavigationBehaviorWidget.test.jsx +51 -46
- package/src/components/theme/Widgets/UserSelectWidget.jsx +13 -10
- package/src/customizations/@plone/volto-slate/blocks/Table/TableBlockView.jsx +3 -3
- package/src/customizations/@plone/volto-slate/blocks/Text/TextBlockView.jsx +2 -2
- package/src/customizations/@plone/volto-slate/editor/SlateEditor.jsx +23 -10
- package/src/customizations/@plone/volto-slate/editor/render.jsx +7 -3
- package/src/customizations/@plone/volto-slate/utils/blocks.js +11 -8
- package/src/customizations/volto/components/manage/Blocks/Grid/View.jsx +2 -2
- package/src/customizations/volto/components/manage/Blocks/Image/Edit.jsx +30 -27
- package/src/customizations/volto/components/manage/Blocks/Image/Edit.test.jsx +244 -246
- package/src/customizations/volto/components/manage/Blocks/Image/View.jsx +23 -25
- package/src/customizations/volto/components/manage/Blocks/LeadImage/Edit.jsx +6 -4
- package/src/customizations/volto/components/manage/Blocks/LeadImage/LeadImageSidebar.jsx +4 -2
- package/src/customizations/volto/components/manage/Blocks/LeadImage/View.jsx +2 -2
- package/src/customizations/volto/components/manage/Controlpanels/Groups/RenderGroups.jsx +1 -1
- package/src/customizations/volto/components/manage/Controlpanels/Groups/RenderGroups.test.jsx +108 -42
- package/src/customizations/volto/components/manage/Diff/DiffField.jsx +4 -3
- package/src/customizations/volto/components/manage/Display/Display.jsx +8 -7
- package/src/customizations/volto/components/manage/History/History.jsx +58 -52
- package/src/customizations/volto/components/manage/Sidebar/ObjectBrowserBody.jsx +42 -21
- package/src/customizations/volto/components/manage/Sidebar/ObjectBrowserNav.jsx +2 -1
- package/src/customizations/volto/components/manage/Sidebar/SidebarPopup.jsx +46 -24
- package/src/customizations/volto/components/manage/Sidebar/objectBrowserSelection.js +58 -0
- package/src/customizations/volto/components/manage/Toolbar/More.jsx +8 -10
- package/src/customizations/volto/components/manage/Widgets/NumberWidget.jsx +1 -1
- package/src/customizations/volto/components/manage/Widgets/NumberWidget.test.jsx +6 -1
- package/src/customizations/volto/components/manage/Widgets/ObjectBrowserWidget.jsx +66 -12
- package/src/customizations/volto/components/manage/Workflow/Workflow.jsx +10 -9
- package/src/customizations/volto/components/theme/Breadcrumbs/Breadcrumbs.jsx +3 -2
- package/src/customizations/volto/components/theme/Comments/Comments.jsx +9 -8
- package/src/customizations/volto/components/theme/Comments/Comments.test.jsx +29 -7
- package/src/customizations/volto/components/theme/ContactForm/ContactForm.jsx +1 -1
- package/src/customizations/volto/components/theme/ContactForm/ContactForm.test.js +5 -0
- package/src/customizations/volto/components/theme/ContentMetadataTags/ContentMetadataTags.jsx +5 -7
- package/src/customizations/volto/components/theme/EventDetails/EventDetails.jsx +2 -2
- package/src/customizations/volto/components/theme/Footer/Footer.jsx +1 -1
- package/src/customizations/volto/components/theme/Header/Header.jsx +10 -8
- package/src/customizations/volto/components/theme/Header/Header.test.jsx +1 -1
- package/src/customizations/volto/components/theme/Header/LanguageSwitcher.jsx +3 -3
- package/src/customizations/volto/components/theme/Image/Image.jsx +4 -3
- package/src/customizations/volto/components/theme/Unauthorized/Unauthorized.jsx +1 -1
- package/src/customizations/volto/components/theme/View/DefaultView.jsx +4 -3
- package/src/customizations/volto/components/theme/View/EventView.jsx +3 -2
- package/src/customizations/volto/helpers/Html/Html.jsx +16 -6
- package/src/customizations/volto/helpers/Html/Readme.md +7 -1
- package/src/customizations/volto/reducers/breadcrumbs/breadcrumbs.js +3 -6
- package/src/customizations/volto/server.jsx +10 -10
- package/src/helpers/schema-utils.js +1 -1
- package/src/helpers/schema-utils.test.js +1 -1
- package/src/hocs/withErrorBoundary.jsx +1 -1
- package/src/hocs/withErrorBoundary.test.jsx +4 -11
- package/src/hocs/withRootNavigation.jsx +3 -2
- package/src/hocs/withRootNavigation.test.jsx +18 -14
- package/src/index.js +3 -3
- package/src/slate.js +1 -1
- package/src/customizations/volto/components/manage/Blocks/LeadImage/AlignChooser.jsx +0 -76
- package/src/customizations/volto/components/manage/Blocks/LeadImage/AlignChooser.test.js +0 -50
- package/src/customizations/volto/components/manage/Sidebar/SidebarPopup copy.jsx +0 -82
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`],
|
|
@@ -48,6 +48,7 @@ const defaultConfig = {
|
|
|
48
48
|
},
|
|
49
49
|
},
|
|
50
50
|
rules: {
|
|
51
|
+
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
|
|
51
52
|
'react/jsx-no-target-blank': [
|
|
52
53
|
'error',
|
|
53
54
|
{
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,34 @@ 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
|
+
### [4.0.0](https://github.com/eea/volto-eea-website-theme/compare/3.19.1...4.0.0) - 7 April 2026
|
|
8
|
+
|
|
9
|
+
#### :rocket: New Features
|
|
10
|
+
|
|
11
|
+
- feat: Volto 18 support - refs #301881 [Alin Voinea - [`ef848a8`](https://github.com/eea/volto-eea-website-theme/commit/ef848a8810d4b92942c775aabb31ac239ea57798)]
|
|
12
|
+
|
|
13
|
+
#### :bug: Bug Fixes
|
|
14
|
+
|
|
15
|
+
- fix: Replace barrel imports for webpack 5 compatibility - refs #301881 [Teodor Voicu - [`6cdc446`](https://github.com/eea/volto-eea-website-theme/commit/6cdc446889a51c5747a209b77119e25fdf984226)]
|
|
16
|
+
- fix: enforce object browser selection limit and stabilize defaults - refs #301881 [Alin Voinea - [`c3d6b97`](https://github.com/eea/volto-eea-website-theme/commit/c3d6b97ab6b057c692ea2dbe6bc3e4d252c695f7)]
|
|
17
|
+
- fix: make test [Alin V. (Claudiu) - [`69bdf9a`](https://github.com/eea/volto-eea-website-theme/commit/69bdf9a1ef5e72f39ab0d2bde56581f3f642a252)]
|
|
18
|
+
|
|
19
|
+
#### :house: Internal changes
|
|
20
|
+
|
|
21
|
+
- chore: Volto 18 eslint update - refs #301881 [Alin Voinea - [`b3d5677`](https://github.com/eea/volto-eea-website-theme/commit/b3d5677106c2de6c4c2e4a48f144d457ac9ce14d)]
|
|
22
|
+
|
|
23
|
+
#### :hammer_and_wrench: Others
|
|
24
|
+
|
|
25
|
+
- tests: Fix Sonar Qube tags - refs #297339 [Alin Voinea - [`13a95bf`](https://github.com/eea/volto-eea-website-theme/commit/13a95bf33f8c94232b682c204ae33118911778d7)]
|
|
26
|
+
### [3.19.1](https://github.com/eea/volto-eea-website-theme/compare/3.19.0...3.19.1) - 24 February 2026
|
|
27
|
+
|
|
28
|
+
#### :bug: Bug Fixes
|
|
29
|
+
|
|
30
|
+
- fix: History in indicators when copied_to or copied_from are not valid URLs - refs #297683 [Teodor Voicu - [`ccd5dad`](https://github.com/eea/volto-eea-website-theme/commit/ccd5dad4c4700d43d0697a1fb49df83d4ee96c83)]
|
|
31
|
+
|
|
32
|
+
#### :house: Internal changes
|
|
33
|
+
|
|
34
|
+
|
|
7
35
|
### [3.19.0](https://github.com/eea/volto-eea-website-theme/compare/3.18.1...3.19.0) - 11 February 2026
|
|
8
36
|
|
|
9
37
|
#### :house: Internal changes
|
package/DEVELOP.md
CHANGED
|
@@ -26,21 +26,20 @@
|
|
|
26
26
|
|
|
27
27
|
### Or add @eeacms/volto-eea-website-theme 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-eea-website-theme --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-eea-website-theme": {
|
|
42
|
+
"output": "packages",
|
|
44
43
|
"url": "https://github.com/eea/volto-eea-website-theme.git",
|
|
45
44
|
"package": "@eeacms/volto-eea-website-theme",
|
|
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-eea-website-theme` to the `addons` key in your project `package.json`
|
|
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-eea-website-theme
|
|
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-eea-website-theme` to `mrs.developer.json`
|
|
|
81
83
|
Go to:
|
|
82
84
|
|
|
83
85
|
```BASH
|
|
84
|
-
cd
|
|
86
|
+
cd packages/volto-eea-website-theme/
|
|
85
87
|
```
|
|
86
88
|
|
|
87
89
|
Start:
|
package/README.md
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
[](https://github.com/eea/volto-eea-website-theme/releases)
|
|
4
4
|
|
|
5
5
|
[](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-eea-website-theme/job/master/display/redirect)
|
|
6
|
-
[](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-eea-website-theme
|
|
6
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-website-theme)
|
|
7
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-website-theme)
|
|
8
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-website-theme)
|
|
9
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-website-theme)
|
|
10
10
|
|
|
11
11
|
[](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-eea-website-theme/job/develop/display/redirect)
|
|
12
|
-
[](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-eea-website-theme
|
|
12
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-website-theme&branch=develop)
|
|
13
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-website-theme&branch=develop)
|
|
14
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-website-theme&branch=develop)
|
|
15
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-website-theme&branch=develop)
|
|
16
16
|
|
|
17
17
|
EEA Website [Volto](https://github.com/plone/volto) Theme
|
|
18
18
|
|
|
@@ -54,6 +54,11 @@ See [Storybook](https://eea.github.io/eea-storybook/).
|
|
|
54
54
|
|
|
55
55
|
Go to http://localhost:3000
|
|
56
56
|
|
|
57
|
+
`make start` now defaults to Volto 18. To run the same setup against Volto 17, use:
|
|
58
|
+
|
|
59
|
+
VOLTO_VERSION=17 make
|
|
60
|
+
VOLTO_VERSION=17 make start
|
|
61
|
+
|
|
57
62
|
### Add volto-eea-website-theme to your Volto project
|
|
58
63
|
|
|
59
64
|
1. Make sure you have a [Plone backend](https://plone.org/download) up-and-running at http://localhost:8080/Plone
|
|
@@ -76,21 +81,28 @@ Go to http://localhost:3000
|
|
|
76
81
|
}
|
|
77
82
|
```
|
|
78
83
|
|
|
79
|
-
- If not, create one
|
|
84
|
+
- If not, create one with Cookieplone, as recommended by the official Plone documentation for Volto 18+:
|
|
80
85
|
|
|
81
86
|
```
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
cd my-volto-project
|
|
87
|
+
uvx cookieplone project
|
|
88
|
+
cd project-title
|
|
85
89
|
```
|
|
86
90
|
|
|
87
|
-
1. Install
|
|
91
|
+
1. Install or update dependencies, then start the project:
|
|
88
92
|
|
|
89
93
|
```
|
|
90
|
-
|
|
91
|
-
yarn start
|
|
94
|
+
make install
|
|
92
95
|
```
|
|
93
96
|
|
|
97
|
+
For a Cookieplone project, start the backend and frontend in separate terminals:
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
make backend-start
|
|
101
|
+
make frontend-start
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
For a legacy Volto 17 project, install the package with `yarn` and restart the frontend as usual.
|
|
105
|
+
|
|
94
106
|
1. Go to http://localhost:3000
|
|
95
107
|
|
|
96
108
|
1. Happy editing!
|
package/docker-compose.yml
CHANGED
package/jest-addon.config.js
CHANGED
|
@@ -19,6 +19,12 @@ const path = require('path');
|
|
|
19
19
|
const fs = require('fs');
|
|
20
20
|
const fg = require('fast-glob');
|
|
21
21
|
|
|
22
|
+
const voltoSlatePath = fs.existsSync(
|
|
23
|
+
path.join(__dirname, '../../../node_modules/@plone/volto-slate/src'),
|
|
24
|
+
)
|
|
25
|
+
? '<rootDir>/node_modules/@plone/volto-slate/src'
|
|
26
|
+
: '<rootDir>/node_modules/@plone/volto/packages/volto-slate/src';
|
|
27
|
+
|
|
22
28
|
// Get the addon name from the current file path
|
|
23
29
|
const pathParts = __filename.split(path.sep);
|
|
24
30
|
const addonsIdx = pathParts.lastIndexOf('addons');
|
|
@@ -428,10 +434,8 @@ module.exports = {
|
|
|
428
434
|
// This ensures tests use the local development version instead of node_modules
|
|
429
435
|
[`^@eeacms/${addonName}/(.*)$`]: `<rootDir>/src/addons/${addonName}/src/$1`,
|
|
430
436
|
'@eeacms/(.*?)/(.*)$': '<rootDir>/node_modules/@eeacms/$1/src/$2',
|
|
431
|
-
'@plone/volto-slate$':
|
|
432
|
-
|
|
433
|
-
'@plone/volto-slate/(.*)$':
|
|
434
|
-
'<rootDir>/node_modules/@plone/volto/packages/volto-slate/src/$1',
|
|
437
|
+
'@plone/volto-slate$': voltoSlatePath,
|
|
438
|
+
'@plone/volto-slate/(.*)$': `${voltoSlatePath}/$1`,
|
|
435
439
|
'~/(.*)$': '<rootDir>/src/$1',
|
|
436
440
|
'load-volto-addons':
|
|
437
441
|
'<rootDir>/node_modules/@plone/volto/jest-addons-loader.js',
|
package/package.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { EditSchema } from './schema';
|
|
3
|
-
import
|
|
3
|
+
import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal';
|
|
4
4
|
import BlockDataForm from '@plone/volto/components/manage/Form/BlockDataForm';
|
|
5
5
|
|
|
6
6
|
import ContextNavigationView from './ContextNavigationView';
|
|
7
7
|
|
|
8
8
|
import { useSelector, shallowEqual } from 'react-redux';
|
|
9
9
|
|
|
10
|
+
const EMPTY_TYPES = Object.freeze([]);
|
|
11
|
+
|
|
10
12
|
function arePropsEqual(oldProps, newProps) {
|
|
11
13
|
return (
|
|
12
14
|
newProps.selected === oldProps.selected &&
|
|
@@ -17,7 +19,7 @@ function arePropsEqual(oldProps, newProps) {
|
|
|
17
19
|
|
|
18
20
|
const ContextNavigationFillEdit = (props) => {
|
|
19
21
|
const contentTypes = useSelector(
|
|
20
|
-
(state) => state.types?.types
|
|
22
|
+
(state) => state.types?.types ?? EMPTY_TYPES,
|
|
21
23
|
shallowEqual,
|
|
22
24
|
);
|
|
23
25
|
|
|
@@ -5,22 +5,16 @@ import { Router } from 'react-router-dom';
|
|
|
5
5
|
import { Provider } from 'react-intl-redux';
|
|
6
6
|
import configureStore from 'redux-mock-store';
|
|
7
7
|
import { createMemoryHistory } from 'history';
|
|
8
|
-
import '@testing-library/jest-dom
|
|
8
|
+
import '@testing-library/jest-dom';
|
|
9
9
|
|
|
10
|
-
jest.mock('@plone/volto/components', () => ({
|
|
11
|
-
|
|
10
|
+
jest.mock('@plone/volto/components/manage/Form/BlockDataForm', () => ({
|
|
11
|
+
__esModule: true,
|
|
12
|
+
default: ({ onChangeField }) => (
|
|
12
13
|
<div>
|
|
13
|
-
<p>
|
|
14
|
+
<p>BlockDataForm</p>
|
|
14
15
|
<input id="test" onChange={onChangeField} />
|
|
15
16
|
</div>
|
|
16
17
|
),
|
|
17
|
-
SidebarPortal: ({ children, selected }) =>
|
|
18
|
-
selected ? (
|
|
19
|
-
<div>
|
|
20
|
-
<div>SidebarPortal</div>
|
|
21
|
-
{children}
|
|
22
|
-
</div>
|
|
23
|
-
) : null,
|
|
24
18
|
}));
|
|
25
19
|
|
|
26
20
|
jest.mock('@plone/volto/components/theme/Navigation/ContextNavigation', () => {
|
|
@@ -32,11 +26,19 @@ jest.mock('@plone/volto/components/theme/Navigation/ContextNavigation', () => {
|
|
|
32
26
|
};
|
|
33
27
|
});
|
|
34
28
|
|
|
35
|
-
jest.mock('@plone/volto/
|
|
29
|
+
jest.mock('@plone/volto/components/manage/Sidebar/SidebarPortal', () => ({
|
|
30
|
+
__esModule: true,
|
|
31
|
+
default: ({ children, selected }) =>
|
|
32
|
+
selected ? (
|
|
33
|
+
<div>
|
|
34
|
+
<div>SidebarPortal</div>
|
|
35
|
+
{children}
|
|
36
|
+
</div>
|
|
37
|
+
) : null,
|
|
38
|
+
}));
|
|
39
|
+
|
|
40
|
+
jest.mock('@plone/volto/helpers/Extensions', () => ({
|
|
36
41
|
withBlockExtensions: jest.fn((Component) => Component),
|
|
37
|
-
emptyBlocksForm: jest.fn(),
|
|
38
|
-
getBlocksLayoutFieldname: () => 'blocks_layout',
|
|
39
|
-
withVariationSchemaEnhancer: jest.fn((Component) => Component),
|
|
40
42
|
}));
|
|
41
43
|
|
|
42
44
|
const mockStore = configureStore();
|
|
@@ -53,14 +55,14 @@ describe('ContextNavigationEdit', () => {
|
|
|
53
55
|
const { getByText, queryByText } = render(
|
|
54
56
|
<Provider store={store}>
|
|
55
57
|
<Router history={history}>
|
|
56
|
-
<ContextNavigationEdit selected={false} />
|
|
58
|
+
<ContextNavigationEdit selected={false} data={{}} />
|
|
57
59
|
</Router>
|
|
58
60
|
</Provider>,
|
|
59
61
|
);
|
|
60
62
|
|
|
61
63
|
expect(getByText('Context navigation')).toBeInTheDocument();
|
|
62
64
|
expect(getByText('ConnectedContextNavigation')).toBeInTheDocument();
|
|
63
|
-
expect(queryByText('
|
|
65
|
+
expect(queryByText('BlockDataForm')).toBeNull();
|
|
64
66
|
expect(queryByText('SidebarPortal')).toBeNull();
|
|
65
67
|
});
|
|
66
68
|
|
|
@@ -69,14 +71,18 @@ describe('ContextNavigationEdit', () => {
|
|
|
69
71
|
const { container, getByText } = render(
|
|
70
72
|
<Provider store={store}>
|
|
71
73
|
<Router history={history}>
|
|
72
|
-
<ContextNavigationEdit
|
|
74
|
+
<ContextNavigationEdit
|
|
75
|
+
selected={true}
|
|
76
|
+
onChangeBlock={() => {}}
|
|
77
|
+
data={{}}
|
|
78
|
+
/>
|
|
73
79
|
</Router>
|
|
74
80
|
</Provider>,
|
|
75
81
|
);
|
|
76
82
|
|
|
77
83
|
expect(getByText('Context navigation')).toBeInTheDocument();
|
|
78
84
|
expect(getByText('ConnectedContextNavigation')).toBeInTheDocument();
|
|
79
|
-
expect(getByText('
|
|
85
|
+
expect(getByText('BlockDataForm')).toBeInTheDocument();
|
|
80
86
|
expect(getByText('SidebarPortal')).toBeInTheDocument();
|
|
81
87
|
|
|
82
88
|
fireEvent.change(container.querySelector('#test'), {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { flattenToAppURL
|
|
2
|
+
import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
|
|
3
|
+
import { withBlockExtensions } from '@plone/volto/helpers/Extensions';
|
|
3
4
|
import DefaultTemplate from './variations/Default';
|
|
4
5
|
|
|
5
6
|
function arePropsEqual(prevProps, nextProps) {
|
|
@@ -5,7 +5,7 @@ import { Router } from 'react-router-dom';
|
|
|
5
5
|
import { Provider } from 'react-intl-redux';
|
|
6
6
|
import configureStore from 'redux-mock-store';
|
|
7
7
|
import { createMemoryHistory } from 'history';
|
|
8
|
-
import '@testing-library/jest-dom
|
|
8
|
+
import '@testing-library/jest-dom';
|
|
9
9
|
|
|
10
10
|
jest.mock('@plone/volto/components/theme/Navigation/ContextNavigation', () => {
|
|
11
11
|
return {
|
|
@@ -16,10 +16,12 @@ jest.mock('@plone/volto/components/theme/Navigation/ContextNavigation', () => {
|
|
|
16
16
|
};
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
-
jest.mock('@plone/volto/helpers', () => ({
|
|
19
|
+
jest.mock('@plone/volto/helpers/Extensions', () => ({
|
|
20
20
|
withBlockExtensions: jest.fn((Component) => Component),
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
}));
|
|
22
|
+
|
|
23
|
+
jest.mock('@plone/volto/helpers/Url/Url', () => ({
|
|
24
|
+
__esModule: true,
|
|
23
25
|
flattenToAppURL: () => '',
|
|
24
26
|
}));
|
|
25
27
|
|
|
@@ -8,10 +8,10 @@ import { Accordion, Icon } from 'semantic-ui-react';
|
|
|
8
8
|
|
|
9
9
|
import Slugger from 'github-slugger';
|
|
10
10
|
|
|
11
|
-
import
|
|
11
|
+
import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink';
|
|
12
12
|
import { withContentNavigation } from '@plone/volto/components/theme/Navigation/withContentNavigation';
|
|
13
13
|
import withEEASideMenu from '@eeacms/volto-block-toc/hocs/withEEASideMenu';
|
|
14
|
-
import { flattenToAppURL } from '@plone/volto/helpers';
|
|
14
|
+
import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
|
|
15
15
|
|
|
16
16
|
const messages = defineMessages({
|
|
17
17
|
navigation: {
|
|
@@ -4,8 +4,10 @@ import cx from 'classnames';
|
|
|
4
4
|
import { compose } from 'redux';
|
|
5
5
|
import { withRouter } from 'react-router';
|
|
6
6
|
|
|
7
|
-
import { flattenToAppURL } from '@plone/volto/helpers';
|
|
8
|
-
import
|
|
7
|
+
import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
|
|
8
|
+
import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink';
|
|
9
|
+
import MaybeWrap from '@plone/volto/components/manage/MaybeWrap/MaybeWrap';
|
|
10
|
+
import Icon from '@plone/volto/components/theme/Icon/Icon';
|
|
9
11
|
import { withContentNavigation } from '@plone/volto/components/theme/Navigation/withContentNavigation';
|
|
10
12
|
|
|
11
13
|
import downloadSVG from '@plone/volto/icons/download.svg';
|
|
@@ -4,7 +4,7 @@ import { Router } from 'react-router-dom';
|
|
|
4
4
|
import { createMemoryHistory } from 'history';
|
|
5
5
|
import ReportNavigation from './ReportNavigation';
|
|
6
6
|
import configureStore from 'redux-mock-store';
|
|
7
|
-
import '@testing-library/jest-dom
|
|
7
|
+
import '@testing-library/jest-dom';
|
|
8
8
|
|
|
9
9
|
const mockStore = configureStore();
|
|
10
10
|
const store = mockStore({
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import EditBlockWrapper from '@eeacms/volto-group-block/components/manage/Blocks/Group/EditBlockWrapper';
|
|
2
|
+
import BlocksForm from '@plone/volto/components/manage/Blocks/Block/BlocksForm';
|
|
3
|
+
import cx from 'classnames';
|
|
5
4
|
|
|
6
|
-
import helpSVG from '@plone/volto/icons/help.svg';
|
|
7
5
|
import RenderBlocks from './RenderBlocks';
|
|
8
6
|
import './editor-flex.less';
|
|
9
7
|
|
|
@@ -17,8 +15,6 @@ const FlexGroup = (props) => {
|
|
|
17
15
|
selected,
|
|
18
16
|
selectedBlock,
|
|
19
17
|
onSelectBlock,
|
|
20
|
-
setSelectedBlock,
|
|
21
|
-
multiSelected,
|
|
22
18
|
manage,
|
|
23
19
|
childBlocksForm,
|
|
24
20
|
formDescription,
|
|
@@ -26,7 +22,7 @@ const FlexGroup = (props) => {
|
|
|
26
22
|
} = props;
|
|
27
23
|
const metadata = props.metadata || props.properties;
|
|
28
24
|
const blockState = {};
|
|
29
|
-
const { no_of_columns =
|
|
25
|
+
const { no_of_columns = 1 } = data;
|
|
30
26
|
const flexClassNames = `ui unstackable items row flex-items-wrapper items-${no_of_columns}-columns`;
|
|
31
27
|
|
|
32
28
|
React.useEffect(() => {
|
|
@@ -43,12 +39,19 @@ const FlexGroup = (props) => {
|
|
|
43
39
|
}
|
|
44
40
|
|
|
45
41
|
return (
|
|
46
|
-
<div
|
|
42
|
+
<div
|
|
43
|
+
className={cx('flex-blocks-form', {
|
|
44
|
+
'disable-inner-buttons': data.disableInnerButtons,
|
|
45
|
+
})}
|
|
46
|
+
data-block={block}
|
|
47
|
+
>
|
|
47
48
|
{isEditMode ? (
|
|
48
49
|
<BlocksForm
|
|
49
50
|
metadata={metadata}
|
|
50
51
|
properties={childBlocksForm}
|
|
51
52
|
manage={manage}
|
|
53
|
+
isMainForm={false}
|
|
54
|
+
stopPropagation={selectedBlock}
|
|
52
55
|
selectedBlock={selected ? selectedBlock : null}
|
|
53
56
|
allowedBlocks={data.allowedBlocks}
|
|
54
57
|
title={data.placeholder}
|
|
@@ -80,42 +83,7 @@ const FlexGroup = (props) => {
|
|
|
80
83
|
}
|
|
81
84
|
}}
|
|
82
85
|
pathname={pathname}
|
|
83
|
-
|
|
84
|
-
{({ draginfo }, editBlock, blockProps) => (
|
|
85
|
-
<div className="flex-item">
|
|
86
|
-
<div className="item-wrapper">
|
|
87
|
-
<EditBlockWrapper
|
|
88
|
-
draginfo={draginfo}
|
|
89
|
-
blockProps={blockProps}
|
|
90
|
-
disabled={data.disableInnerButtons}
|
|
91
|
-
extraControls={
|
|
92
|
-
<>
|
|
93
|
-
{instructions && (
|
|
94
|
-
<>
|
|
95
|
-
<Button
|
|
96
|
-
icon
|
|
97
|
-
basic
|
|
98
|
-
title="Section help"
|
|
99
|
-
onClick={() => {
|
|
100
|
-
setSelectedBlock();
|
|
101
|
-
const tab = manage ? 0 : 1;
|
|
102
|
-
props.setSidebarTab(tab);
|
|
103
|
-
}}
|
|
104
|
-
>
|
|
105
|
-
<Icon name={helpSVG} className="" size="19px" />
|
|
106
|
-
</Button>
|
|
107
|
-
</>
|
|
108
|
-
)}
|
|
109
|
-
</>
|
|
110
|
-
}
|
|
111
|
-
multiSelected={multiSelected.includes(blockProps.block)}
|
|
112
|
-
>
|
|
113
|
-
{editBlock}
|
|
114
|
-
</EditBlockWrapper>
|
|
115
|
-
</div>
|
|
116
|
-
</div>
|
|
117
|
-
)}
|
|
118
|
-
</BlocksForm>
|
|
86
|
+
/>
|
|
119
87
|
) : (
|
|
120
88
|
<div className={flexClassNames}>
|
|
121
89
|
<RenderBlocks metadata={metadata} content={data?.data || {}} />
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { getBaseUrl
|
|
2
|
+
import { getBaseUrl } from '@plone/volto/helpers/Url/Url';
|
|
3
|
+
import { applyBlockDefaults } from '@plone/volto/helpers/Blocks/Blocks';
|
|
3
4
|
import { defineMessages, injectIntl } from 'react-intl';
|
|
4
|
-
import
|
|
5
|
+
import map from 'lodash/map';
|
|
5
6
|
import {
|
|
6
7
|
getBlocksFieldname,
|
|
7
8
|
getBlocksLayoutFieldname,
|
|
8
9
|
hasBlocksData,
|
|
9
|
-
} from '@plone/volto/helpers';
|
|
10
|
+
} from '@plone/volto/helpers/Blocks/Blocks';
|
|
10
11
|
import StyleWrapper from '@plone/volto/components/manage/Blocks/Block/StyleWrapper';
|
|
11
12
|
import config from '@plone/volto/registry';
|
|
12
|
-
import
|
|
13
|
+
import ViewDefaultBlock from '@plone/volto/components/manage/Blocks/Block/DefaultView';
|
|
13
14
|
|
|
14
15
|
const messages = defineMessages({
|
|
15
16
|
unknownBlock: {
|
|
@@ -3,12 +3,53 @@
|
|
|
3
3
|
@type: 'extra';
|
|
4
4
|
@element: 'custom';
|
|
5
5
|
|
|
6
|
-
@baseWidth: 100%;
|
|
7
|
-
|
|
8
6
|
// on edit ensure add button is next to the block input area
|
|
9
7
|
.flex-blocks-form {
|
|
10
|
-
|
|
8
|
+
[data-rbd-draggable-context-id] {
|
|
11
9
|
position: relative;
|
|
12
|
-
width: 100
|
|
10
|
+
min-width: var(--flex-item-width, 100%);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&.disable-inner-buttons {
|
|
14
|
+
.drag.handle.wrapper,
|
|
15
|
+
.delete-button,
|
|
16
|
+
.block-add-button {
|
|
17
|
+
display: none !important;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Mirror column width rules from item.overrides for edit mode
|
|
23
|
+
// (.flex-item wrapper was removed; DnD wrappers are now the flex children)
|
|
24
|
+
// items-1-columns: override inherited 25% from .group.flex .items-1-columns in item.overrides
|
|
25
|
+
.flex-blocks-form
|
|
26
|
+
.flex-items-wrapper.items-1-columns
|
|
27
|
+
[data-rbd-draggable-context-id] {
|
|
28
|
+
--flex-item-width: 100%;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@media only screen and (min-width: @tabletBreakpoint) {
|
|
32
|
+
.flex-blocks-form
|
|
33
|
+
.flex-items-wrapper.items-2-columns
|
|
34
|
+
[data-rbd-draggable-context-id] {
|
|
35
|
+
--flex-item-width: calc(100% / 2 - 1%);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.flex-blocks-form
|
|
39
|
+
.flex-items-wrapper.items-3-columns
|
|
40
|
+
[data-rbd-draggable-context-id] {
|
|
41
|
+
--flex-item-width: calc(100% / 3 - 1%);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.flex-blocks-form
|
|
45
|
+
.flex-items-wrapper.items-4-columns
|
|
46
|
+
[data-rbd-draggable-context-id] {
|
|
47
|
+
--flex-item-width: calc(100% / 4 - 1%);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.flex-blocks-form
|
|
51
|
+
.flex-items-wrapper.items-5-columns
|
|
52
|
+
[data-rbd-draggable-context-id] {
|
|
53
|
+
--flex-item-width: calc(100% / 5 - 1%);
|
|
13
54
|
}
|
|
14
55
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { EditSchema } from './schema';
|
|
3
|
-
import
|
|
3
|
+
import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal';
|
|
4
|
+
import BlockDataForm from '@plone/volto/components/manage/Form/BlockDataForm';
|
|
4
5
|
import LayoutSettingsView from './LayoutSettingsView';
|
|
5
6
|
|
|
6
7
|
const LayoutSettingsEdit = (props) => {
|