Skip to content

Commit 5637f63

Browse files
committed
Merge branch 'master' into plone6-docs
* master: (25 commits) Add projectId for Cypress dashboard (#3023) Docs: faster onboarding, identify running processes, improve internal proxy clarification (#3010) Pin pyOpenSSL to 21.1.0 Back to development Release 14.7.0 Prepare for release Fix changelog Look ma, no `momentjs`! (#2910) Back to development Release 14.6.0 Prepare for release Fix ObjectWidget story (#3009) Use `volto.config.js` as dynamic configuration for addons. It adds up… (#3008) fix: enable url with 'underscore' char fix: fixed italian translations Back to development Release 14.5.0 Prepare for release Chenges to lockfile not saved, apparently :/ Fix `language-independent-field` CSS class styling (#3005) ...
2 parents 00c76fb + facd3c9 commit 5637f63

File tree

77 files changed

+2496
-327
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+2496
-327
lines changed

Diff for: CHANGELOG.md

+44-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Change Log
22

3-
## 14.4.1 (unreleased)
3+
## 14.7.1 (unreleased)
44

55
### Breaking
66

@@ -12,9 +12,50 @@
1212

1313
### Internal
1414

15-
- Lazyload react-beautiful-dnd @tiberiuichim
15+
### Docs
16+
17+
Update documentation for internal proxy & other smaller reorganisation for quicker onboarding of
18+
new users/evaluators. @fredvd
19+
20+
## 14.7.0 (2022-01-28)
21+
22+
### Feature
23+
24+
- Add `<FormattedDate>` and `<FormattedRelativeDate>` components. Check their Storybook stories for details. This is part of ongoing work to minimize the use of 'deprecated' momentjs. @sneridagh @tiberiuichim
25+
26+
### Internal
27+
28+
- Upgrade jest to latest release, 27 major. @tiberiuichim
29+
- Lazyload momentjs. `parseDateTime` helper now requires passing the momentjs library @tiberiuichim
30+
31+
## 14.6.0 (2022-01-27)
32+
33+
### Feature
34+
35+
- Use `volto.config.js` as dynamic configuration for addons. It adds up to the `package.json` `addons` key, allowing dynamic load of addons (eg. via environment variables) @sneridagh
1636

37+
### Internal
38+
39+
- Fix ObjectListWidget story bug caused by lazyloading dnd libraries
40+
@tiberiuichim
41+
42+
## 14.5.0 (2022-01-26)
43+
44+
### Feature
45+
46+
- VocabularyTermsWidget: Token is now on creation of term editable, but stays ineditable afterwards. @ksuess
47+
48+
### Bugfix
49+
50+
- Fix A11Y violations in Navigation @iRohitSingh
51+
- Fix `language-independent-field` CSS class styling @sneridagh
52+
53+
### Internal
54+
55+
- Lazyload react-beautiful-dnd @tiberiuichim
1756
- Lazyload react-dnd @tiberiuichim
57+
- Improve docs on environment variables, add recipes @sneridagh
58+
- Update p.restapi to 8.20.0 and plone.volto to 4.0.0a1 and plone.rest to 2.0.0a2 @sneridagh
1859

1960
## 14.4.0 (2022-01-21)
2061

@@ -32,6 +73,7 @@
3273

3374
### Bugfix
3475

76+
- Fix ListingBlock to add "No results" message when there are no messages @erral
3577
- Fix overflow table in Content view @giuliaghisini
3678
- Fixed url validation in FormValidation to admit ip addresses. @giuliaghisini
3779
- Upgrade to plone.restapi 8.19.0 (to support the language independent fields serialization) @sneridagh

Diff for: Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ MAKEFLAGS+=--no-builtin-rules
1414

1515
INSTANCE_PORT=8080
1616
DOCKER_IMAGE=plone/plone-backend:5.2.6
17-
KGS=plone.restapi==8.19.0 plone.app.iterate==4.0.2 plone.rest==2.0.0a1 plone.app.vocabularies==4.3.0 plone.volto==3.1.0a8
17+
KGS=plone.restapi==8.20.0 plone.volto==4.0.0a2 plone.rest==2.0.0a2 plone.app.iterate==4.0.2 plone.app.vocabularies==4.3.0
1818

1919
# Recipe snippets for reuse
2020

@@ -91,7 +91,7 @@ start-backend: ## Start Plone Backend
9191

9292
.PHONY: start-backend-docker
9393
start-backend-docker:
94-
docker run -it --rm --name=plone -p 8080:8080 -e SITE=Plone -e ADDONS="plone.volto" -e ZCML="plone.volto.cors" plone
94+
docker run -it --rm -p 8080:8080 -e SITE=Plone -e ADDONS='$(KGS)' $(DOCKER_IMAGE)
9595

9696
.PHONY: start-backend-docker-guillotina
9797
start-backend-docker-guillotina:

Diff for: __tests__/addon-registry.test.js

+10
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ describe('AddonConfigurationRegistry', () => {
2626
'test-addon',
2727
'test-released-addon',
2828
'test-released-source-addon',
29+
'my-volto-config-addon',
2930
'test-released-dummy',
3031
'test-released-unmentioned',
3132
]);
@@ -60,6 +61,13 @@ describe('AddonConfigurationRegistry', () => {
6061
name: 'test-released-unmentioned',
6162
packageJson: `${base}/node_modules/test-released-unmentioned/package.json`,
6263
},
64+
'my-volto-config-addon': {
65+
addons: ['test-released-dummy'],
66+
isPublishedPackage: false,
67+
modulePath: `${base}/addons/my-volto-config-addon/src`,
68+
name: 'my-volto-config-addon',
69+
packageJson: `${base}/addons/my-volto-config-addon/package.json`,
70+
},
6371
'test-released-dummy': {
6472
addons: ['test-released-unmentioned'],
6573
isPublishedPackage: false,
@@ -74,6 +82,7 @@ describe('AddonConfigurationRegistry', () => {
7482
const base = path.join(__dirname, 'fixtures', 'test-volto-project');
7583
const reg = new AddonConfigurationRegistry(base);
7684
expect(reg.getResolveAliases()).toStrictEqual({
85+
'my-volto-config-addon': `${base}/addons/my-volto-config-addon/src`,
7786
'test-addon': `${base}/addons/test-addon/src`,
7887
'test-released-addon': `${base}/node_modules/test-released-addon`,
7988
'test-released-dummy': `${base}/addons/test-released-dummy`,
@@ -98,6 +107,7 @@ describe('AddonConfigurationRegistry', () => {
98107
'test-addon',
99108
'test-released-addon',
100109
'test-released-source-addon',
110+
'my-volto-config-addon',
101111
]);
102112
});
103113

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "test-addon",
3+
"customizationPaths": [
4+
"src/custom-addons"
5+
],
6+
"addons": [
7+
"test-released-dummy"
8+
]
9+
}

Diff for: __tests__/fixtures/test-volto-project/addons/my-volto-config-addon/src/testaddon.js

Whitespace-only changes.

Diff for: __tests__/fixtures/test-volto-project/jsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"compilerOptions": {
33
"paths": {
44
"test-addon": ["test-addon/src"],
5-
"test-released-dummy": ["test-released-dummy"]
5+
"test-released-dummy": ["test-released-dummy"],
6+
"my-volto-config-addon": ["my-volto-config-addon/src"]
67
},
78
"baseUrl": "addons"
89
}
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
addons: ['my-volto-config-addon'],
3+
};

Diff for: addon-registry.js

+15-2
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,26 @@ class AddonConfigurationRegistry {
9999
projectRootPath,
100100
'package.json',
101101
)));
102+
// Loads the dynamic config, if any
103+
if (fs.existsSync(path.join(projectRootPath, 'volto.config.js'))) {
104+
this.voltoConfigJS = require(path.join(
105+
projectRootPath,
106+
'volto.config.js',
107+
));
108+
} else {
109+
this.voltoConfigJS = [];
110+
}
111+
this.resultantMergedAddons = [
112+
...(packageJson.addons || []),
113+
...(this.voltoConfigJS.addons || []),
114+
];
102115

103116
this.projectRootPath = projectRootPath;
104117
this.voltoPath =
105118
packageJson.name === '@plone/volto'
106119
? `${projectRootPath}`
107120
: `${projectRootPath}/node_modules/@plone/volto`;
108-
this.addonNames = (packageJson.addons || []).map((s) => s.split(':')[0]);
121+
this.addonNames = this.resultantMergedAddons.map((s) => s.split(':')[0]);
109122
this.packages = {};
110123
this.customizations = new Map();
111124

@@ -114,7 +127,7 @@ class AddonConfigurationRegistry {
114127
this.initTestingPackages();
115128

116129
this.dependencyGraph = buildDependencyGraph(
117-
packageJson.addons || [],
130+
this.resultantMergedAddons,
118131
(name) => {
119132
this.initPublishedPackage(name);
120133
return this.packages[name].addons || [];

Diff for: api/buildout.cfg

+3-2
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,14 @@ eggs = ${instance:eggs}
7474
setuptools =
7575
zc.buildout =
7676
# force to latest p.restapi
77-
plone.restapi = 8.19.0
77+
plone.restapi = 8.20.0
7878
# new JSON only traversal
79-
plone.rest = 2.0.0a1
79+
plone.rest = 2.0.0a2
8080
# Using working copy support in Volto requires it
8181
plone.app.iterate = 4.0.2
8282
# plone.volto requires it
8383
plone.app.vocabularies = 4.3.0
84+
pyOpenSSL = 21.0.0
8485

8586
plone.volto =
8687
robotframework =

Diff for: cypress.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"viewportWidth": 1280,
44
"ignoreTestFiles": ["*~"],
55
"integrationFolder": "cypress/tests/core",
6-
"chromeWebSecurity": false
6+
"chromeWebSecurity": false,
7+
"projectId": "5iy5e2"
78
}

Diff for: cypress/tests/core-sandbox/search.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ context('Search action tests', () => {
3232
cy.navigate('/newsitem/edit');
3333

3434
// Add subject
35-
cy.get('a:contains("Categorization")')
36-
.click()
37-
.get('.field-wrapper-subjects input')
35+
cy.get('.field-wrapper-subjects input')
3836
.type('garden', { force: true })
3937
.type('{enter}');
4038
cy.get('#toolbar-save').click();

Diff for: docs/mkdocs.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,15 @@ extra_css:
2020

2121
nav:
2222
- Getting Started:
23-
- Bootstrap Volto: 'getting-started/install.md'
23+
- Installing Volto: 'getting-started/install.md'
2424
- Developer roadmap: 'getting-started/roadmap.md'
2525
- Learning resources: 'getting-started/others.md'
26-
- How does it work under the hood: 'getting-started/howdoesitwork.md'
27-
- Design principles: 'design-principles/index.md'
28-
- Style Guide: 'style-guide/index.md'
2926
- Configuration:
3027
- What is configurable?: 'configuration/how-to.md'
3128
- Settings reference guide: 'configuration/settings-reference.md'
3229
- Zero config builds: 'configuration/zero-config-builds.md'
3330
- Internal proxy: 'configuration/internalproxy.md'
31+
- Dynamic Volto Addons Configuration: 'configuration/volto-config-js.md'
3432
- Backend configuration: 'configuration/backend.md'
3533
- Richeditor settings: 'configuration/richeditor-settings.md'
3634
- Multilingual: 'configuration/multilingual.md'
@@ -79,6 +77,8 @@ nav:
7977
- Performance improvements: 'deploying/performance.md'
8078
- Upgrade Guide: 'upgrade-guide/index.md'
8179
- Developer Guidelines:
80+
- Design principles: 'developer-guidelines/design-principles.md'
81+
- Style Guide: 'developer-guidelines/style-guide.md'
8282
- Language features: 'developer-guidelines/language-features.md'
8383
- Linting: 'developer-guidelines/linting.md'
8484
- React: 'developer-guidelines/react.md'

Diff for: docs/source/configuration/backend.md

+7-10
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,20 @@ html_meta:
99
# Backend configuration
1010

1111
## plone.volto
12+
<<<<<<< HEAD
13+
In order to fully support all Volto features, the Plone backend content API needs to be prepared for Volto. The add'on `plone.volto` does all the heavy lifting for you and is ready to use in your own projects. We used it in our Getting Started section.
1214

13-
In order to fully support all Volto features, the Plone backend, needs to be prepared for
14-
Volto. This involves configuration, add-ons installation and some patches to the core.
15-
The add'on `plone.volto` does all the heavy lifting for you and it's ready to use
16-
in your own projects. We used it in our Getting Started section.
17-
18-
However, this package is oppinionated and might not fit your needs, so if you want to
19-
use your own integration package instead, just take a look at the features it provides,
15+
This package is slightly opinionated but provides the correct default settings for when
16+
you want to start with Volto. If you have advanced needs or want to move the setting to
17+
your own integration package instead, just take a look at the features it provides,
2018
copy the ones you need for your project and create your own integration package.
2119

2220
https://github.com/plone/plone.volto
2321

2422
!!! tip
2523
From Volto 5.1 and above, Volto features an internal proxy to your API server. So
26-
you don't have to deal with CORS. It's enabled by default, pointing to the server
27-
specified in the `devProxyToApiPath` Volto settings (http://localhost:8080/Plone).
28-
See [here](../configuration/internalproxy.md) for more details.
24+
you don't have to deal with CORS issues. It's enabled by default, pointing to the server specified in the `devProxyToApiPath` Volto settings
25+
(http://localhost:8080/Plone). See [here](../configuration/internalproxy.md) for more information.
2926

3027
## Install a Plone backend locally without Docker
3128

Diff for: docs/source/configuration/environmentvariables.md

+24-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,29 @@ In the frontend we can access this variable with:
2323
window.env.RAZZLE_MY_VARIABLE
2424
```
2525

26-
## RAZZLE_LEGACY_TRAVERSE
26+
## Runtime environment variables
27+
28+
All the environment variables that are configurable work at runtime, not only at build time. This works since Volto 13 onwards.
29+
30+
!!! info
31+
Before Volto 13, you'd do:
32+
33+
```bash
34+
RAZZLE_API_PATH=https://plone.org yarn build && yarn start:prod
35+
```
36+
37+
From Volto 13 onwards, you can now do:
38+
39+
```bash
40+
yarn build && RAZZLE_API_PATH=https://plone.org yarn start:prod
41+
```
42+
43+
This brings you a lot of power since you don't have to rebuild on every config change. You can also generate builds on your CI, then deploy them anywhere.
44+
45+
46+
## Environment variables reference
47+
48+
### RAZZLE_LEGACY_TRAVERSE
2749

2850
From Volto 14 onwards, Seamless mode is the recommended way of setting up your depoloyments. However, it forces you to upgrade several packages in the backend (`plone.restapi` and `plone.rest`) and adjust your web server configuration accordingly.
2951

@@ -33,7 +55,7 @@ In case you can't afford or change your deployment, you can still upgrade Volto
3355
RAZZLE_LEGACY_TRAVERSE=true yarn start:prod
3456
```
3557

36-
## VOLTO_ROBOTSTXT
58+
### VOLTO_ROBOTSTXT
3759

3860
You can override the robots.txt file with an environment variable called
3961
`VOLTO_ROBOTSTXT`. This is useful when using the same build on multiple
@@ -48,7 +70,6 @@ Disallow: /" yarn start
4870
If you want to use the `VOLTO_ROBOTSTXT` environment variable, make sure to
4971
delete the file `public/robots.txt` from your project.
5072

51-
5273
### DEBUG
5374

5475
It will enable the log several logging points scattered through the Volto code. It uses the `volto:` namespace.

Diff for: docs/source/configuration/how-to.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ like:
2222
const absoluteUrl = `${config.settings.apiPath}/${content.url}`
2323
```
2424

25-
Both add-ons and projects can extend Volto's configuration registry. First the add-ons
26-
configuration is applied, in the order they are defined in `package.json`, then finally
27-
the project configuration is applied. Visualized like a pipe would be:
25+
Both the main project and individual add-ons can extend Volto's configuration registry.
26+
First the add-ons configuration is applied, in the order they are defined in
27+
`package.json`, then finally the project configuration is applied. Visualized like
28+
a pipe would be:
2829

2930
> Default Volto configuration -> Add-on 1 -> Add-on 2 -> ... -> Add-on n -> Project
3031

0 commit comments

Comments
 (0)