Skip to content

Commit

Permalink
Merge branch 'master' into addcomponenttoconfigregistry
Browse files Browse the repository at this point in the history
* master: (60 commits)
  Fix the a11y violation of UrlWidget (#2944)
  Back to development
  Release 14.7.1
  Prepare for release
  Add CSS body class in Babel view. Improve marker for language independent fields in Babel view too. (#3027)
  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
  ...
  • Loading branch information
sneridagh committed Feb 2, 2022
2 parents 04063d6 + 61a37c8 commit 6def34d
Show file tree
Hide file tree
Showing 128 changed files with 3,918 additions and 1,410 deletions.
100 changes: 99 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Change Log

## 14.2.1 (unreleased)
## 14.7.2 (unreleased)

### Breaking

Expand All @@ -10,8 +10,106 @@

### Bugfix

- Fix the a11y violation of UrlWidget @iRohitSingh

### Internal

## 14.7.1 (2022-02-02)

### Internal

- Add CSS body class in Babel view. Improve marker for language independent fields in Babel view too. @sneridagh

### Docs

Update documentation for internal proxy & other smaller reorganisation for quicker onboarding of
new users/evaluators. @fredvd

## 14.7.0 (2022-01-28)

### Feature

- 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

### Internal

- Upgrade jest to latest release, 27 major. @tiberiuichim
- Lazyload momentjs. `parseDateTime` helper now requires passing the momentjs library @tiberiuichim

## 14.6.0 (2022-01-27)

### Feature

- 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

### Internal

- Fix ObjectListWidget story bug caused by lazyloading dnd libraries
@tiberiuichim

## 14.5.0 (2022-01-26)

### Feature

- VocabularyTermsWidget: Token is now on creation of term editable, but stays ineditable afterwards. @ksuess

### Bugfix

- Fix A11Y violations in Navigation @iRohitSingh
- Fix `language-independent-field` CSS class styling @sneridagh

### Internal

- Lazyload react-beautiful-dnd @tiberiuichim
- Lazyload react-dnd @tiberiuichim
- Improve docs on environment variables, add recipes @sneridagh
- Update p.restapi to 8.20.0 and plone.volto to 4.0.0a1 and plone.rest to 2.0.0a2 @sneridagh

## 14.4.0 (2022-01-21)

### Feature

- Language independent fields support in Volto forms @sneridagh

## 14.3.0 (2022-01-20)

### Feature

- Bump semantic-ui-react to v2.0.3 @nileshgulia1

## 14.2.3 (2022-01-20)

### Bugfix

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

## 14.2.2 (2022-01-13)

### Bugfix

- Fix home URL item in Navigation, which was evaluating as non-internal @sneridagh
- Improve the request handling in `getAPIResourceWithAuth` and in `Api` helper. This fixes the "Cannot set headers once the content has being sent" @sneridagh
- Fix when you remove the time from DatetimeWidget @iRohitSingh

### Internal

- Fix URL for Climate-Energy, a Volto website @tiberiuichim
- Fix quirky Cypress test in "DX control panel schema" (see https://github.com/plone/volto/runs/4803206906?check_suite_focus=true) @sneridagh

## 14.2.1 (2022-01-12)

### Bugfix

- Fix home URL item in Navigation, which was evaluating as non-internal

### Internal

- Use plone-backend docker images for Cypress tests @sneridagh
- Upgrade `query-string` library so it supports Plone `:list` qs marker @sneridagh

## 14.2.0 (2022-01-04)

### Feature
Expand Down
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ MAKEFLAGS+=--no-builtin-rules
# Project settings

INSTANCE_PORT=8080
KGS=plone.restapi=8.18.0 plone.app.iterate=4.0.2 plone.rest=2.0.0a1 plone.app.vocabularies=4.3.0
DOCKER_IMAGE=plone/plone-backend:5.2.6
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

# Recipe snippets for reuse

Expand Down Expand Up @@ -90,7 +91,7 @@ start-backend: ## Start Plone Backend

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

.PHONY: start-backend-docker-guillotina
start-backend-docker-guillotina:
Expand Down Expand Up @@ -121,20 +122,20 @@ stop-backend-docker-guillotina:

.PHONY: test-acceptance-server
test-acceptance-server:
docker run -i --rm -e ZSERVER_HOST=0.0.0.0 -e ZSERVER_PORT=55001 -p 55001:55001 -e VERSIONS="$(KGS)" -e APPLY_PROFILES=plone.app.contenttypes:plone-content,plone.restapi:default,plone.volto:default-homepage -e CONFIGURE_PACKAGES=plone.app.contenttypes,plone.restapi,plone.volto,plone.volto.cors -e ADDONS='plone.app.robotframework plone.app.contenttypes plone.restapi plone.volto' plone ./bin/robot-server plone.app.robotframework.testing.PLONE_ROBOT_TESTING
docker run -i --rm -e ZSERVER_HOST=0.0.0.0 -e ZSERVER_PORT=55001 -p 55001:55001 -e ADDONS='$(KGS) plone.app.robotframework plone.app.contenttypes' -e APPLY_PROFILES=plone.app.contenttypes:plone-content,plone.restapi:default,plone.volto:default-homepage -e CONFIGURE_PACKAGES=plone.app.contenttypes,plone.restapi,plone.volto,plone.volto.cors $(DOCKER_IMAGE) ./bin/robot-server plone.app.robotframework.testing.PLONE_ROBOT_TESTING

.PHONY: test-acceptance-server-multilingual
test-acceptance-server-multilingual:
docker run -i --rm -e ZSERVER_HOST=0.0.0.0 -e ZSERVER_PORT=55001 -p 55001:55001 -e VERSIONS="$(KGS)" -e APPLY_PROFILES=plone.app.contenttypes:plone-content,plone.restapi:default,plone.volto:multilingual -e CONFIGURE_PACKAGES=plone.app.contenttypes,plone.restapi,plone.volto,plone.volto.cors -e ADDONS='plone.app.robotframework plone.app.contenttypes plone.restapi plone.volto' plone ./bin/robot-server plone.app.robotframework.testing.PLONE_ROBOT_TESTING
docker run -i --rm -e ZSERVER_HOST=0.0.0.0 -e ZSERVER_PORT=55001 -p 55001:55001 -e ADDONS='$(KGS) plone.app.robotframework plone.app.contenttypes' -e APPLY_PROFILES=plone.app.contenttypes:plone-content,plone.restapi:default,plone.volto:multilingual -e CONFIGURE_PACKAGES=plone.app.contenttypes,plone.restapi,plone.volto,plone.volto.cors $(DOCKER_IMAGE) ./bin/robot-server plone.app.robotframework.testing.PLONE_ROBOT_TESTING

.PHONY: test-acceptance-server-workingcopy
test-acceptance-server-workingcopy:
docker run -i --rm -e ZSERVER_HOST=0.0.0.0 -e ZSERVER_PORT=55001 -p 55001:55001 -e VERSIONS="$(KGS)" -e APPLY_PROFILES=plone.app.contenttypes:plone-content,plone.restapi:default,plone.app.iterate:default,plone.volto:default-homepage -e CONFIGURE_PACKAGES=plone.app.contenttypes,plone.restapi,plone.volto,plone.volto.cors -e ADDONS='plone.app.robotframework plone.app.contenttypes plone.restapi plone.app.iterate plone.volto' plone ./bin/robot-server plone.app.robotframework.testing.PLONE_ROBOT_TESTING
docker run -i --rm -e ZSERVER_HOST=0.0.0.0 -e ZSERVER_PORT=55001 -p 55001:55001 -e ADDONS='$(KGS) plone.app.robotframework plone.app.contenttypes' -e APPLY_PROFILES=plone.app.contenttypes:plone-content,plone.restapi:default,plone.app.iterate:default,plone.volto:default-homepage -e CONFIGURE_PACKAGES=plone.app.contenttypes,plone.restapi,plone.volto,plone.volto.cors $(DOCKER_IMAGE) ./bin/robot-server plone.app.robotframework.testing.PLONE_ROBOT_TESTING
# ZSERVER_PORT=55001 CONFIGURE_PACKAGES=plone.app.contenttypes,plone.restapi,plone.app.iterate,plone.volto,plone.volto.cors APPLY_PROFILES=plone.app.contenttypes:plone-content,plone.restapi:default,plone.app.iterate:default,plone.volto:default-homepage ./api/bin/robot-server plone.app.robotframework.testing.PLONE_ROBOT_TESTING

.PHONY: test-acceptance-server-coresandbox
test-acceptance-server-coresandbox:
docker run -i --rm -e ZSERVER_HOST=0.0.0.0 -e ZSERVER_PORT=55001 -p 55001:55001 -e VERSIONS="$(KGS)" -e APPLY_PROFILES=plone.app.contenttypes:plone-content,plone.restapi:default,plone.volto:default-homepage,plone.volto:coresandbox -e CONFIGURE_PACKAGES=plone.app.contenttypes,plone.restapi,plone.volto,plone.volto.cors,plone.volto.coresandbox -e ADDONS='plone.app.robotframework plone.app.contenttypes plone.restapi plone.app.iterate plone.volto' plone ./bin/robot-server plone.app.robotframework.testing.PLONE_ROBOT_TESTING
docker run -i --rm -e ZSERVER_HOST=0.0.0.0 -e ZSERVER_PORT=55001 -p 55001:55001 -e ADDONS='$(KGS) plone.app.robotframework plone.app.contenttypes' -e APPLY_PROFILES=plone.app.contenttypes:plone-content,plone.restapi:default,plone.volto:default-homepage,plone.volto:coresandbox -e CONFIGURE_PACKAGES=plone.app.contenttypes,plone.restapi,plone.volto,plone.volto.cors,plone.volto.coresandbox $(DOCKER_IMAGE) ./bin/robot-server plone.app.robotframework.testing.PLONE_ROBOT_TESTING
# ZSERVER_PORT=55001 CONFIGURE_PACKAGES=plone.app.contenttypes,plone.restapi,plone.volto,plone.volto.cors,plone.volto.coresandbox APPLY_PROFILES=plone.app.contenttypes:plone-content,plone.restapi:default,plone.volto:default-homepage,plone.volto:coresandbox ./api/bin/robot-server plone.app.robotframework.testing.PLONE_ROBOT_TESTING

.PHONY: test-acceptance-server-old
Expand Down
29 changes: 25 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,41 @@ follow the prompts questions, provide `myvoltoproject` as project name then, whe

We recommend Plone as backend of choice for Volto.

You can bootstrap a ready Docker Plone container with all the dependencies and ready for Volto use:
You can bootstrap a ready Docker Plone container with all the dependencies and ready for Volto use. We recommend to use the Plone docker builds based in `pip` [plone/plone-backend](https://github.com/plone/plone-backend) image:

```shell
docker run -it --rm --name=plone -p 8080:8080 -e SITE=Plone -e VERSIONS="plone.restapi=8.16.2 plone.app.iterate=4.0.2 plone.rest=2.0.0a1 plone.app.vocabularies=4.3.0" -e ADDONS="plone.volto" -e ZCML="plone.volto.cors" -e PROFILES="plone.volto:default-homepage" plone
docker run -it --rm --name=plone -p 8080:8080 -e SITE=Plone -e ADDONS="plone.restapi==8.18.0 plone.app.iterate==4.0.2 plone.rest==2.0.0a1 plone.app.vocabularies==4.3.0 plone.volto==3.1.0a7" -e PROFILES="plone.volto:default-homepage" plone/plone-backend
```

or as an alternative if you have experience with Plone and you have all the
dependencies installed on your system, you can use the supplied buildout in the
dependencies installed on your system, you can use the supplied convenience buildout in the
`api` folder by issuing the command:

```shell
make build-backend
```

#### Recommended Plone version

Volto is Plone 6 default UI, so it will work for all Plone 6 released versions.

For the Plone 5 series latest released version (with Python 3) and above is recommended (at the time of writing 5.2.6).

The following KGS (or above) are also recommended, for any Plone version used.

#### KGS (known good versions) for backend packages

Volto always works best with latest versions of the "Frontend stack" or at least the recommended ones (in parenthesis) which are:

- plone.restapi (8.18.0)
- plone.rest (2.0.0a1)
- plone.volto (3.1.0a7)

and the following core packages since some features require up to date versions:

- plone.app.iterate (4.0.2)
- plone.app.vocabularies (4.3.0)

### Start Volto

```shell
Expand All @@ -109,7 +130,7 @@ Volto is actively developed since 2017 and used in production since 2018 on the
- [Excellence at Humboldt-Universität zu Berlin](https://www.alles-beginnt-mit-einer-frage.de) (Website for the excellence initiative of the [Humboldt University Berlin](https://hu-berlin.de), developed by [kitconcept GmbH](https://kitconcept.com), 2019)
- [Forest Information System for Europe](https://forest.eea.europa.eu) (Thematic website focusing on European forests, developed by [Eau de Web](https://www.eaudeweb.ro), 2019)
- [Industrial Emissions portal for Europe](https://industry.eea.europa.eu) (Thematic website focusing on European industrial emissions, developed by [Eau de Web](https://www.eaudeweb.ro), 2020)
- [Energy Climate Union portal for Europe](https://demo-energy-union.eea.europa.eu) (Thematic website focusing on European strides towards mitigating climate change, developed by [Eau de Web](https://www.eaudeweb.ro), 2020)
- [Energy Climate Union portal for Europe](https://climate-energy.eea.europa.eu/) (Thematic website focusing on European strides towards mitigating climate change, developed by [Eau de Web](https://www.eaudeweb.ro), 2020)
- [Talke Carrer Website](https://karriere.talke.com/) (Carrer website for [Talke](https://www.talke.com), one of the leading a chemical and petrochemical logistics companies in Germany, developed by [kitconcept GmbH](https://kitconcept.com), 2020)
- [Stradanove](http://www.stradanove.it/) (Website of the Department of Youth Policies of the Municipality of Modena, developed by [RedTurtle](https://redturtle.it), 2020)
- [VisitModena](https://www.visitmodena.it/) (Tourist website of the Municipality of Modena, developed by [RedTurtle](https://redturtle.it), 2020)
Expand Down
10 changes: 10 additions & 0 deletions __tests__/addon-registry.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe('AddonConfigurationRegistry', () => {
'test-addon',
'test-released-addon',
'test-released-source-addon',
'my-volto-config-addon',
'test-released-dummy',
'test-released-unmentioned',
]);
Expand Down Expand Up @@ -60,6 +61,13 @@ describe('AddonConfigurationRegistry', () => {
name: 'test-released-unmentioned',
packageJson: `${base}/node_modules/test-released-unmentioned/package.json`,
},
'my-volto-config-addon': {
addons: ['test-released-dummy'],
isPublishedPackage: false,
modulePath: `${base}/addons/my-volto-config-addon/src`,
name: 'my-volto-config-addon',
packageJson: `${base}/addons/my-volto-config-addon/package.json`,
},
'test-released-dummy': {
addons: ['test-released-unmentioned'],
isPublishedPackage: false,
Expand All @@ -74,6 +82,7 @@ describe('AddonConfigurationRegistry', () => {
const base = path.join(__dirname, 'fixtures', 'test-volto-project');
const reg = new AddonConfigurationRegistry(base);
expect(reg.getResolveAliases()).toStrictEqual({
'my-volto-config-addon': `${base}/addons/my-volto-config-addon/src`,
'test-addon': `${base}/addons/test-addon/src`,
'test-released-addon': `${base}/node_modules/test-released-addon`,
'test-released-dummy': `${base}/addons/test-released-dummy`,
Expand All @@ -98,6 +107,7 @@ describe('AddonConfigurationRegistry', () => {
'test-addon',
'test-released-addon',
'test-released-source-addon',
'my-volto-config-addon',
]);
});

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "test-addon",
"customizationPaths": [
"src/custom-addons"
],
"addons": [
"test-released-dummy"
]
}
Empty file.
3 changes: 2 additions & 1 deletion __tests__/fixtures/test-volto-project/jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"compilerOptions": {
"paths": {
"test-addon": ["test-addon/src"],
"test-released-dummy": ["test-released-dummy"]
"test-released-dummy": ["test-released-dummy"],
"my-volto-config-addon": ["my-volto-config-addon/src"]
},
"baseUrl": "addons"
}
Expand Down
3 changes: 3 additions & 0 deletions __tests__/fixtures/test-volto-project/volto.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
addons: ['my-volto-config-addon'],
};
17 changes: 15 additions & 2 deletions addon-registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,26 @@ class AddonConfigurationRegistry {
projectRootPath,
'package.json',
)));
// Loads the dynamic config, if any
if (fs.existsSync(path.join(projectRootPath, 'volto.config.js'))) {
this.voltoConfigJS = require(path.join(
projectRootPath,
'volto.config.js',
));
} else {
this.voltoConfigJS = [];
}
this.resultantMergedAddons = [
...(packageJson.addons || []),
...(this.voltoConfigJS.addons || []),
];

this.projectRootPath = projectRootPath;
this.voltoPath =
packageJson.name === '@plone/volto'
? `${projectRootPath}`
: `${projectRootPath}/node_modules/@plone/volto`;
this.addonNames = (packageJson.addons || []).map((s) => s.split(':')[0]);
this.addonNames = this.resultantMergedAddons.map((s) => s.split(':')[0]);
this.packages = {};
this.customizations = new Map();

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

this.dependencyGraph = buildDependencyGraph(
packageJson.addons || [],
this.resultantMergedAddons,
(name) => {
this.initPublishedPackage(name);
return this.packages[name].addons || [];
Expand Down
5 changes: 3 additions & 2 deletions api/buildout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,14 @@ eggs = ${instance:eggs}
setuptools =
zc.buildout =
# force to latest p.restapi
plone.restapi = 8.18.0
plone.restapi = 8.20.0
# new JSON only traversal
plone.rest = 2.0.0a1
plone.rest = 2.0.0a2
# Using working copy support in Volto requires it
plone.app.iterate = 4.0.2
# plone.volto requires it
plone.app.vocabularies = 4.3.0
pyOpenSSL = 21.0.0

plone.volto =
robotframework =
Expand Down
3 changes: 2 additions & 1 deletion cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"viewportWidth": 1280,
"ignoreTestFiles": ["*~"],
"integrationFolder": "cypress/tests/core",
"chromeWebSecurity": false
"chromeWebSecurity": false,
"projectId": "5iy5e2"
}
4 changes: 1 addition & 3 deletions cypress/tests/core-sandbox/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ context('Search action tests', () => {
cy.navigate('/newsitem/edit');

// Add subject
cy.get('a:contains("Categorization")')
.click()
.get('.field-wrapper-subjects input')
cy.get('.field-wrapper-subjects input')
.type('garden', { force: true })
.type('{enter}');
cy.get('#toolbar-save').click();
Expand Down
17 changes: 14 additions & 3 deletions cypress/tests/core/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,22 @@ describe('Add Content Tests', () => {
cy.url().should('eq', Cypress.config().baseUrl + '/my-folder');
cy.get('.navigation .item.active').should('have.text', 'My Folder');
});
it('As editor I am setting the time in datetimeWidget', function () {
// when I add a Event
cy.get('#toolbar-add').click();
cy.get('#toolbar-add-event').click();
cy.get('#field-title').type('datetimeWidget test');
cy.get('#start-time').click();
cy.get('.rc-time-picker-panel-input').click();
cy.get('.rc-time-picker-panel-input').clear().type('6:40 AM');
cy.get('#toolbar-save').click();

it('As editor I can add a Link (with an external link)', function () {
// then

cy.get('.documentFirstHeading').should('have.text', 'datetimeWidget test');
});

it('As editor I can add a Link (with an external link)', function () {
// When I add a link
cy.get('#toolbar-add').click();
cy.get('#toolbar-add-link').click();
Expand All @@ -152,7 +165,6 @@ describe('Add Content Tests', () => {
});

it('As editor I can add a Link (with an internal link)', function () {

// Given a Document "Link Target"
cy.createContent({
contentType: 'Document',
Expand Down Expand Up @@ -184,5 +196,4 @@ describe('Add Content Tests', () => {
cy.url().should('eq', Cypress.config().baseUrl + '/link-target');
cy.get('main').contains('Link Target');
});

});
1 change: 1 addition & 0 deletions cypress/tests/core/dexterity-controlpanel-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ describe('ControlPanel: Dexterity Content-Types Schema', () => {

// Add field
cy.get('button[id=addfield]').click();
cy.wait(1000);
cy.get('.modal .react-select-container').click().type('Choice{enter}');
cy.get('.modal input[id="field-title"]')
.type('Color')
Expand Down
Loading

0 comments on commit 6def34d

Please sign in to comment.