From 74a10cdd0a16357e38e276a664380ab55c1291f0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADctor=20Fern=C3=A1ndez=20de=20Alba?=
Date: Wed, 8 Feb 2023 19:52:02 +0100
Subject: [PATCH 001/142] Update Cypress support commands, add missing peer dep
(#4382)
---
.../volto-testing/cypress/support/commands.js | 515 +++++++++++++++---
.../cypress/support/constants.js | 1 +
packages/volto-testing/package.json | 1 +
packages/volto-testing/yarn.lock | 8 +
4 files changed, 444 insertions(+), 81 deletions(-)
create mode 100644 packages/volto-testing/cypress/support/constants.js
diff --git a/packages/volto-testing/cypress/support/commands.js b/packages/volto-testing/cypress/support/commands.js
index fe15844360..e97938364a 100644
--- a/packages/volto-testing/cypress/support/commands.js
+++ b/packages/volto-testing/cypress/support/commands.js
@@ -1,10 +1,20 @@
import '@testing-library/cypress/add-commands';
import { getIfExists } from '../helpers';
+import { ploneAuth } from './constants';
const HOSTNAME = Cypress.env('BACKEND_HOST') || 'localhost';
const GUILLOTINA_API_URL = `http://${HOSTNAME}:8081/db/web`;
const PLONE_SITE_ID = Cypress.env('SITE_ID') || 'plone';
-const PLONE_API_URL = Cypress.env('API_PATH') || `http://${HOSTNAME}:55001/${PLONE_SITE_ID}`;
+const PLONE_API_URL =
+ Cypress.env('API_PATH') || `http://${HOSTNAME}:55001/${PLONE_SITE_ID}`;
+
+const SLATE_SELECTOR = '.content-area .slate-editor [contenteditable=true]';
+const SLATE_TITLE_SELECTOR = '.block.inner.title [contenteditable="true"]';
+
+const ploneAuthObj = {
+ user: ploneAuth[0],
+ pass: ploneAuth[1],
+};
// --- AUTOLOGIN -------------------------------------------------------------
Cypress.Commands.add('autologin', (usr, pass) => {
@@ -15,8 +25,8 @@ Cypress.Commands.add('autologin', (usr, pass) => {
password = pass || 'admin';
} else {
api_url = PLONE_API_URL;
- user = usr || 'admin';
- password = pass || 'secret';
+ user = usr || ploneAuth[0];
+ password = pass || ploneAuth[1];
}
return cy
@@ -36,9 +46,12 @@ Cypress.Commands.add(
contentType,
contentId,
contentTitle,
+ contentDescription,
path = '',
allow_discussion = false,
transition = '',
+ bodyModifier = (body) => body,
+ image = false,
}) => {
let api_url, auth;
if (Cypress.env('API') === 'guillotina') {
@@ -49,45 +62,46 @@ Cypress.Commands.add(
};
} else {
api_url = PLONE_API_URL;
- auth = {
- user: 'admin',
- pass: 'secret',
- };
+ auth = ploneAuthObj;
}
+
+ const defaultParams = {
+ method: 'POST',
+ url: `${api_url}/${path}`,
+ headers: {
+ Accept: 'application/json',
+ },
+ auth: auth,
+ body: {
+ '@type': contentType,
+ id: contentId,
+ title: contentTitle,
+ description: contentDescription,
+ allow_discussion: allow_discussion,
+ },
+ };
+
if (contentType === 'File') {
- return cy.request({
- method: 'POST',
- url: `${api_url}/${path}`,
- headers: {
- Accept: 'application/json',
- },
- auth: auth,
- body: {
- '@type': contentType,
- id: contentId,
- title: contentTitle,
+ const params = {
+ ...defaultParams,
+ body: bodyModifier({
+ ...defaultParams.body,
file: {
data: 'dGVzdGZpbGUK',
encoding: 'base64',
filename: 'lorem.txt',
'content-type': 'text/plain',
},
- allow_discussion: allow_discussion,
- },
- });
+ }),
+ };
+
+ return cy.request(params);
}
if (contentType === 'Image') {
- return cy.request({
- method: 'POST',
- url: `${api_url}/${path}`,
- headers: {
- Accept: 'application/json',
- },
- auth: auth,
- body: {
- '@type': contentType,
- id: contentId,
- title: contentTitle,
+ const params = {
+ ...defaultParams,
+ body: bodyModifier({
+ ...defaultParams.body,
image: {
data:
'iVBORw0KGgoAAAANSUhEUgAAANcAAAA4CAMAAABZsZ3QAAAAM1BMVEX29fK42OU+oMvn7u9drtIPisHI4OhstdWZyt4fkcXX5+sAg74umMhNp86p0eJ7vNiKw9v/UV4wAAAAAXRSTlMAQObYZgAABBxJREFUeF7tmuty4yAMhZG4X2zn/Z92J5tsBJwWXG/i3XR6frW2Y/SBLIRAfaQUDNt8E5tLUt9BycfcKfq3R6Mlfyimtx4rzp+K3dtibXkor99zsEqLYZltblTecciogoh+TXfY1Ve4dn07rCDGG9dHSEEOg/GmXl0U1XDxTKxNK5De7BxsyyBr6gGm2/vPxKJ8F6f7BXKfRMp1xIWK9A+5ks25alSb353dWnDJN1k35EL5f8dVGifTf/4tjUuuFq7u4srmXC60yAmldLXIWbg65RKU87lcGxJCFqUPv0IacW0PmSivOZFLE908inPToMmii/roG+MRV/O8FU88i8tFsxV3a06MFUw0Qu7RmAtdV5/HVVaOVMTWNOWSwMljLhzhcB6XIS7OK5V6AvRDNN7t5VJWQs1J40UmalbK56usBG/CuCHSYuc+rkUGeMCViNRARPrzW52N3oQLe6WifNliSuuGaH3czbVNudI9s7ZLUCLHVwWlyES522o1t14uvmbblmVTKqFjaZYJFSTPP4dLL1kU1z7p0lzdbRulmEWLxoQX+z9ce7A8GqEEucllLxePuZwdJl1Lezu0hoswvTPt61DrFcRuujV/2cmlxaGBC7Aw6cpovGANwRiSdOAWJ5AGy4gLL64dl0QhUEAuEUNws+XxV+OKGPdw/hESGYF9XEGaFC7sNLMSXWJjHsnanYi87VK428N2uxpOjOFANcagLM5l+7mSycM8KknZpKLcGi6jmzWGr/vLurZ/0g4u9AZuAoeb5r1ceQhyiTPY1E4wUR6u/F3H2ojSpXMMriBPT9cezTto8Cx+MsglHL4fv1Rxrb1LVw9yvyQpJ3AhFnLZfuRLH2QsOG3FGGD20X/th/u5bFAt16Bt308KjF+MNOXgl/SquIEySX3GhaZvc67KZbDxcCDORz2N8yCWPaY5lyQZO7lQ29fnZbt3Xu6qoge4+DjXl/MocySPOp9rlvdyznahRyHEYd77v3LhugOXDv4J65QXfl803BDAdaWBEDhfVx7nKofjoVCgxnUAqw/UAUDPn788BDvQuG4TDtdtUPvzjSlXAB8DvaDOhhrmhwbywylXAm8CvaouikJTL93gs3y7Yy4VYbIxOHrcMizPqWOjqO9l3Uz52kibQy4xxOgqhJvD+w5rvokOcAlGvNCfeqCv1ste1stzLm0f71Iq3ZfTrPfuE5nhPtF+LvQE2lffQC7pYtQy3tdzdrKvd5TLVVzDetScS3nEKmmwDyt1Cev1kX3YfbvzNK4fzrlw+cB6vm+uiUgf2zdXI62241LawCb7Pi5FXFPF8KpzDoF/Sw2lg+GrHNbno1mhPu+VCF/vfMnw06PnUl6j48dVHD3jHNHPua+fc3o/5yp/zsGi0vYtzi3Pz5mHd4T6BWMIlewacd63AAAAAElFTkSuQmCC',
@@ -95,38 +109,75 @@ Cypress.Commands.add(
filename: 'image.png',
'content-type': 'image/png',
},
- },
- });
+ }),
+ };
+
+ return cy.request(params);
}
if (
['Document', 'News Item', 'Folder', 'CMSFolder'].includes(contentType)
) {
- return cy
- .request({
- method: 'POST',
- url: `${api_url}/${path}`,
- headers: {
- Accept: 'application/json',
+ const params = {
+ ...defaultParams,
+ body: {
+ ...defaultParams.body,
+ blocks: {
+ 'd3f1c443-583f-4e8e-a682-3bf25752a300': { '@type': 'title' },
+ '7624cf59-05d0-4055-8f55-5fd6597d84b0': { '@type': 'slate' },
},
- auth: auth,
- body: {
- '@type': contentType,
- id: contentId,
- title: contentTitle,
- blocks: {
- 'd3f1c443-583f-4e8e-a682-3bf25752a300': { '@type': 'title' },
- '7624cf59-05d0-4055-8f55-5fd6597d84b0': { '@type': 'text' },
- },
- blocks_layout: {
- items: [
- 'd3f1c443-583f-4e8e-a682-3bf25752a300',
- '7624cf59-05d0-4055-8f55-5fd6597d84b0',
- ],
- },
- allow_discussion: allow_discussion,
+ blocks_layout: {
+ items: [
+ 'd3f1c443-583f-4e8e-a682-3bf25752a300',
+ '7624cf59-05d0-4055-8f55-5fd6597d84b0',
+ ],
},
- })
- .then(() => {
+ },
+ };
+
+ if (image) {
+ let sourceFilename = 'cypress/fixtures/halfdome2022.jpg';
+ let imageObject = {
+ encoding: 'base64',
+ filename: 'image.jpg',
+ 'content-type': 'image/jpg',
+ };
+ if (typeof image === 'object') {
+ sourceFilename = image.sourceFilename;
+ imageObject = {
+ ...imageObject,
+ ...image,
+ };
+ }
+ cy.readFile(sourceFilename, 'base64').then((encodedImage) => {
+ const withImageParams = {
+ ...params,
+ body: bodyModifier({
+ ...params.body,
+ preview_image: {
+ ...imageObject,
+ data: encodedImage,
+ },
+ }),
+ };
+
+ return cy.request(withImageParams).then(() => {
+ if (transition) {
+ cy.setWorkflow({
+ path: path || contentId,
+ review_state: transition,
+ });
+ }
+ console.log(`${contentType} created`);
+ });
+ });
+ } else {
+ const documentParams = {
+ ...params,
+ body: bodyModifier({
+ ...params.body,
+ }),
+ };
+ return cy.request(documentParams).then(() => {
if (transition) {
cy.setWorkflow({
path: path || contentId,
@@ -135,6 +186,7 @@ Cypress.Commands.add(
}
console.log(`${contentType} created`);
});
+ }
} else {
return cy
.request({
@@ -144,12 +196,12 @@ Cypress.Commands.add(
Accept: 'application/json',
},
auth: auth,
- body: {
+ body: bodyModifier({
'@type': contentType,
id: contentId,
title: contentTitle,
allow_discussion: allow_discussion,
- },
+ }),
})
.then(() => {
if (transition) {
@@ -163,6 +215,7 @@ Cypress.Commands.add(
}
},
);
+
// Remove content
Cypress.Commands.add('removeContent', ({ path = '' }) => {
let api_url, auth;
@@ -174,13 +227,35 @@ Cypress.Commands.add('removeContent', ({ path = '' }) => {
};
} else {
api_url = PLONE_API_URL;
+ auth = ploneAuthObj;
+ }
+
+ return cy.request({
+ method: 'DELETE',
+ url: `${api_url}/${path}`,
+ headers: {
+ Accept: 'application/json',
+ },
+ auth: auth,
+ });
+});
+
+// Get content
+Cypress.Commands.add('getContent', ({ path = '' }) => {
+ let api_url, auth;
+ if (Cypress.env('API') === 'guillotina') {
+ api_url = GUILLOTINA_API_URL;
auth = {
- user: 'admin',
- pass: 'secret',
+ user: 'root',
+ pass: 'root',
};
+ } else {
+ api_url = PLONE_API_URL;
+ auth = ploneAuthObj;
}
+
return cy.request({
- method: 'DELETE',
+ method: 'get',
url: `${api_url}/${path}`,
headers: {
Accept: 'application/json',
@@ -189,6 +264,92 @@ Cypress.Commands.add('removeContent', ({ path = '' }) => {
});
});
+// --- Add DX Content-Type ----------------------------------------------------------
+Cypress.Commands.add('addContentType', (name) => {
+ let api_url, auth;
+ api_url = Cypress.env('API_PATH') || 'http://localhost:8080/Plone';
+ auth = ploneAuthObj;
+
+ return cy
+ .request({
+ method: 'POST',
+ url: `${api_url}/@controlpanels/dexterity-types/${name}`,
+ headers: {
+ Accept: 'application/json',
+ },
+ auth: auth,
+ body: {
+ title: name,
+ },
+ })
+ .then(() => console.log(`${name} content-type added.`));
+});
+
+// --- Remove DX behavior ----------------------------------------------------------
+Cypress.Commands.add('removeContentType', (name) => {
+ let api_url, auth;
+ api_url = Cypress.env('API_PATH') || 'http://localhost:8080/Plone';
+ auth = ploneAuthObj;
+
+ return cy
+ .request({
+ method: 'DELETE',
+ url: `${api_url}/@controlpanels/dexterity-types/${name}`,
+ headers: {
+ Accept: 'application/json',
+ },
+ auth: auth,
+ body: {},
+ })
+ .then(() => console.log(`${name} content-type removed.`));
+});
+
+// --- Add DX field ----------------------------------------------------------
+Cypress.Commands.add('addSlateJSONField', (type, name) => {
+ let api_url, auth;
+ api_url = Cypress.env('API_PATH') || 'http://localhost:8080/Plone';
+ auth = ploneAuthObj;
+
+ return cy
+ .request({
+ method: 'POST',
+ url: `${api_url}/@types/${type}`,
+ headers: {
+ Accept: 'application/json',
+ },
+ auth: auth,
+ body: {
+ id: name,
+ title: name,
+ description: 'Slate JSON Field',
+ factory: 'SlateJSONField',
+ required: false,
+ },
+ })
+ .then(() => console.log(`${name} SlateJSONField field added to ${type}`));
+});
+
+// --- Remove DX field ----------------------------------------------------------
+Cypress.Commands.add('removeSlateJSONField', (type, name) => {
+ let api_url, auth;
+ api_url = Cypress.env('API_PATH') || 'http://localhost:8080/Plone';
+ auth = ploneAuthObj;
+
+ return cy
+ .request({
+ method: 'DELETE',
+ url: `${api_url}/@types/${type}/${name}`,
+ headers: {
+ Accept: 'application/json',
+ },
+ auth: auth,
+ body: {},
+ })
+ .then(() =>
+ console.log(`${name} SlateJSONField field removed from ${type}`),
+ );
+});
+
// --- CREATE USER --------------------------------------------------------
Cypress.Commands.add(
'createUser',
@@ -196,8 +357,18 @@ Cypress.Commands.add(
username = 'editor',
fullname = 'editor',
email = 'editor@local.dev',
- password = 'secret',
+ password = 'password',
roles = ['Member', 'Reader', 'Editor'],
+ groups = {
+ '@id': 'http://localhost:3000/@users',
+ items: [
+ {
+ id: 'AuthenticatedUsers',
+ title: 'AuthenticatedUsers',
+ },
+ ],
+ items_total: 1,
+ },
}) => {
let api_url, auth, path;
if (Cypress.env('API') === 'guillotina') {
@@ -209,10 +380,7 @@ Cypress.Commands.add(
path = 'users';
} else {
api_url = PLONE_API_URL;
- auth = {
- user: 'admin',
- pass: 'secret',
- };
+ auth = ploneAuthObj;
path = '@users';
}
@@ -231,6 +399,7 @@ Cypress.Commands.add(
email: email,
password: password,
roles: roles,
+ groups: groups,
},
})
.then(() => console.log(`User ${username} created`));
@@ -249,10 +418,7 @@ Cypress.Commands.add('removeUser', (username = 'editor') => {
path = 'users';
} else {
api_url = PLONE_API_URL;
- auth = {
- user: 'admin',
- pass: 'secret',
- };
+ auth = ploneAuthObj;
path = '@users';
}
@@ -268,6 +434,56 @@ Cypress.Commands.add('removeUser', (username = 'editor') => {
.then(() => console.log(`User ${username} removed`));
});
+// --- GROUP -----------------------------------------------------------------
+
+Cypress.Commands.add(
+ 'createGroup',
+ ({
+ groupname = 'teachers',
+ email = 'teachers@local.dev',
+ password = ploneAuth[1],
+ roles = ['Member', 'Reader'],
+ users = {
+ '@id': 'http://localhost:3000/@groups',
+ items: [],
+ items_total: 0,
+ },
+ }) => {
+ let api_url, auth, path;
+ if (Cypress.env('API') === 'guillotina') {
+ api_url = GUILLOTINA_API_URL;
+ auth = {
+ user: 'root',
+ pass: 'root',
+ };
+ path = 'groups';
+ } else {
+ api_url = PLONE_API_URL;
+ auth = ploneAuthObj;
+ path = '@groups';
+ }
+
+ return cy
+ .request({
+ method: 'POST',
+ url: `${api_url}/${path}`,
+ headers: {
+ Accept: 'application/json',
+ },
+ auth: auth,
+ body: {
+ '@type': 'Group',
+ groupname: groupname,
+ email: email,
+ password: password,
+ roles: roles,
+ users: users,
+ },
+ })
+ .then(() => console.log(`Group ${groupname} created`));
+ },
+);
+
// --- SET WORKFLOW ----------------------------------------------------------
Cypress.Commands.add(
'setWorkflow',
@@ -284,10 +500,7 @@ Cypress.Commands.add(
}) => {
let api_url, auth;
api_url = PLONE_API_URL;
- auth = {
- user: 'admin',
- pass: 'secret',
- };
+ auth = ploneAuthObj;
return cy.request({
method: 'POST',
url: `${api_url}/${path}/@workflow/${review_state}`,
@@ -350,10 +563,7 @@ Cypress.Commands.add('waitForResourceToLoad', (fileName, type) => {
Cypress.Commands.add('setRegistry', (record, value) => {
let api_url, auth;
api_url = PLONE_API_URL;
- auth = {
- user: 'admin',
- pass: 'secret',
- };
+ auth = ploneAuthObj;
return cy.request({
method: 'PATCH',
@@ -370,7 +580,12 @@ Cypress.Commands.add('setRegistry', (record, value) => {
// Low level command reused by `setSelection` and low level command `setCursor`
Cypress.Commands.add('selection', { prevSubject: true }, (subject, fn) => {
- cy.wrap(subject).trigger('mousedown').then(fn).trigger('mouseup');
+ cy.wrap(subject)
+ .trigger('mousedown')
+ .wait(1000) //multiple waits between selecting the text to ensure toolbar is visible.
+ .then(fn)
+ .wait(1000)
+ .trigger('mouseup');
cy.document().trigger('selectionchange');
return cy.wrap(subject);
@@ -437,6 +652,126 @@ Cypress.Commands.add(
},
);
+Cypress.Commands.add(
+ 'pasteClipboard',
+ { prevSubject: true },
+ (query, htmlContent) => {
+ return cy
+ .wrap(query)
+ .type(' {backspace}')
+ .trigger('paste', createHtmlPasteEvent(htmlContent));
+ },
+);
+
+Cypress.Commands.add('toolbarSave', () => {
+ // Save
+ cy.get('#toolbar-save', { timeout: 10000 }).click();
+ cy.waitForResourceToLoad('@navigation');
+ cy.waitForResourceToLoad('@breadcrumbs');
+ cy.waitForResourceToLoad('@actions');
+ cy.waitForResourceToLoad('@types');
+});
+
+Cypress.Commands.add('clearSlate', (selector) => {
+ return cy
+ .get(selector)
+ .focus()
+ .click()
+ .wait(1000)
+ .type('{selectAll}')
+ .wait(1000)
+ .type('{backspace}');
+});
+
+Cypress.Commands.add('getSlate', (createNewSlate = false) => {
+ let slate;
+ if (createNewSlate) {
+ cy.get('.block.inner').last().type('{moveToEnd}{enter}');
+ }
+ cy.getIfExists(
+ SLATE_SELECTOR,
+ () => {
+ slate = cy.get(SLATE_SELECTOR).last();
+ },
+ () => {
+ slate = cy.get(SLATE_SELECTOR, { timeout: 10000 }).last();
+ },
+ );
+ return slate;
+});
+
+Cypress.Commands.add('getSlateTitle', () => {
+ return cy.get(SLATE_TITLE_SELECTOR, {
+ timeout: 10000,
+ });
+});
+
+Cypress.Commands.add('clearSlateTitle', () => {
+ return cy.clearSlate(SLATE_TITLE_SELECTOR);
+});
+
+// Slate commands
+Cypress.Commands.add('typeInSlate', { prevSubject: true }, (subject, text) => {
+ return (
+ cy
+ .wrap(subject)
+ .then((subject) => {
+ subject[0].dispatchEvent(
+ new InputEvent('beforeinput', {
+ inputType: 'insertText',
+ data: text,
+ }),
+ );
+ return subject;
+ })
+ // TODO: do this only for Electron-based browser which does not understand instantaneously
+ // that the user inserted some text in the block
+ .wait(1000)
+ );
+});
+
+Cypress.Commands.add('lineBreakInSlate', { prevSubject: true }, (subject) => {
+ return (
+ cy
+ .wrap(subject)
+ .then((subject) => {
+ subject[0].dispatchEvent(
+ new InputEvent('beforeinput', { inputType: 'insertLineBreak' }),
+ );
+ return subject;
+ })
+ // TODO: do this only for Electron-based browser which does not understand instantaneously
+ // that the block was split
+ .wait(1000)
+ );
+});
+
+Cypress.Commands.add('setSlateSelection', (subject, query, endQuery) => {
+ cy.get('.slate-editor.selected [contenteditable=true]')
+ .focus()
+ // .click()
+ .setSelection(subject, query, endQuery)
+ .wait(1000); // this wait is needed for the selection change to be detected after
+});
+
+Cypress.Commands.add('getSlateEditorAndType', (type) => {
+ cy.getSlate().focus().click().type(type);
+});
+
+Cypress.Commands.add('setSlateCursor', (subject, query, endQuery) => {
+ cy.get('.slate-editor.selected [contenteditable=true]')
+ .focus()
+ .click()
+ .setCursor(subject, query, endQuery)
+ .wait(1000); // this wait is needed for the selection change to be detected after
+});
+
+Cypress.Commands.add('clickSlateButton', (button) => {
+ cy.get(`.slate-inline-toolbar .button-wrapper a[title="${button}"]`, {
+ timeout: 1000,
+ }).click({ force: true }); // force click is needed to ensure the button in visible in view.
+});
+
// Helper functions
function getTextNode(el, match) {
const walk = document.createTreeWalker(el, NodeFilter.SHOW_TEXT, null, false);
@@ -459,6 +794,24 @@ function setBaseAndExtent(...args) {
document.getSelection().setBaseAndExtent(...args);
}
+function createHtmlPasteEvent(htmlContent) {
+ return Object.assign(
+ new Event('paste', { bubbles: true, cancelable: true }),
+ {
+ clipboardData: {
+ getData: () => htmlContent,
+ types: ['text/html'],
+ },
+ },
+ );
+}
+
+Cypress.Commands.add('addNewBlock', (blockName, createNewSlate = false) => {
+ let block;
+ block = cy.getSlate(createNewSlate).type(`/${blockName}{enter}`);
+ return block;
+});
+
Cypress.Commands.add('navigate', (route = '') => {
return cy.window().its('appHistory').invoke('push', route);
});
diff --git a/packages/volto-testing/cypress/support/constants.js b/packages/volto-testing/cypress/support/constants.js
new file mode 100644
index 0000000000..4cdc2876dc
--- /dev/null
+++ b/packages/volto-testing/cypress/support/constants.js
@@ -0,0 +1 @@
+export const ploneAuth = ['admin', 'secret'];
diff --git a/packages/volto-testing/package.json b/packages/volto-testing/package.json
index cb7799ba4f..1effd4f616 100644
--- a/packages/volto-testing/package.json
+++ b/packages/volto-testing/package.json
@@ -59,6 +59,7 @@
"@testing-library/cypress": "8.0.7",
"@testing-library/jest-dom": "5.16.4",
"@testing-library/react": "12.1.5",
+ "axe-core": "4.6.3",
"cypress": "11.1.0",
"cypress-axe": "1.0.0",
"cypress-file-upload": "5.0.8"
diff --git a/packages/volto-testing/yarn.lock b/packages/volto-testing/yarn.lock
index 35b73bb426..ec67ffda95 100644
--- a/packages/volto-testing/yarn.lock
+++ b/packages/volto-testing/yarn.lock
@@ -263,6 +263,7 @@ __metadata:
"@testing-library/cypress": 8.0.7
"@testing-library/jest-dom": 5.16.4
"@testing-library/react": 12.1.5
+ axe-core: 4.6.3
cypress: 11.1.0
cypress-axe: 1.0.0
cypress-file-upload: 5.0.8
@@ -673,6 +674,13 @@ __metadata:
languageName: node
linkType: hard
+"axe-core@npm:4.6.3":
+ version: 4.6.3
+ resolution: "axe-core@npm:4.6.3"
+ checksum: d0c46be92b9707c48b88a53cd5f471b155a2bfc8bf6beffb514ecd14e30b4863e340b5fc4f496d82a3c562048088c1f3ff5b93b9b3b026cb9c3bfacfd535da10
+ languageName: node
+ linkType: hard
+
"balanced-match@npm:^1.0.0":
version: 1.0.2
resolution: "balanced-match@npm:1.0.2"
From 2052645a52662ce0a9cac2f71c7ff3af8978f1d2 Mon Sep 17 00:00:00 2001
From: Victor Fernandez de Alba
Date: Wed, 8 Feb 2023 19:53:46 +0100
Subject: [PATCH 002/142] Changelog
---
packages/volto-testing/news/4382.feature | 1 +
1 file changed, 1 insertion(+)
create mode 100644 packages/volto-testing/news/4382.feature
diff --git a/packages/volto-testing/news/4382.feature b/packages/volto-testing/news/4382.feature
new file mode 100644
index 0000000000..9e7fb5bdba
--- /dev/null
+++ b/packages/volto-testing/news/4382.feature
@@ -0,0 +1 @@
+Update Cypress support commands, add missing peer dependency `axe-core` @sneridagh
From 1154b49f5baa8dd61f5d469da506f86fc1a7b05f Mon Sep 17 00:00:00 2001
From: Victor Fernandez de Alba
Date: Wed, 8 Feb 2023 19:54:29 +0100
Subject: [PATCH 003/142] Release @plone/volto-testing 3.1.0
---
packages/volto-testing/CHANGELOG.md | 7 +++++++
packages/volto-testing/news/4382.feature | 1 -
packages/volto-testing/package.json | 2 +-
3 files changed, 8 insertions(+), 2 deletions(-)
delete mode 100644 packages/volto-testing/news/4382.feature
diff --git a/packages/volto-testing/CHANGELOG.md b/packages/volto-testing/CHANGELOG.md
index ce81401d93..ff65a00722 100644
--- a/packages/volto-testing/CHANGELOG.md
+++ b/packages/volto-testing/CHANGELOG.md
@@ -8,6 +8,13 @@
+## 3.1.0 (2023-02-08)
+
+### Feature
+
+- Update Cypress support commands, add missing peer dependency `axe-core` @sneridagh [#4382](https://github.com/plone/volto/issues/4382)
+
+
## 3.0.0 (2022-12-15)
### Breaking
diff --git a/packages/volto-testing/news/4382.feature b/packages/volto-testing/news/4382.feature
deleted file mode 100644
index 9e7fb5bdba..0000000000
--- a/packages/volto-testing/news/4382.feature
+++ /dev/null
@@ -1 +0,0 @@
-Update Cypress support commands, add missing peer dependency `axe-core` @sneridagh
diff --git a/packages/volto-testing/package.json b/packages/volto-testing/package.json
index 1effd4f616..abba91f379 100644
--- a/packages/volto-testing/package.json
+++ b/packages/volto-testing/package.json
@@ -9,7 +9,7 @@
}
],
"license": "MIT",
- "version": "3.0.0",
+ "version": "3.1.0",
"repository": {
"type": "git",
"url": "git@github.com:plone/volto.git"
From c3f7b37ab3bdd5a635f5c8128ff6e71843e53412 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADctor=20Fern=C3=A1ndez=20de=20Alba?=
Date: Thu, 9 Feb 2023 11:42:31 +0100
Subject: [PATCH 004/142] Add SCSS support in core (#4383)
---
news/4383.feature | 1 +
package.json | 8 ++
razzle.config.js | 1 +
yarn.lock | 337 +++++++++++++++++++++++++++++++++++++++++-----
4 files changed, 311 insertions(+), 36 deletions(-)
create mode 100644 news/4383.feature
diff --git a/news/4383.feature b/news/4383.feature
new file mode 100644
index 0000000000..b0985dbd96
--- /dev/null
+++ b/news/4383.feature
@@ -0,0 +1 @@
+Add scss support in core @sneridagh
diff --git a/package.json b/package.json
index a5584aa372..f1c9190f5f 100644
--- a/package.json
+++ b/package.json
@@ -137,6 +137,12 @@
"stylelint-prettier"
],
"overrides": [
+ {
+ "files": [
+ "**/*.scss"
+ ],
+ "customSyntax": "postcss-scss"
+ },
{
"files": [
"**/*.less"
@@ -316,6 +322,7 @@
"postcss-load-config": "3.1.4",
"postcss-loader": "4.3.0",
"postcss-overrides": "3.1.4",
+ "postcss-scss": "4.0.6",
"prepend-http": "2",
"prettier": "2.0.5",
"pretty-bytes": "5.3.0",
@@ -326,6 +333,7 @@
"razzle": "4.2.17",
"razzle-dev-utils": "4.2.17",
"razzle-plugin-bundle-analyzer": "4.2.17",
+ "razzle-plugin-scss": "4.2.18",
"rc-time-picker": "3.7.3",
"react": "17.0.2",
"react-anchor-link-smooth-scroll": "1.0.12",
diff --git a/razzle.config.js b/razzle.config.js
index a17a2541fe..992f8c17dc 100644
--- a/razzle.config.js
+++ b/razzle.config.js
@@ -330,6 +330,7 @@ const defaultPlugins = [
{ object: require('./webpack-plugins/webpack-svg-plugin') },
{ object: require('./webpack-plugins/webpack-bundle-analyze-plugin') },
{ object: require('./jest-extender-plugin') },
+ 'scss',
];
const plugins = addonExtenders.reduce(
diff --git a/yarn.lock b/yarn.lock
index 0138d12329..0ba2e37af2 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2863,6 +2863,7 @@ __metadata:
postcss-load-config: 3.1.4
postcss-loader: 4.3.0
postcss-overrides: 3.1.4
+ postcss-scss: 4.0.6
prepend-http: 2
prettier: 2.0.5
pretty-bytes: 5.3.0
@@ -2873,6 +2874,7 @@ __metadata:
razzle: 4.2.17
razzle-dev-utils: 4.2.17
razzle-plugin-bundle-analyzer: 4.2.17
+ razzle-plugin-scss: 4.2.18
rc-time-picker: 3.7.3
react: 17.0.2
react-anchor-link-smooth-scroll: 1.0.12
@@ -5660,6 +5662,16 @@ __metadata:
languageName: node
linkType: hard
+"adjust-sourcemap-loader@npm:3.0.0":
+ version: 3.0.0
+ resolution: "adjust-sourcemap-loader@npm:3.0.0"
+ dependencies:
+ loader-utils: ^2.0.0
+ regex-parser: ^2.2.11
+ checksum: 5ceabea85219fcafed06f7d1aafb37dc761c6435e4ded2a8c6b01c69844250aa94ef65a4d07210dc7566c2d8b4c9ba8897518db596a550461eed26fbeb76b96f
+ languageName: node
+ linkType: hard
+
"agent-base@npm:6, agent-base@npm:^6.0.0, agent-base@npm:^6.0.2":
version: 6.0.2
resolution: "agent-base@npm:6.0.2"
@@ -6033,6 +6045,13 @@ __metadata:
languageName: node
linkType: hard
+"arity-n@npm:^1.0.4":
+ version: 1.0.4
+ resolution: "arity-n@npm:1.0.4"
+ checksum: 3d76e16907f7b8a9452690c1efc301d0fbecea457365797eccfbade9b8d1653175b2c38343201bf26fdcbf0bcbb31eab6d912e7c008c6d19042301dc0be80a73
+ languageName: node
+ linkType: hard
+
"arr-diff@npm:^4.0.0":
version: 4.0.0
resolution: "arr-diff@npm:4.0.0"
@@ -7623,6 +7642,13 @@ __metadata:
languageName: node
linkType: hard
+"camelcase@npm:5.3.1, camelcase@npm:^5.0.0, camelcase@npm:^5.3.1":
+ version: 5.3.1
+ resolution: "camelcase@npm:5.3.1"
+ checksum: e6effce26b9404e3c0f301498184f243811c30dfe6d0b9051863bd8e4034d09c8c2923794f280d6827e5aa055f6c434115ff97864a16a963366fb35fd673024b
+ languageName: node
+ linkType: hard
+
"camelcase@npm:^2.0.0":
version: 2.1.1
resolution: "camelcase@npm:2.1.1"
@@ -7630,13 +7656,6 @@ __metadata:
languageName: node
linkType: hard
-"camelcase@npm:^5.0.0, camelcase@npm:^5.3.1":
- version: 5.3.1
- resolution: "camelcase@npm:5.3.1"
- checksum: e6effce26b9404e3c0f301498184f243811c30dfe6d0b9051863bd8e4034d09c8c2923794f280d6827e5aa055f6c434115ff97864a16a963366fb35fd673024b
- languageName: node
- linkType: hard
-
"camelcase@npm:^6.0.0, camelcase@npm:^6.2.0":
version: 6.3.0
resolution: "camelcase@npm:6.3.0"
@@ -7801,6 +7820,25 @@ __metadata:
languageName: node
linkType: hard
+"chokidar@npm:>=3.0.0 <4.0.0, chokidar@npm:^3.4.1, chokidar@npm:^3.4.2":
+ version: 3.5.3
+ resolution: "chokidar@npm:3.5.3"
+ dependencies:
+ anymatch: ~3.1.2
+ braces: ~3.0.2
+ fsevents: ~2.3.2
+ glob-parent: ~5.1.2
+ is-binary-path: ~2.1.0
+ is-glob: ~4.0.1
+ normalize-path: ~3.0.0
+ readdirp: ~3.6.0
+ dependenciesMeta:
+ fsevents:
+ optional: true
+ checksum: b49fcde40176ba007ff361b198a2d35df60d9bb2a5aab228279eb810feae9294a6b4649ab15981304447afe1e6ffbf4788ad5db77235dc770ab777c6e771980c
+ languageName: node
+ linkType: hard
+
"chokidar@npm:^2.1.8":
version: 2.1.8
resolution: "chokidar@npm:2.1.8"
@@ -7824,25 +7862,6 @@ __metadata:
languageName: node
linkType: hard
-"chokidar@npm:^3.4.1, chokidar@npm:^3.4.2":
- version: 3.5.3
- resolution: "chokidar@npm:3.5.3"
- dependencies:
- anymatch: ~3.1.2
- braces: ~3.0.2
- fsevents: ~2.3.2
- glob-parent: ~5.1.2
- is-binary-path: ~2.1.0
- is-glob: ~4.0.1
- normalize-path: ~3.0.0
- readdirp: ~3.6.0
- dependenciesMeta:
- fsevents:
- optional: true
- checksum: b49fcde40176ba007ff361b198a2d35df60d9bb2a5aab228279eb810feae9294a6b4649ab15981304447afe1e6ffbf4788ad5db77235dc770ab777c6e771980c
- languageName: node
- linkType: hard
-
"chownr@npm:^1.1.1, chownr@npm:^1.1.2":
version: 1.1.4
resolution: "chownr@npm:1.1.4"
@@ -8322,6 +8341,15 @@ __metadata:
languageName: node
linkType: hard
+"compose-function@npm:3.0.3":
+ version: 3.0.3
+ resolution: "compose-function@npm:3.0.3"
+ dependencies:
+ arity-n: ^1.0.4
+ checksum: 9f17d431e3ee4797c844f2870e13494079882ac3dbc54c143b7d99967b371908e0ce7ceb71c6aed61e2ecddbcd7bb437d91428a3d0e6569aee17a87fcbc7918f
+ languageName: node
+ linkType: hard
+
"compressible@npm:~2.0.16":
version: 2.0.18
resolution: "compressible@npm:2.0.18"
@@ -8484,6 +8512,22 @@ __metadata:
languageName: node
linkType: hard
+"convert-source-map@npm:1.7.0":
+ version: 1.7.0
+ resolution: "convert-source-map@npm:1.7.0"
+ dependencies:
+ safe-buffer: ~5.1.1
+ checksum: bcd2e3ea7d37f96b85a6e362c8a89402ccc73757256e3ee53aa2c22fe915adb854c66b1f81111be815a3a6a6ce3c58e8001858e883c9d5b4fe08a853fa865967
+ languageName: node
+ linkType: hard
+
+"convert-source-map@npm:^0.3.3":
+ version: 0.3.5
+ resolution: "convert-source-map@npm:0.3.5"
+ checksum: 33b209aa8f33bcaa9a22f2dbf6bfb71f4a429d8e948068d61b6087304e3194c30016d1e02e842184e653b74442c7e2dd2e7db97532b67f556aded3d8b4377a2c
+ languageName: node
+ linkType: hard
+
"convert-source-map@npm:^1.4.0, convert-source-map@npm:^1.5.0, convert-source-map@npm:^1.6.0, convert-source-map@npm:^1.7.0":
version: 1.9.0
resolution: "convert-source-map@npm:1.9.0"
@@ -8982,6 +9026,18 @@ __metadata:
languageName: node
linkType: hard
+"css@npm:^2.0.0":
+ version: 2.2.4
+ resolution: "css@npm:2.2.4"
+ dependencies:
+ inherits: ^2.0.3
+ source-map: ^0.6.1
+ source-map-resolve: ^0.5.2
+ urix: ^0.1.0
+ checksum: a35d483c5ccc04bcde3b1e7393d58ad3eee1dd6956df0f152de38e46a17c0ee193c30eec6b1e59831ad0e74599385732000e95987fcc9cb2b16c6d951bae49e1
+ languageName: node
+ linkType: hard
+
"css@npm:^3.0.0":
version: 3.0.0
resolution: "css@npm:3.0.0"
@@ -9215,6 +9271,16 @@ __metadata:
languageName: node
linkType: hard
+"d@npm:1, d@npm:^1.0.1":
+ version: 1.0.1
+ resolution: "d@npm:1.0.1"
+ dependencies:
+ es5-ext: ^0.10.50
+ type: ^1.0.1
+ checksum: 49ca0639c7b822db670de93d4fbce44b4aa072cd848c76292c9978a8cd0fff1028763020ff4b0f147bd77bfe29b4c7f82e0f71ade76b2a06100543cdfd948d19
+ languageName: node
+ linkType: hard
+
"damerau-levenshtein@npm:^1.0.4":
version: 1.0.8
resolution: "damerau-levenshtein@npm:1.0.8"
@@ -10505,6 +10571,17 @@ __metadata:
languageName: node
linkType: hard
+"es5-ext@npm:^0.10.35, es5-ext@npm:^0.10.50":
+ version: 0.10.62
+ resolution: "es5-ext@npm:0.10.62"
+ dependencies:
+ es6-iterator: ^2.0.3
+ es6-symbol: ^3.1.3
+ next-tick: ^1.1.0
+ checksum: 25f42f6068cfc6e393cf670bc5bba249132c5f5ec2dd0ed6e200e6274aca2fed8e9aec8a31c76031744c78ca283c57f0b41c7e737804c6328c7b8d3fbcba7983
+ languageName: node
+ linkType: hard
+
"es5-shim@npm:^4.5.13":
version: 4.6.7
resolution: "es5-shim@npm:4.6.7"
@@ -10512,6 +10589,17 @@ __metadata:
languageName: node
linkType: hard
+"es6-iterator@npm:2.0.3, es6-iterator@npm:^2.0.3":
+ version: 2.0.3
+ resolution: "es6-iterator@npm:2.0.3"
+ dependencies:
+ d: 1
+ es5-ext: ^0.10.35
+ es6-symbol: ^3.1.1
+ checksum: 6e48b1c2d962c21dee604b3d9f0bc3889f11ed5a8b33689155a2065d20e3107e2a69cc63a71bd125aeee3a589182f8bbcb5c8a05b6a8f38fa4205671b6d09697
+ languageName: node
+ linkType: hard
+
"es6-shim@npm:^0.35.5":
version: 0.35.7
resolution: "es6-shim@npm:0.35.7"
@@ -10519,6 +10607,16 @@ __metadata:
languageName: node
linkType: hard
+"es6-symbol@npm:^3.1.1, es6-symbol@npm:^3.1.3":
+ version: 3.1.3
+ resolution: "es6-symbol@npm:3.1.3"
+ dependencies:
+ d: ^1.0.1
+ ext: ^1.1.2
+ checksum: cd49722c2a70f011eb02143ef1c8c70658d2660dead6641e160b94619f408b9cf66425515787ffe338affdf0285ad54f4eae30ea5bd510e33f8659ec53bcaa70
+ languageName: node
+ linkType: hard
+
"escalade@npm:^3.0.2, escalade@npm:^3.1.1":
version: 3.1.1
resolution: "escalade@npm:3.1.1"
@@ -11257,6 +11355,15 @@ __metadata:
languageName: node
linkType: hard
+"ext@npm:^1.1.2":
+ version: 1.7.0
+ resolution: "ext@npm:1.7.0"
+ dependencies:
+ type: ^2.7.2
+ checksum: ef481f9ef45434d8c867cfd09d0393b60945b7c8a1798bedc4514cb35aac342ccb8d8ecb66a513e6a2b4ec1e294a338e3124c49b29736f8e7c735721af352c31
+ languageName: node
+ linkType: hard
+
"extend-shallow@npm:^2.0.1":
version: 2.0.1
resolution: "extend-shallow@npm:2.0.1"
@@ -13533,6 +13640,13 @@ __metadata:
languageName: node
linkType: hard
+"immutable@npm:^4.0.0":
+ version: 4.2.4
+ resolution: "immutable@npm:4.2.4"
+ checksum: 3be84eded37b05e65cad57bfba630bc1bf170c498b7472144bc02d2650cc9baef79daf03574a9c2e41d195ebb55a1c12c9b312f41ee324b653927b24ad8bcaa7
+ languageName: node
+ linkType: hard
+
"immutable@npm:~3.7.4":
version: 3.7.6
resolution: "immutable@npm:3.7.6"
@@ -17173,6 +17287,13 @@ __metadata:
languageName: node
linkType: hard
+"next-tick@npm:^1.1.0":
+ version: 1.1.0
+ resolution: "next-tick@npm:1.1.0"
+ checksum: 83b5cf36027a53ee6d8b7f9c0782f2ba87f4858d977342bfc3c20c21629290a2111f8374d13a81221179603ffc4364f38374b5655d17b6a8f8a8c77bdea4fe8b
+ languageName: node
+ linkType: hard
+
"nice-try@npm:^1.0.4":
version: 1.0.5
resolution: "nice-try@npm:1.0.5"
@@ -19038,6 +19159,24 @@ __metadata:
languageName: node
linkType: hard
+"postcss-scss@npm:4.0.6":
+ version: 4.0.6
+ resolution: "postcss-scss@npm:4.0.6"
+ peerDependencies:
+ postcss: ^8.4.19
+ checksum: 133a1cba31e2e167f4e841e66ec6a798eaf44c7911f9182ade0b5b1e71a8198814aa390b8c9d5db6b01358115232e5b15b1a4f8c5198acfccfb1f3fdbd328cdf
+ languageName: node
+ linkType: hard
+
+"postcss-scss@npm:^3.0.4":
+ version: 3.0.5
+ resolution: "postcss-scss@npm:3.0.5"
+ dependencies:
+ postcss: ^8.2.7
+ checksum: e927317fa095a6a2375ba923d70c9f0f31dc6fd61148885fc7c3d85cc55450601288be3d0a890cf34473807d27a15693135a8c076581e8ae29fffa175a1b37a3
+ languageName: node
+ linkType: hard
+
"postcss-selector-parser@npm:^3.0.0":
version: 3.1.2
resolution: "postcss-selector-parser@npm:3.1.2"
@@ -19105,6 +19244,17 @@ __metadata:
languageName: node
linkType: hard
+"postcss@npm:7.0.36":
+ version: 7.0.36
+ resolution: "postcss@npm:7.0.36"
+ dependencies:
+ chalk: ^2.4.2
+ source-map: ^0.6.1
+ supports-color: ^6.1.0
+ checksum: 4cfc0989b9ad5d0e8971af80d87f9c5beac5c84cb89ff22ad69852edf73c0a2fa348e7e0a135b5897bf893edad0fe86c428769050431ad9b532f072ff530828d
+ languageName: node
+ linkType: hard
+
"postcss@npm:8.4.13":
version: 8.4.13
resolution: "postcss@npm:8.4.13"
@@ -19126,7 +19276,7 @@ __metadata:
languageName: node
linkType: hard
-"postcss@npm:^8.2.15, postcss@npm:^8.2.4, postcss@npm:^8.3.11":
+"postcss@npm:^8.2.15, postcss@npm:^8.2.4, postcss@npm:^8.2.7, postcss@npm:^8.3.11":
version: 8.4.21
resolution: "postcss@npm:8.4.21"
dependencies:
@@ -19804,6 +19954,27 @@ __metadata:
languageName: node
linkType: hard
+"razzle-plugin-scss@npm:4.2.18":
+ version: 4.2.18
+ resolution: "razzle-plugin-scss@npm:4.2.18"
+ dependencies:
+ autoprefixer: ^10.2.3
+ css-loader: ^5.0.0
+ deepmerge: ^4.2.2
+ postcss-load-config: ^3.0.0
+ postcss-loader: ^4.2.0
+ postcss-scss: ^3.0.4
+ resolve-url-loader: ^3.1.2
+ sass: ^1.29.0
+ sass-loader: ^10.0.3
+ peerDependencies:
+ mini-css-extract-plugin: ">=0.9.0 <1.0.0"
+ razzle: 4.2.18
+ razzle-dev-utils: 4.2.18
+ checksum: 87a70a6327183eb077d5beb8ea5a04b679e104fc554c351ee497090ce1fb99f9c2b800562abb1bfb9b31661599d189c293539f5bac3cd45cd4a9aea2ba8e3b91
+ languageName: node
+ linkType: hard
+
"razzle-start-server-webpack-plugin@npm:4.2.17":
version: 4.2.17
resolution: "razzle-start-server-webpack-plugin@npm:4.2.17"
@@ -21125,6 +21296,13 @@ __metadata:
languageName: node
linkType: hard
+"regex-parser@npm:^2.2.11":
+ version: 2.2.11
+ resolution: "regex-parser@npm:2.2.11"
+ checksum: 78200331ec0cc372302d287a4946c38681eb5fe435453fca572cb53cac0ba579e5eb3b9e25eac24c0c80a555fb3ea7a637814a35da1e9bc88e8819110ae5de24
+ languageName: node
+ linkType: hard
+
"regexp.prototype.flags@npm:^1.2.0, regexp.prototype.flags@npm:^1.4.3":
version: 1.4.3
resolution: "regexp.prototype.flags@npm:1.4.3"
@@ -21484,6 +21662,24 @@ __metadata:
languageName: node
linkType: hard
+"resolve-url-loader@npm:^3.1.2":
+ version: 3.1.5
+ resolution: "resolve-url-loader@npm:3.1.5"
+ dependencies:
+ adjust-sourcemap-loader: 3.0.0
+ camelcase: 5.3.1
+ compose-function: 3.0.3
+ convert-source-map: 1.7.0
+ es6-iterator: 2.0.3
+ loader-utils: ^1.2.3
+ postcss: 7.0.36
+ rework: 1.0.1
+ rework-visit: 1.0.0
+ source-map: 0.6.1
+ checksum: eb52911eff20723f07409cc12138d254fa0dd4a4f3b1ba11ee1b29912afb03f1272aaddb523658be1e3a946e0d1bf6f603d0e107753ab83d48ad2116cf04b7f6
+ languageName: node
+ linkType: hard
+
"resolve-url@npm:^0.2.1":
version: 0.2.1
resolution: "resolve-url@npm:0.2.1"
@@ -21574,6 +21770,23 @@ __metadata:
languageName: node
linkType: hard
+"rework-visit@npm:1.0.0":
+ version: 1.0.0
+ resolution: "rework-visit@npm:1.0.0"
+ checksum: 969ca1f4e5bf4a1755c464a9b498da51eb3f28a798cf73da2cf0a3a3ab7b21a2f05c9d3bfa5fb81c8aaf5487dd31679efa67b8d0f418277ef5deb2a230b17c81
+ languageName: node
+ linkType: hard
+
+"rework@npm:1.0.1":
+ version: 1.0.1
+ resolution: "rework@npm:1.0.1"
+ dependencies:
+ convert-source-map: ^0.3.3
+ css: ^2.0.0
+ checksum: 13e5054d81ac84eee488fd4bacd20d08f35683bd8e296b4358e7f0a41b2d30a959313b7794f388f336705ad18d36af6ee7080e1b6c1313ecf33bc51d1bd95971
+ languageName: node
+ linkType: hard
+
"rfdc@npm:^1.3.0":
version: 1.3.0
resolution: "rfdc@npm:1.3.0"
@@ -21773,6 +21986,44 @@ __metadata:
languageName: node
linkType: hard
+"sass-loader@npm:^10.0.3":
+ version: 10.4.1
+ resolution: "sass-loader@npm:10.4.1"
+ dependencies:
+ klona: ^2.0.4
+ loader-utils: ^2.0.0
+ neo-async: ^2.6.2
+ schema-utils: ^3.0.0
+ semver: ^7.3.2
+ peerDependencies:
+ fibers: ">= 3.1.0"
+ node-sass: ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0
+ sass: ^1.3.0
+ webpack: ^4.36.0 || ^5.0.0
+ peerDependenciesMeta:
+ fibers:
+ optional: true
+ node-sass:
+ optional: true
+ sass:
+ optional: true
+ checksum: df9a65a62247e95305299ccbdf212cffdcdb69490928aecdf4f3dcf539b5302ed7cbffa663f83c5fc3ce0864decf84257a9ce484f6df4cb4426feeb88445dcd0
+ languageName: node
+ linkType: hard
+
+"sass@npm:^1.29.0":
+ version: 1.58.0
+ resolution: "sass@npm:1.58.0"
+ dependencies:
+ chokidar: ">=3.0.0 <4.0.0"
+ immutable: ^4.0.0
+ source-map-js: ">=0.6.2 <2.0.0"
+ bin:
+ sass: sass.js
+ checksum: a7219634881d2de6441fb619787fb1a02e3fa0333fb715be26aa335ba49d6bdb4f1105d9df70a80a67200893022b08346745783dc49046095d94fc6e044492d6
+ languageName: node
+ linkType: hard
+
"sax@npm:1.2.x, sax@npm:~1.2.4":
version: 1.2.4
resolution: "sax@npm:1.2.4"
@@ -22501,14 +22752,14 @@ __metadata:
languageName: node
linkType: hard
-"source-map-js@npm:^1.0.2":
+"source-map-js@npm:>=0.6.2 <2.0.0, source-map-js@npm:^1.0.2":
version: 1.0.2
resolution: "source-map-js@npm:1.0.2"
checksum: c049a7fc4deb9a7e9b481ae3d424cc793cb4845daa690bc5a05d428bf41bf231ced49b4cf0c9e77f9d42fdb3d20d6187619fc586605f5eabe995a316da8d377c
languageName: node
linkType: hard
-"source-map-resolve@npm:^0.5.0":
+"source-map-resolve@npm:^0.5.0, source-map-resolve@npm:^0.5.2":
version: 0.5.3
resolution: "source-map-resolve@npm:0.5.3"
dependencies:
@@ -22548,6 +22799,13 @@ __metadata:
languageName: node
linkType: hard
+"source-map@npm:0.6.1, source-map@npm:^0.6.0, source-map@npm:^0.6.1, source-map@npm:~0.6.0, source-map@npm:~0.6.1":
+ version: 0.6.1
+ resolution: "source-map@npm:0.6.1"
+ checksum: 59ce8640cf3f3124f64ac289012c2b8bd377c238e316fb323ea22fbfe83da07d81e000071d7242cad7a23cd91c7de98e4df8830ec3f133cb6133a5f6e9f67bc2
+ languageName: node
+ linkType: hard
+
"source-map@npm:^0.5.0, source-map@npm:^0.5.6, source-map@npm:^0.5.7":
version: 0.5.7
resolution: "source-map@npm:0.5.7"
@@ -22555,13 +22813,6 @@ __metadata:
languageName: node
linkType: hard
-"source-map@npm:^0.6.0, source-map@npm:^0.6.1, source-map@npm:~0.6.0, source-map@npm:~0.6.1":
- version: 0.6.1
- resolution: "source-map@npm:0.6.1"
- checksum: 59ce8640cf3f3124f64ac289012c2b8bd377c238e316fb323ea22fbfe83da07d81e000071d7242cad7a23cd91c7de98e4df8830ec3f133cb6133a5f6e9f67bc2
- languageName: node
- linkType: hard
-
"source-map@npm:^0.7.3":
version: 0.7.4
resolution: "source-map@npm:0.7.4"
@@ -24141,6 +24392,20 @@ __metadata:
languageName: node
linkType: hard
+"type@npm:^1.0.1":
+ version: 1.2.0
+ resolution: "type@npm:1.2.0"
+ checksum: dae8c64f82c648b985caf321e9dd6e8b7f4f2e2d4f846fc6fd2c8e9dc7769382d8a52369ddbaccd59aeeceb0df7f52fb339c465be5f2e543e81e810e413451ee
+ languageName: node
+ linkType: hard
+
+"type@npm:^2.7.2":
+ version: 2.7.2
+ resolution: "type@npm:2.7.2"
+ checksum: 0f42379a8adb67fe529add238a3e3d16699d95b42d01adfe7b9a7c5da297f5c1ba93de39265ba30ffeb37dfd0afb3fb66ae09f58d6515da442219c086219f6f4
+ languageName: node
+ linkType: hard
+
"typed-array-length@npm:^1.0.4":
version: 1.0.4
resolution: "typed-array-length@npm:1.0.4"
From 5132e7a77fafc4de6dd1b9e84e2fbfd6ea3bf4c8 Mon Sep 17 00:00:00 2001
From: Rob Gietema
Date: Thu, 9 Feb 2023 14:52:46 +0100
Subject: [PATCH 005/142] Use open in new tab setting for link types (#4384)
---
news/4384.feature | 1 +
src/components/theme/Navigation/NavItem.jsx | 1 +
.../Navigation/__snapshots__/Navigation.test.jsx.snap | 1 +
src/components/theme/View/LinkView.jsx | 9 ++++++++-
4 files changed, 11 insertions(+), 1 deletion(-)
create mode 100644 news/4384.feature
diff --git a/news/4384.feature b/news/4384.feature
new file mode 100644
index 0000000000..8680e794ef
--- /dev/null
+++ b/news/4384.feature
@@ -0,0 +1 @@
+Use open in new tab setting for link types. @robgietema
\ No newline at end of file
diff --git a/src/components/theme/Navigation/NavItem.jsx b/src/components/theme/Navigation/NavItem.jsx
index 0468acf786..992759eb1f 100644
--- a/src/components/theme/Navigation/NavItem.jsx
+++ b/src/components/theme/Navigation/NavItem.jsx
@@ -28,6 +28,7 @@ const NavItem = ({ item, lang }) => {
key={item.url}
className="item"
rel="noopener noreferrer"
+ target={settings.openExternalLinkInNewTab ? '_blank' : '_self'}
>
{item.title}
diff --git a/src/components/theme/Navigation/__snapshots__/Navigation.test.jsx.snap b/src/components/theme/Navigation/__snapshots__/Navigation.test.jsx.snap
index 950e63b053..17a73e9bae 100644
--- a/src/components/theme/Navigation/__snapshots__/Navigation.test.jsx.snap
+++ b/src/components/theme/Navigation/__snapshots__/Navigation.test.jsx.snap
@@ -49,6 +49,7 @@ exports[`Navigation renders a navigation component including external links 1`]
className="item"
href="https://store.plone.org"
rel="noopener noreferrer"
+ target="_self"
>
Store
diff --git a/src/components/theme/View/LinkView.jsx b/src/components/theme/View/LinkView.jsx
index 420c992d39..e31334bae3 100644
--- a/src/components/theme/View/LinkView.jsx
+++ b/src/components/theme/View/LinkView.jsx
@@ -9,6 +9,7 @@ import { isInternalURL, flattenToAppURL } from '@plone/volto/helpers';
import { Container } from 'semantic-ui-react';
import { UniversalLink } from '@plone/volto/components';
import { FormattedMessage } from 'react-intl';
+import config from '@plone/volto/registry';
/**
* View container class.
@@ -58,6 +59,7 @@ class LinkView extends Component {
*/
render() {
const { remoteUrl } = this.props.content;
+ const { openExternalLinkInNewTab } = config.settings;
return (
{this.props.content.title}
@@ -72,7 +74,12 @@ class LinkView extends Component {
id="The link address is:"
defaultMessage="The link address is:"
/>{' '}
-
+
{flattenToAppURL(remoteUrl)}
From fca412a61a50b34980e7600129bbbce2e86a0c95 Mon Sep 17 00:00:00 2001
From: Alin Voinea
Date: Mon, 13 Feb 2023 11:35:13 +0200
Subject: [PATCH 006/142] Fix Cannot read properties of undefined (reading
'translations') (#4377)
---
news/4377.bugfix | 1 +
src/components/manage/Toolbar/Toolbar.jsx | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
create mode 100644 news/4377.bugfix
diff --git a/news/4377.bugfix b/news/4377.bugfix
new file mode 100644
index 0000000000..5a3d81d2eb
--- /dev/null
+++ b/news/4377.bugfix
@@ -0,0 +1 @@
+Fix Cannot read properties of undefined (reading 'translations') @avoinea
diff --git a/src/components/manage/Toolbar/Toolbar.jsx b/src/components/manage/Toolbar/Toolbar.jsx
index b8793a5f1a..d9f46c89e3 100644
--- a/src/components/manage/Toolbar/Toolbar.jsx
+++ b/src/components/manage/Toolbar/Toolbar.jsx
@@ -510,7 +510,7 @@ class Toolbar extends Component {
((this.props.content.is_folderish &&
this.props.types.length > 0) ||
(config.settings.isMultilingual &&
- this.props.content['@components'].translations)) && (
+ this.props.content['@components']?.translations)) && (